當前位置: 首頁>>代碼示例>>Java>>正文


Java TextFieldWithBrowseButton.addBrowseFolderListener方法代碼示例

本文整理匯總了Java中com.intellij.openapi.ui.TextFieldWithBrowseButton.addBrowseFolderListener方法的典型用法代碼示例。如果您正苦於以下問題:Java TextFieldWithBrowseButton.addBrowseFolderListener方法的具體用法?Java TextFieldWithBrowseButton.addBrowseFolderListener怎麽用?Java TextFieldWithBrowseButton.addBrowseFolderListener使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.intellij.openapi.ui.TextFieldWithBrowseButton的用法示例。


在下文中一共展示了TextFieldWithBrowseButton.addBrowseFolderListener方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createUIComponents

import com.intellij.openapi.ui.TextFieldWithBrowseButton; //導入方法依賴的package包/類
private void createUIComponents() {
    defaultExtensionLabel = new JBLabel(TesterBundle.message("settings.defaultExtension"));
    defaultExtensionCombobox = new ComboBox<>(new String[]{"phpt", "php"});

    bootstrapFileLabel = new JBLabel(TesterBundle.message("settings.bootstrapFile"));
    bootstrapFileField = new TextFieldWithBrowseButton();
    bootstrapFileField.addBrowseFolderListener(null, null, project, FileChooserDescriptorFactory.createSingleFileDescriptor("php"));

    namespaceMappingTable = new NamespaceMappingTable(project);
    namespaceMappingPanel = ToolbarDecorator.createDecorator(namespaceMappingTable.getTableView(), new ElementProducer<TesterNamespaceMapping>() {
        @Override
        public TesterNamespaceMapping createElement() {
            return new TesterNamespaceMapping();
        }

        @Override
        public boolean canCreateElement() {
            return true;
        }
    }).createPanel();

    namespaceMappingPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, JBColor.LIGHT_GRAY), TesterBundle.message("settings.namespaceMappings.title")));
}
 
開發者ID:jiripudil,項目名稱:intellij-nette-tester,代碼行數:24,代碼來源:TesterConfigurableForm.java

示例2: createUIComponents

import com.intellij.openapi.ui.TextFieldWithBrowseButton; //導入方法依賴的package包/類
private void createUIComponents() {
    phpInterpreter = new PhpInterpreterComboBox(project, null);
    phpInterpreter.setModel(PhpInterpretersManagerImpl.getInstance(project).getInterpreters(), null);
    phpInterpreter.setNoItemText("<default project interpreter>");

    interpreterOptions = new PhpConfigurationOptionsComponent();

    phpIniPath = new TextFieldWithBrowseButton();
    phpIniPath.addBrowseFolderListener(null, null, project, FileChooserDescriptorFactory.createSingleFileDescriptor("ini"));

    useSystemPhpIniCheckbox = new JBCheckBox(TesterBundle.message("runConfiguration.editor.testEnv.useSystemPhpIni"));

    interpreterLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.testEnv.interpreter"));
    interpreterOptionsLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.testEnv.interpreterOptions"));
    pathToPhpIniLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.testEnv.phpIni"));
}
 
開發者ID:jiripudil,項目名稱:intellij-nette-tester,代碼行數:17,代碼來源:TesterTestEnvironmentSettingsEditor.java

示例3: createUIComponents

import com.intellij.openapi.ui.TextFieldWithBrowseButton; //導入方法依賴的package包/類
private void createUIComponents() {
    testScope = new TextFieldWithBrowseButton();
    testScope.addBrowseFolderListener(null, null, project, FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor());

    testerExecutable = new TextFieldWithBrowseButton();
    testerExecutable.addBrowseFolderListener(null, null, project, FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor());

    testerOptions = new RawCommandLineEditor();
    testerOptions.setDialogCaption("Options");

    userSetupScript = new TextFieldWithBrowseButton();
    userSetupScript.addBrowseFolderListener(null, null, project, FileChooserDescriptorFactory.createSingleFileDescriptor("php"));

    testScopeLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.tester.testScope"));
    testerExecutableLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.tester.testerExecutable"));
    testerOptionsLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.tester.testerOptions"));
    setupScriptLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.tester.setupScript"));
}
 
開發者ID:jiripudil,項目名稱:intellij-nette-tester,代碼行數:19,代碼來源:TesterSettingsEditor.java

示例4: makePathButton

