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); } }); }
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); } } }); }
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()); }
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()); }
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(); }
private void createUIComponents() { usageLink = SwingHelper.createWebHyperlink(StylintBundle.message("stylint.settings.how.to.use"), StylintBundle.message("stylint.settings.how.to.use.link")); }
private void createUIComponents() { myFilter = new MyPackageFilter(); myDescriptionTextArea = SwingHelper.createHtmlViewer(true, null, null, null); }