當前位置: 首頁>>代碼示例>>Java>>正文


Java TextCellEditor.getControl方法代碼示例

本文整理匯總了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));
}
 
開發者ID:sopeco,項目名稱:DynamicSpotter,代碼行數:35,代碼來源:PropertiesEditingSupport.java

示例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;
   }
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:16,代碼來源:ModelFieldEditorFactory.java

示例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();
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:9,代碼來源:InputFieldEditingSupport.java

示例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();
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:16,代碼來源:NoteEditManager.java

示例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();
}
 
開發者ID:kozake,項目名稱:ermaster-k,代碼行數:16,代碼來源:NoteEditManager.java

示例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();
}
 
開發者ID:dbflute-session,項目名稱:erflute,代碼行數:10,代碼來源:WalkerNoteEditManager.java

示例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();
}
 
開發者ID:sopeco,項目名稱:DynamicSpotter,代碼行數:19,代碼來源:TextEditorErrorListener.java

示例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();
}
 
開發者ID:winture,項目名稱:wt-studio,代碼行數:17,代碼來源:TextAreaEditManager.java

示例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);
		}
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:20,代碼來源:GridWidgetCommonBuilder.java


注:本文中的org.eclipse.jface.viewers.TextCellEditor.getControl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。