Package com.jgoodies.forms.builder

Examples of com.jgoodies.forms.builder.ButtonBarBuilder2


    panel2.add(mUpBtn);
    panel2.add(mDownBtn);

    btnPanel.add(panel2, BorderLayout.SOUTH);

    ButtonBarBuilder2 bottomBar = Utilities.createFilterButtonBar();

    mOkBtn = new JButton(Localizer.getLocalization(Localizer.I18N_OK));
    mOkBtn.addActionListener(new ActionListener() {

      @Override
      public void actionPerformed(ActionEvent e) {
        Object[] o = mFilterListModel.toArray();
        ProgramFilter[] filters = new ProgramFilter[o.length];
        for (int i = 0; i < o.length; i++) {
          filters[i] = (ProgramFilter) o[i];
        }
        mFilterList.setProgramFilterArr(filters);

        mFilterList.store();

        Settings.propDefaultFilter.setString(mDefaultFilterId);
        FilterManagerImpl.getInstance().setCurrentFilter(FilterManagerImpl.getInstance().getCurrentFilter());

        setVisible(false);
      }
    });
    getRootPane().setDefaultButton(mOkBtn);

    mCancelBtn = new JButton(Localizer.getLocalization(Localizer.I18N_CANCEL));
    mCancelBtn.addActionListener(new ActionListener() {
      @Override
      public void actionPerformed(ActionEvent e) {
        close();
      }
    });
    bottomBar.addButton(new JButton[] {mOkBtn, mCancelBtn});

    JTextArea ta = UiUtilities.createHelpTextArea(mLocalizer.msg("hint", "Choose a filter to edit or create a new one."));

    contentPane.add(new JScrollPane(mFilterListBox), BorderLayout.CENTER);
    contentPane.add(btnPanel, BorderLayout.EAST);
    contentPane.add(bottomBar.getPanel(), BorderLayout.SOUTH);
    contentPane.add(ta, BorderLayout.NORTH);

    updateBtns();
    Settings.layoutWindow("selectFilterDlg", this, new Dimension(600,400));
  }
View Full Code Here


    JScrollPane pane = new JScrollPane(mTable);
    pane.getViewport().setBackground(mTable.getBackground());
   
    contentPanel.add(pane, cc.xyw(1,3,2));
   
    ButtonBarBuilder2 builder = new ButtonBarBuilder2();

    mInfo = new JButton(mLocalizer.msg("info","Info"), IconLoader.getInstance().getIconFromTheme("status", "dialog-information", 16));
    mInfo.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        Object selection = getSelection();
       
        if(selection instanceof PluginProxy) {
          showInfoDialog((PluginProxy)selection);
        }
        else if (selection instanceof InternalPluginProxyIf) {
          showInfoDialog((InternalPluginProxyIf)selection);
        }
        else if (selection instanceof TvDataServiceProxy) {
          showInformation((TvDataServiceProxy)selection);
        }
      }
    });
   
    mConfigure = new JButton(mLocalizer.msg("configure", "Configure"), TVBrowserIcons.preferences(TVBrowserIcons.SIZE_SMALL));
    mConfigure.addActionListener(new ActionListener() {

      public void actionPerformed(ActionEvent e) {
        Object selection = getSelection();
       
        if(selection instanceof PluginProxy) {
          configurePlugin((PluginProxy)selection);
        }
        else if (selection instanceof InternalPluginProxyIf) {
          mSettingsDialog.showSettingsTab(((InternalPluginProxyIf) selection)
              .getSettingsId());
        }
        else if (selection instanceof TvDataServiceProxy) {
          configureService((TvDataServiceProxy)selection);
        }
      }
    });
   
    builder.addButton(mInfo);
    builder.addRelatedGap();
    builder.addButton(mConfigure);
    builder.addRelatedGap();
    builder.addGlue();
    builder.addRelatedGap();
   
    mRemove = new JButton(Localizer.getLocalization(Localizer.I18N_DELETE),TVBrowserIcons.delete(TVBrowserIcons.SIZE_SMALL));
    mRemove.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        if(getSelection() instanceof PluginProxy) {
          removePlugin((PluginProxy)getSelection());
        }
        else {
          removeService((TvDataServiceProxy)getSelection());
        }
      }
    });
   
    builder.addButton(mRemove);
   
    contentPanel.add(builder.getPanel(), cc.xyw(1,5,2));
   
    mTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
      public void valueChanged(ListSelectionEvent evt) {
        updateBtns();
      }
