Class ExtensionDecorator

java.lang.Object
org.gvsig.andami.plugins.ExtensionDecorator
All Implemented Interfaces:
HiddableExtension, IExtension

public class ExtensionDecorator extends Object implements HiddableExtension
This class extends the functionality of Extension class to let the programmer set an extension visible or not on-the-fly.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
    static final int
     
    static final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ExtensionDecorator(IExtension e, int visibilityControl)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    execute(String actionCommand)
    This method is executed when the user clicks on any of the controls associated with this extension (menus, tools, etc).
     
    Gets the status of the extension, which may be queried to check if the extension has some unsaved data or some associated background tasks.
    getStatus(IExtension extension)
     
    int
    Determines whether the extension will be visible or not, overriding the value defined by the extension itself.
    void
    Extension's initialization code should be here.
    boolean
    This method is invoked by Andami to check whether the extension (and its associated controls) is enabled or disabled.
    boolean
    This method is invoked by Andami to check whether the extension (and its associated controls) is visible or hidden.
    void
    Extension's post-initialization code should be here.
    void
     
    void
    setVisibility(int state)
    Sets the absolute visibility of this extension (overriding the value set at the MDIManager)
    void
    Extension's termination code should be here.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • ExtensionDecorator

      public ExtensionDecorator(IExtension e, int visibilityControl)
  • Method Details

    • setExtension

      public void setExtension(IExtension e)
    • setVisibility

      public void setVisibility(int state)
      Description copied from interface: HiddableExtension
      Sets the absolute visibility of this extension (overriding the value set at the MDIManager)
      Specified by:
      setVisibility in interface HiddableExtension
    • getVisibility

      public int getVisibility()
      Description copied from interface: HiddableExtension
      Determines whether the extension will be visible or not, overriding the value defined by the extension itself.
      Specified by:
      getVisibility in interface HiddableExtension
      Returns:
    • getExtension

      public IExtension getExtension()
    • initialize

      public void initialize()
      Description copied from interface: IExtension
      Extension's initialization code should be here. This method is called for all the extensions during Andami's initialization.
      Specified by:
      initialize in interface IExtension
    • terminate

      public void terminate()
      Description copied from interface: IExtension
      Extension's termination code should be here. This method is called for all the extensions during Andami's termination.
      Specified by:
      terminate in interface IExtension
    • execute

      public void execute(String actionCommand)
      Description copied from interface: IExtension
      This method is executed when the user clicks on any of the controls associated with this extension (menus, tools, etc).
      Specified by:
      execute in interface IExtension
      Parameters:
      actionCommand - An String specifying the action to execute. This is useful when there are different controls associated with the same extension.
    • isEnabled

      public boolean isEnabled()
      Description copied from interface: IExtension
      This method is invoked by Andami to check whether the extension (and its associated controls) is enabled or disabled. Disabled controls (menus and buttons) are shown in light grey colour, and it is not possible to click on them.
      Specified by:
      isEnabled in interface IExtension
      Returns:
      true if the extension should be enabled, false otherwise
    • isVisible

      public boolean isVisible()
      Description copied from interface: IExtension
      This method is invoked by Andami to check whether the extension (and its associated controls) is visible or hidden.
      Specified by:
      isVisible in interface IExtension
      Returns:
      true if the extension should be visible, false otherwise
    • postInitialize

      public void postInitialize()
      Description copied from interface: IExtension
      Extension's post-initialization code should be here. This method is called for all the extensions during Andami's initialization, after initialize() has been called for ALL the extensions.
      Specified by:
      postInitialize in interface IExtension
    • getStatus

      public IExtensionStatus getStatus()
      Description copied from interface: IExtension
      Gets the status of the extension, which may be queried to check if the extension has some unsaved data or some associated background tasks.
      Specified by:
      getStatus in interface IExtension
      Returns:
      An IExtensionStatus object, containing the status of this extension.
      See Also:
    • getStatus

      public IExtensionStatus getStatus(IExtension extension)
      Specified by:
      getStatus in interface IExtension