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)
-
-
Field Summary
Fields Modifier and Type Field Description private GanttEvent
_event
private int
_index
private GanttSection
_section
-
Constructor Summary
Constructors Constructor Description EventDeleteCommand(GanttEvent event, GanttSection section, int index)
Creates a new undoable/redoable delete Event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Called when the event is about to be destroyed.GanttEvent
getEvent()
int
getIndex()
GanttSection
getSection()
void
redo()
Redoes an event in the chart.void
setEvent(GanttEvent event)
void
setIndex(int index)
void
setSection(GanttSection section)
java.lang.String
toString()
void
undo()
Undoes an event in the chart.
-
-
-
Field Detail
-
_event
private GanttEvent _event
-
_index
private int _index
-
_section
private GanttSection _section
-
-
Constructor Detail
-
EventDeleteCommand
public EventDeleteCommand(GanttEvent event, GanttSection section, int index)
Creates a new undoable/redoable delete Event.- Parameters:
event
-GanttEvent
being deletedsection
-GanttSection
index (of all GanttSections) prior to deleteindex
- Index of event inGanttSection
section prior to delete
-
-
Method Detail
-
undo
public void undo()
Description copied from interface:IUndoRedoCommand
Undoes an event in the chart. This should put the event back to the state it was prior to the event taking place.- Specified by:
undo
in interfaceIUndoRedoCommand
-
redo
public void redo()
Description copied from interface:IUndoRedoCommand
Redoes an event in the chart. This should put the event back to the state it was after the event took place.- Specified by:
redo
in interfaceIUndoRedoCommand
-
dispose
public void dispose()
Description copied from interface:IUndoRedoCommand
Called when the event is about to be destroyed. If any resources need to be cleaned up you should do so here.- Specified by:
dispose
in interfaceIUndoRedoCommand
-
getEvent
public GanttEvent getEvent()
-
setEvent
public void setEvent(GanttEvent event)
-
getIndex
public int getIndex()
-
setIndex
public void setIndex(int index)
-
getSection
public GanttSection getSection()
-
setSection
public void setSection(GanttSection section)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-