PropertiesEditingSupport.java 文件源码

java
阅读 36 收藏 0 点赞 0 评论 0

项目:DynamicSpotter 作者:
/**
 * Creates an editing support for the given operating viewer.
 * 
 * @param operatingViewer
 *            the viewer this editing support works for
 * @param editor
 *            the editor which is operated in
 * @param propertiesViewer
 *            the properties group viewer that contains the operating viewer
 */
public PropertiesEditingSupport(ColumnViewer operatingViewer, AbstractSpotterEditor editor,
        PropertiesGroupViewer propertiesViewer) {
    super(operatingViewer);
    this.editor = editor;
    this.propertiesViewer = propertiesViewer;
    Composite parent = (Composite) getViewer().getControl();
    cellDefaultTextEditor = new TextCellEditor(parent);
    cellDefaultTextEditor.getControl().addTraverseListener(new ActivationTraverser(cellDefaultTextEditor));

    cellNumberEditor = new TextCellEditor(parent);
    ControlDecoration decor = new ControlDecoration(cellNumberEditor.getControl(), SWT.LEFT | SWT.TOP);
    cellNumberEditor.addListener(new TextEditorErrorListener(cellNumberEditor, decor));
    cellNumberEditor.getControl().addTraverseListener(new ActivationTraverser(cellNumberEditor));

    cellBooleanEditor = new CustomComboBoxCellEditor(parent, BOOLEAN_VALUES, SWT.DROP_DOWN | SWT.READ_ONLY);
    cellBooleanEditor.setActivationStyle(COMBO_ACTIVATION_STYLE);
    cellBooleanEditor.getControl().addTraverseListener(new ComboActivationTraverser(cellBooleanEditor));
    cellComboBoxEditor = new CustomComboBoxCellEditor(parent, new String[0], SWT.DROP_DOWN | SWT.READ_ONLY);
    cellComboBoxEditor.setActivationStyle(COMBO_ACTIVATION_STYLE);
    cellComboBoxEditor.getControl().addTraverseListener(new ComboActivationTraverser(cellComboBoxEditor));

    cellCustomDialogEditor = new CustomDialogCellEditor(parent);
    cellCustomDialogEditor.getControl().addTraverseListener(new ActivationTraverser(cellCustomDialogEditor));
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号