Package com.luciad.view
Class TLcdDeleteSelectionAction
java.lang.Object
com.luciad.gui.ALcdAction
com.luciad.view.ALcdObjectSelectionAction
com.luciad.view.TLcdDeleteSelectionAction
- All Implemented Interfaces:
ILcdAction,ILcdUndoableSource,ILcdPropertyChangeSource,ActionListener,Serializable,EventListener
public class TLcdDeleteSelectionAction
extends ALcdObjectSelectionAction
implements ILcdUndoableSource
An
ILcdAction that deletes all objects that were selected in a
ILcdLayer from their respective ILcdModel.
The ILcdView is updated after deletion of the objects.- Since:
- 2016.0
- See Also:
-
Field Summary
Fields inherited from class com.luciad.gui.ALcdAction
changeSupportFields inherited from interface com.luciad.gui.ILcdAction
DEFAULT, LONG_DESCRIPTION, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SHOW_ACTION_NAME, SMALL_ICON, VISIBLE -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new selection action for the given view. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidactionPerformed(ActionEvent aActionEvent, List<TLcdDomainObjectContext> aSelection) Performs what the action should do.Returns theILcdStringTranslatorset on this action.protected voidremove(List<TLcdDomainObjectContext> aSelection) Deselects the given objects and removes them from their model.voidsetStringTranslator(ILcdStringTranslator aStringTranslator) Sets theILcdStringTranslatorthat this action should use to translate theStringsthat will be visible in the user interface.protected voidundoRemove(List<TLcdDomainObjectContext> aSelection) Re-adds the given objects to their model and selects the newly added objects.Methods inherited from class com.luciad.view.ALcdObjectSelectionAction
actionPerformed, addUndoableListener, fireUndoableHappened, getObjectFilter, getView, isAutoHide, removeUndoableListener, setAutoHideMethods inherited from class com.luciad.gui.ALcdAction
addPropertyChangeListener, firePropertyChange, getDisplayName, getIcon, getLongDescription, getName, getShortDescription, getValue, isEnabled, isTraceOn, putValue, registerInstance, removePropertyChangeListener, setClassTraceOn, setDisplayName, setEnabled, setIcon, setLongDescription, setName, setShortDescription, setTraceOnMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.gui.ILcdUndoableSource
addUndoableListener, removeUndoableListener
-
Constructor Details
-
TLcdDeleteSelectionAction
Creates a new selection action for the given view.- Parameters:
aView- the for which the selection can be deleted. Layers should be editable and their model should allow removal of elements.- See Also:
-
-
Method Details
-
setStringTranslator
Sets the
ILcdStringTranslatorthat this action should use to translate theStringsthat will be visible in the user interface.This method should be called before this action is used. Any
Stringsalready created by this action will not be translated with the specified translator.The following list of
Stringsare translated by the given instance:- "Delete objects"
- "Undo {0}".
{0}will be replaced by the display name of the action that is to be undone. E.g. "Undo Delete objects". - "Redo {0}".
{0}will be replaced by the display name of the action that is to be redone. E.g. "Redo Delete objects".
ILcdStringTranslatorneeds to be able to translate what is passed in{0}, but not the entire formattedString. For example, for "Undo {0}" it needs to be able to translate "Undo {0}" itself and "Delete objects", but not "Undo Delete objects".- Parameters:
aStringTranslator- TheILcdStringTranslatorthat should be used. Must not benull.
-
getStringTranslator
Returns the
ILcdStringTranslatorset on this action.- Returns:
- The translator set on this action. Never
null.
-
actionPerformed
Description copied from class:ALcdObjectSelectionActionPerforms what the action should do. Only invoked when the selection is compliant with the restrictions imposed by the filter, min/max interval and the strict setting of the constructor.- Specified by:
actionPerformedin classALcdObjectSelectionAction- Parameters:
aActionEvent- The action event.aSelection- The list with selected objects that were accepted by the filter. They are provided asTLcdDomainObjectContextinstances, so that their layer and model is also available. Never containsnullvalues. The size of the list is within the min/max interval specified in the constructor. When using the constructor that does not specify this interval, the list size is always 1.
-
remove
Deselects the given objects and removes them from their model. This method is called when performing the action or when performing a redo-operation.- Parameters:
aSelection- the list of objects to be removed
-
undoRemove
Re-adds the given objects to their model and selects the newly added objects. This method is called when an undo-operation is performed.- Parameters:
aSelection- the list of objects to be removed
-