Java Code Examples for org.eclipse.jface.action.Action#AS_PUSH_BUTTON

The following examples show how to use org.eclipse.jface.action.Action#AS_PUSH_BUTTON . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CommentAction.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
public CommentAction(Shell shell, String comment){
	super("", Action.AS_PUSH_BUTTON);
	Assert.isNotNull(shell);
	this.shell = shell;
	this.comment = comment;
	init();
	
}
 
Example 2
Source File: DateAction.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
public DateAction(Shell shell, LocalDateTime localDateTime, Composite composite){
	super("", Action.AS_PUSH_BUTTON);
	Assert.isNotNull(shell);
	this.shell = shell;
	this.localDateTime = localDateTime == null ? LocalDateTime.now() : localDateTime;
	this.lblDateText = new Label(composite, SWT.NONE);
	this.lblDateText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
	
	init();
}
 
Example 3
Source File: CommonQuickOutlinePage.java    From APICloud-Studio with GNU General Public License v3.0 4 votes vote down vote up
/**
 * 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));
}
 
Example 4
Source File: CodesSelectionComposite.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
public AllSelectionAction(){
	super("Alle", Action.AS_PUSH_BUTTON);
}