final RepositoryDirectoryInterface repdir = repositorydir; TreeEditor editor = new TreeEditor( wTree ); editor.setItem( ti ); final Text text = new Text( wTree, SWT.NONE ); props.setLook( text ); text.setFocus(); editor.layout(); editor.setEditor( text );
/** * Specify the Control that is to be displayed and the cell in the tree that it is to be positioned above. * * <p>Note: The Control provided as the editor <b>must</b> be created with its parent being the Tree control * specified in the TreeEditor constructor. * * @param editor the Control that is displayed above the cell being edited * @param item the TreeItem for the row of the cell being tracked by this editor * @param column the zero based index of the column of the cell being tracked by this editor * * @since 3.1 */ public void setEditor (Control editor, TreeItem item, int column) { setItem(item); setColumn(column); setEditor(editor); } @Override
text.addListener( SWT.Traverse, textListener ); text.addListener( SWT.Verify, textListener ); editor.setEditor( composite, item ); text.setText( item.getText() ); text.selectAll();
/** * Specify the Control that is to be displayed and the cell in the tree that it is to be positioned above. * * <p>Note: The Control provided as the editor <b>must</b> be created with its parent being the Tree control * specified in the TreeEditor constructor. * * @param editor the Control that is displayed above the cell being edited * @param item the TreeItem for the row of the cell being tracked by this editor */ public void setEditor (Control editor, TreeItem item) { setItem(item); setEditor(editor); }
editor.minimumWidth = Math.min( editor.minimumWidth, right - left ); editor.minimumHeight = size.y + inset * 2; editor.layout(); break; case SWT.Traverse:
/** * Specifies the <code>TreeItem</code> that is to be edited. * * @param item the item to be edited */ public void setItem (TreeItem item) { this.item = item; resize(); }
private void addRenameTowTreeScriptItems() { lastItem = new TreeItem[1]; editor = new TreeEditor( wTree ); wTree.addListener( SWT.Selection, new Listener() { public void handleEvent( Event event ) { final TreeItem item = (TreeItem) event.item; renameFunction( item ); } } ); }
private void createEditors() { final Tree tree = fPluginTreeViewer.getTree(); levelColumnEditor = new TreeEditor(tree); levelColumnEditor.horizontalAlignment = SWT.CENTER; levelColumnEditor.minimumWidth = 60; autoColumnEditor = new TreeEditor(tree); autoColumnEditor.horizontalAlignment = SWT.CENTER; autoColumnEditor.grabHorizontal = true; Control oldEditor = levelColumnEditor.getEditor(); if (oldEditor != null && !oldEditor.isDisposed()) { oldEditor.dispose(); oldEditor = autoColumnEditor.getEditor(); if (oldEditor != null && !oldEditor.isDisposed()) { oldEditor.dispose(); levelColumnEditor.setEditor(spinner, item, 1); autoColumnEditor.setEditor(combo, item, 2);
public void setColumn(int index) { TreeColumn treeColumn = ((Tree)composite).getColumn(index); TreeEditor treeEditor = (TreeEditor)compositeEditor; treeEditor.minimumWidth = treeColumn.getWidth(); treeEditor.setColumn(index); }
/** * Asks the entry currently being edited to apply its current cell editor * value. */ private void applyEditorValue() { TreeItem treeItem = treeEditor.getItem(); // treeItem can be null when view is opened if (treeItem == null || treeItem.isDisposed()) { return; } IPropertySheetEntry entry = (IPropertySheetEntry) treeItem.getData(); entry.applyEditorValue(); }
/** * Specify the Control that is to be displayed and the cell in the tree that it is to be positioned above. * * <p>Note: The Control provided as the editor <b>must</b> be created with its parent being the Tree control * specified in the TreeEditor constructor. * * @param editor the Control that is displayed above the cell being edited * @param item the TreeItem for the row of the cell being tracked by this editor * @param column the zero based index of the column of the cell being tracked by this editor * * @since 3.1 */ public void setEditor (Control editor, TreeItem item, int column) { setItem(item); setColumn(column); setEditor(editor); } @Override
text.addListener( SWT.Traverse, textListener ); text.addListener( SWT.Verify, textListener ); editor.setEditor( composite, item ); text.setText( item.getText() ); text.selectAll();
/** * Specify the Control that is to be displayed and the cell in the tree that it is to be positioned above. * * <p>Note: The Control provided as the editor <b>must</b> be created with its parent being the Tree control * specified in the TreeEditor constructor. * * @param editor the Control that is displayed above the cell being edited * @param item the TreeItem for the row of the cell being tracked by this editor */ public void setEditor (Control editor, TreeItem item) { setItem(item); setEditor(editor); }
editor.minimumWidth = Math.min( editor.minimumWidth, right - left ); editor.minimumHeight = size.y + inset * 2; editor.layout(); break; case SWT.Traverse:
/** * Specifies the <code>TreeItem</code> that is to be edited. * * @param item the item to be edited */ public void setItem (TreeItem item) { this.item = item; resize(); }
private void addRenameTowTreeScriptItems() { lastItem = new TreeItem[1]; editor = new TreeEditor( wTree ); wTree.addListener( SWT.Selection, new Listener() { public void handleEvent( Event event ) { final TreeItem item = (TreeItem) event.item; renameFunction( item ); } } ); }
/** * Asks the entry currently being edited to apply its current cell editor * value. */ private void applyEditorValue() { TreeItem treeItem = treeEditor.getItem(); // treeItem can be null when view is opened if (treeItem == null || treeItem.isDisposed()) { return; } IPropertySheetEntry entry = (IPropertySheetEntry) treeItem.getData(); entry.applyEditorValue(); }
TreeEditor editor = new TreeEditor( wTree ); editor.setItem( ti ); final Text text = new Text( wTree, SWT.NONE ); props.setLook( text ); text.setFocus(); editor.layout(); editor.setEditor( text );
/** * Specify the Control that is to be displayed and the cell in the tree that it is to be positioned above. * * <p>Note: The Control provided as the editor <b>must</b> be created with its parent being the Tree control * specified in the TreeEditor constructor. * * @param editor the Control that is displayed above the cell being edited * @param item the TreeItem for the row of the cell being tracked by this editor * @param column the zero based index of the column of the cell being tracked by this editor * * @since 3.1 */ public void setEditor (Control editor, TreeItem item, int column) { setItem(item); setColumn(column); setEditor(editor); } public void setEditor (Control editor) {
text.addListener( SWT.Traverse, textListener ); text.addListener( SWT.Verify, textListener ); editor.setEditor( composite, item ); text.setText( item.getText() ); text.selectAll();