Package tvbrowser.ui.mainframe.toolbar

Examples of tvbrowser.ui.mainframe.toolbar.DefaultToolBarModel


    this.getContentPane().setLayout(new FormLayout("fill:pref:grow", "pref, 3dlu, fill:min:grow, 3dlu, pref, 3dlu, pref"));
    ((JPanel) this.getContentPane()).setBorder(BorderFactory.createEmptyBorder(
        0, 6, 2, 6));

    // Initialize the buttonPanel and fill the vectors with the actions.
    final DefaultToolBarModel toolbarModel = DefaultToolBarModel.getInstance();
    Action[] currentActions = toolbarModel.getActions();

    ArrayList<Action> notSelectedActionsList = new ArrayList<Action>(Arrays.asList(toolbarModel
        .getAvailableActions()));

    for (Action a : currentActions) {
      mCurrentActions.addElement(a);
    }

    for (Action a : currentActions) {
      if (notSelectedActionsList.contains(a)) {
        notSelectedActionsList.remove(a);
      }
    }

    Action[] availableActions = new Action[notSelectedActionsList.size()];
    notSelectedActionsList.toArray(availableActions);

    for (Action a : availableActions) {
      mAvailableActions.addElement(a);
    }

    mAvailableActions.insertElementAt(toolbarModel.getSeparatorAction(), 0);
    mAvailableActions.insertElementAt(toolbarModel.getGlueAction(), 1);
    mAvailableActions.insertElementAt(toolbarModel.getSpaceAction(), 2);

    // Initialize the Panel with the available Buttons
    mButtonPanel = new JPanel();
    mButtonPanel.setLayout(new GridLayout(0, 4, 2, 2));
    mButtonPanel.setAlignmentX(Component.LEFT_ALIGNMENT);
View Full Code Here

TOP

Related Classes of tvbrowser.ui.mainframe.toolbar.DefaultToolBarModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.