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


Java Action.AS_CHECK_BOX属性代码示例

本文整理汇总了Java中org.eclipse.jface.action.Action.AS_CHECK_BOX属性的典型用法代码示例。如果您正苦于以下问题:Java Action.AS_CHECK_BOX属性的具体用法?Java Action.AS_CHECK_BOX怎么用?Java Action.AS_CHECK_BOX使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.jface.action.Action的用法示例。


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

示例1: addToolbarAction

private void addToolbarAction(String name, boolean toggle, String imageName, String description, Runnable runnable) {
	Action a = new Action(name, toggle ? Action.AS_CHECK_BOX : Action.AS_PUSH_BUTTON) {
		public void run() {
			runnable.run();
		}
	};
	addToolbarAction(name, toggle, imageName, description, a);
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:8,代码来源:PandionJView.java

示例2: ShowOverlayAction

private ShowOverlayAction() {
    super("Show In &Loupe", Action.AS_CHECK_BOX);
    setAccelerator(SWT.MOD1 + 'L');
    ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
    mImage = imageLoader.loadImage("show-overlay.png", Display.getDefault()); //$NON-NLS-1$
    setImageDescriptor(ImageDescriptor.createFromImage(mImage));
    setToolTipText("Show the overlay in the loupe view");
    setEnabled(PixelPerfectModel.getModel().getOverlayImage() != null);
    PixelPerfectModel.getModel().addImageChangeListener(this);
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:10,代码来源:ShowOverlayAction.java

示例3: ActionButton

public ActionButton(Composite parent, ImageAction action) {
    this.mAction = (Action) action;
    if (this.mAction.getStyle() == Action.AS_CHECK_BOX) {
        mButton = new Button(parent, SWT.CHECK);
    } else {
        mButton = new Button(parent, SWT.PUSH);
    }
    mButton.setText(action.getText());
    mButton.setImage(action.getImage());
    this.mAction.addPropertyChangeListener(this);
    mButton.addSelectionListener(this);
    mButton.setToolTipText(action.getToolTipText());
    mButton.setEnabled(this.mAction.isEnabled());
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:14,代码来源:ActionButton.java

示例4: widgetSelected

@Override
public void widgetSelected(SelectionEvent e) {
    if (mAction.getStyle() == Action.AS_CHECK_BOX) {
        mAction.setChecked(mButton.getSelection());
    }
    mAction.run();
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:7,代码来源:ActionButton.java

示例5: PixelPerfectAutoRefreshAction

private PixelPerfectAutoRefreshAction() {
    super("Auto &Refresh", Action.AS_CHECK_BOX);
    setAccelerator(SWT.MOD1 + 'R');
    ImageLoader imageLoader = ImageLoader.getLoader(HierarchyViewerDirector.class);
    mImage = imageLoader.loadImage("auto-refresh.png", Display.getDefault()); //$NON-NLS-1$
    setImageDescriptor(ImageDescriptor.createFromImage(mImage));
    setToolTipText("Automatically refresh the screenshot");
}
 
开发者ID:utds3lab,项目名称:SMVHunter,代码行数:8,代码来源:PixelPerfectAutoRefreshAction.java

示例6: toCheckAction

public Action toCheckAction() {
	final Action result = new Action(text, Action.AS_CHECK_BOX) {

		@Override
		public void runWithEvent(final Event e) {
			selector.widgetSelected(new SelectionEvent(e));
		}
	};

	result.setImageDescriptor(GamaIcons.create(image).descriptor());
	result.setToolTipText(tooltip);
	result.setId(image);
	return result;

}
 
开发者ID:gama-platform,项目名称:gama,代码行数:15,代码来源:GamaCommand.java

示例7: contributeToQuickOutlineMenu

/**
 * Contributes actions to quick outline menu.
 * 
 * @param manager
 *            - menu manager.
 */
void contributeToQuickOutlineMenu(IMenuManager manager)
{
	// add sort action
	Action sortAction = new Action(Messages.CommonQuickOutlinePage_SortAlphabetically, Action.AS_CHECK_BOX)
	{
		public void run()
		{
			// Hide tree control during redraw
			getTreeViewer().getControl().setVisible(false);

			// Set the sorting according to whether this Action is checked/unchecked
			// TODO Store this persistently across quick outlines per-language?
			if (this.isChecked())
			{
				getTreeViewer().setComparator(new ViewerComparator());
			}
			else
			{
				getTreeViewer().setComparator(null);
			}

			// Show the tree control
			getTreeViewer().getControl().setVisible(true);
		}
	};
	sortAction.setImageDescriptor(UIUtils.getImageDescriptor(CommonEditorPlugin.PLUGIN_ID, "icons/sort.gif")); //$NON-NLS-1$
	sortAction.setToolTipText(Messages.CommonQuickOutlinePage_SortAlphabetically);
	// this._sortItem = new ActionContributionItem(sortAction);
	manager.add(new ActionContributionItem(sortAction));

	// add Collapse All action
	Action collapseAction = new Action(Messages.CommonQuickOutlinePage_CollapseAll, Action.AS_PUSH_BUTTON)
	{
		public void run()
		{
			getTreeViewer().collapseAll();
		}
	};
	collapseAction.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
			.getImageDescriptor(ISharedImages.IMG_ELCL_COLLAPSEALL));
	collapseAction.setToolTipText(Messages.CommonQuickOutlinePage_CollapseAll);
	manager.add(new ActionContributionItem(collapseAction));

	// Expand All action
	Action expandAction = new Action(Messages.CommonQuickOutlinePage_ExpandAll)
	{
		public void run()
		{
			getTreeViewer().expandAll();
		}
	};
	expandAction
			.setImageDescriptor(UIUtils.getImageDescriptor(CommonEditorPlugin.PLUGIN_ID, "icons/expandall.gif")); //$NON-NLS-1$
	expandAction.setToolTipText(Messages.CommonQuickOutlinePage_ExpandAll);
	manager.add(new ActionContributionItem(expandAction));
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:62,代码来源:CommonQuickOutlinePage.java

示例8: createActions

private void createActions() {

		_actionCalendarOptions = new ActionCalendarOptions(this);
		_actionTourInfo = new ActionTourInfo(this, _parent);

		/*
		 * Back
		 */
		{
			_actionBack = new Action() {
				@Override
				public void run() {
					_calendarGraph.scroll_WithWheel_Screen(1);
				}
			};
			_actionBack.setText(Messages.Calendar_View_Action_Back);
			_actionBack.setToolTipText(Messages.Calendar_View_Action_Back_Tooltip);
			_actionBack.setImageDescriptor(TourbookPlugin.getImageDescriptor(Messages.Image__ArrowUp));
		}

		/*
		 * Forward
		 */
		{
			_actionForward = new Action() {
				@Override
				public void run() {
					_calendarGraph.scroll_WithWheel_Screen(-1);
				}
			};
			_actionForward.setText(Messages.Calendar_View_Action_Forward);
			_actionForward.setToolTipText(Messages.Calendar_View_Action_Forward_Tooltip);
			_actionForward.setImageDescriptor(TourbookPlugin.getImageDescriptor(Messages.Image__ArrowDown));
		}

		/*
		 * Link with other views
		 */
		{
			_actionSetLinked = new Action(null, Action.AS_CHECK_BOX) {
				@Override
				public void run() {
					_calendarGraph.setLinked(_actionSetLinked.isChecked());
				}
			};
			_actionSetLinked.setText(Messages.Calendar_View_Action_LinkWithOtherViews);
			_actionSetLinked.setImageDescriptor(TourbookPlugin.getImageDescriptor(Messages.Image__SyncViews));
			_actionSetLinked.setChecked(true);
		}

		/*
		 * Today
		 */
		{
			_actionGotoToday = new Action() {
				@Override
				public void run() {
					_calendarGraph.gotoDate_Today();
				}
			};
			_actionGotoToday.setText(Messages.Calendar_View_Action_GotoToday);
			_actionGotoToday.setImageDescriptor(TourbookPlugin.getImageDescriptor(Messages.Image__ZoomCentered));
		}
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:64,代码来源:CalendarView.java

示例9: ActionPinToolTip

public ActionPinToolTip() {

			super(null, Action.AS_CHECK_BOX);

			setToolTipText(Messages.Photo_Tooltip_Action_PinToolTip_ToolTip);
			setImageDescriptor(TourbookPlugin.getImageDescriptor(Messages.Image__Pin_Blue));
		}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:7,代码来源:PhotoToolTipUI.java

示例10: ActionPinSlideout

public ActionPinSlideout() {

			super(null, Action.AS_CHECK_BOX);

			setToolTipText(Messages.Slideout_Dialog_Action_PinSlideoutLocation_Tooltip);
			setImageDescriptor(CommonActivator.getImageDescriptor(Messages.Image__Pin_Themed));
		}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:7,代码来源:AdvancedSlideout.java

示例11: ActionSlideoutKeepOpen

public ActionSlideoutKeepOpen() {

			super(null, Action.AS_CHECK_BOX);

			setToolTipText(Messages.Slideout_Dialog_Action_KeepSlideoutOpen_Tooltip);
			setImageDescriptor(CommonActivator.getImageDescriptor(Messages.Image__BookOpen_Themed));
		}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:7,代码来源:AdvancedSlideout.java

示例12: ActionMouseMode

public ActionMouseMode(final Chart chart) {

		super(Messages.Action_mouse_mode, Action.AS_CHECK_BOX);
		
		fChart = chart;

		setToolTipText(Messages.Action_mouse_mode_tooltip);
		setImageDescriptor(Activator.getImageDescriptor(Messages.Image__MouseMode));
	}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:9,代码来源:ActionMouseMode.java


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