aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/export/AbstractExport.java
blob: 72ea5440c1bd4634d9870f725f61519b32fc70ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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;
    }

    @Override
    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);
    }

    /**
     * Generates a localized string from a resource id.
     * 
     * @param resourceId
     *            the resource id of the string
     * @param params
     *            The parameter
     * @return localized string
     */
    protected static String getString(int resourceId, Object... params) {
        return cgeoapplication.getInstance().getString(resourceId, params);
    }

    @Override
    public String toString() {
        // used in the array adapter of the dialog showing the exports
        return getName();
    }
}