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


Java ColumnViewer.getControl方法代碼示例

本文整理匯總了Java中org.eclipse.jface.viewers.ColumnViewer.getControl方法的典型用法代碼示例。如果您正苦於以下問題:Java ColumnViewer.getControl方法的具體用法?Java ColumnViewer.getControl怎麽用?Java ColumnViewer.getControl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.viewers.ColumnViewer的用法示例。


在下文中一共展示了ColumnViewer.getControl方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: EntryCellEditingSupport

import org.eclipse.jface.viewers.ColumnViewer; //導入方法依賴的package包/類
/**
 * The default constructor.
 * 
 * @param viewer
 *            The viewer that is using this <code>EditingSupport</code>.
 *            <code>Control</code>s required by this class will be
 *            constructed under this viewer's <code>Control</code> (usually
 *            a <code>Table</code>).
 * @param contentProvider
 *            The content provider. The methods required as an
 *            <code>EditingSupport</code> are passed to this content
 *            provider.
 */
public EntryCellEditingSupport(ColumnViewer viewer, EntryCellContentProvider contentProvider) {
	super(viewer);

	this.contentProvider = contentProvider;

	// Get the viewer's Composite so we can create the CellEditors.
	Composite parent = (Composite) viewer.getControl();

	// Create the TextCellEditor.
	textCell = new TextCellEditor(parent, SWT.LEFT);

	// Create the ComboBoxCellEditor.
	comboCell = new ComboBoxCellEditor(parent, new String[] {}, SWT.DROP_DOWN | SWT.READ_ONLY);
	comboCell.getControl().setBackground(parent.getBackground());
	// Create a HashMap to contain values for discrete Entry values.
	valueMap = new HashMap<String, Integer>();

	return;
}
 
開發者ID:eclipse,項目名稱:eavp,代碼行數:33,代碼來源:EntryCellEditingSupport.java

示例2: getCellEditor

import org.eclipse.jface.viewers.ColumnViewer; //導入方法依賴的package包/類
@Override
public CellEditor getCellEditor(AvroNode node, ColumnViewer viewer) {
	TextCellEditor textCellEditor = new TextCellEditor((Composite) viewer.getControl());
	if (validator != null) {
		validator.setNode(node);
		textCellEditor.setValidator(validator);
	}
	return textCellEditor;
}
 
開發者ID:Talend,項目名稱:avro-schema-editor,代碼行數:10,代碼來源:EditingSupportFactory.java

示例3: AbstractCellCursor

import org.eclipse.jface.viewers.ColumnViewer; //導入方法依賴的package包/類
/**
 * @param viewer
 * @param style
 */
public AbstractCellCursor(ColumnViewer viewer, int style) {
	super((Composite) viewer.getControl(), style);
	this.viewer = viewer;

	Listener listener = createListener();
	int[] eventsToListen = { SWT.Paint, SWT.KeyDown, SWT.MouseDown,
			SWT.MouseDoubleClick };

	for (int event : eventsToListen) {
		addListener(event, listener);
	}
	getParent().addListener(SWT.FocusIn, listener);
}
 
開發者ID:grosenberg,項目名稱:fluentmark,代碼行數:18,代碼來源:AbstractCellCursor.java

示例4: GridViewerEditor

import org.eclipse.jface.viewers.ColumnViewer; //導入方法依賴的package包/類
GridViewerEditor(ColumnViewer viewer,
		ColumnViewerEditorActivationStrategy editorActivationStrategy,
		int feature) {
	super(viewer, editorActivationStrategy, feature);
	this.selectionFollowsEditor = (feature & SELECTION_FOLLOWS_EDITOR) == SELECTION_FOLLOWS_EDITOR;
	this.gridEditor = new GridEditor((Grid) viewer.getControl());
}
 
開發者ID:heartsome,項目名稱:translationstudio8,代碼行數:8,代碼來源:GridViewerEditor.java

示例5: GenericEditingSupport

import org.eclipse.jface.viewers.ColumnViewer; //導入方法依賴的package包/類
public GenericEditingSupport(ColumnViewer viewer,
    IGenericTableColumn column) {
  super(viewer);
  this.editor = new TextCellEditor((Composite) viewer.getControl(),
      column.getAlignMent());
  this.column = column;
}
 
開發者ID:incentivetoken,項目名稱:offspring,代碼行數:8,代碼來源:GenericEditingSupport.java

示例6: InlineEditingSupport

