1 11 12 package org.eclipse.pde.internal.ui.editor.cheatsheet.comp.actions; 13 14 import org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSConstants; 15 import org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTask; 16 import org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTaskGroup; 17 import org.eclipse.pde.internal.ui.PDEUIMessages; 18 import org.eclipse.pde.internal.ui.wizards.cheatsheet.CompCSCreationOperation; 19 20 21 25 public class CompCSAddTaskAction extends CompCSAbstractAddAction { 26 27 30 public CompCSAddTaskAction() { 31 setText(PDEUIMessages.CompCSCreationOperation_task); 32 } 33 34 37 public void run() { 38 39 if (fParentObject == null) { 40 return; 41 } 42 ICompCSTask task = CompCSCreationOperation.createBasicTask(fParentObject); 43 if (fParentObject.getType() == ICompCSConstants.TYPE_TASKGROUP) { 45 ICompCSTaskGroup parent = (ICompCSTaskGroup)fParentObject; 46 String name = generateTaskObjectName(parent, PDEUIMessages.CompCSCreationOperation_task); 47 task.setFieldName(name); 48 parent.addFieldTaskObject(task); 49 } else if (fParentObject.getType() == ICompCSConstants.TYPE_COMPOSITE_CHEATSHEET) { 50 } 52 } 53 54 } 55 | Popular Tags |