title: Menubar's abstract description
body: <p>I want to create some description of menu bars (items and connected with them actions-object or handler's-methods) with some abstraction from gui library. In what way I can do it?</p>
  
  <p>some draft</p>
  
  <p>data structure (without access methods and other stuff):</p>
  
  <pre><code>public class MenuInfoHolder {
      List&lt;Column&gt; menu;
  
      public static class Column {
          SimpleItem title;
          List&lt;Block&gt; blocks;
      }
      public static class SimpleItem{
          String title;
          char key;
      }
      public static class Block{
          List&lt;SimpleItem&gt; items;
      }   
      public static abstract class ActionProducedItem extends SimpleItem { 
          abstract void invokeActionHandler(ActionHandler handler);
      }
  }
  </code></pre>
  
  <p>and here might be some using, like</p>
  
  <pre><code>Menu menu = new Menu();
  ActionProducedItem item = new ActionProducedItem("Aaaa", 'a'){
      @Override
      void invokeActionHandler(ActionHandler handler) {
          handler.foo();
      }
  };
  Block block = new Block();
  block.add(item);
  Column column = new Column("BBB", 'B');
  column.add(block);
  menu.add(column);
  </code></pre>
  
  <p>Does exist any other better implementation (probably with Builder pattern or spring framework)?</p>
  
  <p>UPD:
  another worlds,</p>
  
  <p>using SWT, smt like:</p>
  
  <pre><code>final Menu popupMenu = new Menu(shell, SWT.BAR);
  MenuItem menuItem = new MenuItem(popupMenu, SWT.CASCADE);
  menuItem.setText("More options");
  Menu subMenu = new Menu(menuItem);
  menuItem.setMenu(subMenu);
  ...
  shell.setMenuBar(menu);
  </code></pre>
  
  <p>using Swing, smt like:</p>
  
  <pre><code>    JMenuBar menuBar = new JMenuBar();                
      setJMenuBar(menuBar);        
      JMenu fileMenu = new JMenu("File");
      JMenu editMenu = new JMenu("Edit");
      menuBar.add(fileMenu);
  </code></pre>
  
  <p>But in both case we operate with same data. So I want make some abstraction about this.</p>
  
  <p>Thanks.</p>