aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/export/AbstractExport.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/export/AbstractExport.java')
-rw-r--r--main/src/cgeo/geocaching/export/AbstractExport.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/export/AbstractExport.java b/main/src/cgeo/geocaching/export/AbstractExport.java
new file mode 100644
index 0000000..85b060b
--- /dev/null
+++ b/main/src/cgeo/geocaching/export/AbstractExport.java
@@ -0,0 +1,32 @@
+package cgeo.geocaching.export;
+
+import cgeo.geocaching.cgeoapplication;
+
+abstract class AbstractExport implements Export {
+ private final String name;
+
+ protected AbstractExport(final String name) {
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Generates a localized string from a resource id.
+ *
+ * @param resourceId
+ * the resource id of the string
+ * @return localized string
+ */
+ protected static String getString(int resourceId) {
+ return cgeoapplication.getInstance().getString(resourceId);
+ }
+
+ @Override
+ public String toString() {
+ // used in the array adapter of the dialog showing the exports
+ return getName();
+ }
+}