001: /*******************************************************************************
002: * Copyright (c) 2005, 2006 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.ui.internal.provisional.cheatsheets;
011:
012: import java.util.Dictionary;
013:
014: /**
015: * A task within a composite cheat sheet.
016: * <p>
017: * This interface is not intended to be implemented by clients.
018: * </p>
019: */
020:
021: public interface ICompositeCheatSheetTask {
022: /**
023: * The constant that indicates that the task has not been
024: * processed yet.
025: */
026: public static final int NOT_STARTED = 0;
027: /**
028: * The constant that indicates that the task is in progress.
029: */
030: public static final int IN_PROGRESS = 1;
031: /**
032: * The constant that indicates that the task has been skipped.
033: */
034: public static final int SKIPPED = 2;
035: /**
036: * The constant that indicates that the task has been completed.
037: */
038: public static final int COMPLETED = 3;
039:
040: /**
041: * @return the unique identifier of this task.
042: */
043: public String getId();
044:
045: /**
046: * @return the translatable name of the task.
047: */
048: public String getName();
049:
050: /**
051: * Returns the kind of the task editor or task group.
052: * @return task editor kind or <code>null</code> if no editor
053: * is assoticated with this task.
054: */
055: public String getKind();
056:
057: /**
058: * The task parameters are used to configure the
059: * task editor with data meaningful to an editor of this kind.
060: * @return the parameter names and values as specified in the
061: * composite cheatsheet content file.
062: */
063: public Dictionary getParameters();
064:
065: /**
066: * Returns the description of the task.
067: * @return a plain String, or XML markup that can
068: * be understood by FormText widget.
069: * @see org.eclipse.ui.forms.widgets.FormText
070: */
071: public String getDescription();
072:
073: /**
074: * Gets the text to be displayed when this task is completed
075: * @return a plain String, or XML markup that can
076: * be understood by FormText widget.
077: * @see org.eclipse.ui.forms.widgets.FormText
078: */
079: public String getCompletionMessage();
080:
081: /**
082: * Get the subtasks of this task. Each subtask may be
083: * a task group or editable task. If the task is an editable task
084: * there will be no children and an empty array will be returned.
085: * @return an array of subtasks for this task
086: */
087: public ICompositeCheatSheetTask[] getSubtasks();
088:
089: /**
090: * get the tasks which are required to be completed
091: * before this task is started.
092: * @return an array of tasks that must be completed
093: * before this task can be started. The array will be
094: * empty if this tasks is independent of other tasks.
095: */
096: public ICompositeCheatSheetTask[] getRequiredTasks();
097:
098: /**
099: * Determine whether the required tasks for this task have
100: * all been completed.
101: * @return true if there are noi required tasks or all required
102: * tasks have been completed.
103: */
104: public boolean requiredTasksCompleted();
105:
106: /**
107: * Get the state of this task
108: * @return NOT_STARTED, IN_PROGRESS, SKIPPED or COMPLETED.
109: */
110: public int getState();
111:
112: /**
113: * Get the enclosing composite cheat sheet
114: * @return the composite cheat sheet which contains this task
115: */
116: public ICompositeCheatSheet getCompositeCheatSheet();
117:
118: /**
119: * Get the parent task group
120: * @return The task group which contains this task or <code>null</code>
121: * if this is the root of the composite cheat sheet.
122: */
123: public ITaskGroup getParent();
124:
125: /**
126: * Test whether this task can be skipped. Skippable tasks are optional
127: * tasks which are identified in the content file by having the attribute
128: * <code>skip = "true"</code>. Only skippable tasks can be skipped.
129: * @return true if this task has the skip attribute set to true in the
130: * content file.
131: */
132: public boolean isSkippable();
133:
134: }
|