本文整理汇总了Java中org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION属性的典型用法代码示例。如果您正苦于以下问题:Java ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION属性的具体用法?Java ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION怎么用?Java ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent
的用法示例。
在下文中一共展示了ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: activate
@Override
public void activate(ColumnViewerEditorActivationEvent activationEvent) {
super.activate(activationEvent);
if (activationStyle != SWT.NONE) {
boolean mouseSelection = activationEvent.eventType == ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION
|| activationEvent.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION;
boolean keyboardSelection = activationEvent.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED;
boolean programmatic = activationEvent.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
boolean traversal = activationEvent.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL;
if (mouseSelection && (activationStyle & DROP_DOWN_ON_MOUSE_ACTIVATION) != 0 || keyboardSelection
&& (activationStyle & DROP_DOWN_ON_KEY_ACTIVATION) != 0 || programmatic
&& (activationStyle & DROP_DOWN_ON_PROGRAMMATIC_ACTIVATION) != 0 || traversal
&& (activationStyle & DROP_DOWN_ON_TRAVERSE_ACTIVATION) != 0) {
comboBox.getDisplay().asyncExec(new Runnable() {
@Override
public void run() {
comboBox.setListVisible(true);
}
});
}
}
}
示例2: initEditBehaviour
private void initEditBehaviour(final int type) {
TableViewerFocusCellManager focusCellManager = new TableViewerFocusCellManager(tableViewer, new FocusCellOwnerDrawHighlighter(tableViewer));
ColumnViewerEditorActivationStrategy activationSupport = new ColumnViewerEditorActivationStrategy(tableViewer) {
@Override
protected boolean isEditorActivationEvent(ColumnViewerEditorActivationEvent event) {
logger.debug(event.toString());
boolean singleSelect = ((IStructuredSelection)tableViewer.getSelection()).size() == 1;
int mouseActivationType=
type == 0 ? ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION : ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION;
boolean isLeftMouseSelect = event.eventType == mouseActivationType && ((MouseEvent)event.sourceEvent).button == 1;
return singleSelect && (isLeftMouseSelect
|| event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC
|| event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL);
// Enable editor only with mouse double click
// if (event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION) {
// EventObject source = event.sourceEvent;
// if (source instanceof MouseEvent && ((MouseEvent)source).button == 3)
// return false;
//
// return true;
// }
//
// return false;
}
};
TableViewerEditor.create(tableViewer, focusCellManager, activationSupport, ColumnViewerEditor.TABBING_HORIZONTAL |
ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR |
ColumnViewerEditor.TABBING_VERTICAL |
ColumnViewerEditor.KEYBOARD_ACTIVATION);
}
示例3: setCellEditSupport
/**
* Initialize cell editing.
*
* @param viewer
*/
public static void setCellEditSupport(final TableViewer viewer) {
final TableViewerFocusCellManager focusCellManager = new TableViewerFocusCellManager(
viewer,
new FocusCellOwnerDrawHighlighter(viewer));
final ColumnViewerEditorActivationStrategy actSupport = new ColumnViewerEditorActivationStrategy(viewer) {
@Override
protected boolean isEditorActivationEvent(final ColumnViewerEditorActivationEvent event) {
return (event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL)
|| (event.eventType == ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION)
|| ((event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED)
&& (event.keyCode == SWT.CR))
|| (event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC);
}
};
TableViewerEditor.create(//
viewer,
focusCellManager,
actSupport,
ColumnViewerEditor.TABBING_HORIZONTAL //
| ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR //
| ColumnViewerEditor.TABBING_VERTICAL
| ColumnViewerEditor.KEYBOARD_ACTIVATION);
}
示例4: activate
public void activate(ColumnViewerEditorActivationEvent activationEvent) {
super.activate(activationEvent);
if (activationStyle != SWT.NONE) {
boolean dropDown = false;
if ((activationEvent.eventType == ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION || activationEvent.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION)
&& (activationStyle & DROP_DOWN_ON_MOUSE_ACTIVATION) != 0) {
dropDown = true;
} else if (activationEvent.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED
&& (activationStyle & DROP_DOWN_ON_KEY_ACTIVATION) != 0) {
dropDown = true;
} else if (activationEvent.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC
&& (activationStyle & DROP_DOWN_ON_PROGRAMMATIC_ACTIVATION) != 0) {
dropDown = true;
} else if (activationEvent.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
&& (activationStyle & DROP_DOWN_ON_TRAVERSE_ACTIVATION) != 0) {
dropDown = true;
}
if (dropDown) {
getControl().getDisplay().asyncExec(new Runnable() {
public void run() {
((CCombo) getControl()).setListVisible(true);
}
});
}
}
}
示例5: activate
public void activate(ColumnViewerEditorActivationEvent activationEvent) {
super.activate(activationEvent);
if (activationStyle != SWT.NONE) {
boolean dropDown = false;
if ((activationEvent.eventType == ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION || activationEvent.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION)
&& (activationStyle & DROP_DOWN_ON_MOUSE_ACTIVATION) != 0 ) {
dropDown = true;
} else if (activationEvent.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED
&& (activationStyle & DROP_DOWN_ON_KEY_ACTIVATION) != 0 ) {
dropDown = true;
} else if (activationEvent.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC
&& (activationStyle & DROP_DOWN_ON_PROGRAMMATIC_ACTIVATION) != 0) {
dropDown = true;
} else if (activationEvent.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
&& (activationStyle & DROP_DOWN_ON_TRAVERSE_ACTIVATION) != 0) {
dropDown = true;
}
if (dropDown) {
getControl().getDisplay().asyncExec(new Runnable() {
public void run() {
((CCombo) getControl()).setListVisible(true);
}
});
}
}
}