Java Code Examples for org.eclipse.ui.menus.UIElement#setChecked()

The following examples show how to use org.eclipse.ui.menus.UIElement#setChecked() . 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: AbstractToggleCurrentLockHandler.java    From elexis-3-core with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void updateElement(UIElement element, Map parameters){
	IPersistentObject po = ElexisEventDispatcher.getSelected(getTemplateClass());
	if (po == null) {
		element.setIcon(Images.IMG_LOCK_CLOSED.getImageDescriptor());
		element.setChecked(false);
		return;
	}
	
	if (LocalLockServiceHolder.get().isLockedLocal(po)) {
		element.setIcon(Images.IMG_LOCK_OPEN.getImageDescriptor());
		element.setChecked(true);
	} else {
		element.setIcon(Images.IMG_LOCK_CLOSED.getImageDescriptor());
		element.setChecked(false);
	}
}
 
Example 2
Source File: SwitchPerspectiveHandler.java    From tlaplus with MIT License 5 votes vote down vote up
public void updateElement(UIElement element, Map parameters)
{
    String parameter = (String) parameters.get(PARAM_PERSPECTIVE_ID);
    if (parameter != null)
    {
        if (UIHelper.getActivePerspectiveId().equals(parameter))
        {
            element.setChecked(true);
        } else
        {
            element.setChecked(false);
        }
    }
}
 
Example 3
Source File: StockSCSToggleArticleOutlay.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters){
	boolean isSuspended =
		ConfigServiceHolder.get().getLocal(Preferences.INVENTORY_MACHINE_SUSPEND_OUTLAY,
			Preferences.INVENTORY_MACHINE_SUSPEND_OUTLAY_DEFAULT);
	if (isSuspended) {
		element.setChecked(false);
		element.setIcon(Images.IMG_DRAWER.getImageDescriptor());
	} else {
		element.setChecked(true);
		element.setIcon(Images.IMG_DRAWER_ARROW.getImageDescriptor());
	}
}
 
Example 4
Source File: ToggleMarkOccurrencesHandler.java    From xds-ide with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {
    boolean on = PreferenceKeys.PKEY_HIGHLIGHT_OCCURENCES.getStoredBoolean();
    element.setChecked(on);
}
 
Example 5
Source File: ShowErrors.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void updateElement(final UIElement element, final Map parameters) {
	element.setChecked(GamaPreferences.Runtime.CORE_SHOW_ERRORS.getValue());
}
 
Example 6
Source File: ErrorsPauseAndEdit.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void updateElement(final UIElement element, final Map parameters) {
	element.setChecked(GamaPreferences.Runtime.CORE_REVEAL_AND_STOP.getValue());
}
 
Example 7
Source File: TreatWarningsAsErrors.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void updateElement(final UIElement element, final Map parameters) {
	element.setChecked(GamaPreferences.Runtime.CORE_WARNINGS.getValue());
}
 
Example 8
Source File: ShowHidenNonPrintingCharacterHandler.java    From translationstudio8 with GNU General Public License v2.0 4 votes vote down vote up
public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {
	element.setChecked(isSelected);
}
 
Example 9
Source File: ShowHidenNonPrintingCharacterHandler.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {
	element.setChecked(isSelected);
}
 
Example 10
Source File: ShowHidenNonPrintingCharacterHandler.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {
	element.setChecked(isSelected);
}
 
Example 11
Source File: FlatViewHandler.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
@Override
public void updateElement(UIElement element, Map parameters){
	boolean bFlat = CoreHub.userCfg.get(DocumentsView.SETTING_FLAT_VIEW, false);
	element.setChecked(bFlat);
}