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

The following examples show how to use org.eclipse.jface.action.IAction#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: CommonActionProvider.java    From neoscada with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void init ( final ICommonActionExtensionSite aSite )
{
    super.init ( aSite );
    final ICommonViewerSite viewSite = aSite.getViewSite ();
    if ( viewSite instanceof ICommonViewerWorkbenchSite )
    {
        final ICommonViewerWorkbenchSite workbenchSite = (ICommonViewerWorkbenchSite)viewSite;
        this.openAction = new Action ( "Open", IAction.AS_PUSH_BUTTON ) {
            @Override
            public void run ()
            {
                EditorHelper.handleOpen ( workbenchSite.getPage (), workbenchSite.getSelectionProvider () );
            }
        };
    }
}
 
Example 2
Source File: TmfChartView.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
private IAction createClampAction() {
    Action action = new Action(Messages.TmfChartView_LockYAxis, IAction.AS_PUSH_BUTTON) {
        @Override
        public void run() {
            LockRangeDialog rangeDialog = new LockRangeDialog(getSite().getShell(), getChartViewer());
            rangeDialog.open();
        }
    };
    action.setChecked(false);
    return action;
}
 
Example 3
Source File: ControlFlowView.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
private IAction createDynamicFilterConfigureAction() {
    return new Action(PackageMessages.ControlFlowView_DynamicFiltersConfigureLabel, IAction.AS_PUSH_BUTTON) {
        @Override
        public void run() {
            DynamicFilterDialog dialog = new DynamicFilterDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), fActiveThreadsFilter, getTrace());
            if (dialog.open() == Window.OK) {
                /* Remove the previous Active Threads filter */
                checkNotNull(getTimeGraphViewer()).removeFilter(fActiveThreadsFilter);

                ActiveThreadsFilter newFilter = dialog.getActiveThreadsResult();
                ActiveThreadsFilter previousFilter = fActiveThreadsFilter;

                /* Set the filter to the view */
                fActiveThreadsFilter = newFilter;

                boolean enabled = fActiveThreadsFilter.isEnabled();
                if (enabled) {
                    checkNotNull(getTimeGraphViewer()).addFilter(newFilter);
                }

                /*
                 * Prevent double refresh from change state of setChecked
                 * and ensure that a refresh is done if the mode of the
                 * filter is changed or options are changed
                 */
                if (previousFilter.isEnabled() && newFilter.isEnabled()) {
                    boolean changed = !Objects.equals(previousFilter.getCpuRanges(), newFilter.getCpuRanges()) || previousFilter.isCpuRangesBased() != newFilter.isCpuRangesBased();
                    if (changed) {
                        refresh();
                    }
                } else {
                    fActiveThreadsRapidToggle.setChecked(enabled);
                }
            }
        }
    };
}
 
Example 4
Source File: LaborOrderPulldownMenuCreator.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Returns action to the pulldown button
 * 
 * @return
 */
public IAction getAction(){
	int buttonStyle = IAction.AS_DROP_DOWN_MENU;
	if (actions.size() == 1) {
		buttonStyle = IAction.AS_PUSH_BUTTON;
	}
	IAction dropDownAction = new Action("Dropdown", buttonStyle) {
		@Override
		public void run(){
			getSelected().run();
		}
	};
	dropDownAction.setMenuCreator(this);
	return dropDownAction;
}
 
Example 5
Source File: ZoomInAction.java    From gef with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Constructs a new {@link ZoomInAction}.
 */
public ZoomInAction() {
	this("Zoom In", IAction.AS_PUSH_BUTTON,
			MvcFxUiBundle.getDefault().getImageRegistry()
					.getDescriptor(MvcFxUiBundle.IMG_ICONS_ZOOM_IN));
}
 
Example 6
Source File: ScrollTopRightAction.java    From gef with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Constructs a new {@link ScrollTopRightAction}.
 */
public ScrollTopRightAction() {
	this("Scroll Top/Right", IAction.AS_PUSH_BUTTON,
			MvcFxUiBundle.getDefault().getImageRegistry().getDescriptor(
					MvcFxUiBundle.IMG_ICONS_SCROLL_TOP_RIGHT));
}
 
Example 7
Source File: SelectAllAction.java    From gef with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Constructs a new {@link SelectAllAction}.
 */
public SelectAllAction() {
	this("Select All", IAction.AS_PUSH_BUTTON, null);
	setId(ActionFactory.SELECT_ALL.getId());
}
 
Example 8
Source File: ScrollBottomRightAction.java    From gef with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Constructs a new {@link ScrollBottomRightAction}.
 */
public ScrollBottomRightAction() {
	this("Scroll Bottom/Right", IAction.AS_PUSH_BUTTON,
			MvcFxUiBundle.getDefault().getImageRegistry().getDescriptor(
					MvcFxUiBundle.IMG_ICONS_SCROLL_BOTTOM_RIGHT));
}
 
Example 9
Source File: FoldingActionGroup.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
FoldingAction(ResourceBundle bundle, String prefix) {
	super(bundle, prefix, IAction.AS_PUSH_BUTTON);
}
 
Example 10
Source File: ScrollTopLeftAction.java    From gef with Eclipse Public License 2.0 4 votes vote down vote up
/**
 * Constructs a new {@link ScrollTopLeftAction}.
 */
public ScrollTopLeftAction() {
	this("Scroll Top/Left", IAction.AS_PUSH_BUTTON,
			MvcFxUiBundle.getDefault().getImageRegistry().getDescriptor(
					MvcFxUiBundle.IMG_ICONS_SCROLL_TOP_LEFT));
}
 
