本文整理汇总了Java中org.eclipse.swt.widgets.ToolItem.notifyListeners方法的典型用法代码示例。如果您正苦于以下问题:Java ToolItem.notifyListeners方法的具体用法?Java ToolItem.notifyListeners怎么用?Java ToolItem.notifyListeners使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.ToolItem
的用法示例。
在下文中一共展示了ToolItem.notifyListeners方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.eclipse.swt.widgets.ToolItem; //导入方法依赖的package包/类
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
// Sanity check.
if (null == event) {
return null;
}
// Class check.
if (!(event.getTrigger() instanceof Event)) {
return null;
}
final Event eventWidget = (Event) event.getTrigger();
// Makes sure event came from a ToolItem.
if (!(eventWidget.widget instanceof ToolItem)) {
return null;
}
final ToolItem toolItem = (ToolItem) eventWidget.widget;
// Creates fake selection event.
final Event newEvent = new Event();
newEvent.button = 1;
newEvent.widget = toolItem;
newEvent.detail = SWT.ARROW;
newEvent.x = toolItem.getBounds().x;
newEvent.y = toolItem.getBounds().y + toolItem.getBounds().height;
// Dispatches the event.
toolItem.notifyListeners(SWT.Selection, newEvent);
return null;
}
示例2: setCurrentInput
import org.eclipse.swt.widgets.ToolItem; //导入方法依赖的package包/类
public void setCurrentInput(Object selected, String source) {
if (isUpdating) return;
currentPage = null;
setWidgetsEnabled(true);
if (selected instanceof MobileComponentTreeObject) {
UIComponent uic = null;
if (selected instanceof MobilePageComponentTreeObject) {
currentPage = ((MobilePageComponentTreeObject) selected).getObject();
} else if (selected instanceof MobileUIComponentTreeObject) {
uic = ((MobileUIComponentTreeObject) selected).getObject();
currentPage = uic.getPage();
}
if (currentPage == null) {
resetViewers();
} else {
if (!currentPage.equals(checkboxTreeViewer.getInput())) {
resetViewers();
checkboxTreeViewer.setInput(currentPage);
initTreeSelection(checkboxTreeViewer, null);
}
MobileSmartSource cs = MobileSmartSource.valueOf(source);
if (cs != null) {
MobilePickerContentProvider contentProvider = (MobilePickerContentProvider) checkboxTreeViewer.getContentProvider();
if (isParentDialog) { // when dbo's property edition
contentProvider.setSelectedDbo(uic);
}
ToolItem buttonToSelect = btnSequence;
currentSource = source;
Filter filter = cs.getFilter();
if (Filter.Sequence.equals(filter)) {
buttonToSelect = btnSequence;
}
if (Filter.Database.equals(filter)) {
buttonToSelect = btnDatabase;
}
if (Filter.Iteration.equals(filter)) {
buttonToSelect = btnIteration;
}
if (Filter.Form.equals(filter)) {
buttonToSelect = btnForm;
}
buttonToSelect.notifyListeners(SWT.Selection, null);
}
}
updateMessage();
} else {
resetViewers();
updateMessage();
}
}