01: /*******************************************************************************
02: * Copyright (c) 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.pde.internal.ui.editor.cheatsheet.comp.actions;
11:
12: import org.eclipse.jface.action.Action;
13: import org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSObject;
14: import org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTaskGroup;
15: import org.eclipse.pde.internal.core.icheatsheet.comp.ICompCSTaskObject;
16:
17: /**
18: * SimpleCSAddStepAction
19: *
20: */
21: public abstract class CompCSAbstractAddAction extends Action {
22:
23: protected ICompCSObject fParentObject;
24:
25: /**
26: *
27: */
28: public CompCSAbstractAddAction() {
29: // NO-OP
30: }
31:
32: /**
33: * @param cheatsheet
34: */
35: public void setParentObject(ICompCSObject object) {
36: fParentObject = object;
37: }
38:
39: protected String[] getTaskObjectNames(ICompCSTaskGroup parent) {
40: ICompCSTaskObject[] taskObjects = parent.getFieldTaskObjects();
41: String[] taskObjectNames = new String[taskObjects.length];
42: for (int i = 0; i < taskObjects.length; ++i) {
43: taskObjectNames[i] = taskObjects[i].getFieldName();
44: }
45:
46: return taskObjectNames;
47: }
48: }
|