当前位置: 首页>>代码示例>>Java>>正文


Java ToolItem.notifyListeners方法代码示例

本文整理汇总了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;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:35,代码来源:DropDownCommandHandler.java

示例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();
	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:57,代码来源:MobilePickerComposite.java


注:本文中的org.eclipse.swt.widgets.ToolItem.notifyListeners方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。