use of org.netxms.ui.eclipse.alarmviewer.objecttabs.AlarmTab in project netxms by netxms.
the class ToggleAlarmFilterHandler method execute.
/* (non-Javadoc)
* @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Object object = event.getApplicationContext();
if (object instanceof IEvaluationContext) {
// $NON-NLS-1$
Object tab = ((IEvaluationContext) object).getVariable("org.netxms.ui.eclipse.objectview.ActiveTab");
if ((tab != null) && (tab instanceof AlarmTab)) {
ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
// $NON-NLS-1$
Command command = service.getCommand("org.netxms.ui.eclipse.alarmviewer.commands.show_filter_alarm_list");
// $NON-NLS-1$
State state = command.getState("org.netxms.ui.eclipse.alarmviewer.commands.show_filter_alarm_list.state");
boolean isChecked = !(Boolean) state.getValue();
state.setValue(isChecked);
((AlarmTab) tab).setFilterEnabled(isChecked);
service.refreshElements(event.getCommand().getId(), null);
}
}
return null;
}
use of org.netxms.ui.eclipse.alarmviewer.objecttabs.AlarmTab in project netxms by netxms.
the class ToggleAlarmStatusColorsHandler method execute.
/* (non-Javadoc)
* @see org.eclipse.core.commands.AbstractHandler#execute(org.eclipse.core.commands.ExecutionEvent)
*/
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
Object object = event.getApplicationContext();
if (object instanceof IEvaluationContext) {
// $NON-NLS-1$
Object tab = ((IEvaluationContext) object).getVariable("org.netxms.ui.eclipse.objectview.ActiveTab");
if ((tab != null) && (tab instanceof AlarmTab)) {
boolean isChecked = !Activator.getDefault().getPreferenceStore().getBoolean("SHOW_ALARM_STATUS_COLORS");
((AlarmTab) tab).setShowColors(isChecked);
ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
service.refreshElements(event.getCommand().getId(), null);
}
}
return null;
}
Aggregations