当前位置: 首页>>代码示例>>Java>>正文


Java InsertPathAction.addTo方法代码示例

本文整理汇总了Java中com.intellij.ui.InsertPathAction.addTo方法的典型用法代码示例。如果您正苦于以下问题:Java InsertPathAction.addTo方法的具体用法?Java InsertPathAction.addTo怎么用?Java InsertPathAction.addTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.intellij.ui.InsertPathAction的用法示例。


在下文中一共展示了InsertPathAction.addTo方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createUIComponents

import com.intellij.ui.InsertPathAction; //导入方法依赖的package包/类
private void createUIComponents() {
  myLanguageLevelCombo = new LanguageLevelCombo(JavaCoreBundle.message("default.language.level.description")) {
    @Override
    protected LanguageLevel getDefaultLevel() {
      Sdk sdk = myProjectJdkConfigurable.getSelectedProjectJdk();
      if (sdk == null) return null;
      JavaSdkVersion version = JavaSdk.getInstance().getVersion(sdk);
      return version == null ? null : version.getMaxLanguageLevel();
    }
  };
  final JTextField textField = new JTextField();
  final FileChooserDescriptor outputPathsChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  InsertPathAction.addTo(textField, outputPathsChooserDescriptor);
  outputPathsChooserDescriptor.setHideIgnored(false);
  BrowseFilesListener listener = new BrowseFilesListener(textField, "", ProjectBundle.message("project.compiler.output"), outputPathsChooserDescriptor);
  myProjectCompilerOutput = new FieldPanel(textField, null, null, listener, EmptyRunnable.getInstance());
  FileChooserFactory.getInstance().installFileCompletion(myProjectCompilerOutput.getTextField(), outputPathsChooserDescriptor, true, null);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:ProjectConfigurable.java

示例2: createBrowseField

import com.intellij.ui.InsertPathAction; //导入方法依赖的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

示例3: createOutputPathPanel

import com.intellij.ui.InsertPathAction; //导入方法依赖的package包/类
private CommitableFieldPanel createOutputPathPanel(final String title, final CommitPathRunnable commitPathRunnable) {
  final JTextField textField = new JTextField();
  final FileChooserDescriptor outputPathsChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  outputPathsChooserDescriptor.setHideIgnored(false);
  InsertPathAction.addTo(textField, outputPathsChooserDescriptor);
  FileChooserFactory.getInstance().installFileCompletion(textField, outputPathsChooserDescriptor, true, null);

  CommitableFieldPanel commitableFieldPanel =
          new CommitableFieldPanel(textField, null, null, new BrowseFilesListener(textField, title, "", outputPathsChooserDescriptor), null);
  commitableFieldPanel.myCommitRunnable = new Runnable() {
    @Override
    public void run() {
      if (!getModel().isWritable()) {
        return;
      }
      String url = commitableFieldPanel.getUrl();
      commitPathRunnable.saveUrl(url);
    }
  };
  return commitableFieldPanel;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:BuildElementsEditor.java

示例4: AlternativeJREPanel

import com.intellij.ui.InsertPathAction; //导入方法依赖的package包/类
public AlternativeJREPanel() {
  myCbEnabled = new JBCheckBox(ExecutionBundle.message("run.configuration.use.alternate.jre.checkbox"));

  myFieldWithHistory = new TextFieldWithHistory();
  final ArrayList<String> foundJDKs = new ArrayList<String>();
  for (JreProvider provider : JreProvider.EP_NAME.getExtensions()) {
    String path = provider.getJrePath();
    if (!StringUtil.isEmpty(path)) {
      foundJDKs.add(path);
    }
  }
  final Sdk[] allJDKs = ProjectJdkTable.getInstance().getAllJdks();
  for (Sdk jdk : allJDKs) {
    foundJDKs.add(jdk.getHomePath());
  }
  myFieldWithHistory.setHistory(foundJDKs);
  myPathField = new ComponentWithBrowseButton<TextFieldWithHistory>(myFieldWithHistory, null);
  myPathField.addBrowseFolderListener(ExecutionBundle.message("run.configuration.select.alternate.jre.label"),
                                      ExecutionBundle.message("run.configuration.select.jre.dir.label"),
                                      null, BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR,
                                      TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);

  setLayout(new MigLayout("ins 0, gap 10, fill, flowx"));
  add(myCbEnabled, "shrinkx");
  add(myPathField, "growx, pushx");

  InsertPathAction.addTo(myFieldWithHistory.getTextEditor());

  myCbEnabled.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      enabledChanged();
    }
  });
  enabledChanged();

  setAnchor(myCbEnabled);

  updateUI();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:40,代码来源:AlternativeJREPanel.java

示例5: createUIComponents

