Examples of TreeEditor


Examples of org.eclipse.swt.custom.TreeEditor

    _viewer = new TreeViewer(parent, SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
    _viewer.setContentProvider(_content);
    _viewer.setInput(this);
    _tree = _viewer.getTree();
    _tree.setHeaderVisible(true);
    final TreeEditor editor = new TreeEditor(_tree);
    // The editor must have the same size as the cell and must
    // not be any smaller than 50 pixels.
    editor.horizontalAlignment = SWT.LEFT;
    editor.grabHorizontal = true;
    editor.minimumWidth = 50;
View Full Code Here

Examples of org.eclipse.swt.custom.TreeEditor

      collProcessCompleteErrorsViewer.setInput(obj.getCollectionProcessCompleteErrors());
    }
  }

  private void createEditorsForTree(final Tree tree) {
    final TreeEditor editor1 = new TreeEditor(tree);
    editor1.horizontalAlignment = SWT.CENTER;
    editor1.minimumWidth = 60;

    final TreeEditor editor2 = new TreeEditor(tree);
    editor2.horizontalAlignment = SWT.CENTER;
    editor2.grabHorizontal = true;
    editor2.minimumWidth = 60;

    tree.addSelectionListener(new SelectionAdapter() {
      public void widgetSelected(SelectionEvent e) {
        // Clean up any previous editor control
        Control oldEditor = editor1.getEditor();
        if (oldEditor != null)
          oldEditor.dispose();

        oldEditor = editor2.getEditor();
        if (oldEditor != null)
          oldEditor.dispose();

        // Identify the selected row
        final TreeItem item = (TreeItem) e.item;
        // if (!isEditable(item))
        // return;

        final Spinner spinner = new Spinner(tree, SWT.BORDER);
        spinner.setMinimum(0);
        String level = item.getText(1);
        int defaultLevel = level.length() == 0 || "default".equals(level) ? 0 : Integer.parseInt(level); //$NON-NLS-1$
        spinner.setSelection(defaultLevel);
        spinner.addModifyListener(new ModifyListener() {
          public void modifyText(ModifyEvent e) {
            if (item.getChecked()) {
              int selection = spinner.getSelection();
              item.setText(1, selection == 0 ? "default" //$NON-NLS-1$
                      : Integer.toString(selection));
              // fTab.updateLaunchConfigurationDialog();
            }
          }
        });
        editor1.setEditor(spinner, item, 1);

        final CCombo combo = new CCombo(tree, SWT.BORDER | SWT.READ_ONLY);
        combo.setItems(new String[] { "default", Boolean.toString(true), Boolean.toString(false) }); //$NON-NLS-1$
        combo.setText(item.getText(2));
        combo.pack();
        combo.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            if (item.getChecked()) {
              item.setText(2, combo.getText());
              // fTab.updateLaunchConfigurationDialog();
            }
          }
        });
        editor2.setEditor(combo, item, 2);

      }
    });
  }
View Full Code Here

Examples of org.eclipse.swt.custom.TreeEditor

    public RenameAction( ServersView view )
    {
        super( ACTION_TEXT );
        this.view = view;
        this.tree = view.getViewer().getTree();
        this.treeEditor = new TreeEditor( tree );
        init();
    }
View Full Code Here

Examples of org.eclipse.swt.custom.TreeEditor

        // add our listeners to the widget
        hookControl();

        // create a new tree editor
        treeEditor = new TreeEditor(tree);

        // create the entry and editor listener
        createEntryListener();
        createEditorListener();
    }
View Full Code Here

Examples of org.eclipse.swt.custom.TreeEditor

   */
  TreeViewerEditor(TreeViewer viewer, SWTFocusCellManager focusCellManager,
      ColumnViewerEditorActivationStrategy editorActivationStrategy,
      int feature) {
    super(viewer, editorActivationStrategy, feature);
    treeEditor = new TreeEditor(viewer.getTree());
    this.focusCellManager = focusCellManager;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.