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
ConstructorDescriptionTLcyLspSetControllerActiveSettable
(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.boolean
isActive()
Returns true if the state of this object is active, false if the state is inactive.boolean
Returns true if this object is enabled, false otherwise.void
Associates a given value with a given key.void
setActive
(boolean aActive) Sets the active state of this object.void
setController
(ILspController aController) Sets the controller of this active settable.void
setEnabled
(boolean aEnabled) Sets the enabled state of this active settable.void
Sets 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. Ifnull
is provided, a controller must be set before using this active settableaView
- the view to activate the controller for. Ifnull
is 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:ILcyActiveSettable
Gets a value given its key.- Specified by:
getValue
in interfaceILcyActiveSettable
- Overrides:
getValue
in 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:ILcyActiveSettable
Associates a given value with a given key.- Specified by:
putValue
in interfaceILcyActiveSettable
- Overrides:
putValue
in classALcyActiveSettable
- Parameters:
aKey
- The key.aValue
- The value to associate to the key.- See Also:
-
isActive
public boolean isActive()Description copied from interface:ILcyActiveSettable
Returns 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:ILcyActiveSettable
Sets 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:ILcyActiveSettable
Sets the enabled state of this active settable.- Specified by:
setEnabled
in interfaceILcyActiveSettable
- Overrides:
setEnabled
in 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:ILcyActiveSettable
Returns true if this object is enabled, false otherwise.- Specified by:
isEnabled
in interfaceILcyActiveSettable
- Overrides:
isEnabled
in classALcyActiveSettable
- Returns:
- true if this object is enabled, false otherwise.
- See Also:
-