Package com.intellij.openapi.ui

Examples of com.intellij.openapi.ui.TextFieldWithBrowseButton


      _importCheckbox.addActionListener(new ActionListener() {
        public void actionPerformed(final ActionEvent e) {
          _pathTextField.setEnabled(isImport());
        }
      });
      _pathTextField = new TextFieldWithBrowseButton();
      _pathTextField.setEnabled(false);
      try {
        _pathTextField.setText(FindBugsCustomPluginUtil.getAsFile(plugin).getPath());
      } catch (final MalformedURLException e) {
        LOGGER.debug("invalid plugin=" + plugin, e);
View Full Code Here


        initModuleComboBox();
        editorUi = createEditorUi();
    }

    private void initClassChooser() {
        behaviorClassInput = new TextFieldWithBrowseButton();
        behaviorClassInput.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                BehaviorClassBrowser browser = new BehaviorClassBrowser(project, "Choose Behavior");
                browser.setField(behaviorClassInput);
                behaviorClassInput.setText(browser.show());
View Full Code Here

      }
    };

    final TableCellRenderer customPackageRootsCellRenderer = new TableCellRenderer() {
      private final JBLabel myLabel = new JBLabel();
      private final TextFieldWithBrowseButton myTextWithBrowse = new TextFieldWithBrowseButton() {
        public void setOpaque(final boolean isOpaque) {
          // never make this renderer opaque in order not to have cell selection background between text field and browse button
        }
      };

      public Component getTableCellRendererComponent(final JTable table,
                                                     final Object value,
                                                     final boolean isSelected,
                                                     final boolean hasFocus,
                                                     final int row,
                                                     final int column) {

        if (value instanceof List) {
          //noinspection unchecked
          final List<String> paths = (List<String>)value;

          final String text = StringUtil.join(paths, new Function<String, String>() {
            public String fun(final String s) {
              return FileUtil.toSystemDependentName(s);
            }
          }, SEMICOLON);

          if (isSelected) {
            myTextWithBrowse.setText(text);
            return myTextWithBrowse;
          }
          else {
            myLabel.setText(text);
            return myLabel;
          }
        }
        else {
          myLabel.setText("");
          return myLabel;
        }
      }
    };

    final LocalPathCellEditor customPackageRootsEditor = new LocalPathCellEditor(myProject) {
      public Object getCellEditorValue() {
        return StringUtil.split(FileUtil.toSystemIndependentName(myComponent.getChildComponent().getText()), SEMICOLON);
      }

      @Override
      public Component getTableCellEditorComponent(final JTable table, Object value, boolean isSelected, final int row, int column) {
        myComponent = new CellEditorComponentWithBrowseButton<JTextField>(new TextFieldWithBrowseButton(createActionListener(table)), this);
        //noinspection unchecked
        final String text = StringUtil.join((List<String>)value, new Function<String, String>() {
          public String fun(final String s) {
            return FileUtil.toSystemDependentName(s);
          }
View Full Code Here

  private final TextFieldWithBrowseButton myConfigFileTextFieldWithBrowseButton;
  private final JBLabel myLabel = new JBLabel("Configuration file:");

  ConfigFileRunSettingsSection() {
    myConfigFileTextFieldWithBrowseButton = new TextFieldWithBrowseButton();
    setAnchor(myLabel);
  }
View Full Code Here

  private final TextFieldWithBrowseButton myDirectoryTextFieldWithBrowseButton;
  private final JBLabel myLabel;

  AllInDirectoryRunSettingsSection() {
    myDirectoryTextFieldWithBrowseButton = new TextFieldWithBrowseButton();
    myLabel = new JBLabel("Directory:");
    setAnchor(myLabel);
  }
View Full Code Here

  private final TextFieldWithBrowseButton myJsTestFileTextFieldWithBrowseButton;
  private final JBLabel myLabel;

  JsFileRunSettingsSection() {
    myConfigFileRunSettingsSection = new ConfigFileRunSettingsSection();
    myJsTestFileTextFieldWithBrowseButton = new TextFieldWithBrowseButton();
    myLabel = new JBLabel("JavaScript test file:");
    setAnchor(SwingUtils.getWiderComponent(myLabel, myConfigFileRunSettingsSection));
  }
View Full Code Here

public class FileSelectorTableCellEditor extends AbstractTableCellEditor {

  private final TextFieldWithBrowseButton editor;

  public FileSelectorTableCellEditor(final Project project, final Module module) {
    editor = new TextFieldWithBrowseButton(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createAllButJarContentsDescriptor();
        descriptor.setTitle("Choose source file or folder");
        VirtualFile rootFolder = null;
        VirtualFile[] contentRoots = ModuleRootManager.getInstance(module).getContentRoots();
View Full Code Here

  private JPanel createSelectDirectoryPanel(@NotNull Project project, @NotNull JTextField directoryTextField) {
    FileChooserDescriptor fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
    String adapterName = getAssertFrameworkAdapterName();
    String title = "Select a directory for " + adapterName + " files";
    String description = adapterName + " source files will be copied to the selected directory";
    TextFieldWithBrowseButton directoryTextFieldWithBrowseButton = new TextFieldWithBrowseButton(directoryTextField);
    directoryTextFieldWithBrowseButton.addBrowseFolderListener(
      title, description, project, fileChooserDescriptor
    );
    Dimension oldDimension = directoryTextFieldWithBrowseButton.getPreferredSize();
    directoryTextFieldWithBrowseButton.setMaximumSize(oldDimension);
    JPanel panel = new JPanel(new BorderLayout(0, 2));
    panel.add(new JLabel("Copy these files to directory:"), BorderLayout.NORTH);
    panel.add(directoryTextFieldWithBrowseButton, BorderLayout.CENTER);
    return SwingHelper.wrapWithHorizontalStretch(panel);
  }
View Full Code Here

        commonOptionsPlaceholder.setLayout(new BorderLayout(0, 0));
        rootPanel.add(commonOptionsPlaceholder, new GridConstraints(2, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_BOTH, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_CAN_SHRINK | GridConstraints.SIZEPOLICY_CAN_GROW, null, null, null, 0, false));
        scriptParametersField = new RawCommandLineEditor();
        scriptParametersField.setDialogCaption(ResourceBundle.getBundle("org/intellij/lang/batch/util/BatchBundle").getString("runcfg.captions.script_parameters_dialog"));
        rootPanel.add(scriptParametersField, new GridConstraints(1, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, new Dimension(150, -1), null, null, 0, false));
        scriptNameField = new TextFieldWithBrowseButton();
        rootPanel.add(scriptNameField, new GridConstraints(0, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
        final Spacer spacer1 = new Spacer();
        rootPanel.add(spacer1, new GridConstraints(3, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_VERTICAL, 1, GridConstraints.SIZEPOLICY_WANT_GROW, null, null, null, 0, false));
    }
View Full Code Here

        rootPanel = new JPanel();
        rootPanel.setLayout(new GridLayoutManager(3, 2, new Insets(0, 0, 0, 0), -1, -1));
        final JLabel label1 = new JLabel();
        this.$$$loadLabelText$$$(label1, ResourceBundle.getBundle("org/intellij/lang/batch/util/BatchBundle").getString("runcfg.labels.working_directory"));
        rootPanel.add(label1, new GridConstraints(2, 0, 1, 1, GridConstraints.ANCHOR_WEST, GridConstraints.FILL_NONE, GridConstraints.SIZEPOLICY_FIXED, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
        workingDirectoryField = new TextFieldWithBrowseButton();
        rootPanel.add(workingDirectoryField, new GridConstraints(2, 1, 1, 1, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, new Dimension(150, -1), null, null, 0, false));
        envsField = new EnvironmentVariablesComponent();
        envsField.setText(ResourceBundle.getBundle("org/intellij/lang/batch/util/BatchBundle").getString("runcfg.labels.environment_variables"));
        rootPanel.add(envsField, new GridConstraints(0, 0, 1, 2, GridConstraints.ANCHOR_CENTER, GridConstraints.FILL_HORIZONTAL, GridConstraints.SIZEPOLICY_WANT_GROW, GridConstraints.SIZEPOLICY_FIXED, null, null, null, 0, false));
        final JLabel label2 = new JLabel();
View Full Code Here

TOP

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

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.