import com.intellij.ui.InsertPathAction; //导入方法依赖的package包/类
private void createUIComponents() {
  myLanguageLevelCombo = new LanguageLevelCombo();
  final JTextField textField = new JTextField();
  final FileChooserDescriptor outputPathsChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  InsertPathAction.addTo(textField, outputPathsChooserDescriptor);
  outputPathsChooserDescriptor.setHideIgnored(false);
  BrowseFilesListener listener = new BrowseFilesListener(textField, "", ProjectBundle.message("project.compiler.output"), outputPathsChooserDescriptor);
  myProjectCompilerOutput = new FieldPanel(textField, null, null, listener, EmptyRunnable.getInstance());
  FileChooserFactory.getInstance().installFileCompletion(myProjectCompilerOutput.getTextField(), outputPathsChooserDescriptor, true, null);
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:11,代码来源:ProjectConfigurable.java

示例6: createBrowseField

import com.intellij.ui.InsertPathAction; //导入方法依赖的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) {
    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:lshain-android-source,项目名称:tools-idea,代码行数:16,代码来源:CustomizableActionsPanel.java

示例7: AlternativeJREPanel

import com.intellij.ui.InsertPathAction; //导入方法依赖的package包/类
public AlternativeJREPanel() {
  myCbEnabled = new JBCheckBox(ExecutionBundle.message("run.configuration.use.alternate.jre.checkbox"));

  myFieldWithHistory = new TextFieldWithHistory();
  final ArrayList<String> foundJDKs = new ArrayList<String>();
  final Sdk[] allJDKs = SdkTable.getInstance().getAllSdks();
  for (Sdk jdk : allJDKs) {
    foundJDKs.add(jdk.getHomePath());
  }
  myFieldWithHistory.setHistory(foundJDKs);
  myPathField = new ComponentWithBrowseButton<TextFieldWithHistory>(myFieldWithHistory, null);
  myPathField.addBrowseFolderListener(ExecutionBundle.message("run.configuration.select.alternate.jre.label"),
                                      ExecutionBundle.message("run.configuration.select.jre.dir.label"),
                                      null, BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR,
                                      TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);

  setLayout(new MigLayout("ins 0, gap 10, fill, flowx"));
  add(myCbEnabled, "shrinkx");
  add(myPathField, "growx, pushx");

  InsertPathAction.addTo(myFieldWithHistory.getTextEditor());

  myCbEnabled.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      enabledChanged();
    }
  });
  enabledChanged();

  setAnchor(myCbEnabled);

  updateUI();
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:34,代码来源:AlternativeJREPanel.java

示例8: AlternativeJREPanel