import org.eclipse.jface.viewers.ColumnViewer; //導入方法依賴的package包/類
public InlineEditingSupport ( final IObservableMap map, final ColumnViewer viewer, final DataBindingContext dbc )
{
    super ( viewer, dbc );
    this.map = map;
    this.cellEditor = new TextCellEditor ( (Composite)viewer.getControl () );
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:7,代碼來源:ConfigurationFormToolkit.java

示例7: PrefValueEditingSupport

import org.eclipse.jface.viewers.ColumnViewer; //導入方法依賴的package包/類
public PrefValueEditingSupport(ColumnViewer viewer) {
	super(viewer);
	cellEditor = new TextCellEditor((Composite) viewer.getControl());
}
 
開發者ID:32kda,項目名稱:com.onpositive.prefeditor,代碼行數:5,代碼來源:PrefValueEditingSupport.java

示例8: InputFieldEditingSupport

import org.eclipse.jface.viewers.ColumnViewer; //導入方法依賴的package包/類
public InputFieldEditingSupport(ColumnViewer viewer) {
	super(viewer);
	cellEditor = new TextCellEditor((Table) viewer.getControl());
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:5,代碼來源:InputFieldsComposite.java

示例9: getCellEditor

import org.eclipse.jface.viewers.ColumnViewer; //導入方法依賴的package包/類
@Override
public CellEditor getCellEditor(AvroNode node, ColumnViewer viewer) {
	StudioSchemaTypes studioTypes = getAttributeValue(node);
	String[] valuesAsString = studioTypes.getValuesAsString();
	return new ComboBoxCellEditor((Composite) viewer.getControl(), valuesAsString);
}
 
開發者ID:Talend,項目名稱:avro-schema-editor,代碼行數:7,代碼來源:StudioEditingSupportFactory.java

示例10: TableEditingSupport

import org.eclipse.jface.viewers.ColumnViewer; //導入方法依賴的package包/類
public TableEditingSupport(ColumnViewer viewer, int idx) {
	super(viewer);
	this.editor = new TextCellEditor((Composite) viewer.getControl());
	this.idx = idx;
}
 
開發者ID:grosenberg,項目名稱:fluentmark,代碼行數:6,代碼來源:TableDialog.java

示例11: ViewState

import org.eclipse.jface.viewers.ColumnViewer; //導入方法依賴的package包/類
protected ViewState(final ColumnViewer viewer, final IWorkbenchPage page) {
    this.viewer = viewer;
    listener = new SearchDoubleClickListener(viewer.getControl(), page);
}
 
開發者ID:GRA-UML,項目名稱:tool,代碼行數:5,代碼來源:ReferenceLibrarySearchResultPage.java

示例12: ToolTipSupport

import org.eclipse.jface.viewers.ColumnViewer; //導入方法依賴的package包/類
protected ToolTipSupport(ColumnViewer viewer, int style, boolean manualActivation) {
	super(viewer.getControl(), style, manualActivation);
	this.viewer = viewer;
}
 
開發者ID:xored,項目名稱:q7.quality.mockups,代碼行數:5,代碼來源:TableWithTooltipSupport.java

示例13: setUpCellEditor

import org.eclipse.jface.viewers.ColumnViewer; //導入方法依賴的package包/類
protected void setUpCellEditor(ColumnViewer viewer){
	// set up validation of the cell editors
	textCellEditor = new TextCellEditor((Composite) viewer.getControl());

	textCellEditor.addListener(new ICellEditorListener() {
		@Override
		public void editorValueChanged(boolean oldValidState, boolean newValidState){
			if (newValidState) {
				textCellEditor.getControl().setBackground(
					Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
			} else {
				textCellEditor.getControl().setBackground(
					Display.getCurrent().getSystemColor(SWT.COLOR_RED));
			}
		}
		
		@Override
		public void cancelEditor(){
			textCellEditor.getControl().setBackground(
				Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
		}
		
		@Override
		public void applyEditorValue(){
			textCellEditor.getControl().setBackground(
				Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
		}
	});
	
	focusCell =
		new TableViewerFocusCellManager((TableViewer) viewer, new FocusCellHighlighter(viewer) {
		
	});
	
	ColumnViewerEditorActivationStrategy actSupport =
		new ColumnViewerEditorActivationStrategy(viewer) {
			@Override
			protected boolean isEditorActivationEvent(ColumnViewerEditorActivationEvent event){
				return event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
					|| event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION
					|| (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.CR)
					|| (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.KEYPAD_CR)
					|| event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
			}
		};
	
	TableViewerEditor.create((TableViewer) viewer, focusCell, actSupport,
		ColumnViewerEditor.TABBING_VERTICAL
			| ColumnViewerEditor.KEYBOARD_ACTIVATION);
}
 
開發者ID:elexis,項目名稱:elexis-3-core,代碼行數:51,代碼來源:LabOrderEditingSupport.java

示例14: setUpCellEditor

import org.eclipse.jface.viewers.ColumnViewer; //導入方法依賴的package包/類
protected void setUpCellEditor(ColumnViewer viewer){
	// set up validation of the cell editors
	textCellEditor = new TextCellEditor((Composite) viewer.getControl());
	
	textCellEditor.addListener(new ICellEditorListener() {
		@Override
		public void editorValueChanged(boolean oldValidState, boolean newValidState){
			if (newValidState) {
				textCellEditor.getControl()
					.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
			} else {
				textCellEditor.getControl()
					.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
			}
		}
		
		@Override
		public void cancelEditor(){
			textCellEditor.getControl()
				.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
		}
		
		@Override
		public void applyEditorValue(){
			textCellEditor.getControl()
				.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
		}
	});
	
	focusCell =
		new TreeViewerFocusCellManager((TreeViewer) viewer, new FocusCellHighlighter(viewer) {
		
		});
		
	ColumnViewerEditorActivationStrategy actSupport =
		new ColumnViewerEditorActivationStrategy(viewer) {
			@Override
			protected boolean isEditorActivationEvent(ColumnViewerEditorActivationEvent event){
				return event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
					|| event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION
					|| (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED
						&& event.keyCode == SWT.CR)
					|| (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED
						&& event.keyCode == SWT.KEYPAD_CR)
					|| event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
			}
		};
	
	TreeViewerEditor.create((TreeViewer) viewer, focusCell, actSupport,
		ColumnViewerEditor.TABBING_VERTICAL | ColumnViewerEditor.KEYBOARD_ACTIVATION);
}
 
開發者ID:elexis,項目名稱:elexis-3-core,代碼行數:52,代碼來源:LabResultEditingSupport.java

示例15: OptionValueEditingSupport

import org.eclipse.jface.viewers.ColumnViewer; //導入方法依賴的package包/類
/**
 * Constructor.
 * 
 * @param viewer
 *            the {@link ColumnViewer}
 */
private OptionValueEditingSupport(ColumnViewer viewer) {
    super(viewer);
    editor = new TextCellEditor((Composite) viewer.getControl());
}
 
開發者ID:ObeoNetwork,項目名稱:M2Doc,代碼行數:11,代碼來源:CustomGenconfEditor.java


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