Пример #1
0
 @Override
 public void updateElement(
     final UIElement element, @SuppressWarnings("rawtypes") final Map parameters) {
   final IEclipsePreferences prefsNode = ErlangOutlinePage.getPrefsNode();
   final String filterId = (String) parameters.get("org.erlide.ui.filterId");
   final boolean value = prefsNode.getBoolean(filterId, false);
   element.setChecked(value);
 }
Пример #2
0
 @Override
 public Object execute(final ExecutionEvent event) throws ExecutionException {
   // final Command command = event.getCommand();
   // final boolean oldValue = HandlerUtil.toggleCommandState(command);
   final String filterId = event.getParameter("org.erlide.ui.filterId");
   final IEclipsePreferences prefsNode = ErlangOutlinePage.getPrefsNode();
   final boolean oldValue = prefsNode.getBoolean(filterId, false);
   final boolean value = !oldValue;
   final Object activePart = HandlerUtil.getVariable(event, "activePart");
   if (activePart instanceof ContentOutline) {
     OutlineFilterUtils.addFilter(filterId, value, activePart);
   }
   prefsNode.putBoolean(filterId, value);
   try {
     prefsNode.flush();
   } catch (final BackingStoreException e) {
     ErlLogger.error(e);
   }
   return null;
 }