本文整理汇总了Java中org.eclipse.jface.viewers.TextCellEditor.getControl方法的典型用法代码示例。如果您正苦于以下问题:Java TextCellEditor.getControl方法的具体用法?Java TextCellEditor.getControl怎么用?Java TextCellEditor.getControl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.viewers.TextCellEditor
的用法示例。
在下文中一共展示了TextCellEditor.getControl方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PropertiesEditingSupport
import org.eclipse.jface.viewers.TextCellEditor; //导入方法依赖的package包/类
/**
* 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));
}
示例2: getSimpleTextEditor
import org.eclipse.jface.viewers.TextCellEditor; //导入方法依赖的package包/类
private CellEditor getSimpleTextEditor(Composite parent, FieldDescriptor anot) {
TextCellEditor ed = new TextCellEditor(parent) {
@Override
protected void doSetValue(Object value) {
String string = value!=null ? value.toString() : "";
super.doSetValue(string);
}
};
if (anot!=null && anot.regex().length()>0) {
Text text = (Text)ed.getControl();
RegexDecorator deco = new RegexDecorator(text, anot.regex());
deco.setAllowInvalidValues(false);
}
return ed;
}
示例3: InputFieldEditingSupport
import org.eclipse.jface.viewers.TextCellEditor; //导入方法依赖的package包/类
public InputFieldEditingSupport(TableViewer viewer) {
super(viewer);
this.viewer = viewer;
//cellEditor = new TextCellEditor(viewer.getTable(), SWT.MULTI | SWT.WRAP | SWT.BORDER);
cellEditor = new TextCellEditor(viewer.getTable());
final Text aaa = (Text)cellEditor.getControl();
}
示例4: initCellEditor
import org.eclipse.jface.viewers.TextCellEditor; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void initCellEditor() {
final TextCellEditor editor = (TextCellEditor) getCellEditor();
if (note.getText() != null) {
editor.setValue(note.getText());
}
final Text text = (Text) editor.getControl();
text.selectAll();
}
示例5: initCellEditor
import org.eclipse.jface.viewers.TextCellEditor; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void initCellEditor() {
TextCellEditor editor = (TextCellEditor) this.getCellEditor();
if (note.getText() != null) {
editor.setValue(note.getText());
}
Text text = (Text) editor.getControl();
text.selectAll();
}
示例6: initCellEditor
import org.eclipse.jface.viewers.TextCellEditor; //导入方法依赖的package包/类
@Override
protected void initCellEditor() {
final TextCellEditor editor = (TextCellEditor) getCellEditor();
if (note.getNoteText() != null) {
editor.setValue(note.getNoteText());
}
final Text text = (Text) editor.getControl();
text.selectAll();
}
示例7: TextEditorErrorListener
import org.eclipse.jface.viewers.TextCellEditor; //导入方法依赖的package包/类
/**
* Creates a new text editor error listener.
*
* @param textCellEditor
* the associated text cell editor
* @param decor
* the control decoration
*/
public TextEditorErrorListener(TextCellEditor textCellEditor, ControlDecoration decor) {
this.textCellEditor = textCellEditor;
textCtrl = (Text) textCellEditor.getControl();
this.decor = decor;
decor.setImage(DECOR_IMG);
decor.setShowOnlyOnFocus(true);
decor.setShowHover(true);
decor.hide();
decor.hideHover();
}
示例8: initCellEditor
import org.eclipse.jface.viewers.TextCellEditor; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void initCellEditor()
{
TextCellEditor editor = (TextCellEditor) this.getCellEditor();
if ((textArea).getTextArea() != null) {
editor.setValue((textArea).getTextArea());
}
Text text = (Text) editor.getControl();
text.selectAll();
}
示例9: addTextEditor
import org.eclipse.jface.viewers.TextCellEditor; //导入方法依赖的package包/类
/**
* Adds the text editor.
*
* @param table
* the table
* @param cellEditor
* the cell editor
* @param position
* the position
*/
protected void addTextEditor(Table table, CellEditor[] cellEditor, Map<String, Integer> columns, String columnsName){
cellEditor[columns.get(columnsName)]=new TextCellEditor(table);
if(columnsName.equals(Messages.PRECISION) || columnsName.equals(Messages.SCALE)){
TextCellEditor editor = (TextCellEditor) cellEditor[columns.get(columnsName)];
Text txt = (Text) editor.getControl();
txt.setTextLimit(2);
}
}