Esempio n. 1
0
 @Override
 public void actionPerformed(ActionEvent e) {
   Collection<String> t = new LinkedList<String>(getToolString());
   ActionParser parser = new ActionParser(null);
   // get text definition of current action
   String res = parser.saveAction(act);
   // remove the button from toolbar preferences
   t.remove(res);
   Main.pref.putCollection("toolbar", t);
   Main.toolbar.refreshToolbarControl();
 }
Esempio n. 2
0
 @Override
 public boolean ok() {
   Collection<String> t = new LinkedList<String>();
   ActionParser parser = new ActionParser(null);
   for (int i = 0; i < selected.size(); ++i) {
     ActionDefinition action = (ActionDefinition) selected.get(i);
     if (action.isSeparator()) {
       t.add("|");
     } else {
       String res = parser.saveAction(action);
       if (res != null) {
         t.add(res);
       }
     }
   }
   if (t.isEmpty()) {
     t = Collections.singletonList(EMPTY_TOOLBAR_MARKER);
   }
   Main.pref.putCollection("toolbar", t);
   Main.toolbar.refreshToolbarControl();
   return false;
 }