本文整理匯總了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;
}
示例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;
}
示例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);
}
示例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());
}
示例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;
}
示例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 () );
}
示例7: PrefValueEditingSupport
import org.eclipse.jface.viewers.ColumnViewer; //導入方法依賴的package包/類
public PrefValueEditingSupport(ColumnViewer viewer) {
super(viewer);
cellEditor = new TextCellEditor((Composite) viewer.getControl());
}
示例8: InputFieldEditingSupport
import org.eclipse.jface.viewers.ColumnViewer; //導入方法依賴的package包/類
public InputFieldEditingSupport(ColumnViewer viewer) {
super(viewer);
cellEditor = new TextCellEditor((Table) viewer.getControl());
}
示例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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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());
}