Java Code Examples for org.eclipse.jface.action.Action#AS_CHECK_BOX
The following examples show how to use
org.eclipse.jface.action.Action#AS_CHECK_BOX .
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: KonsListe.java From elexis-3-core with Eclipse Public License 1.0 | 6 votes |
private void makeActions(){ filterAction = new Action(Messages.KonsListe_FilterListAction, Action.AS_CHECK_BOX) { //$NON-NLS-1$ { setImageDescriptor(Images.IMG_FILTER.getImageDescriptor()); setToolTipText(Messages.KonsListe_FilterListToolTip); //$NON-NLS-1$ } @Override public void run(){ if (!isChecked()) { filter = null; } else { KonsFilterDialog kfd = new KonsFilterDialog(actPatient, filter); if (kfd.open() == Dialog.OK) { filter = kfd.getResult(); } else { kfd = null; setChecked(false); } } restart(null); } }; }
Example 2
Source File: GamaCommand.java From gama with GNU General Public License v3.0 | 5 votes |
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; }
Example 3
Source File: FlipAxisAction.java From birt with Eclipse Public License 1.0 | 5 votes |
public FlipAxisAction( ExtendedItemHandle eih ) { super( Messages.getString( "FlipAxisAction.Text.FlipAxis" ),//$NON-NLS-1$ Action.AS_CHECK_BOX ); this.eih = eih; init( ); }
Example 4
Source File: ShowAxisAction.java From birt with Eclipse Public License 1.0 | 5 votes |
public ShowAxisAction( ExtendedItemHandle eih ) { super( Messages.getString( "ShowAxisAction.Text.ShowValueAxis" ),//$NON-NLS-1$ Action.AS_CHECK_BOX ); this.eih = eih; init( ); }
Example 5
Source File: ReminderView.java From elexis-3-core with Eclipse Public License 1.0 | 5 votes |
public FilterTimeAction(int days){ super(String.format("nächste %d Tage", days), Action.AS_CHECK_BOX); this.days = days; if (filterDueDateDays == days) { setChecked(true); } }
Example 6
Source File: ShowEigenartikelProductsAction.java From elexis-3-core with Eclipse Public License 1.0 | 5 votes |
public ShowEigenartikelProductsAction(EigenartikelTreeContentProvider eal, EigenartikelSelector eigenartikelSelector){ super("Produkte anzeigen", Action.AS_CHECK_BOX); this.eal = eal; this.eigenartikelSelector = eigenartikelSelector; setImageDescriptor(Images.IMG_CARDS.getImageDescriptor()); setToolTipText(""); setChecked(CoreHub.userCfg.get(ShowEigenartikelProductsAction.FILTER_CFG, false)); execute(); }
Example 7
Source File: CommonQuickOutlinePage.java From APICloud-Studio with GNU General Public License v3.0 | 4 votes |
/** * 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 8
Source File: BuildTargetsActionGroup.java From goclipse with Eclipse Public License 1.0 | 4 votes |
public ToggleEnabledAction(BuildTargetElement buildTargetElement) { super(buildTargetElement, BuildManagerMessages.LABEL_EnableForNormalBuild, Action.AS_CHECK_BOX); setChecked(buildTarget.isNormalBuildEnabled()); }
Example 9
Source File: HideValidStatusAction.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
public HideValidStatusAction(){ super(Messages.hideValidStatusAction,Action.AS_CHECK_BOX); setToolTipText(Messages.hideValidStatusAction); setChecked(false); }
Example 10
Source File: HideReviewedAction.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
public HideReviewedAction(){ super(Messages.hideReviewedAction,Action.AS_CHECK_BOX); setToolTipText(Messages.hideReviewedAction); setChecked(false); }
Example 11
Source File: PatHeuteView.java From elexis-3-core with Eclipse Public License 1.0 | 4 votes |
private void makeActions(){ statAction = new Action(Messages.PatHeuteView_statisticsAction) { //$NON-NLS-1$ { setToolTipText(Messages.PatHeuteView_statisticsToolTip); //$NON-NLS-1$ } @Override public void run(){ StatLoader loader = new StatLoader(); loader.schedule(); } }; printAction = new Action(Messages.PatHeuteView_printList) { //$NON-NLS-1$ { setImageDescriptor(Images.IMG_PRINTER.getImageDescriptor()); setToolTipText(Messages.PatHeuteView_printListToolTip); //$NON-NLS-1$ } @Override public void run(){ TerminListeDialog tld = new TerminListeDialog(getViewSite().getShell()); tld.open(); } }; reloadAction = new Action(Messages.PatHeuteView_reloadAction) { //$NON-NLS-1$ { setImageDescriptor(Images.IMG_REFRESH.getImageDescriptor()); setToolTipText(Messages.PatHeuteView_reloadToolTip); //$NON-NLS-1$ } @Override public void run(){ kons = null; kload.schedule(); } }; filterAction = new Action(Messages.PatHeuteView_filterAction, Action.AS_CHECK_BOX) { //$NON-NLS-1$ { setImageDescriptor(Images.IMG_FILTER.getImageDescriptor()); setToolTipText(Messages.PatHeuteView_filterToolTip); //$NON-NLS-1$ } @Override public void run(){ GridData gd = (GridData) ldFilter.getLayoutData(); if (filterAction.isChecked()) { gd.heightHint = 50; // gd.minimumHeight=15; } else { gd.heightHint = 0; } parent.layout(true); } }; }
Example 12
Source File: SelectorPanel.java From elexis-3-core with Eclipse Public License 1.0 | 4 votes |
public SelectorPanel(Composite parent, IAction... actions){ super(parent, SWT.NONE); setBackground(parent.getBackground()); /* * RowLayout layout = new RowLayout(SWT.HORIZONTAL); layout.fill = true; layout.pack = true; */ FormLayout layout = new FormLayout(); layout.marginLeft = 0; layout.marginRight = 0; setLayout(layout); tActions = new ToolBarManager(SWT.FLAT | SWT.HORIZONTAL | SWT.WRAP); aClr = new Action(Messages.SelectorPanel_clearFields) { { setImageDescriptor(Images.IMG_CLEAR.getImageDescriptor()); } @Override public void run(){ clearValues(); } }; tActions.add(aClr); autoSearchActivatedAction = new Action(Messages.SelectorPanel_automaticSearch, Action.AS_CHECK_BOX) { { setImageDescriptor(Images.IMG_REFRESH.getImageDescriptor()); } @Override public void run(){ autoSearchActivated = !autoSearchActivated; if (autoSearchActivated) contentsChanged(null); super.run(); } }; autoSearchActivatedAction.setToolTipText(Messages.SelectorPanel_activateAutomaticSearch); autoSearchActivatedAction.setChecked(autoSearchActivated); tActions.add(autoSearchActivatedAction); performSearchAction = new Action(Messages.SelectorPanel_performSearch) { { setImageDescriptor(Images.IMG_NEXT.getImageDescriptor()); } @Override public void run(){ boolean oldState = autoSearchActivated; autoSearchActivated = true; contentsChanged(null); autoSearchActivated = oldState; super.run(); } }; performSearchAction.setToolTipText(Messages.SelectorPanel_performSearchTooltip); tActions.add(performSearchAction); for (IAction ac : actions) { if (ac != null) { tActions.add(ac); } else { tActions.add(new Separator()); } } tb = tActions.createControl(this); FormData fdActions = new FormData(); fdActions.top = new FormAttachment(0, 0); fdActions.right = new FormAttachment(100, 0); tb.setLayoutData(fdActions); cFields = new Composite(this, SWT.NONE); FormData fd = new FormData(); fd.left = new FormAttachment(0, 0); fd.top = new FormAttachment(0, 0); fd.right = new FormAttachment(100, 0); cFields.setLayoutData(fd); cFields.setLayout(new FillLayout()); if (parent.getData("TEST_COMP_NAME") != null) { for (int idx = 0; idx < tb.getItemCount(); idx++) { tb.getItem(idx).setData("TEST_COMP_NAME", parent.getData("TEST_COMP_NAME") + "_" + idx + "_tbi"); } } pack(); }
Example 13
Source File: CodesSelectionComposite.java From elexis-3-core with Eclipse Public License 1.0 | 4 votes |
public CodeSelectionAction(ICoding iCoding){ super(iCoding.getDisplay(), Action.AS_CHECK_BOX); this.iCoding = iCoding; }