text.addListener(SWT.FocusOut, textListener); text.addListener(SWT.Traverse, textListener); editor.setEditor(text, item, column); text.setText(item.getText(column)); text.selectAll();
editor.grabHorizontal = true; editor.grabVertical = true; editor.setEditor( composite, item, 2 );
editor.setEditor( button );
editor.setEditor( text, row, colnr );
@Override protected void setEditor(Control w, Item item, int columnNumber) { tableEditor.setEditor(w, (TableItem) item, columnNumber); }
@Override protected void setEditor(Control w, Item item, int columnNumber) { tableEditor.setEditor(w, (TableItem) item, columnNumber); }
@Override void setEditor(Control w, Item item, int columnNumber) { fTableEditor.setEditor(w, (TableItem) item, columnNumber); }
protected void setEditor(Control w, Item item, int columnNumber) { tableEditor.setEditor(w, (TableItem) item, columnNumber); }
editor.grabHorizontal = true; editor.grabVertical = true; editor.setEditor(button , item, cell.getColumnIndex()); editor.layout();
TableItem item = new TableItem(table, SWT.None); TableEditor editor = new TableEditor(table); Button checkbox = new Button(table, SWT.CHECK); checkbox.pack(); editor.setEditor(checkbox,item,0); item.setData("cb",checkbox); // using key enables you to add more pieces of complex data
Table table = new Table(new Shell(new Display()), SWT.NONE); table.setHeaderVisible (true); TableColumn column = new TableColumn (table, SWT.NONE); StyledText styledText = new StyledText(table, SWT.NONE); TableItem item = new TableItem (table, SWT.NONE); TableEditor editor = new TableEditor (table); editor.grabHorizontal = true; editor.grabVertical = true; editor.setEditor (styledText, item, 0);
/** * Cleanup all widgetry & resources used by the in-place editing */ private void cleanupEditor() { if (fEditorText != null) { fNewFilter = null; fNewTableItem = null; fTableEditor.setEditor(null, null, 0); fEditorText.getDisplay().asyncExec(new Runnable() { public void run() { fEditorText.dispose(); fEditorText = null; } }); } }
TableItem item = (TableItem) item; Button button = new Button(table,swt.none); button.setText("Remove"); control.setBackground(item.getBackground()); TableEditor editor = new TableEditor(table); editor.grabHorizontal = true; editor.grabVertical = true; editor.setEditor(button , item, columnIndex); editor.layout();
/** * Disposes the editors without placing their contents * into the table. */ @Override void disposeEditors () { comboEditor.setEditor (null, null, -1); combo.dispose (); nameText.dispose(); }
/** * Disposes the editors without placing their contents * into the table. */ @Override void disposeEditors() { comboEditor.setEditor(null, null, -1); combo.dispose(); nameText.dispose(); }
/** * Specify the Control that is to be displayed and the cell in the table 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 Table control * specified in the TableEditor constructor. * * @param editor the Control that is displayed above the cell being edited * @param item the TableItem 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 */ public void setEditor (Control editor, TableItem item, int column) { setItem(item); setColumn(column); setEditor(editor); } public void layout () {
/** * Specify the Control that is to be displayed and the cell in the table 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 Table control * specified in the TableEditor constructor. * * @param editor the Control that is displayed above the cell being edited * @param item the TableItem 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 */ public void setEditor (Control editor, TableItem item, int column) { setItem(item); setColumn(column); setEditor(editor); } public void layout () {
private Button createPermissionEditor(Table table, TableItem item, int index) { Button button = new Button(table, SWT.CHECK); button.pack(); TableEditor editor = new TableEditor(table); editor.grabVertical = true; editor.verticalAlignment = SWT.CENTER; editor.minimumWidth = button.getSize().x; editor.setEditor(button, item, index); editor.getEditor(); return button; }
/** * Disposes the editors without placing their contents * into the table. */ @Override void disposeEditors () { comboEditor.setEditor (null, null, -1); combo.dispose (); widthText.dispose (); heightText.dispose (); nameText.dispose (); exclude.dispose (); }