View Full Code Here

    ruleListBoxPanel.add(new JScrollPane(mRuleTableBox), BorderLayout.CENTER);

    filterComponentsPanel.add(btnPanel, BorderLayout.EAST);
    filterComponentsPanel.add(ruleListBoxPanel, BorderLayout.CENTER);

    ButtonBarBuilder2 bottomBar = Utilities.createFilterButtonBar();

    mOkBtn = new JButton(Localizer.getLocalization(Localizer.I18N_OK));
    mOkBtn.addActionListener(this);
    getRootPane().setDefaultButton(mOkBtn);

    mCancelBtn = new JButton(Localizer.getLocalization(Localizer.I18N_CANCEL));
    mCancelBtn.addActionListener(this);

    bottomBar.addButton(new JButton[] {mOkBtn, mCancelBtn});

    contentPane.add(northPanel, BorderLayout.NORTH);
    contentPane.add(filterComponentsPanel, BorderLayout.CENTER);
    contentPane.add(bottomBar.getPanel(), BorderLayout.SOUTH);

    if (mFilter != null) {
      mFilterNameTF.setText(mFilter.toString());
      mFilterRuleTF.setText(mFilter.getRule());
    }
View Full Code Here

public class Utilities {
  private static final util.ui.Localizer mLocalizer = util.ui.Localizer.getLocalizerFor(Utilities.class);

  static ButtonBarBuilder2 createFilterButtonBar() {
    ButtonBarBuilder2 bottomBar = new ButtonBarBuilder2();

    JButton helpButton = new JButton(Localizer.getLocalization(Localizer.I18N_HELP));
    helpButton.addActionListener(new ActionListener() {

      @Override
      public void actionPerformed(ActionEvent e) {
        Launch.openURL(mLocalizer.msg("helpUrl", "http://enwiki.tvbrowser.org/index.php/Filters"));
      }
    });
    bottomBar.addButton(helpButton);
    bottomBar.addGlue();
    return bottomBar;
  }
View Full Code Here

        close();
        SearchPlugin.getInstance().openSearchDialog(mText.getText(), getSearchSettings());
      }
    });

    ButtonBarBuilder2 builder = new ButtonBarBuilder2();
    builder.addButton(stdSearch);
    builder.addUnrelatedGap();
    builder.addGlue();

    JButton go = new JButton(mLocalizer.msg("go", "go"));
    go.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent actionEvent) {
        search();
      }
    });

    JButton cancel = new JButton(Localizer
        .getLocalization(Localizer.I18N_CANCEL));
    cancel.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent actionEvent) {
        close();
      }
    });

    builder.addButton(new JButton[] { go, cancel });
    panel.add(builder.getPanel(), cc.xyw(1, 9, 3));

    Settings.layoutWindow("extras.repetitionDialog", this, new Dimension(Sizes
        .dialogUnitXAsPixel(220, this), Sizes.dialogUnitYAsPixel(125, this)));

    UiUtilities.registerForClosing(this);
View Full Code Here

      public void actionPerformed(ActionEvent evt) {
        dispose();
      }
    });

    ButtonBarBuilder2 buttons = new ButtonBarBuilder2();
    buttons.addButton(new JButton[]{mSearchBt, mCloseBt});

    JPanel buttonPanel = new JPanel(new BorderLayout());
    buttonPanel.add(buttons.getPanel(), BorderLayout.EAST);

    main.add(buttonPanel);

    Settings.layoutWindow("extras.searchDialog", this);
  }
View Full Code Here

     *
     * @param buttons  an array of buttons to add
     * @return a left aligned button bar with the given buttons
     */
    public static JPanel buildLeftAlignedBar(JButton[] buttons) {
        ButtonBarBuilder2 builder = new ButtonBarBuilder2();
        builder.addButton(buttons);
        builder.addGlue();
        return builder.getPanel();
    }
View Full Code Here

     * @return a left aligned button bar with the given buttons
     */
    public static JPanel buildLeftAlignedBar(
            JButton[] buttons,
            boolean  leftToRightButtonOrder) {
        ButtonBarBuilder2 builder = new ButtonBarBuilder2();
        builder.setLeftToRightButtonOrder(leftToRightButtonOrder);
        builder.addButton(buttons);
        builder.addGlue();
        return builder.getPanel();
    }
View Full Code Here

     *
     * @param buttons  an array of buttons to add
     * @return a centered button bar with the given buttons
     */
    public static JPanel buildCenteredBar(JButton[] buttons) {
        ButtonBarBuilder2 builder = new ButtonBarBuilder2();
        builder.addGlue();
        builder.addButton(buttons);
        builder.addGlue();
        return builder.getPanel();
    }
View Full Code Here

     *
     * @param buttons  an array of buttons to add
     * @return a filled button bar with the given buttons
     */
    public static JPanel buildGrowingBar(JButton[] buttons) {
        ButtonBarBuilder2 builder = new ButtonBarBuilder2();
        builder.addGrowing(buttons);
        return builder.getPanel();
    }
View Full Code Here

TOP

Related Classes of com.jgoodies.forms.builder.ButtonBarBuilder2

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.