本文整理匯總了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);
}
}