Package com.jgoodies.forms.builder

Examples of com.jgoodies.forms.builder.ButtonBarBuilder2


    mHelpBtn = new JButton(mLocalizer.msg("openWebsite","Open website"), TVBrowserIcons.webBrowser(TVBrowserIcons.SIZE_SMALL));
    mHelpBtn.addActionListener(this);
    mHelpBtn.setEnabled(false);

    ButtonBarBuilder2 builder = new ButtonBarBuilder2();

    if(onlyUpdate && !mIsVersionChange) {
      mAutoUpdates = new JCheckBox(mLocalizer.msg("autoUpdates","Find plugin updates automatically"), Settings.propAutoUpdatePlugins.getBoolean());
      mAutoUpdates.addItemListener(new ItemListener() {
        public void itemStateChanged(ItemEvent e) {
          Settings.propAutoUpdatePlugins.setBoolean(e.getStateChange() == ItemEvent.SELECTED);
        }
      });

      builder.addFixed(mAutoUpdates);
      builder.addRelatedGap();
    }
    builder.addFixed(mHelpBtn);

    builder.addGlue();
    builder.addFixed(mDownloadBtn);
   
    builder.addRelatedGap();
    builder.addFixed(mCloseBtn);
   

    final CellConstraints cc = new CellConstraints();

    FormLayout layout = new FormLayout("default,5dlu,0dlu:grow","default");

    JPanel northPn = new JPanel(layout);
    northPn.add(new JLabel(onlyUpdate ?mLocalizer.msg("updateHeader","Updates for installed plugins were found.") :
      mLocalizer.msg("header","Here you can download new plugins and updates for it.")), cc.xyw(1,1,3));

    JPanel southPn = new JPanel(new BorderLayout());

    southPn.add(builder.getPanel(), BorderLayout.SOUTH);

    ArrayList<SoftwareUpdateItem> selectedItems = new ArrayList<SoftwareUpdateItem>();
    for (SoftwareUpdateItem item : itemArr) {
      if (item.isAlreadyInstalled() && item.getInstalledVersion().compareTo(item.getVersion()) < 0) {
        selectedItems.add(item);
View Full Code Here


    buttons[1].setFont(buttons[1].getFont().deriveFont(Font.BOLD,13));
    buttons[2].setFont(buttons[2].getFont().deriveFont(Font.BOLD,13));
   
    getRootPane().setDefaultButton(buttons[0]);
   
    ButtonBarBuilder2 bb = new ButtonBarBuilder2();
    bb.addGlue();
    bb.addButton(buttons);
    bb.addGlue();
    bb.setBorder(Borders.createEmptyBorder("6dlu,6dlu,6dlu,6dlu"));
   
    pb.add(bb.getPanel(), cc.xyw(1,3,3));
    pb.getPanel().setBackground(Color.white);
  }
View Full Code Here

      public void actionPerformed(ActionEvent e) {
        saveAndClose();
      }
    });

    ButtonBarBuilder2 buttons = new ButtonBarBuilder2();
    buttons.addGlue();
    buttons.addButton(new JButton[] { okBtn, cancelBtn });

    rootPn.add(BorderLayout.NORTH, content);
    rootPn.add(BorderLayout.SOUTH, buttons.getPanel());

    getRootPane().setDefaultButton(okBtn);

    JScrollPane scrollPane = new JScrollPane(rootPn);
    scrollPane.setBorder(null);
View Full Code Here

    buttons[0].setFont(buttons[0].getFont().deriveFont(Font.BOLD,13));
    buttons[1].setFont(buttons[1].getFont().deriveFont(Font.BOLD,13));
   
    getRootPane().setDefaultButton(buttons[0]);
   
    ButtonBarBuilder2 bb = new ButtonBarBuilder2();
    bb.addGlue();
    bb.addButton(buttons);
    bb.addGlue();
    bb.setBorder(Borders.createEmptyBorder("6dlu,6dlu,6dlu,6dlu"));
   
    pb.add(bb.getPanel(), cc.xyw(1,3,3));
    pb.getPanel().setBackground(Color.white);
  }
View Full Code Here

    // Hack because of growing JTextArea in FormLayout
    txt2.setMinimumSize(new Dimension(150, 20));
    panel.add(txt2, cc.xy(3, 17));
   
    // buttons
    ButtonBarBuilder2 builder = new ButtonBarBuilder2();
    JButton defaultButton = new JButton(Localizer.getLocalization(Localizer.I18N_DEFAULT));
   
    defaultButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        resetToDefaults();
      }

    });
   
    builder.addButton(defaultButton);
    builder.addRelatedGap();
    builder.addGlue();

    mOKBt = new JButton(Localizer.getLocalization(Localizer.I18N_OK));
    mOKBt.addActionListener(this);
   
    getRootPane().setDefaultButton(mOKBt);
   
    mCloseBt = new JButton(Localizer.getLocalization(Localizer.I18N_CANCEL));
    mCloseBt.addActionListener(this);

    builder.addButton(new JButton[] { mOKBt, mCloseBt });

    panel.add(new JSeparator(), cc.xyw(1, 19, 3));
    panel.add(builder.getPanel(), cc.xyw(1, 21, 3));
   
    pack();
    Settings.layoutWindow("channelConfig", this, new Dimension(420,350));
  }
