Class LangPackage

java.lang.Object
overit.geocall.platform.Package
overit.geocall.platform.LangPackage
All Implemented Interfaces:
Serializable

public class LangPackage extends Package
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 Details

    • owner

      protected Layer owner
  • Constructor Details

    • LangPackage

      protected LangPackage()
      Create a new language package. This constructor can be called from class extensions, instead of LangPackage(String), because it is easier to use since the package containing the translation files is automatically calculated according to the subclass package.
    • LangPackage

      public LangPackage(String position)
      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 under overit.geocallapp.wfm.lang
      
       LangPackage 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

      public Layer getOwner()
      Returns:
      the layer that this package belongs to or null if the package has not yet been registered to any layer
    • setOwner

      protected void setOwner(Layer owner)
      Set the layer that this package belongs to.
      Parameters:
      owner - the owner layer