Package com.intellij.openapi.ui

Examples of com.intellij.openapi.ui.FixedSizeButton


        commandLineOptionsTextField = createHistoryTextField(JFLEX_OPTIONS_KEY, JFlexSettings.DEFAULT_OPTIONS_CHARAT_NOBAK);
        enabledEmbedJavaCheckBox = new StateRestoringCheckBox(JFLEX_ENABLED_EMBED_JAVA_KEY, true);
    }

    private void fixButton(final TextFieldWithStoredHistory historyField, ComponentWithBrowseButton<TextFieldWithStoredHistory> control) {
        FixedSizeButton button = control.getButton();
        control.remove(button);
        BorderLayout borderLayout = new BorderLayout();
        JPanel buttonPanel = new JPanel(borderLayout);
        buttonPanel.setBorder(IdeBorderFactory.createEmptyBorder(4, 0, 4, 0));
        buttonPanel.add(button, BorderLayout.CENTER);
        control.add(buttonPanel, BorderLayout.EAST);
        button.setAttachedComponent(new JComponent() {
            public Dimension getPreferredSize() {
                Dimension size = historyField.getTextEditor().getPreferredSize();
                return new Dimension(-1, size.height + 6);
            }
View Full Code Here


  }

  private static JPanel constructFieldWithBrowseButton(final JComponent aComponent, final ActionListener aActionListener, int delta) {
    JPanel result = new JPanel(new GridBagLayout());
    result.add(aComponent, new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0,0));
    FixedSizeButton browseButton = new FixedSizeButton(aComponent.getPreferredSize().height - delta);//ignore border in case of browse button
    TextFieldWithBrowseButton.MyDoClickAction.addTo(browseButton, aComponent);
    result.add(browseButton, new GridBagConstraints(1, 0, 1, 1, 0, 1, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0,0,0,0), 0,0));
    browseButton.addActionListener(aActionListener);

    return result;
  }
View Full Code Here

    }

    this.add(myComponent, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));

    if (myBrowseButtonActionListener != null) {
      FixedSizeButton browseButton = new FixedSizeButton(getComponent());
      myDoClickAction = new TextFieldWithBrowseButton.MyDoClickAction(browseButton);
      browseButton.setFocusable(false);
      browseButton.addActionListener(myBrowseButtonActionListener);
      myButtons.add(browseButton);
      this.add(browseButton, new GridBagConstraints(GridBagConstraints.RELATIVE, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 2, 0, 0), 0, 0));
    }
    if (myViewerDialogTitle != null) {
      final FixedSizeButton showViewerButton = new FixedSizeButton(getComponent());
      if (myBrowseButtonActionListener == null) {
        LOG.assertTrue(myDoClickAction == null);
        myDoClickAction = new TextFieldWithBrowseButton.MyDoClickAction(showViewerButton);
      }
      showViewerButton.setFocusable(false);
      showViewerButton.setIcon(Icons.OPEN_EDIT_DIALOG_ICON);
      showViewerButton.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
          Viewer viewer = new Viewer();
          viewer.setTitle(myViewerDialogTitle);
          viewer.show();
        }
View Full Code Here

TOP

Related Classes of com.intellij.openapi.ui.FixedSizeButton

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.