Package overit.geocall.platform
Class LangPackage
java.lang.Object
overit.geocall.platform.Package
overit.geocall.platform.LangPackage
- All Implemented Interfaces:
Serializable
This class defines a language package, i.e. a package containing the files used for the translation of the graphical
interface.
It is possible to define a language package by creating a
LangPackage extension by defining eventually the
position of the package.
Remember to annotate the class with the @Package annotation.
package overit.geocallapp.wfm.lang;
{@literal @}Package
public class WFMLangPackage extends LangPackage {
// there's no need to define any constructor
}
Or you can define a language package programmatically by creating a new instance of LangPackage and registering
it by calling the Layer.setLangPackage(LangPackage) method.
LangPackage langPackage = new LangPackage("overit/geocallapp/wfm/lang/");
layer.setLangPackage(langPackage);
The association between LangPackage and Layer occurs automatically as long as the class that defines its implementation:
- is positioned within the domain defined by the Layer
- contains the annotation
@Package
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreate a new language package.LangPackage(String position) Create a new language package by explicitly specifying the package position. -
Method Summary
Methods inherited from class overit.geocall.platform.Package
equals, getAlias, getName, getPosition, hashCode, invariant, setAlias, setPosition, validatePosition
-
Field Details
-
owner
-
-
Constructor Details
-
LangPackage
protected LangPackage()Create a new language package. This constructor can be called from class extensions, instead ofLangPackage(String), because it is easier to use since the package containing the translation files is automatically calculated according to the subclass package. -
LangPackage
Create a new language package by explicitly specifying the package position. The paths directories must be separated with the/character, they must start without the/character and must end with.
The following example shows the definition of a new language package, positioned underoverit.geocallapp.wfm.langLangPackage langPackage = new LangPackage("overit/geocallapp/wfm/lang/");- Parameters:
position- path that identifies the position of the package containing the translation files. Null value is not allowed.
-
-
Method Details
-
getOwner
- Returns:
- the layer that this package belongs to or null if the package has not yet been registered to any layer
-
setOwner
Set the layer that this package belongs to.- Parameters:
owner- the owner layer
-