1 11 12 package org.eclipse.ui.internal.cheatsheets.composite.model; 13 14 17 18 import org.eclipse.ui.IMemento; 19 import org.eclipse.ui.internal.cheatsheets.composite.parser.EditableTaskParseStrategy; 20 import org.eclipse.ui.internal.cheatsheets.composite.parser.ITaskParseStrategy; 21 import org.eclipse.ui.internal.provisional.cheatsheets.ICompositeCheatSheetTask; 22 import org.eclipse.ui.internal.provisional.cheatsheets.IEditableTask; 23 import org.eclipse.ui.internal.provisional.cheatsheets.TaskEditor; 24 25 public class EditableTask extends AbstractTask implements IEditableTask { 26 27 private TaskEditor editor; 28 29 private ITaskParseStrategy parserStrategy; 30 31 private boolean editorInitialized = false; 32 33 private boolean underReview = false; 34 35 public EditableTask(CompositeCheatSheetModel model, String id, String name, String kind) { 36 super(model, id, name, kind); 37 parserStrategy = new EditableTaskParseStrategy(); 38 } 39 40 public ITaskParseStrategy getParserStrategy() { 41 return parserStrategy; 42 } 43 44 public ICompositeCheatSheetTask[] getSubtasks() { 45 return EMPTY; 46 } 47 48 public void setStarted() { 49 if (state==NOT_STARTED) { 50 setState(IN_PROGRESS); 51 } 52 } 53 54 public void setEditor(TaskEditor editor) { 55 this.editor = editor; 56 } 57 58 public TaskEditor getEditor() { 59 return editor; 60 } 61 62 public void reset() { 63 setStateNoNotify(NOT_STARTED); 64 editorInitialized = false; 65 } 66 67 public void setInput(IMemento memento) { 68 if (editor != null) { 69 editor.setInput(this, memento); 70 editorInitialized = true; 71 } 72 } 73 74 public boolean isEditorInitialized() { 75 return editorInitialized; 76 } 77 78 public void setUnderReview(boolean underReview) { 79 this.underReview = underReview; 80 } 81 82 public boolean isUnderReview() { 83 return underReview; 84 } 85 86 } 87 | Popular Tags |