Java Code Examples for org.eclipse.jface.action.Action#isChecked()

The following examples show how to use org.eclipse.jface.action.Action#isChecked() . 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: SearchScopeActionGroup.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private int getCheckedActionCount(Action[] result) {
	// Ensure that exactly one action is selected
	int checked= 0;
	for (int i = 0; i < result.length; i++) {
		Action action = result[i];
		if (action.isChecked()) {
			checked++;
		}
	}
	return checked;
}
 
Example 2
Source File: PerformanceView.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Stop collecting all data.
 */
protected void onPause(Action action) {
	this.paused = action.isChecked();
	CollectedDataAccess.setPaused(this.paused);
}
 
Example 3
Source File: SourceGraphView.java    From n4js with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * User clicked button 'pause'.
 */
protected void onPause(Action action) {
	this.paused = action.isChecked();
}
 
Example 4
Source File: PatHeuteView.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
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);
			}
			
		};
	
}