import com.intellij.openapi.ui.TextFieldWithBrowseButton; //導入方法依賴的package包/類
private void makePathButton() {
        btnPath = new TextFieldWithBrowseButton();
        btnPath.setText(PackageTemplateHelper.getRootDirPath());
        btnPath.addBrowseFolderListener(Localizer.get("SelectPackageTemplate"), "", project, FileReaderUtil.getPackageTemplatesDescriptor());

//        panel.add(new SeparatorComponent(), new CC().growX().spanX().wrap());
        panel.add(btnPath, new CC().pushX().growX().spanX());
        addPathButtons();

        rbFromPath = new JBRadioButton(Localizer.get("label.FromPath"));
        rbFromPath.addItemListener(e -> {
            if (e.getStateChange() == ItemEvent.SELECTED) {
                toggleSourcePath(
                        TemplateSourceType.PATH,
                        null,
                        btnPath
                );
            }
        });

        panel.add(rbFromPath, new CC().growX().spanX().wrap());
    }
 
開發者ID:CeH9,項目名稱:PackageTemplates,代碼行數:23,代碼來源:SelectPackageTemplateDialog.java

示例5: DeviceDriverForm

import com.intellij.openapi.ui.TextFieldWithBrowseButton; //導入方法依賴的package包/類
public DeviceDriverForm() {
    author.setText(System.getProperty("user.name"));
    license.addItem(new ComboItem(DriverLicenseType.GPL.name(), DriverLicenseType.GPL.name()));
    license.addItem(new ComboItem(DriverLicenseType.BSD.name(), DriverLicenseType.BSD.name()));
    license.addItem(new ComboItem(DriverLicenseType.DUAL.name(), DriverLicenseType.DUAL.name()));
    kernelVersion.setText(KernelBundle.getString("kernel.version") + " " + System.getProperty("os.version"));
    useHostKernelCheckBox.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {
            kernelSourcePath.setEnabled(!useHostKernelCheckBox.isSelected());
        }
    });

    TextFieldWithBrowseButton textFieldWithBrowseButton = new TextFieldWithBrowseButton();
    textFieldWithBrowseButton.addBrowseFolderListener(KernelBundle.getString("choose.kernel.sources"), null, null,
            new FileChooserDescriptor(false, true, false, false, false, false));
    kernelSourcePath.setComponent(textFieldWithBrowseButton);
    kernelSourcePath.setEnabled(false);
    kernelSourcePath.getComponent().setText("/usr/src/linux-headers-" + System.getProperty("os.version"));
}
 
開發者ID:asebak,項目名稱:clion-kernel,代碼行數:21,代碼來源:DeviceDriverForm.java

示例6: createBrowseField