import com.intellij.ui.InsertPathAction; //导入方法依赖的package包/类
public AlternativeJREPanel() {
  myCbEnabled = new JBCheckBox(ExecutionBundle.message("run.configuration.use.alternate.jre.checkbox"));

  myFieldWithHistory = new TextFieldWithHistory();
  myFieldWithHistory.setHistorySize(-1);
  final ArrayList<String> foundJDKs = new ArrayList<String>();
  final Sdk[] allJDKs = ProjectJdkTable.getInstance().getAllJdks();

  for (Sdk sdk : allJDKs) {
    foundJDKs.add(sdk.getName());
  }

  for (JreProvider provider : JreProvider.EP_NAME.getExtensions()) {
    String path = provider.getJrePath();
    if (!StringUtil.isEmpty(path)) {
      foundJDKs.add(path);
    }
  }

  for (Sdk jdk : allJDKs) {
    String homePath = jdk.getHomePath();

    if (!SystemInfo.isMac) {
      final File jre = new File(jdk.getHomePath(), "jre");
      if (jre.isDirectory()) {
        homePath = jre.getPath();
      }
    }

    if (!foundJDKs.contains(homePath)) {
      foundJDKs.add(homePath);
    }
  }
  myFieldWithHistory.setHistory(foundJDKs);
  myPathField = new ComponentWithBrowseButton<TextFieldWithHistory>(myFieldWithHistory, null);
  myPathField.addBrowseFolderListener(ExecutionBundle.message("run.configuration.select.alternate.jre.label"),
                                      ExecutionBundle.message("run.configuration.select.jre.dir.label"),
                                      null, BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR,
                                      TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);

  setLayout(new MigLayout("ins 0, gap 10, fill, flowx"));
  add(myCbEnabled, "shrinkx");
  add(myPathField, "growx, pushx");

  InsertPathAction.addTo(myFieldWithHistory.getTextEditor());

  myCbEnabled.addActionListener(new ActionListener() {
    public void actionPerformed(ActionEvent e) {
      enabledChanged();
    }
  });
  enabledChanged();

  setAnchor(myCbEnabled);

  updateUI();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:58,代码来源:AlternativeJREPanel.java

示例9: initBrowseActions

import com.intellij.ui.InsertPathAction; //导入方法依赖的package包/类
private void initBrowseActions() {
  InsertPathAction.addTo(myPathToCertificatesField, FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
  myClientCertificatePathField.addBrowseFolderListener(
      SvnBundle.message("dialog.edit.http.proxies.settings.dialog.select.ssl.client.certificate.path.title"),
      null, null, new FileChooserDescriptor(true, false, false, false, false, false));
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:ConfigureProxiesOptionsPanel.java

示例10: AlternativeJREPanel

import com.intellij.ui.InsertPathAction; //导入方法依赖的package包/类
public AlternativeJREPanel() {
    myCbEnabled = new JBCheckBox(ExecutionBundle.message("run.configuration.use.alternate.jre.checkbox"));

    myFieldWithHistory = new TextFieldWithHistory();
    myFieldWithHistory.setHistorySize(-1);
    final List<String> foundJDKs = new ArrayList<>();
    final Sdk[] allJDKs = ProjectJdkTable.getInstance().getAllJdks();

    String javaHomeOfCurrentProcess = System.getProperty("java.home");
    if (javaHomeOfCurrentProcess != null && !javaHomeOfCurrentProcess.isEmpty()) {
        foundJDKs.add(javaHomeOfCurrentProcess);
    }

    for (Sdk sdk : allJDKs) {
        String name = sdk.getName();
        if (!foundJDKs.contains(name)) {
            foundJDKs.add(name);
        }
    }

    for (Sdk jdk : allJDKs) {
        String homePath = jdk.getHomePath();

        if (!SystemInfo.isMac) {
            final File jre = new File(jdk.getHomePath(), "jre");
            if (jre.isDirectory()) {
                homePath = jre.getPath();
            }
        }

        if (!foundJDKs.contains(homePath)) {
            foundJDKs.add(homePath);
        }
    }

    myFieldWithHistory.setHistory(foundJDKs);
    myPathField = new ComponentWithBrowseButton<>(myFieldWithHistory, null);
    myPathField.addBrowseFolderListener(ExecutionBundle.message("run.configuration.select.alternate.jre.label"),
            ExecutionBundle.message("run.configuration.select.jre.dir.label"),
            null, BrowseFilesListener.SINGLE_DIRECTORY_DESCRIPTOR,
            TextComponentAccessor.TEXT_FIELD_WITH_HISTORY_WHOLE_TEXT);

    setLayout(new MigLayout("ins 0, gap 10, fill, flowx"));
    add(myCbEnabled, "shrinkx");
    add(myPathField, "growx, pushx");

    InsertPathAction.addTo(myFieldWithHistory.getTextEditor());

    myCbEnabled.addActionListener(new ActionListener() {
        public void actionPerformed(ActionEvent e) {
            enabledChanged();
        }
    });
    enabledChanged();

    setAnchor(myCbEnabled);

    updateUI();
}
 
开发者ID:ligasgr,项目名称:intellij-xquery,代码行数:60,代码来源:AlternativeJREPanel.java

示例11: init

import com.intellij.ui.InsertPathAction; //导入方法依赖的package包/类
private void init() {
  myPanel = new JPanel(new VerticalFlowLayout(true, false));

  final JPanel namePanel = new JPanel(new BorderLayout());
  final JLabel label = new JLabel("<html><body><b>Project name:</b></body></html>", SwingConstants.LEFT);
  namePanel.add(label, BorderLayout.NORTH);

  myProjectName = new JTextField();
  myProjectName.setColumns(40);

  final JPanel nameFieldPanel = new JPanel();
  nameFieldPanel.setLayout(new BoxLayout(nameFieldPanel, BoxLayout.X_AXIS));
  nameFieldPanel.add(Box.createHorizontalStrut(4));
  nameFieldPanel.add(myProjectName);

  namePanel.add(nameFieldPanel, BorderLayout.CENTER);
  final JPanel wrapper = new JPanel(new FlowLayout(FlowLayout.LEFT));
  wrapper.add(namePanel);
  wrapper.setAlignmentX(0);
  myPanel.add(wrapper);

  myPanel.add(new JLabel(ProjectBundle.message("project.compiler.output")));

  final JTextField textField = new JTextField();
  final FileChooserDescriptor outputPathsChooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
  InsertPathAction.addTo(textField, outputPathsChooserDescriptor);
  outputPathsChooserDescriptor.setHideIgnored(false);
  BrowseFilesListener listener = new BrowseFilesListener(textField, "", ProjectBundle.message("project.compiler.output"), outputPathsChooserDescriptor);
  myProjectCompilerOutput = new FieldPanel(textField, null, null, listener, EmptyRunnable.getInstance());
  FileChooserFactory.getInstance().installFileCompletion(myProjectCompilerOutput.getTextField(), outputPathsChooserDescriptor, true, null);

  myProjectCompilerOutput.getTextField().getDocument().addDocumentListener(new DocumentAdapter() {
    @Override
    protected void textChanged(DocumentEvent e) {
      if (myFreeze) return;
      myModulesConfigurator.processModuleCompilerOutputChanged(getCompilerOutputUrl());
    }
  });

  myPanel.add(myProjectCompilerOutput);
  myPanel.add(ScrollPaneFactory.createScrollPane(myErrorsComponent, true));
}
 
开发者ID:consulo,项目名称:consulo,代码行数:43,代码来源:ProjectConfigurable.java


注:本文中的com.intellij.ui.InsertPathAction.addTo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。