Java 类com.intellij.util.ui.SwingHelper 实例源码

项目:intellij-ce-playground    文件:ConfigureTasksActivationDialog.java   
private void setUpDialog(@NotNull String projectPath) {
  final AbstractExternalSystemSettings externalSystemSettings = ExternalSystemApiUtil.getSettings(myProject, myProjectSystemId);
  //noinspection unchecked
  Collection<ExternalProjectSettings> projectsSettings = externalSystemSettings.getLinkedProjectsSettings();
  List<ProjectItem> projects = ContainerUtil.map(projectsSettings, new Function<ExternalProjectSettings, ProjectItem>() {
    @Override
    public ProjectItem fun(ExternalProjectSettings settings) {
      return new ProjectItem(uiAware.getProjectRepresentationName(settings.getExternalProjectPath(), null), settings);
    }
  });

  myTree = new SimpleTree();
  myRootNode = new RootNode();
  treeBuilder = createTreeBuilder(myProject, myRootNode, myTree);
  final ExternalProjectSettings currentProjectSettings = externalSystemSettings.getLinkedProjectSettings(projectPath);
  if (currentProjectSettings != null) {
    SwingHelper.updateItems(projectCombobox, projects,
                            new ProjectItem(uiAware.getProjectRepresentationName(projectPath, null), currentProjectSettings));
  }
  projectCombobox.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      updateTree(myRootNode);
    }
  });
}
项目:intellij-ce-playground    文件:PackagesNotificationPanel.java   
public PackagesNotificationPanel() {
  myHtmlViewer = SwingHelper.createHtmlViewer(true, null, null, null);
  myHtmlViewer.setVisible(false);
  myHtmlViewer.setOpaque(true);
  myHtmlViewer.addHyperlinkListener(new HyperlinkAdapter() {
    @Override
    protected void hyperlinkActivated(HyperlinkEvent e) {
      final Runnable handler = myLinkHandlers.get(e.getDescription());
      if (handler != null) {
        handler.run();
      }
      else if (myErrorTitle != null && myErrorDescription != null) {
        showError(myErrorTitle, myErrorDescription);
      }
    }
  });
}
项目:consulo    文件:PackagesNotificationPanel.java   
public PackagesNotificationPanel() {
  myHtmlViewer = SwingHelper.createHtmlViewer(true, null, null, null);
  myHtmlViewer.setVisible(false);
  myHtmlViewer.setOpaque(true);
  myHtmlViewer.addHyperlinkListener(new HyperlinkAdapter() {
    @Override
    protected void hyperlinkActivated(HyperlinkEvent e) {
      final Runnable handler = myLinkHandlers.get(e.getDescription());
      if (handler != null) {
        handler.run();
      }
      else if (myErrorTitle != null && myErrorDescription != null) {
        showError(myErrorTitle, myErrorDescription);
      }
    }
  });
}
项目:stylint-plugin    文件:StylintSettingsPage.java   
private void configESLintBinField() {
    TextFieldWithHistory textFieldWithHistory = stylintExeField.getChildComponent();
    textFieldWithHistory.setHistorySize(-1);
    textFieldWithHistory.setMinimumAndPreferredWidth(0);

    SwingHelper.addHistoryOnExpansion(textFieldWithHistory, () -> FileUtils.toAbsolutePath(StylintFinder.findAllStylintExe()));
    SwingHelper.installFileCompletionAndBrowseDialog(project, stylintExeField, "Select Stylint Exe", FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
}
项目:stylint-plugin    文件:StylintSettingsPage.java   
private void configStylintConfigField() {
    TextFieldWithHistory textFieldWithHistory = stylintConfigFile.getChildComponent();
    textFieldWithHistory.setHistorySize(-1);
    textFieldWithHistory.setMinimumAndPreferredWidth(0);

    SwingHelper.addHistoryOnExpansion(textFieldWithHistory, () -> StylintFinder.searchForLintConfigFiles(new File(project.getBaseDir().getPath())));
    SwingHelper.installFileCompletionAndBrowseDialog(project, stylintConfigFile, "Select Stylint Config", FileChooserDescriptorFactory.createSingleFileNoJarsDescriptor());
}
项目:intellij    文件:AddDirectoryToProjectAction.java   
OpenBlazeWorkspaceFileActionDialog(
    Project project, WorkspacePathResolver workspacePathResolver) {
  super(project, /* canBeParent */ false, IdeModalityType.PROJECT);
  this.project = project;
  this.workspacePathResolver = workspacePathResolver;

  FileChooserDescriptor descriptor =
      FileChooserDescriptorFactory.createSingleFolderDescriptor();
  fileTextField =
      WorkspaceFileTextField.create(
          workspacePathResolver, descriptor, PATH_FIELD_WIDTH, myDisposable);
  JBLabel directoryLabel =
      new JBLabel("Directory:", AllIcons.Modules.SourceFolder, SwingConstants.LEFT);
  JPanel directoryPanel =
      SwingHelper.newHorizontalPanel(
          Component.TOP_ALIGNMENT, directoryLabel, fileTextField.getField());

  JBLabel warning =
      new JBLabel(
          "<html>" + WARNING_TEXT + "</html>",
          AllIcons.General.BalloonWarning,
          SwingConstants.LEFT);
  warning.setPreferredSize(new Dimension(800, 100));
  component =
      SwingHelper.newLeftAlignedVerticalPanel(
          directoryPanel, warning, Box.createVerticalGlue());

  setTitle("Add Directory to Project");

  init();
}
项目:stylint-plugin    文件:StylintSettingsPage.java   
private void createUIComponents() {
    usageLink = SwingHelper.createWebHyperlink(StylintBundle.message("stylint.settings.how.to.use"), StylintBundle.message("stylint.settings.how.to.use.link"));
}
项目:consulo    文件:ManagePackagesDialog.java   
private void createUIComponents() {
  myFilter = new MyPackageFilter();
  myDescriptionTextArea = SwingHelper.createHtmlViewer(true, null, null, null);
}