Class ThemePackage

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

public class ThemePackage extends Package
This class defines a theme package, i.e. a package containing the scss files used to define the application themes. It is possible to define a theme package by creating a ThemePackage extension by defining eventually the position of the package. Remember to annotate the class with the @Package annotation.

 package overit.geocallapp.wfm.theme;

 {@literal @}Package
 public class WFMThemePackage extends ThemePackage {
   // there's no need to define any constructor
 }
 
Or you can define a theme package programmatically by creating a new instance of ThemePackage and registering it by calling the Layer.setThemePackage(ThemePackage) method.

 ThemePackage themePackage = new ThemePackage("overit/geocallapp/wfm/theme/");
 layer.setThemePackage(themePackage);
 
The association between ThemePackage 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

    • ThemePackage

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

      public ThemePackage(String position)
      Create a new theme 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 theme package, positioned under overit.geocallapp.wfm.theme
      
       ThemePackage themePackage = new ThemePackage("overit/geocallapp/wfm/theme/");
       
      Parameters:
      position - path that identifies the position of the package containing the scss 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