Java 类org.eclipse.swt.custom.ControlEditor 实例源码

项目:eZooKeeper    文件:TableEdit.java   
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;
    }
}
项目:TranskribusSwtGui    文件:TaggingWidget.java   
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));
//      }
    }
项目:TranskribusSwtGui    文件:TaggingWidgetUtils.java   
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);
}
项目:TranskribusSwtGui    文件:TaggingWidgetUtils.java   
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);
        }
    }
}
项目:AcademicTorrents-Downloader    文件:TableOrTreeUtils.java   
/**
 * @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);
    }
}
项目:TranskribusSwtGui    文件:TaggingWidgetUtils.java   
public static void deleteEditor(ControlEditor editor) {
    if (editor.getEditor()!=null)
        editor.getEditor().dispose();
    editor.dispose();
}
项目:AcademicTorrents-Downloader    文件:TableOrTreeUtils.java   
public static ControlEditor createTableOrTreeEditor(TableOrTreeSWT tableOrTree) {
    return (tableOrTree instanceof TreeDelegate) ? new TreeEditor(
            (Tree) tableOrTree.getComposite()) : new TableEditor(
            (Table) tableOrTree.getComposite());
}
项目:eZooKeeper    文件:TableEdit.java   
/**
 * Returns the editor.
 * 
 * @return The editor
 */
public ControlEditor getEditor() {
    return _Editor;
}
项目:eZooKeeper    文件:TableEdit.java   
/**
 * Sets the editor.
 * 
 * @param editor the editor to set
 */
public void setEditor(ControlEditor editor) {
    _Editor = editor;
}