/**
   * ********************************************************************************* CONSTRUCTORS
   * ********************************************************************************
   */
  public FreeplaneActionMultiCaster(AFreeplaneAction a, AFreeplaneAction b) {
    super(b.getKey());

    if (a != null) {
      assert (b.getKey().equals(a.getKey()));
    }
    this.a = a;
    this.b = b;
  }
Ejemplo n.º 2
0
 private void updateMenus() {
   Controller controller = Controller.getCurrentController();
   final ModeController modeController = controller.getModeController();
   final MenuBuilder menuBuilder = modeController.getUserInputListenerFactory().getMenuBuilder();
   menuBuilder.removeChildElements(MENU_CATEGORY);
   int i = 0;
   int maxEntries = getMaxMenuEntries();
   for (final String key : lastOpenedList) {
     if (i == 0
         && (!modeController.getModeName().equals(MModeController.MODENAME)
             || controller.getMap() == null
             || controller.getMap().getURL() == null)) {
       i++;
       maxEntries++;
     }
     if (i == maxEntries) {
       break;
     }
     final AFreeplaneAction lastOpenedActionListener = new OpenLastOpenedAction(i++, this);
     final IFreeplaneAction decoratedAction = menuBuilder.decorateAction(lastOpenedActionListener);
     final JMenuItem item = new JFreeplaneMenuItem(decoratedAction);
     item.setActionCommand(key);
     String text = createOpenMapItemName(key);
     item.setText(text);
     item.setMnemonic(0);
     menuBuilder.addMenuItem(
         MENU_CATEGORY,
         item,
         MENU_CATEGORY + '/' + lastOpenedActionListener.getKey(),
         UIBuilder.AS_CHILD);
   }
 }