protected void endTableEdit(TableCursor tableCursor, ControlEditor editor, final CommitEditRunnable commitEditRunnable, TableItem row, int column, String newValue) throws Exception { if (commitEditRunnable == null) { return; } commitEditRunnable.setTableCursor(tableCursor); commitEditRunnable.setEditor(editor); commitEditRunnable.setRow(row); commitEditRunnable.setColumn(column); commitEditRunnable.setNewValue(newValue); BusyIndicator.showWhile(row.getDisplay(), commitEditRunnable); Exception error = commitEditRunnable.getError(); if (error != null) { throw error; } }
public void updateButtonVisibility() { if (removeSelectedTagBtn!=null) removeSelectedTagBtn.setEnabled(isTagSelected(getTagNameSelectedInTable())); logger.trace("updating buttons: "+addDelEditors.size()); for (String tagName : addDelEditors.keySet()) { ControlEditor e = addDelEditors.get(tagName); if (e.getEditor() == null || e.getEditor().isDisposed()) continue; TagAddRemoveComposite c = (TagAddRemoveComposite) e.getEditor(); SWTUtil.setEnabled(c.getRemoveButton(), isTagSelected(tagName)); } // for (String k : removeBtns.keySet()) { // SWTUtil.setEnabled(removeBtns.get(k), selectedTags.contains(k)); //// removeBtns.get(k).setEnabled(selectedTags.contains(k)); // } }
public static <T> void replaceEditor(Map<T, ControlEditor> editors, T key, ControlEditor editor) { if (editors.containsKey(key)) { ControlEditor t = editors.get(key); deleteEditor(t); } editors.put(key, editor); }
public static <T> void updateEditors(Map<T, ControlEditor> editors, Collection<T> tagNames) { Set<T> keys = new HashSet<>(editors.keySet()); for (T tn : keys) { if (!tagNames.contains(tn)) { deleteEditor(editors.get(tn)); editors.remove(tn); } } }
/** * @since 4.4.0.5 */ public static void setEditorItem(ControlEditor editor, Control input, int column, TableItemOrTreeItem item) { if (item instanceof TreeItemDelegate) { ((TreeEditor) editor).setEditor(input, (TreeItem) item.getItem(), column); } else { ((TableEditor) editor).setEditor(input, (TableItem) item.getItem(), column); } }
public static void deleteEditor(ControlEditor editor) { if (editor.getEditor()!=null) editor.getEditor().dispose(); editor.dispose(); }
public static ControlEditor createTableOrTreeEditor(TableOrTreeSWT tableOrTree) { return (tableOrTree instanceof TreeDelegate) ? new TreeEditor( (Tree) tableOrTree.getComposite()) : new TableEditor( (Table) tableOrTree.getComposite()); }
/** * Returns the editor. * * @return The editor */ public ControlEditor getEditor() { return _Editor; }
/** * Sets the editor. * * @param editor the editor to set */ public void setEditor(ControlEditor editor) { _Editor = editor; }