Search in sources :

Example 16 with FixedSizeButton

use of com.intellij.openapi.ui.FixedSizeButton in project intellij-community by JetBrains.

the class StudyNewProjectPanel method layoutPanel.

private void layoutPanel() {
    myCoursesComboBox = new ComboBox<>();
    final LabeledComponent<ComboBox> coursesCombo = LabeledComponent.create(myCoursesComboBox, "Courses:", BorderLayout.WEST);
    myRefreshButton = new FixedSizeButton(coursesCombo);
    if (SystemInfo.isMac && !UIUtil.isUnderDarcula())
        myRefreshButton.putClientProperty("JButton.buttonType", null);
    myRefreshButton.setIcon(AllIcons.Actions.Refresh);
    myBrowseButton = new FixedSizeButton(coursesCombo);
    final JPanel comboPanel = new JPanel(new BorderLayout());
    comboPanel.add(coursesCombo, BorderLayout.CENTER);
    comboPanel.add(myRefreshButton, BorderLayout.EAST);
    final JPanel coursesPanel = new JPanel(new BorderLayout());
    coursesPanel.add(comboPanel, BorderLayout.CENTER);
    coursesPanel.add(myBrowseButton, BorderLayout.EAST);
    add(coursesPanel);
    myAnchor = coursesCombo;
    final JPanel panel = new JPanel(new BorderLayout());
    final JLabel invisibleLabel = new JLabel();
    invisibleLabel.setPreferredSize(new JLabel("Location: ").getPreferredSize());
    panel.add(invisibleLabel, BorderLayout.WEST);
    myInfoPanel = new JPanel(new VerticalFlowLayout());
    myAuthorLabel = new JLabel();
    myDescriptionPane = new JTextPane();
    myDescriptionPane.setEditable(true);
    myDescriptionPane.setEnabled(true);
    myAuthorLabel.setEnabled(true);
    myDescriptionPane.setPreferredSize(new Dimension(150, 200));
    myDescriptionPane.setFont(coursesCombo.getFont());
    myInfoPanel.add(myAuthorLabel);
    myInfoPanel.add(new JBScrollPane(myDescriptionPane));
    panel.add(myInfoPanel, BorderLayout.CENTER);
    add(panel);
}
Also used : ComboBox(com.intellij.openapi.ui.ComboBox) FixedSizeButton(com.intellij.openapi.ui.FixedSizeButton) JBScrollPane(com.intellij.ui.components.JBScrollPane) VerticalFlowLayout(com.intellij.openapi.ui.VerticalFlowLayout)

Example 17 with FixedSizeButton

use of com.intellij.openapi.ui.FixedSizeButton in project intellij-community by JetBrains.

the class EditLocationDialog method init.

@Override
protected void init() {
    setTitle(myTitle);
    myTfUrl = new JTextField();
    myTfPath = new JTextField();
    myBtnBrowseLocalPath = new FixedSizeButton(myTfPath);
    super.init();
}
Also used : FixedSizeButton(com.intellij.openapi.ui.FixedSizeButton)

Example 18 with FixedSizeButton

use of com.intellij.openapi.ui.FixedSizeButton in project android by JetBrains.

the class ChooseGradleHomeDialogFixture method chooseGradleHome.

@NotNull
public ChooseGradleHomeDialogFixture chooseGradleHome(@NotNull File gradleHomePath) {
    FixedSizeButton browseButton = robot().finder().findByType(target(), FixedSizeButton.class, true);
    robot().click(browseButton);
    FileChooserDialogFixture fileChooserDialog = FileChooserDialogFixture.findDialog(robot(), new GenericTypeMatcher<JDialog>(JDialog.class) {

        @Override
        protected boolean isMatching(@NotNull JDialog dialog) {
            Collection<JLabel> descriptionLabels = robot().finder().findAll(dialog, JLabelMatcher.withText("Gradle home:"));
            return descriptionLabels.size() == 1;
        }
    });
    fileChooserDialog.select(findFileByIoFile(gradleHomePath, true));
    fileChooserDialog.clickOk();
    return this;
}
Also used : FileChooserDialogFixture(com.android.tools.idea.tests.gui.framework.fixture.FileChooserDialogFixture) Collection(java.util.Collection) FixedSizeButton(com.intellij.openapi.ui.FixedSizeButton) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

FixedSizeButton (com.intellij.openapi.ui.FixedSizeButton)18 ActionEvent (java.awt.event.ActionEvent)6 ActionListener (java.awt.event.ActionListener)6 ComboBox (com.intellij.openapi.ui.ComboBox)3 EditorTextField (com.intellij.ui.EditorTextField)3 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)2 TextFieldWithBrowseButton (com.intellij.openapi.ui.TextFieldWithBrowseButton)2 VirtualFile (com.intellij.openapi.vfs.VirtualFile)2 JBScrollPane (com.intellij.ui.components.JBScrollPane)2 List (java.util.List)2 NotNull (org.jetbrains.annotations.NotNull)2 FileChooserDialogFixture (com.android.tools.idea.tests.gui.framework.fixture.FileChooserDialogFixture)1 TreeClassChooser (com.intellij.ide.util.TreeClassChooser)1 AnActionEvent (com.intellij.openapi.actionSystem.AnActionEvent)1 Document (com.intellij.openapi.editor.Document)1 Editor (com.intellij.openapi.editor.Editor)1 ExternalProjectPojo (com.intellij.openapi.externalSystem.model.project.ExternalProjectPojo)1 ExternalSystemNode (com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemNode)1 ExternalSystemTasksTree (com.intellij.openapi.externalSystem.service.task.ui.ExternalSystemTasksTree)1 Sdk (com.intellij.openapi.projectRoots.Sdk)1