View Full Code Here

    mActionsPane = new JScrollPane(mPluginsPane);

    mConfigBtn = new JButton(mLocalizer.msg("config", "Configure view"));
    mConfigBtn.setIcon(TVBrowserIcons.preferences(TVBrowserIcons.SIZE_SMALL));

    ButtonBarBuilder2 buttonBuilder = new ButtonBarBuilder2();

    buttonBuilder.addButton(mConfigBtn);
    mConfigBtn.setVisible(showSettings);

    if (pluginsSize == null) {
      mActionsPane.setPreferredSize(new Dimension(250, 500));
    } else {
      mActionsPane.setPreferredSize(pluginsSize);
    }

    if (ProgramInfo.getInstance().getSettings().getShowFunctions()) {
      JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
      split.setDividerSize(5);
      split.setContinuousLayout(true);
      split.setDividerLocation(mActionsPane.getPreferredSize().width + 1);
      split.setLeftComponent(mActionsPane);
      split.setRightComponent(scrollPane);
      mMainPanel.add(split, BorderLayout.CENTER);
      mFindAsYouType.installKeyListener(split);
    } else {
      final JButton functions = new JButton(mLocalizer.msg("functions",
          "Functions"));
      functions.setFocusable(false);

      functions.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseClicked(MouseEvent e) {
          if (e.getClickCount() == 1) {
            JPopupMenu popupMenu = PluginProxyManager.createPluginContextMenu(
                mProgram, ProgramInfoProxy.getInstance());
            popupMenu.show(functions, e.getX(), e.getY()
                - popupMenu.getPreferredSize().height);
          }
        }
      });

      buttonBuilder.addUnrelatedGap();
      buttonBuilder.addButton(functions);
      mMainPanel.add(scrollPane, BorderLayout.CENTER);
    }

    // buttons
    JPanel buttonPn = new JPanel(new BorderLayout(0, 5));
    buttonPn.add(mFindAsYouType.getSearchBar(), BorderLayout.NORTH);
    buttonPn.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));

    mMainPanel.add(buttonPn, BorderLayout.SOUTH);

    mConfigBtn.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        exit();
        MainFrame.getInstance().showSettingsDialog(SettingsItem.PROGRAMINFO);
      }
    });

    mHighlight = new JCheckBox(mLocalizer
        .msg("highlight", "Highlight favorite"), ProgramInfo.getInstance()
        .getSettings().getHighlightFavorite());
    mHighlight.addActionListener(new ActionListener() {

      @Override
      public void actionPerformed(ActionEvent e) {
        ProgramInfo.getInstance().getSettings().setHighlightFavorite(
            mHighlight.isSelected());
        highlightFavorites();
      }
    });
    buttonBuilder.addUnrelatedGap();
    buttonBuilder.addFixed(mHighlight);

    mCloseBtn = new JButton(Localizer.getLocalization(Localizer.I18N_CLOSE));
    mCloseBtn.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent evt) {
        exit();
      }
    });

    buttonBuilder.addGlue();
    buttonBuilder.addButton(mCloseBtn);

    buttonPn.add(buttonBuilder.getPanel(), BorderLayout.SOUTH);

    /*
     * The action for the search button in the function panel.
     */
    final Action searchAction = new AbstractAction() {
View Full Code Here

      nextpanel.add(mBackBtn, cc.xy(1,1));
      nextpanel.add(mNextBtn, cc.xy(3,1));
      panel.add(nextpanel, cc.xy(2, 1));
    }
   
    ButtonBarBuilder2 builder = new ButtonBarBuilder2();
    builder.addButton(mDoneBtn);
    builder.addRelatedGap();
    builder.addFixed(mCancelBtn);
    panel.add(builder.getPanel(), cc.xy(4, 1));
   
    for (int btn : btns) {
      if (btn == WizardStep.BUTTON_DONE) {
        mDoneBtn.setEnabled(true);
      } else if (btn == WizardStep.BUTTON_BACK) {
View Full Code Here

    JTextArea txt = UiUtilities.createHelpTextArea(mLocalizer.msg("DLSTNote", ""));
    // Hack because of growing JTextArea in FormLayout
    txt.setMinimumSize(new Dimension(200, 20));
    panel.add(txt, cc.xyw(1, 3, 3));

    ButtonBarBuilder2 builder = new ButtonBarBuilder2();
   
    JButton defaultButton = new JButton(Localizer.getLocalization(Localizer.I18N_DEFAULT));
   
    defaultButton.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        resetToDefaults();
      }

    });
   
    builder.addButton(defaultButton);
    builder.addRelatedGap();
    builder.addGlue();

    mOKBt = new JButton(Localizer.getLocalization(Localizer.I18N_OK));
    mOKBt.addActionListener(this);
    getRootPane().setDefaultButton(mOKBt);
   
    mCloseBt = new JButton(Localizer.getLocalization(Localizer.I18N_CANCEL));
    mCloseBt.addActionListener(this);

    builder.addButton(new JButton[] { mOKBt, mCloseBt });

    panel.add(builder.getPanel(), cc.xyw(1, 5, 3));

    pack();

    if (getWidth() < 400) {
      setSize(400, getHeight());
View Full Code Here

      public void actionPerformed(ActionEvent e) {
        cancelPressed();
      }
    });

    ButtonBarBuilder2 bar = new ButtonBarBuilder2();
    bar.addButton(new JButton[] {ok, cancel});

    JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0));
    panel.add(bar.getPanel());
    content.add(panel, cc.xyw(1,9,3));

    UiUtilities.registerForClosing(this);

    setPreferredSize(new Dimension(Sizes.dialogUnitXAsPixel(270, this), Sizes.dialogUnitYAsPixel(180, this)));
View Full Code Here

      public void actionPerformed(ActionEvent e) {
        cancelPressed();
      }
    });

    ButtonBarBuilder2 bar = new ButtonBarBuilder2();
    bar.addButton(new JButton[] {ok, cancel});

    JPanel panel = new JPanel(new FlowLayout(FlowLayout.RIGHT, 0, 0));
    panel.add(bar.getPanel());
    content.add(panel, cc.xyw(1,5,3));
  
    UiUtilities.registerForClosing(this);
   
    pack();
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.