Class ALcyPreferencesAddOn

java.lang.Object
com.luciad.lucy.addons.ALcyAddOn
com.luciad.lucy.addons.ALcyPreferencesAddOn
Direct Known Subclasses:
ALcyFormatAddOn, ALcyLspFormatAddOn, TLcyAPSAddOn, TLcyASTERIXDecoderAddOn, TLcyAsynchronousPaintAddOn, TLcyConnectionAddOn, TLcyCopyPasteAddOn, TLcyDebugAddOn, TLcyDefaultDecodersAddOn, TLcyDimensionalFilterAddOn, TLcyDrawingTEAAddOn, TLcyErrorLogAddOn, TLcyFormatBarAddOn, TLcyFusionClientAddOn, TLcyFusionCoreAddOn, TLcyGenericMapAddOn, TLcyHelpAddOn, TLcyLayerControlAddOn, TLcyLspCameraLinkAddOn, TLcyLspHypsometryAddOn, TLcyLspLayerCustomizerAddOn, TLcyLspMapAddOn, TLcyLspMapOverviewAddOn, TLcyLspPreviewAddOn, TLcyLspPrintAddOn, TLcyLspRadarVideoStyleCustomizerAddOn, TLcyLspStyleRepositoryAddOn, TLcyMapEditUnitAddOn, TLcyModelCustomizerAddOn, TLcyNetworkConnectionAddOn, TLcyObjectPropertiesComparisonAddOn, TLcyPIMTrackAddOn, TLcyRecentFilesAddOn, TLcyS57RealtimeAddOn, TLcyWMSEarthClientAddOn, TLcyWMSEcdisAddOn, TLcyWorkspaceAddon

public abstract class ALcyPreferencesAddOn extends ALcyAddOn
ALcyAddOn that is equipped with a TLcyPreferencesTool to read its preferences from the set configuration file. The configured preferences are available through getPreferences().
  • Constructor Details

    • ALcyPreferencesAddOn

      protected ALcyPreferencesAddOn(String aLongPrefix, String aShortPrefix)
      Creates a new ALcyPreferencesAddOn.

      Typically this constructor is called as follows:

      
         public class MyAddOn extends ALcyPreferencesAddOn{
           public MyAddOn(){
             super(ALcyTool.getLongPrefix(MyAddOn.class),
                   ALcyTool.getShortPrefix(MyAddOn.class)
           }
           //...
         }
       
      Note that the code above won't work when multiple add-ons are located in the same package as the long prefix won't be unique. In that case, you could use the ALcyTool.getLongPrefixWithClassName(Class) instead:
      
         public class MyAddOn extends ALcyPreferencesAddOn{
           public MyAddOn(){
             super(ALcyTool.getLongPrefixWithClassName(MyAddOn.class),
                   ALcyTool.getShortPrefix(MyAddOn.class)
           }
           //...
         }
       
      Parameters:
      aLongPrefix - The long prefix. This prefix must be globally unique. It is stored in workspace files, so if backward compatibility is a concern (e.g. read an old workspace file), this prefix must never change.
      aShortPrefix - The short prefix, see also TLcyPreferencesTool. It might be stored in workspace files, so if backward compatibility is a concern (e.g. read an old workspace file), this prefix must never change.
  • Method Details

    • getLongPrefix

      public String getLongPrefix()
      Returns the long prefix of this add-on.
      Returns:
      the long prefix of this add-on.
    • getShortPrefix

      public String getShortPrefix()
      Returns the short prefix of this add-on.
      Returns:
      the short prefix of this add-on.
    • getLucyEnv

      public ILcyLucyEnv getLucyEnv()
      Returns the Lucy environment into which this add-on was plugged.
      Returns:
      the Lucy environment into which this add-on was plugged
      See Also:
    • getPreferencesTool

      public TLcyPreferencesTool getPreferencesTool()
      Returns the preferences tool used by the add-on. The preferences tool provides access to the add-on's configuration, system, user and workspace preferences.
      Returns:
      the add-on's preferences tool
    • getPreferences

      public ALcyProperties getPreferences()

      Convenience method that returns the composite workspace preferences of this add-on's preferences tool. These preferences include the configured preferences of the add-on.

      Returns:
      the preferences for this add-on
      See Also:
    • plugInto

      public void plugInto(ILcyLucyEnv aLucyEnv)
      Creates and plugs in the add-on's preferences tool.
      Specified by:
      plugInto in class ALcyAddOn
      Parameters:
      aLucyEnv - the Lucy environment to plug into
      See Also:
    • unplugFrom

      public void unplugFrom(ILcyLucyEnv aLucyEnv)
      Unplugs the add-on's preferences tool.
      Specified by:
      unplugFrom in class ALcyAddOn
      Parameters:
      aLucyEnv - the Lucy environment
      See Also:
    • createPreferencesTool

      protected TLcyPreferencesTool createPreferencesTool()

      Creates the TLcyPreferencesTool to be used by this add-on. Overwriting this method for example allows to register additional ILcyPropertyConverters for (complex) custom properties, to make sure they are correctly decoded from the add-on's configuration file and/or saved to the workspace. Note that this isn't required for simple properties such as String, int, double, etc.

      The default implementation creates a new tool based on the ALcyAddOn.getConfigSourceName() and the add-on's prefixes.

      Returns:
      the created TLcyPreferencesTool.