Package org.eclipse.ui.internal.provisional.cheatsheets

Examples of org.eclipse.ui.internal.provisional.cheatsheets.TaskEditor


    childMemento.putString(ICompositeCheatsheetTags.TASK_ID, task.getId());
    childMemento.putString(ICompositeCheatsheetTags.STATE, Integer.toString(task.getState()));
   
    // If this is an editable task that has been started, completed or skipped save the editor state
    if (task instanceof IEditableTask && task.getState() != ICompositeCheatSheetTask.NOT_STARTED) {
      TaskEditor editor = getEditor(task);
      if (editor != null) {
        IMemento taskDataMemento = childMemento.createChild(ICompositeCheatsheetTags.TASK_DATA);
        editor.saveState(taskDataMemento);
      } else {
        // The editor has not been started so save its previously loaded state
        IMemento taskData = getTaskMemento(task.getId());
        if (taskData != null) {
          IMemento previousDataMemento = childMemento.createChild(ICompositeCheatsheetTags.TASK_DATA);
View Full Code Here


  /*
   * Ensure that if this task is visible and in a runnable state that it has been started
   */
  private void showEditor(EditableTask task) {
    if (task == selectedTask) {
      TaskEditor editor = getTaskEditor(task);
      if (editor!= null) {
        if (!task.isEditorInitialized()) {
          task.setInput(model.getTaskMemento(task.getId()));
        }
        setCurrentEditor(editor.getControl().getParent());
      }
    }
  }
View Full Code Here

    buf.append(message);
    buf.append("</a></p>"); //$NON-NLS-1$
  }

  private void reviewTask(EditableTask task) {
    TaskEditor taskEditor = getTaskEditor(task);
    Composite container = taskEditor.getControl().getParent();
    Composite separator = toolkit.createCompositeSeparator(container);
    GridData data = new GridData();
    data.heightHint = 1;
    data.horizontalAlignment = SWT.FILL;
      separator.setLayoutData(data);
View Full Code Here

    container.layout(true);
    showEditor(task);
  }
 
  private void endReview(EditableTask task) {
    TaskEditor taskEditor = getTaskEditor(task);
    Control editorControl = taskEditor.getControl();
    Composite container = editorControl.getParent();
    Control[] children = container.getChildren();
    for (int i = children.length -2; i < children.length; i++) {
      children[i].dispose();
    }
View Full Code Here

   * Get the task editor for this task. If no editor exists create one
   */
  private TaskEditor getTaskEditor(EditableTask editable) {
    if (editable.getEditor() == null) {
            // Create a new editor using the extension point data
      TaskEditor editor = TaskEditorManager.getInstance().getEditor(editable.getKind());
      if (editor != null) {
        Composite editorPanel = new Composite(taskEditorContainer, SWT.NULL);
        GridLayout layout = new GridLayout();
        layout.marginWidth = 0;
        layout.marginHeight = 0;
        editorPanel.setLayout(layout);
        mform.getToolkit().adapt(editorPanel);
        editor.createControl(editorPanel, mform.getToolkit());
        editable.setEditor(editor);
        GridData gridData = new GridData(GridData.FILL_BOTH);
        editor.getControl().setLayoutData(gridData);
      }
    }
    return editable.getEditor()
  }
View Full Code Here

  public TaskEditor getEditor(String editorKind) {
    CheatSheetRegistryReader.TaskEditorNode editorInfo =
      CheatSheetRegistryReader.getInstance().findTaskEditor(editorKind);
    if (editorInfo != null) {
      TaskEditor editorInstance = null;
      Class extClass = null;
      String className = editorInfo.getClassName();
      try {
        Bundle bundle = Platform.getBundle(editorInfo.getPluginId());
        extClass = bundle.loadClass(className);
View Full Code Here

TOP

Related Classes of org.eclipse.ui.internal.provisional.cheatsheets.TaskEditor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.