import com.intellij.openapi.ui.TextFieldWithBrowseButton; //導入方法依賴的package包/類
private static TextFieldWithBrowseButton createBrowseField(){
  TextFieldWithBrowseButton textField = new TextFieldWithBrowseButton();
  textField.setPreferredSize(new Dimension(200, textField.getPreferredSize().height));
  textField.setMinimumSize(new Dimension(200, textField.getPreferredSize().height));
  final FileChooserDescriptor fileChooserDescriptor = new FileChooserDescriptor(true, false, false, false, false, false) {
    @Override
    public boolean isFileSelectable(VirtualFile file) {
      //noinspection HardCodedStringLiteral
      return file.getName().endsWith(".png");
    }
  };
  textField.addBrowseFolderListener(IdeBundle.message("title.browse.icon"), IdeBundle.message("prompt.browse.icon.for.selected.action"), null,
                                    fileChooserDescriptor);
  InsertPathAction.addTo(textField.getTextField(), fileChooserDescriptor);
  return textField;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:17,代碼來源:CustomizableActionsPanel.java

示例7: createComponent

import com.intellij.openapi.ui.TextFieldWithBrowseButton; //導入方法依賴的package包/類
@Override
public JComponent createComponent() {
  myPanel = new JPanel(new BorderLayout(10, 5));
  final JPanel contentPanel = new JPanel(new BorderLayout(4, 0));
  myPanel.add(contentPanel, BorderLayout.NORTH);
  contentPanel.add(new JLabel(myFrameworkName + " home:"), BorderLayout.WEST);
  myPathField = new TextFieldWithBrowseButton();
  contentPanel.add(myPathField);
  myPathField
    .addBrowseFolderListener("Select " + myFrameworkName + " home", "", myProject, new FileChooserDescriptor(false, true, false, false, false, false) {
      @Override
      public boolean isFileSelectable(VirtualFile file) {
        return isSdkHome(file);
      }
    });
  return myPanel;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:18,代碼來源:SdkHomeConfigurable.java

示例8: setupUrlField

import com.intellij.openapi.ui.TextFieldWithBrowseButton; //導入方法依賴的package包/類
public static void setupUrlField(@NotNull TextFieldWithBrowseButton field, @NotNull final Project project) {
  FileChooserDescriptor descriptor = new FileChooserDescriptor(true, false, false, false, false, false) {
    @Override
    public boolean isFileSelectable(VirtualFile file) {
      return HtmlUtil.isHtmlFile(file) || virtualFileToUrl(file, project) != null;
    }
  };
  descriptor.setTitle(XmlBundle.message("javascript.debugger.settings.choose.file.title"));
  descriptor.setDescription(XmlBundle.message("javascript.debugger.settings.choose.file.subtitle"));
  descriptor.setRoots(ProjectRootManager.getInstance(project).getContentRoots());

  field.addBrowseFolderListener(new TextBrowseFolderListener(descriptor, project) {
    @NotNull
    @Override
    protected String chosenFileToResultingText(@NotNull VirtualFile chosenFile) {
      if (chosenFile.isDirectory()) {
        return chosenFile.getPath();
      }

      Url url = virtualFileToUrl(chosenFile, project);
      return url == null ? chosenFile.getUrl() : url.toDecodedForm();
    }
  });
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:25,代碼來源:StartBrowserPanel.java

示例9: SdkVersionSelectionDialog

import com.intellij.openapi.ui.TextFieldWithBrowseButton; //導入方法依賴的package包/類
public SdkVersionSelectionDialog(JComponent parent, String title, String name, List<String> scalaVersions)
{
    super(parent, false);
    setTitle(title);
    //Create and populate the panel.
    centerPanel = new JPanel(new SpringLayout());

    versionLabel = new JLabel(name, JLabel.TRAILING);
    versionComboBox = new ComboBox(new DefaultComboBoxModel<>(scalaVersions.toArray()));
    versionLabel.setLabelFor(versionComboBox);

    centerPanel.add(versionLabel);
    centerPanel.add(versionComboBox);

    destination = new TextFieldWithBrowseButton();
    destination.addBrowseFolderListener("Select new Mule distribution destination", null, null, FileChooserDescriptorFactory.createSingleFolderDescriptor());
    destinationLabel = new JLabel("Destination:", JLabel.TRAILING);
    destinationLabel.setLabelFor(destination);

    //By default, should be ~/mule-distro
    File distro = new File(SystemProperties.getUserHome(), "mule-distro");
    destination.setText(distro.getAbsolutePath());

    centerPanel.add(destinationLabel);
    centerPanel.add(destination);

    //Lay out the panel.
    SpringUtilities.makeCompactGrid(centerPanel,
            2, 2, //rows, cols
            6, 6,        //initX, initY
            6, 6);       //xPad, yPad

    init();
}
 
開發者ID:machaval,項目名稱:mule-intellij-plugins,代碼行數:35,代碼來源:SdkVersionSelectionDialog.java

示例10: createUIComponents

import com.intellij.openapi.ui.TextFieldWithBrowseButton; //導入方法依賴的package包/類
private void createUIComponents() {
    interpreterOptions = new RawCommandLineEditor();
    interpreterOptions.setDialogCaption("Options");

    customWorkingDirectory = new TextFieldWithBrowseButton();
    customWorkingDirectory.addBrowseFolderListener(null, null, project, FileChooserDescriptorFactory.createSingleFolderDescriptor());

    environmentVariables = new EnvironmentVariablesComponent();

    interpreterOptionsLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.cli.interpreterOptions"));
    workingDirectoryLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.cli.workingDirectory"));
}
 
開發者ID:jiripudil,項目名稱:intellij-nette-tester,代碼行數:13,代碼來源:PhpCommandLineSettingsEditor.java

示例11: createUIComponents

import com.intellij.openapi.ui.TextFieldWithBrowseButton; //導入方法依賴的package包/類
private void createUIComponents() {
  myJarPathComponent = new LabeledComponent<TextFieldWithBrowseButton>();
  TextFieldWithBrowseButton textFieldWithBrowseButton = new TextFieldWithBrowseButton();
  textFieldWithBrowseButton.addBrowseFolderListener("Choose JAR File", null, myProject,
                                                    new FileChooserDescriptor(false, false, true, true, false, false));
  myJarPathComponent.setComponent(textFieldWithBrowseButton);
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:8,代碼來源:JarApplicationConfigurable.java

示例12: getAdditionalSettings

import com.intellij.openapi.ui.TextFieldWithBrowseButton; //導入方法依賴的package包/類
@Override
public JComponent getAdditionalSettings(WizardContext wizardContext) {
  myPathPanel = new TextFieldWithBrowseButton();
  final FileChooserDescriptor descriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  myPathPanel.addBrowseFolderListener("Select Directory Containing Module Files", null, wizardContext.getProject(), descriptor);
  onChosen(false);
  return myPathPanel;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:9,代碼來源:CreateModuleFromSourcesMode.java

示例13: assignLabel

import com.intellij.openapi.ui.TextFieldWithBrowseButton; //導入方法依賴的package包/類
public static LabeledComponent<TextFieldWithBrowseButton> assignLabel(TextFieldWithBrowseButton targetDirectoryField, Project project) {
  LabeledComponent<TextFieldWithBrowseButton> labeledComponent = new LabeledComponent<TextFieldWithBrowseButton>();
  labeledComponent.setText(CodeEditorBundle.message("export.to.html.output.directory.label"));
  targetDirectoryField.addBrowseFolderListener(CodeEditorBundle.message("export.to.html.select.output.directory.title"),
                                               CodeEditorBundle.message("export.to.html.select.output.directory.description"),
                                               project, FileChooserDescriptorFactory.createSingleFolderDescriptor());
  labeledComponent.setComponent(targetDirectoryField);
  return labeledComponent;
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:10,代碼來源:ExportToHTMLDialog.java

示例14: initComponents

import com.intellij.openapi.ui.TextFieldWithBrowseButton; //導入方法依賴的package包/類
protected void initComponents() {
  myProgramParametersComponent = LabeledComponent.create(new RawCommandLineEditor(),
                                                         ExecutionBundle.message("run.configuration.program.parameters"));

  FileChooserDescriptor fileChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  //noinspection DialogTitleCapitalization
  fileChooserDescriptor.setTitle(ExecutionBundle.message("select.working.directory.message"));
  myWorkingDirectoryField = new TextFieldWithBrowseButton();
  myWorkingDirectoryField.addBrowseFolderListener(new MacroAwareTextBrowseFolderListener(fileChooserDescriptor, getProject()) {
    @Override
    public void actionPerformed(ActionEvent e) {
      myFileChooserDescriptor.putUserData(LangDataKeys.MODULE_CONTEXT, myModuleContext);
      setProject(getProject());
      super.actionPerformed(e);
    }
  });

  myWorkingDirectoryComponent = LabeledComponent.create(createComponentWithMacroBrowse(myWorkingDirectoryField), ExecutionBundle.message("run.configuration.working.directory.label"));
  myEnvVariablesComponent = new EnvironmentVariablesComponent();

  myEnvVariablesComponent.setLabelLocation(BorderLayout.WEST);
  myProgramParametersComponent.setLabelLocation(BorderLayout.WEST);
  myWorkingDirectoryComponent.setLabelLocation(BorderLayout.WEST);

  addComponents();

  setPreferredSize(new Dimension(10, 10));

  setAnchor(myEnvVariablesComponent.getLabel());
}
 
開發者ID:jskierbi,項目名稱:intellij-ce-playground,代碼行數:31,代碼來源:CommonProgramParametersPanel.java

示例15: createEditor

import com.intellij.openapi.ui.TextFieldWithBrowseButton; //導入方法依賴的package包/類
@NotNull
@Override
protected JComponent createEditor() {

    ComboboxWithBrowseButton tomcatField = runnerSetting.getTomcatField();
    TextFieldWithBrowseButton docBaseField = runnerSetting.getDocBaseField();
    JTextField contextPathField = runnerSetting.getContextPathField();
    JFormattedTextField portField = runnerSetting.getPortField();
    JXButton configrationButton = runnerSetting.getConfigrationButton();
    configrationButton.addActionListener(new ActionListener() {
        @Override
        public void actionPerformed(ActionEvent e) {


            ShowSettingsUtil.getInstance().showSettingsDialog(project, TomcatSettingConfigurable.class);

        }
    });


    docBaseField.addBrowseFolderListener("webapp", "Choose Web Folder", project, FileChooserDescriptorFactory.createSingleFolderDescriptor().withRoots(project.getBaseDir()));
    docBaseField.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
        @Override
        protected void textChanged(DocumentEvent documentEvent) {

            if (!documentEvent.getType().equals(DocumentEvent.EventType.REMOVE)) {
                String text = docBaseField.getText();
                if (text != null && !text.trim().equals("")) {
                    VirtualFile fileByIoFile = LocalFileSystem.getInstance().findFileByIoFile(new File(text));
                    Module module = ModuleUtilCore.findModuleForFile(fileByIoFile, project);
                    String contextPath = module == null ? "/" : "/" + module.getName();
                    contextPathField.setText(contextPath);
                }
            }

        }
    });


    portField.setValue(8080);
    DefaultFormatterFactory tf = new DefaultFormatterFactory();
    NumberFormat format = NumberFormat.getInstance();
    format.setGroupingUsed(false);
    NumberFormatter formatter = new NumberFormatter(format);
    formatter.setValueClass(Integer.class);
    formatter.setMinimum(0);
    formatter.setMaximum(65535);
    tf.setDefaultFormatter(formatter);
    portField.setFormatterFactory(tf);

    return runnerSetting.getMainPanel();
}
 
開發者ID:zengkid,項目名稱:SmartTomcat,代碼行數:53,代碼來源:TomcatSettingsEditor.java


注:本文中的com.intellij.openapi.ui.TextFieldWithBrowseButton.addBrowseFolderListener方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。