Class SectionDeleteCommand
- java.lang.Object
-
- org.eclipse.nebula.widgets.ganttchart.undoredo.commands.SectionDeleteCommand
-
- All Implemented Interfaces:
IUndoRedoCommand
public class SectionDeleteCommand extends java.lang.Object implements IUndoRedoCommand
Represents one GanttSection delete action that can be undone/redone.Note that this command is not added internally. This is because there is no code that automatically deletes sections from your GanttComposite. You need to create and record this command together with the code that removes the section from your composite.
-
-
Field Summary
Fields Modifier and Type Field Description private int_indexprivate GanttSection_section
-
Constructor Summary
Constructors Constructor Description SectionDeleteCommand(GanttSection section, int index)Creates a new undoable/redoable delete Event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose()Called when the event is about to be destroyed.intgetIndex()GanttSectiongetSection()voidredo()Redoes an event in the chart.voidsetIndex(int index)voidsetSection(GanttSection section)java.lang.StringtoString()voidundo()Undoes an event in the chart.
-
-
-
Field Detail
-
_section
private GanttSection _section
-
_index
private int _index
-
-
Constructor Detail
-
SectionDeleteCommand
public SectionDeleteCommand(GanttSection section, int index)
Creates a new undoable/redoable delete Event.- Parameters:
section-GanttSectionbeing deletedindex- Index ofGanttSectionprior to delete
-
-
Method Detail
-
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
-
getSection
public GanttSection getSection()
-
setSection
public void setSection(GanttSection section)
-
getIndex
public int getIndex()
-
setIndex
public void setIndex(int index)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-