Class TLcyLspSetControllerActiveSettable
- All Implemented Interfaces:
ILcyActiveSettable,ILcdPropertyChangeSource,Serializable
- Direct Known Subclasses:
TLcyLspCreateControllerActiveSettable
An active settable implementation which allows to activate a controller on a Lightspeed view.
When calling setActive(true), the active settable will install the controller on the Lightspeed view.
The active settable will de-activate itself when another controller is placed on the view.
Note: this active settable does nothing when calling setActive(false).
To de-activate it, you need to install another controller on the view.
This means that typically you use multiple instances of this class, allowing the user of your application to
switch between different controllers.
To ensure that this is reflected in the UI, you need to indicate that de-activation of this active settable is not
possible when inserting it into the UI.
For example by passing false as last argument in TLcyActionBarUtil#insertInConfiguredActionBars,
or ILcyActionBar#insertActiveSettable.
- Since:
- 2012.1
- See Also:
-
Field Summary
Fields inherited from interface com.luciad.lucy.gui.ILcyActiveSettable
DEFAULT, LONG_DESCRIPTION, NAME, SHORT_DESCRIPTION, SHOW_ACTION_NAME, SMALL_ICON, SMALL_SELECTED_ICON, VISIBLE -
Constructor Summary
ConstructorsConstructorDescriptionTLcyLspSetControllerActiveSettable(ILspController aController, ILspView aView, ILcyLucyEnv aLucyEnv) Creates a new active settable that, when active, sets the given controller on the given view. -
Method Summary
Modifier and TypeMethodDescriptionReturns the controller of this active settable.Returns the current Lucy environment.Gets a value given its key.getView()Returns the view to set the controller on.booleanisActive()Returns true if the state of this object is active, false if the state is inactive.booleanReturns true if this object is enabled, false otherwise.voidAssociates a given value with a given key.voidsetActive(boolean aActive) Sets the active state of this object.voidsetController(ILspController aController) Sets the controller of this active settable.voidsetEnabled(boolean aEnabled) Sets the enabled state of this active settable.voidSets the view to set the controller on.Methods inherited from class com.luciad.lucy.gui.ALcyActiveSettable
addPropertyChangeListener, firePropertyChange, getDisplayName, getIcon, getLongDescription, getName, getShortDescription, removePropertyChangeListener, setDisplayName, setIcon, setLongDescription, setName, setShortDescription
-
Constructor Details
-
TLcyLspSetControllerActiveSettable
public TLcyLspSetControllerActiveSettable(ILspController aController, ILspView aView, ILcyLucyEnv aLucyEnv) Creates a new active settable that, when active, sets the given controller on the given view. The active settable's icon, name and short description will be initialized with those of the controller.- Parameters:
aController- the controller that will be activated on the view. Ifnullis provided, a controller must be set before using this active settableaView- the view to activate the controller for. Ifnullis provided, a view must be set before using this active settableaLucyEnv- the Lucy back-end. Must not be null.
-
-
Method Details
-
getValue
Description copied from interface:ILcyActiveSettableGets a value given its key.- Specified by:
getValuein interfaceILcyActiveSettable- Overrides:
getValuein classALcyActiveSettable- Parameters:
aKey- The key to retrieve the value for.- Returns:
- The value associated with the given key, or null if they key is unknown.
- See Also:
-
putValue
Description copied from interface:ILcyActiveSettableAssociates a given value with a given key.- Specified by:
putValuein interfaceILcyActiveSettable- Overrides:
putValuein classALcyActiveSettable- Parameters:
aKey- The key.aValue- The value to associate to the key.- See Also:
-
isActive
public boolean isActive()Description copied from interface:ILcyActiveSettableReturns true if the state of this object is active, false if the state is inactive. As for every property: whenever the return value of this method changes, a property change event must be fired (seeILcyActiveSettable.setActive(boolean)).- Returns:
- true if the state of this object is active, false if the state is inactive.
- See Also:
-
setActive
public void setActive(boolean aActive) Description copied from interface:ILcyActiveSettableSets the active state of this object. When the new state is different from the previous state, a certain action will need to be performed. Also a property change event will be fired in such a case. If no property change event is fired, synchronization between this ILcyActiveSettable and the GUI widget representing it will probably fail (e.g. the checkbox will not change state). Note: refer to Implementing Bound Property Support Within a Bean for an example about firing a property change.- Parameters:
aActive- True if the new state is active, false if the new state is inactive.- See Also:
-
getController
Returns the controller of this active settable.- Returns:
- the controller of this active settable.
-
setController
Sets the controller of this active settable.- Parameters:
aController- The controller to work on.
-
getLucyEnv
Returns the current Lucy environment.- Returns:
- the current Lucy environment
-
getView
Returns the view to set the controller on.- Returns:
- the view to set the controller on.
-
setView
Sets the view to set the controller on.- Parameters:
aView- the view to set the controller on.
-
setEnabled
public void setEnabled(boolean aEnabled) Description copied from interface:ILcyActiveSettableSets the enabled state of this active settable.- Specified by:
setEnabledin interfaceILcyActiveSettable- Overrides:
setEnabledin classALcyActiveSettable- Parameters:
aEnabled- True if the new state of this object is enabled, false otherwise.- See Also:
-
isEnabled
public boolean isEnabled()Description copied from interface:ILcyActiveSettableReturns true if this object is enabled, false otherwise.- Specified by:
isEnabledin interfaceILcyActiveSettable- Overrides:
isEnabledin classALcyActiveSettable- Returns:
- true if this object is enabled, false otherwise.
- See Also:
-