use of org.netxms.ui.eclipse.objectview.objecttabs.InterfacesTab in project netxms by netxms.
the class HideSubInterfacesHandler 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 InterfacesTab)) {
ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
// $NON-NLS-1$
Command command = service.getCommand("org.netxms.ui.eclipse.objectview.commands.hideSubInterfaces");
// $NON-NLS-1$
State state = command.getState("org.netxms.ui.eclipse.objectview.commands.hideSubInterfaces.state");
boolean isChecked = !(Boolean) state.getValue();
state.setValue(isChecked);
((InterfacesTab) tab).hideSubInterfaces(isChecked);
service.refreshElements(event.getCommand().getId(), null);
}
}
return null;
}
use of org.netxms.ui.eclipse.objectview.objecttabs.InterfacesTab in project netxms by netxms.
the class ToggleFilterHandler method execute.
@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 InterfacesTab)) {
ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
// $NON-NLS-1$
Command command = service.getCommand("org.netxms.ui.eclipse.objectview.commands.show_filter");
// $NON-NLS-1$
State state = command.getState("org.netxms.ui.eclipse.objectview.commands.show_filter.state");
boolean isChecked = !(Boolean) state.getValue();
state.setValue(isChecked);
((InterfacesTab) tab).enableFilter(isChecked);
service.refreshElements(event.getCommand().getId(), null);
}
}
return null;
}
Aggregations