Class EventDeleteCommand
java.lang.Object
org.eclipse.nebula.widgets.ganttchart.undoredo.commands.EventDeleteCommand
- All Implemented Interfaces:
IUndoRedoCommand
public class EventDeleteCommand extends java.lang.Object implements IUndoRedoCommand
Represents one GanttEvent delete action that can be undone/redone.
Note that this command is not added internally. But you are able to
create and add this type of command within your custom
IGanttEventListener.eventsDeleteRequest(java.util.List, org.eclipse.swt.events.MouseEvent)
-
Constructor Summary
Constructors Constructor Description EventDeleteCommand(GanttEvent event, GanttSection section, int index)Creates a new undoable/redoable delete Event. -
Method Summary
Modifier and Type Method Description voiddispose()Called when the event is about to be destroyed.GanttEventgetEvent()intgetIndex()GanttSectiongetSection()voidredo()Redoes an event in the chart.voidsetEvent(GanttEvent event)voidsetIndex(int index)voidsetSection(GanttSection section)java.lang.StringtoString()voidundo()Undoes an event in the chart.
-
Constructor Details
-
EventDeleteCommand
Creates a new undoable/redoable delete Event.- Parameters:
event-GanttEventbeing deletedsection-GanttSectionindex (of all GanttSections) prior to deleteindex- Index of event inGanttSectionsection prior to delete
-
-
Method Details
-
undo
public void undo()Description copied from interface:IUndoRedoCommandUndoes an event in the chart. This should put the event back to the state it was prior to the event taking place.- Specified by:
undoin interfaceIUndoRedoCommand
-
redo
public void redo()Description copied from interface:IUndoRedoCommandRedoes an event in the chart. This should put the event back to the state it was after the event took place.- Specified by:
redoin interfaceIUndoRedoCommand
-
dispose
public void dispose()Description copied from interface:IUndoRedoCommandCalled when the event is about to be destroyed. If any resources need to be cleaned up you should do so here.- Specified by:
disposein interfaceIUndoRedoCommand
-
getEvent
-
setEvent
-
getIndex
public int getIndex() -
setIndex
public void setIndex(int index) -
getSection
-
setSection
-
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-