Example 11
Source File: FilterTableEditorControl.java    From depan with Apache License 2.0 4 votes vote down vote up
public ElementAction(String label,
    ContextualFilterContributor<? extends ContextualFilter> contrib) {
  super(label, IAction.AS_PUSH_BUTTON);
  this.contrib = contrib;
}
 
Example 12
Source File: RerunSelectedAction.java    From CodeCheckerEclipsePlugin with Eclipse Public License 1.0 4 votes vote down vote up
public RerunSelectedAction(ReportListView listView) {
    super(listView, "Rerun selected reports", IAction.AS_PUSH_BUTTON);
    setEnabled(false);
}
 
Example 13
Source File: FilterTableEditorControl.java    From depan with Apache License 2.0 4 votes vote down vote up
public EditAction(String label, ContextualFilter filter) {
  super(label, IAction.AS_PUSH_BUTTON);
  this.filter = filter;
}
 
Example 14
Source File: GamaFoldingActionGroup.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
FoldingAction() {
	super("Collapse comments", IAction.AS_PUSH_BUTTON);
}
 
Example 15
Source File: TexOutlinePage.java    From texlipse with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Creates the actions associated with the outline. 
 */
private void createActions() {
    // context menu actions 
    TexOutlineActionCut cut = new TexOutlineActionCut(this);
    this.outlineActions.put(ACTION_CUT, cut);
    
    TexOutlineActionCopy copy = new TexOutlineActionCopy(this);
    this.outlineActions.put(ACTION_COPY, copy);
    
    TexOutlineActionPaste paste = new TexOutlineActionPaste(this);
    this.outlineActions.put(ACTION_PASTE, paste);
    
    TexOutlineActionDelete delete = new TexOutlineActionDelete(this);
    this.outlineActions.put(ACTION_DELETE, delete);
    
    
    // toolbar actions
    TexOutlineActionUpdate update = new TexOutlineActionUpdate(this);
    this.outlineActions.put(ACTION_UPDATE, update);
    
    
    Action collapse = new Action("Collapse one level", IAction.AS_PUSH_BUTTON) {
        public void run() {
            if (expandLevel > 1) {
                expandLevel--;
                getTreeViewer().collapseAll();
                getTreeViewer().expandToLevel(expandLevel);
            }
        }
    };
    collapse.setToolTipText("Collapse one level");
    collapse.setImageDescriptor(TexlipsePlugin.getImageDescriptor("collapse"));
    this.outlineActions.put(ACTION_COLLAPSE, collapse);
    
    Action expand = new Action("Expand one level", IAction.AS_PUSH_BUTTON) {
        public void run() {
            if (expandLevel < input.getTreeDepth()) {
                expandLevel++;
            }
            getTreeViewer().collapseAll();
            getTreeViewer().expandToLevel(expandLevel);
        }
    };
    expand.setToolTipText("Expand one level");
    expand.setImageDescriptor(TexlipsePlugin.getImageDescriptor("expand"));
    this.outlineActions.put(ACTION_EXPAND, expand);
    
    IAction action = createHideAction("Hide sections", OutlineNode.TYPE_SECTION, 
    		TexlipsePlugin.getImageDescriptor("hide_sec"));
    this.outlineActions.put(ACTION_HIDE_SEC, action);
    
    action = createHideAction("Hide subsections", OutlineNode.TYPE_SUBSECTION, 
    		TexlipsePlugin.getImageDescriptor("hide_sub"));
    this.outlineActions.put(ACTION_HIDE_SUBSEC, action);
    
    action = createHideAction("Hide subsubsections", OutlineNode.TYPE_SUBSUBSECTION, 
    		TexlipsePlugin.getImageDescriptor("hide_subsub"));
    this.outlineActions.put(ACTION_HIDE_SUBSUBSEC, action);

    action = createHideAction("Hide paragraphs", OutlineNode.TYPE_PARAGRAPH, 
    		TexlipsePlugin.getImageDescriptor("hide_para"));
    this.outlineActions.put(ACTION_HIDE_PARAGRAPH, action);
            
    action = createHideAction("Hide floating environments", OutlineNode.TYPE_ENVIRONMENT, 
    		TexlipsePlugin.getImageDescriptor("hide_env"));
    this.outlineActions.put(ACTION_HIDE_FLOAT, action);

    action = createHideAction("Hide labels", OutlineNode.TYPE_LABEL, 
    		TexlipsePlugin.getImageDescriptor("hide_label"));
    this.outlineActions.put(ACTION_HIDE_LABEL, action);
}
 
Example 16
Source File: FoldingActionGroup.java    From xtext-eclipse with Eclipse Public License 2.0 4 votes vote down vote up
FoldingAction(ResourceBundle bundle, String prefix) {
	super(bundle, prefix, IAction.AS_PUSH_BUTTON);
}
 
Example 17
Source File: WriteAttributesOperationWizardValuePage.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
public RemoveAction ()
{
    super ( "Remove Entry", IAction.AS_PUSH_BUTTON );
}
 
Example 18
Source File: GamaToolbarFactory.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
ToggleOverlay() {
	super("Toggle Overlay", IAction.AS_PUSH_BUTTON);
	setIcon();
}
 
Example 19
Source File: RefreshAction.java    From CodeCheckerEclipsePlugin with Eclipse Public License 1.0 4 votes vote down vote up
public RefreshAction(ReportListView listView) {
    super(listView, "Refresh reports", IAction.AS_PUSH_BUTTON);
}
 
Example 20
Source File: AbstractViewerAction.java    From gef with Eclipse Public License 2.0 2 votes vote down vote up
/**
 * Creates a new {@link AbstractViewerAction}.
 *
 * @param text
 *            Text for the action.
 */
protected AbstractViewerAction(String text) {
	this(text, IAction.AS_PUSH_BUTTON, null);
}