Package net.sourceforge.processdash.ui.lib

Examples of net.sourceforge.processdash.ui.lib.DropDownButton


      List importActions = ExtensionManager.getExecutableExtensions(
              "defect-importer", dashboard);
      if (importActions.isEmpty())
          return null;

      DropDownButton result = new DropDownButton(resources
              .getString("Log.Import_Button"));
      result.setMainButtonBehavior(DropDownButton.OPEN_DROP_DOWN_MENU);
      result.getMenu().getPopupMenu().addPopupMenuListener(new PopupMenuListener() {
        public void popupMenuCanceled(PopupMenuEvent e) {}
        public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {}
        public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
            reupdateImportActions();
        }});
     
      for (Iterator i = importActions.iterator(); i.hasNext();) {
          Action a = (Action) i.next();
          if (a.getValue(IMPORT_ACTION_INVALID) != null)
              i.remove();
          else
              result.getMenu().add(a);
      }

      if (result.isEmpty())
          return null;
      else
          return result;
  }
View Full Code Here


    private JPanel constructFilterPanel() {
        JPanel retPanel = new JPanel(false);
        retPanel.setLayout(new BoxLayout(retPanel, BoxLayout.X_AXIS));
        retPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
        DropDownButton button;
        JLabel label;

        retPanel.add(Box.createHorizontalGlue());

        addTimeFormatControl(retPanel);
        retPanel.add(new JLabel("          "));

        label = new JLabel(getResource("Filter.Label") + " ");
        retPanel.add(label);
        retPanel.add(Box.createHorizontalStrut(5));

        addScrollButton(retPanel, "Filter.Scroll_Backward",
                "scrollFilterBackward");
        fromDate = addDateField(retPanel, "Filter.From");
        toDate = addDateField(retPanel, "Filter.To");
        addScrollButton(retPanel, "Filter.Scroll_Forward",
                "scrollFilterForward");

        button = new DropDownButton(getResource("Filter.Apply"));
        button.setRunFirstMenuOption(false);
        button.getButton().addActionListener(
                createActionListener("applyFilter"));

        JMenu menu = button.getMenu();
        addFilterMenuItem(menu, "Filter.Today", "filterToday");
        addFilterMenuItem(menu, "Filter.Week", "filterThisWeek");
        menu.add(createWeekFilterStartDaySubmenu());
        addFilterMenuItem(menu, "Filter.Month", "filterThisMonth");
        menu.addSeparator();
View Full Code Here

            actions = new ArrayList<AbstractChartItemAction>();

            JButton revertButton = new JButton(new RevertSettingsAction(item,
                    actions));

            DropDownButton saveButton = new DropDownButton("");
            saveButton.setRunFirstMenuOption(false);
            saveButton.getMenu().add(new SaveSettingsAsAction(item, actions));
            saveButton.getButton().setAction(
                new SaveSettingsAction(item, actions));

            return BoxUtils.hbox(BoxUtils.GLUE, revertButton, BoxUtils.GLUE,
                saveButton, BoxUtils.GLUE);
        }
View Full Code Here

        actionArray = (TSAction[]) actions.toArray(actionArray);
        return makeDropDownButton(actionArray);
    }

    private DropDownButton makeDropDownButton(TSAction... actions) {
        DropDownButton result = new DropDownButton(actions[0]);
        for (int i = 1;  i < actions.length;  i++)
            result.getMenu().add(actions[i]);
        result.setRunFirstMenuOption(false);
        return result;
    }
View Full Code Here

TOP

Related Classes of net.sourceforge.processdash.ui.lib.DropDownButton

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.