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


Java MenuEvent类代码示例

本文整理汇总了Java中org.eclipse.swt.events.MenuEvent的典型用法代码示例。如果您正苦于以下问题:Java MenuEvent类的具体用法?Java MenuEvent怎么用?Java MenuEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


MenuEvent类属于org.eclipse.swt.events包,在下文中一共展示了MenuEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: refactorMenuShown

import org.eclipse.swt.events.MenuEvent; //导入依赖的package包/类
private void refactorMenuShown(IMenuManager refactorSubmenu) {
	// we know that we have an MenuManager since we created it in
	// addRefactorSubmenu.
	Menu menu = ((MenuManager) refactorSubmenu).getMenu();
	menu.addMenuListener(new MenuAdapter() {
		@Override
		public void menuHidden(MenuEvent e) {
			refactorMenuHidden();
		}
	});
	ITextSelection textSelection = (ITextSelection) fEditor.getSelectionProvider().getSelection();
	// JavaTextSelection javaSelection= new
	// JavaTextSelection(getEditorInput(), getDocument(),
	// textSelection.getOffset(), textSelection.getLength());

	for (Iterator<SelectionDispatchAction> iter = fActions.iterator(); iter.hasNext();) {
		SelectionDispatchAction action = iter.next();
		action.update(textSelection);
	}
	refactorSubmenu.removeAll();
	if (fillRefactorMenu(refactorSubmenu) == 0)
		refactorSubmenu.add(fNoActionAvailable);
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:24,代码来源:RefactorActionGroup.java

示例2: getMenu

import org.eclipse.swt.events.MenuEvent; //导入依赖的package包/类
/**
 * Generate the contextual menu to manage the template set. The menu is empty and
 * it is initialized the first time it's opened
 */
@Override
public Menu getMenu(Menu parent) {
	MenuItem root = new MenuItem(parent, SWT.CASCADE);
	menu = new Menu (parent);
	root.setMenu (menu);
	root.setText(Messages.HandleDefaultsAction_menuTitle);

	//Menu listener to show the current adapter highlighted on show
	menu.addMenuListener(new MenuAdapter() {
		@Override
		public void menuShown(MenuEvent e) {
			if (refreshItemList || menu.getItemCount() == 0 || !DefaultManager.INSTANCE.getAvailableElements().equals(values)){
				for(MenuItem item : menu.getItems()){
					item.dispose();
				}
				initilizeItems();
				refreshItemList = false;
			}
		}
	});
	return menu;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:27,代码来源:HandleDefaultsAction.java

示例3: getMenu

import org.eclipse.swt.events.MenuEvent; //导入依赖的package包/类
public Menu getMenu(final Control parent) {

		_isAdvancedMenu = true;

		dispose();

		_menu = new Menu(parent);

		// Add listener to repopulate the menu each time
		_menu.addMenuListener(new MenuAdapter() {
			@Override
			public void menuShown(final MenuEvent e) {
				fillMenu((Menu) e.widget);
			}
		});

		return _menu;
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:19,代码来源:ActionAddTourTag.java

示例4: getMenu

import org.eclipse.swt.events.MenuEvent; //导入依赖的package包/类
public Menu getMenu(final Menu parent) {

		dispose();

		_menu = new Menu(parent);

		// Add listener to repopulate the menu each time
		_menu.addMenuListener(new MenuAdapter() {
			@Override
			public void menuShown(final MenuEvent e) {

				// dispose old menu items
				for (final MenuItem menuItem : ((Menu) e.widget).getItems()) {
					menuItem.dispose();
				}

				fillMenu(_menu);
			}
		});

		return _menu;
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:23,代码来源:ActionDeleteTourMenu2.java

示例5: getMenu

import org.eclipse.swt.events.MenuEvent; //导入依赖的package包/类
public Menu getMenu(final Menu parent) {

		dispose();
		fMenu = new Menu(parent);

		// Add listener to repopulate the menu each time
		fMenu.addMenuListener(new MenuAdapter() {
			@Override
			public void menuShown(final MenuEvent e) {

				// dispose old menu items
				for (final MenuItem menuItem : ((Menu) e.widget).getItems()) {
					menuItem.dispose();
				}

				fillMenu(fMenu);
			}
		});

		return fMenu;
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:22,代码来源:ActionMergeIntoMenu.java

示例6: getMenu

import org.eclipse.swt.events.MenuEvent; //导入依赖的package包/类
@Override
public Menu getMenu(final Menu parent) {

	dispose();

	_menu = new Menu(parent);

	// Add listener to repopulate the menu each time
	_menu.addMenuListener(new MenuAdapter() {
		@Override
		public void menuShown(final MenuEvent e) {

			// dispose old menu items
			for (final MenuItem menuItem : ((Menu) e.widget).getItems()) {
				menuItem.dispose();
			}

			fillMenu(_menu);
		}
	});

	return _menu;
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:24,代码来源:ActionReimportSubMenu.java

示例7: getMenu

import org.eclipse.swt.events.MenuEvent; //导入依赖的package包/类
public Menu getMenu(final Menu parent) {

		dispose();
		_menu = new Menu(parent);

		// Add listener to repopulate the menu each time
		_menu.addMenuListener(new MenuAdapter() {
			@Override
			public void menuShown(final MenuEvent e) {

				// dispose old menu items
				for (final MenuItem menuItem : ((Menu) e.widget).getItems()) {
					menuItem.dispose();
				}

				fillMenu(_menu);
			}
		});

		return _menu;
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:22,代码来源:ActionSetPerson.java

示例8: getMenu

import org.eclipse.swt.events.MenuEvent; //导入依赖的package包/类
@Override
public Menu getMenu(final Menu parent) {

	dispose();

	_menu = new Menu(parent);

	// Add listener to repopulate the menu each time
	_menu.addMenuListener(new MenuAdapter() {
		@Override
		public void menuShown(final MenuEvent e) {

			// dispose old menu items
			for (final MenuItem menuItem : ((Menu) e.widget).getItems()) {
				menuItem.dispose();
			}

			fillMenu(_menu);

			enableActions();
		}
	});

	return _menu;
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:26,代码来源:ActionCadenceSubMenu.java

示例9: getMenu

import org.eclipse.swt.events.MenuEvent; //导入依赖的package包/类
@Override
public Menu getMenu(final Menu parent) {

	dispose();
	__categoryMenu = new Menu(parent);

	// Add listener to repopulate the menu each time
	__categoryMenu.addMenuListener(new MenuAdapter() {
		@Override
		public void menuShown(final MenuEvent e) {

			final Menu menu = (Menu) e.widget;

			// dispose old items
			final MenuItem[] items = menu.getItems();
			for (final MenuItem item : items) {
				item.dispose();
			}

			// add actions
			createColumnActions(__categoryMenu, __category);
		}
	});

	return __categoryMenu;
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:27,代码来源:ColumnContextMenu.java

示例10: refactorMenuShown

import org.eclipse.swt.events.MenuEvent; //导入依赖的package包/类
private void refactorMenuShown(IMenuManager refactorSubmenu) {
	// we know that we have an MenuManager since we created it in
	// addRefactorSubmenu.
	Menu menu= ((MenuManager)refactorSubmenu).getMenu();
	menu.addMenuListener(new MenuAdapter() {
		@Override
		public void menuHidden(MenuEvent e) {
			refactorMenuHidden();
		}
	});
	ITextSelection textSelection= (ITextSelection)fEditor.getSelectionProvider().getSelection();
	JavaTextSelection javaSelection= new JavaTextSelection(getEditorInput(), getDocument(), textSelection.getOffset(), textSelection.getLength());

	for (Iterator<SelectionDispatchAction> iter= fActions.iterator(); iter.hasNext(); ) {
		SelectionDispatchAction action= iter.next();
		action.update(javaSelection);
	}
	refactorSubmenu.removeAll();
	if (fillRefactorMenu(refactorSubmenu) == 0)
		refactorSubmenu.add(fNoActionAvailable);
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:22,代码来源:RefactorActionGroup.java

示例11: initMenu

import org.eclipse.swt.events.MenuEvent; //导入依赖的package包/类
protected void initMenu() {
    menu.addMenuListener(new MenuAdapter() {
        public void menuShown(MenuEvent e) {
            Menu m = (Menu) e.widget;
            MenuItem[] items = m.getItems();
            for (int i = 0; i < items.length; i++) {
                items[i].dispose();
            }
            fillMenu(m);
        }
    });
}
 
开发者ID:iloveeclipse,项目名称:skin4eclipse,代码行数:13,代码来源:SaveSessionsPulldownMenu.java

示例12: createOutputMenu

import org.eclipse.swt.events.MenuEvent; //导入依赖的package包/类
/**
 * Generate the list of all the previews output format
 * 
 * @param parent
 */
private void createOutputMenu(Menu parent) {
	MenuItem root = new MenuItem(parent, SWT.CASCADE);
	menu = new Menu(parent);
	root.setMenu(menu);
	root.setText(Messages.ViewSettingsDropDownAction_previewFormatMenu);
	JrxmlEditor editor = getEditor();
	PreviewContainer preview = (PreviewContainer) editor.getEditor(JrxmlEditor.PAGE_PREVIEW);
	viewFactory = preview.getViewFactory();
	for (String key : viewFactory.getKeys()) {
		if (viewFactory.isSeparator(key)) {
			new MenuItem(menu, SWT.SEPARATOR);
		} else {
			creteItem(key, editor);
		}
	}

	menu.addMenuListener(new MenuAdapter() {
		@Override
		public void menuShown(MenuEvent e) {
			String actualPreview = getEditor().getDefaultViewerKey();
			for (MenuItem item : menu.getItems()) {
				item.setSelection(item.getText().equals(actualPreview));
			}
		}
	});
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:32,代码来源:PreviewFormatDropDownAction.java

示例13: onShowContextMenu

import org.eclipse.swt.events.MenuEvent; //导入依赖的package包/类
@Override
public void onShowContextMenu(final MenuEvent menuEvent, final Control menuParentControl) {

	_tagMenuMgr.onShowMenu(//
			menuEvent,
			menuParentControl,
			Display.getCurrent().getCursorLocation(),
			null);
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:10,代码来源:TourChartContextProvider.java

示例14: getMenu

import org.eclipse.swt.events.MenuEvent; //导入依赖的package包/类
public Menu getMenu(final Menu parent) {

		dispose();
		_menu = new Menu(parent);

		// Add listener to repopulate the menu each time
		_menu.addMenuListener(new MenuAdapter() {
			@Override
			public void menuShown(final MenuEvent e) {

				final Menu menu = (Menu) e.widget;

				// dispose old items
				for (final MenuItem menuItem : menu.getItems()) {
					menuItem.dispose();
				}

				/*
				 * create all expand types
				 */
				final int selectedExpandType = getSelectedExpandType();
				int typeIndex = 0;
				for (final int expandType : TagManager.EXPAND_TYPES) {

					final ActionSetTagStructure actionTagStructure = new ActionSetTagStructure(
							expandType,
							TagManager.EXPAND_TYPE_NAMES[typeIndex++]);

					// check active expand type
					actionTagStructure.setChecked(selectedExpandType == expandType);

					addActionToMenu(actionTagStructure);
				}
			}
		});

		return _menu;
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:39,代码来源:ActionMenuSetTagStructure.java

示例15: getMenu

import org.eclipse.swt.events.MenuEvent; //导入依赖的package包/类
public Menu getMenu(final Control parent) {

		dispose();
		_menu = new Menu(parent);

		// Add listener to repopulate the menu each time
		_menu.addMenuListener(new MenuAdapter() {
			@Override
			public void menuShown(final MenuEvent e) {
				onFillMenu((Menu) e.widget);
			}
		});

		return _menu;
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:16,代码来源:ActionRemoveTourTag.java


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