com.intellij.openapi.ui.ComboBox Java Examples
The following examples show how to use
com.intellij.openapi.ui.ComboBox.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SettingsPanelMock.java From tmc-intellij with MIT License | 6 votes |
public void initComponents() { panel1 = new JPanel(); projectPathField = new JFormattedTextField(); checkForNewOrCheckBox = new JCheckBox(); checkThatAllActiveCheckBox = new JCheckBox(); sendDiagnosticsCheckBox = new JCheckBox(); sendSnapshotsOfYourCheckBox = new JCheckBox(); selectErrorLanguageField = new ComboBox<>(); browseButton = new JButton(); okButton = new JButton(); cancelButton = new JButton(); downloadCourseExercisesButton = new JButton(); logoutButton = new JButton(); loggedUser = new JLabel(); currentOrganization = new JLabel(); changeOrganizationButton = new JButton(); currentCourse = new JLabel(); changeCourseButton = new JButton(); }
Example #2
Source File: FieldsTableDelegate.java From JSONToKotlinClass with MIT License | 6 votes |
public void setClass(ClassModel classModel) { fieldsData = classModel.fields; fieldsTable.setModel(new FieldsTableModel(fieldsData)); TableColumn column = fieldsTable.getColumnModel().getColumn(0); column.setPreferredWidth(30); TableColumn modifierColumn = fieldsTable.getColumnModel().getColumn(2); ComboBox<String> modifierCombobox = new ComboBox<>(); modifierCombobox.addItem(languageResolver.getModifier(true)); modifierCombobox.addItem(languageResolver.getModifier(false)); modifierColumn.setCellEditor(new DefaultCellEditor(modifierCombobox)); DefaultTableCellRenderer centerRenderer = new DefaultTableCellRenderer(); centerRenderer.setHorizontalAlignment(JLabel.CENTER); for (int i = 1; i < columns.length; i++) { if (i != 3) { fieldsTable.getColumnModel().getColumn(i).setCellRenderer(centerRenderer); } } }
Example #3
Source File: SelectFileTemplateDialog.java From PackageTemplates with Apache License 2.0 | 6 votes |
@NotNull private ComboBox getSelector() { ArrayList<TemplateForSearch> listTemplateForSearch = FileTemplateHelper.getTemplates( project, cbAddInternal.isSelected(), cbAddJ2EE.isSelected(), ptWrapper.getPackageTemplate().getFileTemplateSource() ); ComboBox comboBox = new ComboBox(listTemplateForSearch.toArray()); comboBox.setRenderer(new ListCellRendererWrapper<TemplateForSearch>() { @Override public void customize(JList list, TemplateForSearch template, int index, boolean selected, boolean hasFocus) { if (template != null) { setIcon(FileTemplateUtil.getIcon(template.getTemplate())); setText(template.getTemplate().getName()); } } }); new ComboboxSpeedSearch(comboBox); return comboBox; }
Example #4
Source File: AddFilterRuleDialog.java From AndroidStringsOneTabTranslation with Apache License 2.0 | 6 votes |
protected JComponent doCreateCenterPanel() { JPanel panel = new JPanel(new BorderLayout(5, 0)); FilterRule.FilterRuleType[] types = FilterRule.FilterRuleType.values(); ruleType = new ComboBox(types); ruleType.setEnabled(true); ruleType.setSelectedIndex(0); panel.add(ruleType, BorderLayout.WEST); filterName = new JTextField(20); PromptSupport.setPrompt("Set the string name here", filterName); panel.add(filterName, BorderLayout.CENTER); return panel; }
Example #5
Source File: FieldsTableDelegate.java From haystack with MIT License | 6 votes |
public void setClass(ClassModel classModel) { fieldsData = classModel.getFields(); fieldsTable.setModel(new FieldsTableModel(fieldsData)); TableColumn column = fieldsTable.getColumnModel().getColumn(0); column.setPreferredWidth(30); fieldsTable.getColumnModel().getColumn(1).setPreferredWidth(30); TableColumn modifierColumn = fieldsTable.getColumnModel().getColumn(3); ComboBox<String> modifierCombobox = new ComboBox<>(); List<String> typeList = languageResolver.getSupportTypeList(); for (int i = 0; i < typeList.size(); i++) { modifierCombobox.addItem(typeList.get(i)); } modifierColumn.setCellEditor(new DefaultCellEditor(modifierCombobox)); DefaultTableCellRenderer centerRenderer = new DefaultTableCellRenderer(); centerRenderer.setHorizontalAlignment(JLabel.CENTER); for (int i = 2; i < columns.length; i++) { fieldsTable.getColumnModel().getColumn(i).setCellRenderer(centerRenderer); } }
Example #6
Source File: WriteRulesDialog.java From PackageTemplates with Apache License 2.0 | 6 votes |
@Override public void preShow() { panel.setLayout(new MigLayout(new LC().gridGap("0", "8pt"))); //Type ArrayList<WriteRules> actionTypes = new ArrayList<>(); if(hasParent){ actionTypes.add(WriteRules.FROM_PARENT); } actionTypes.add(WriteRules.USE_EXISTING); actionTypes.add(WriteRules.ASK_ME); actionTypes.add(WriteRules.OVERWRITE); comboBoxRules = new ComboBox(actionTypes.toArray()); comboBoxRules.setRenderer(new WriteRulesCellRenderer()); comboBoxRules.setSelectedItem(writeRules); panel.add(comboBoxRules, new CC().pushX().growX().spanX().gapY("10","10")); }
Example #7
Source File: BlazeIntellijPluginConfiguration.java From intellij with Apache License 2.0 | 6 votes |
public BlazeIntellijPluginConfigurationSettingsEditor( Iterable<Label> javaLabels, RunConfigurationStateEditor blazeFlagsEditor, RunConfigurationStateEditor exeFlagsEditor) { targetCombo = new ComboBox<>( new DefaultComboBoxModel<>( Ordering.usingToString().sortedCopy(javaLabels).toArray(new Label[0]))); targetCombo.setRenderer( new ListCellRendererWrapper<Label>() { @Override public void customize( JList list, @Nullable Label value, int index, boolean selected, boolean hasFocus) { setText(value == null ? null : value.toString()); } }); this.blazeFlagsEditor = blazeFlagsEditor; this.exeFlagsEditor = exeFlagsEditor; ProjectSdksModel sdksModel = new ProjectSdksModel(); sdksModel.reset(null); sdkCombo = new JdkComboBox(sdksModel, IdeaJdkHelper::isIdeaJdkType); keepInSyncCheckBox = new JBCheckBox("Keep in sync with source XML"); keepInSyncCheckBox.addItemListener(e -> updateEnabledStatus()); }
Example #8
Source File: SearchPanel.java From KodeBeagle with Apache License 2.0 | 6 votes |
private void createFields() { kbApiURLComboBox = new ComboBox(); kbApiURLComboBox.setEditable(true); kbApiURLComboBox.setVisible(true); kbApiURLOverrideCheckBox = new JCheckBox(); kbApiURLOverrideCheckBox.setVisible(true); kbApiURLOverrideCheckBox.setText(OVERRIDE); kbApiURLOverrideCheckBox.addActionListener(new ActionListener() { @Override public void actionPerformed(final ActionEvent e) { if (kbApiURLComboBox.isEnabled()) { kbApiURLComboBox.setEnabled(false); kbApiURLComboBox.setSelectedItem(RefreshActionBase.KODEBEAGLE_API_URL_DEFAULT); } else { kbApiURLComboBox.setEnabled(true); kbApiURLComboBox.requestFocus(); } } }); }
Example #9
Source File: StreamConfigurationPanel.java From JHelper with GNU Lesser General Public License v3.0 | 6 votes |
public StreamConfigurationPanel( StreamConfiguration configuration, StreamConfiguration.StreamType[] allowedTypes, String defaultFileName, SizeChangedListener listener ) { super(new VerticalLayout()); type = new ComboBox<>(allowedTypes); type.setSelectedItem(configuration.type); type.addActionListener( e -> { fileName.setVisible(((StreamConfiguration.StreamType) type.getSelectedItem()).hasStringParameter); if (listener != null) { listener.sizeChanged(); } } ); fileName = new JTextField(configuration.type.hasStringParameter ? configuration.fileName : defaultFileName); fileName.setVisible(((StreamConfiguration.StreamType) type.getSelectedItem()).hasStringParameter); add(type); add(fileName); }
Example #10
Source File: SelectOwner.java From floobits-intellij with Apache License 2.0 | 6 votes |
protected SelectOwner(List<String> title, RunLater<String> runLater) { super(true); jPanel = new JPanel(); this.runLater = runLater; init(); this.setTitle("Select Workspace Owner"); Object[] organizations = title.toArray(); orgList = new ComboBox(organizations, 200); if (organizations.length > 0) { orgList.setSelectedIndex(0); } JLabel jLabel = new JLabel(); jLabel.setText("Select the owner for the workspace:"); jPanel.add(jLabel); jPanel.add(orgList); }
Example #11
Source File: KeymapPanel.java From consulo with Apache License 2.0 | 6 votes |
private JPanel createKeymapListPanel() { JPanel panel = new JPanel(); panel.setLayout(new GridBagLayout()); myKeymapList = new ComboBox(myKeymapListModel); myKeymapList.setEditor(new MyEditor()); myKeymapList.setRenderer(new MyKeymapRenderer(myKeymapList.getRenderer())); JLabel keymapLabel = new JLabel(KeyMapBundle.message("keymaps.border.factory.title")); keymapLabel.setLabelFor(myKeymapList); panel.add(keymapLabel, new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); panel.add(myKeymapList, new GridBagConstraints(1, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 4, 0, 0), 0, 0)); panel.add(createKeymapButtonsPanel(), new GridBagConstraints(2, 0, 1, 1, 0, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0)); myKeymapList.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { if (myKeymapListModel.getSelectedItem() != mySelectedKeymap) processCurrentKeymapChanged(getCurrentQuickListIds()); } }); panel.add(createKeymapNamePanel(), new GridBagConstraints(3, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 10, 0, 0), 0, 0)); return panel; }
Example #12
Source File: CleanUnshelvedFilterDialog.java From consulo with Apache License 2.0 | 6 votes |
public CleanUnshelvedFilterDialog(@Nullable Project project) { super(project); setTitle("Clean Unshelved Changelists"); mySystemUnshelvedButton = new JRadioButton("created automatically", true); myUnshelvedWithFilterButton = new JRadioButton("older than one", false); myAllUnshelvedButton = new JRadioButton("all", false); myTimePeriodComboBox = new ComboBox(new EnumComboBoxModel<>(TimePeriod.class)); myTimePeriodComboBox.setEnabled(myUnshelvedWithFilterButton.isSelected()); myUnshelvedWithFilterButton.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent e) { myTimePeriodComboBox.setEnabled(myUnshelvedWithFilterButton.isSelected()); } }); setOKButtonText("Delete"); init(); setResizable(false); }
Example #13
Source File: CreateNewLibraryDialog.java From consulo with Apache License 2.0 | 6 votes |
public CreateNewLibraryDialog(@Nonnull JComponent parent, @Nonnull StructureConfigurableContext context, @Nonnull NewLibraryEditor libraryEditor, @Nonnull List<LibraryTable> libraryTables, int selectedTable) { super(parent, new LibraryRootsComponent(context.getProject(), libraryEditor)); myContext = context; myLibraryEditor = libraryEditor; final DefaultComboBoxModel model = new DefaultComboBoxModel(); for (LibraryTable table : libraryTables) { model.addElement(table); } myLibraryLevelCombobox = new ComboBox(model); myLibraryLevelCombobox.setSelectedIndex(selectedTable); myLibraryLevelCombobox.setRenderer(new ListCellRendererWrapper() { @Override public void customize(JList list, Object value, int index, boolean selected, boolean hasFocus) { if (value instanceof LibraryTable) { setText(((LibraryTable)value).getPresentation().getDisplayName(false)); } } }); init(); }
Example #14
Source File: ArtifactConfigurable.java From consulo with Apache License 2.0 | 6 votes |
@Override protected JComponent createTopRightComponent(final JTextField nameField) { final ComboBox artifactTypeBox = new ComboBox(); for (ArtifactType type : ArtifactType.EP_NAME.getExtensions()) { artifactTypeBox.addItem(type); } artifactTypeBox.setRenderer(new ArtifactTypeCellRenderer()); artifactTypeBox.setSelectedItem(getArtifact().getArtifactType()); artifactTypeBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final ArtifactType selected = (ArtifactType)artifactTypeBox.getSelectedItem(); if (selected != null && !Comparing.equal(selected, getArtifact().getArtifactType())) { getEditor().setArtifactType(selected); } } }); return LabeledComponent.left(artifactTypeBox, "Type"); }
Example #15
Source File: ScopeChooserCombo.java From consulo with Apache License 2.0 | 6 votes |
public void init(final Project project, final boolean suggestSearchInLibs, final boolean prevSearchWholeFiles, final Object selection, @Nullable Condition<? super ScopeDescriptor> scopeFilter) { if (myProject != null) { throw new IllegalStateException("scope chooser combo already initialized"); } myOptions = BitUtil.set(myOptions, OPT_LIBRARIES, suggestSearchInLibs); myOptions = BitUtil.set(myOptions, OPT_SEARCH_RESULTS, prevSearchWholeFiles); myProject = project; NamedScopesHolder.ScopeListener scopeListener = () -> { SearchScope selectedScope = getSelectedScope(); rebuildModelAndSelectScopeOnSuccess(selectedScope); }; myScopeFilter = scopeFilter; NamedScopeManager.getInstance(project).addScopeListener(scopeListener, this); DependencyValidationManager.getInstance(project).addScopeListener(scopeListener, this); addActionListener(this::handleScopeChooserAction); ComboBox<ScopeDescriptor> combo = getComboBox(); combo.setMinimumAndPreferredWidth(JBUIScale.scale(300)); combo.setRenderer(createDefaultRenderer()); combo.setSwingPopup(false); rebuildModelAndSelectScopeOnSuccess(selection); }
Example #16
Source File: NameSuggestionsField.java From consulo with Apache License 2.0 | 6 votes |
private void setupComboBox(final ComboBox combobox, FileType fileType) { final EditorComboBoxEditor comboEditor = new StringComboboxEditor(myProject, fileType, combobox) { @Override public void setItem(Object anObject) { myNonHumanChange = true; super.setItem(anObject); } }; combobox.setEditor(comboEditor); combobox.setRenderer(new EditorComboBoxRenderer(comboEditor)); combobox.setEditable(true); combobox.setMaximumRowCount(8); comboEditor.selectAll(); }
Example #17
Source File: NameSuggestionsField.java From consulo with Apache License 2.0 | 5 votes |
public NameSuggestionsField(Project project) { super(new BorderLayout()); myProject = project; myComboBoxModel = new MyComboBoxModel(); final ComboBox comboBox = new ComboBox(myComboBoxModel,-1); myComponent = comboBox; add(myComponent, BorderLayout.CENTER); setupComboBox(comboBox, InternalStdFileTypes.JAVA); }
Example #18
Source File: QuarkusModuleInfoStep.java From intellij-quarkus with Eclipse Public License 2.0 | 5 votes |
@Override public void _init() { ProgressIndicator indicator = new EmptyProgressIndicator() { @Override public void setText(String text) { SwingUtilities.invokeLater(() -> panel.setLoadingText(text)); } }; try { QuarkusModel model = QuarkusModelRegistry.INSTANCE.load(context.getUserData(QuarkusConstants.WIZARD_ENDPOINT_URL_KEY), indicator); context.putUserData(QuarkusConstants.WIZARD_MODEL_KEY, model); final FormBuilder formBuilder = new FormBuilder(); final CollectionComboBoxModel<ToolDelegate> toolModel = new CollectionComboBoxModel<>(Arrays.asList(ToolDelegate.getDelegates())); toolComboBox = new ComboBox<>(toolModel); toolComboBox.setRenderer(new ColoredListCellRenderer<ToolDelegate>() { @Override protected void customizeCellRenderer(@NotNull JList<? extends ToolDelegate> list, ToolDelegate toolDelegate, int index, boolean selected, boolean hasFocus) { this.append(toolDelegate.getDisplay()); } }); formBuilder.addLabeledComponent("Tool:", toolComboBox); groupIdField = new JBTextField("org.acme"); formBuilder.addLabeledComponent("Group:", groupIdField); artifactIdField = new JBTextField("code-with-quarkus"); formBuilder.addLabeledComponent("Artifact:", artifactIdField); versionField = new JBTextField("1.0.0-SNAPSHOT"); formBuilder.addLabeledComponent("Version:", versionField); classNameField = new JBTextField("org.acme.ExampleResource"); formBuilder.addLabeledComponent("Class name:", classNameField); pathField = new JBTextField("/hello"); formBuilder.addLabeledComponent("Path:", pathField); panel.add(ScrollPaneFactory.createScrollPane(formBuilder.getPanel(), true), "North"); } catch (IOException e) { LOGGER.error(e.getLocalizedMessage(), e); throw new RuntimeException(e); } }
Example #19
Source File: RevealingSpaceComboboxEditor.java From consulo with Apache License 2.0 | 5 votes |
public RevealingSpaceComboboxEditor(final Project project, ComboBox comboBox) { super(project, PlainTextFileType.INSTANCE, comboBox); SwingUtilities.invokeLater(new Runnable() { @Override public void run() { Editor editor = getEditor(); if (editor != null) { editor.getSettings().setWhitespacesShown(true); } } }); }
Example #20
Source File: LocalToServerSettingsEditor.java From consulo with Apache License 2.0 | 5 votes |
public LocalToServerSettingsEditor(final ServerType<S> type, DeploymentConfigurator<D> deploymentConfigurator, Project project) { myServerType = type; myDeploymentConfigurator = deploymentConfigurator; myProject = project; mySourceListModel = new SortedComboBoxModel<DeploymentSource>(new Comparator<DeploymentSource>() { @Override public int compare(DeploymentSource o1, DeploymentSource o2) { return o1.getPresentableName().compareToIgnoreCase(o2.getPresentableName()); } }); mySourceListModel.addAll(deploymentConfigurator.getAvailableDeploymentSources()); mySourceComboBox = new ComboBox(mySourceListModel); mySourceComboBox.setRenderer(new ColoredListCellRenderer<DeploymentSource>() { @Override protected void customizeCellRenderer(@Nonnull JList list, DeploymentSource value, int index, boolean selected, boolean hasFocus) { if (value == null) return; setIcon(value.getIcon()); append(value.getPresentableName()); } }); myDeploymentSettingsComponent = new JPanel(new BorderLayout()); mySourceComboBox.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { onDeploymentSourceChanged(null); } }); }
Example #21
Source File: SettingConfigurable.java From AndroidStringsOneTabTranslation with Apache License 2.0 | 5 votes |
@Nullable @Override public JComponent createComponent() { if (settingPanel == null) { settingPanel = new JPanel(new VerticalLayout(18)); // header UI Container container = new Container(); container.setLayout(new BorderLayout()); currentEngine = TranslationEngineType.fromName( PropertiesComponent.getInstance().getValue(StorageDataKey.SettingLanguageEngine)); TranslationEngineType[] items = TranslationEngineType.getLanguageEngineArray(); languageEngineBox = new ComboBox(items); languageEngineBox.setEnabled(true); languageEngineBox.setSelectedItem(currentEngine); languageEngineBox.addActionListener(this); container.add(new JLabel("Language engine: "), BorderLayout.WEST); container.add(languageEngineBox, BorderLayout.CENTER); settingPanel.add(container); initContentContainer(); initAndAddFilterContainer(); } return settingPanel; }
Example #22
Source File: SelectAccount.java From floobits-intellij with Apache License 2.0 | 5 votes |
public SelectAccount(@Nullable Project project, String[] accounts) { super(project); setTitle("Select a Floobits Account"); contentPanel = new JPanel(); cccccomboBox = new ComboBox(new DefaultComboBoxModel(accounts)); if (accounts.length > 0) { cccccomboBox.setSelectedIndex(0); } contentPanel.add(cccccomboBox); JLabel label = new JLabel("Select Account"); contentPanel.add(label); init(); }
Example #23
Source File: ServiceArgumentSelectionDialog.java From idea-php-symfony2-plugin with MIT License | 5 votes |
@Nullable @Override public TableCellEditor getEditor(ServiceParameter modelParameter) { Set<String> sorted = modelParameter.getPossibleServices(); ComboBox comboBox = new ComboBox(sorted.toArray(new String[sorted.size()] ), 200); comboBox.setEditable(true); return new DefaultCellEditor(comboBox); }
Example #24
Source File: SymfonyCreateService.java From idea-php-symfony2-plugin with MIT License | 5 votes |
@Nullable @Override public TableCellEditor getEditor(MethodParameter.MethodModelParameter modelParameter) { Set<String> sorted = modelParameter.getPossibleServices(); ComboBox comboBox = new ComboBox(sorted.toArray(new String[sorted.size()] ), 200); comboBox.setEditable(true); return new DefaultCellEditor(comboBox); }
Example #25
Source File: SettingsDialog.java From PackageTemplates with Apache License 2.0 | 5 votes |
private void createLanguageViews() { jlLanguage = new JLabel(Localizer.get("settings.Language")); comboLanguages = new ComboBox(new EnumComboBoxModel<>(Language.class)); if (SaveUtil.reader().getLanguage() != null) { comboLanguages.setSelectedItem(SaveUtil.reader().getLanguage()); } }
Example #26
Source File: Base64EncodingDialog.java From StringManipulation with Apache License 2.0 | 5 votes |
private void createUIComponents() { model = new DefaultComboBoxModel(new String[]{ "UTF-8", "ASCII", "CP1256", "ISO-8859-1", "ISO-8859-2", "ISO-8859-6", "ISO-8859-15", "Windows-1252"}); myComboBox = new ComboBox(model, 20); myComboBox.setEditable(true); myComboBox.setOpaque(true); defaultColor = myComboBox.getForeground(); myComboBox.setSelectedItem("UTF-8"); final JTextComponent tc = (JTextComponent) myComboBox.getEditor().getEditorComponent(); tc.getDocument().addDocumentListener(new DocumentAdapter() { @Override protected void textChanged(DocumentEvent documentEvent) { JTextField editorJComp = (JTextField) myComboBox.getEditor().getEditorComponent(); try { Charset instance = Charset.forName(getCharset()); editorJComp.setForeground(defaultColor); } catch (Exception ee) { editorJComp.setForeground(JBColor.RED); } } }); }
Example #27
Source File: AbstractAddDialog.java From nosql4idea with Apache License 2.0 | 5 votes |
void initCombo(final ComboBox combobox, final JPanel parentPanel) { combobox.setModel(new DefaultComboBoxModel(JsonDataType.values())); combobox.setRenderer(new ColoredListCellRenderer() { @Override protected void customizeCellRenderer(JList jList, Object o, int i, boolean b, boolean b2) { append(((JsonDataType) o).type); } }); combobox.setSelectedItem(null); combobox.addItemListener(new ItemListener() { @Override public void itemStateChanged(ItemEvent itemEvent) { JsonDataType selectedType = (JsonDataType) combobox.getSelectedItem(); currentEditor = UI_COMPONENT_BY_JSON_DATATYPE.get(selectedType); currentEditor.reset(); parentPanel.invalidate(); parentPanel.removeAll(); parentPanel.add(currentEditor.getComponent(), BorderLayout.CENTER); parentPanel.validate(); } }); combobox.setSelectedItem(JsonDataType.STRING); }
Example #28
Source File: SdkVersionSelectionDialog.java From mule-intellij-plugins with Apache License 2.0 | 5 votes |
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(); }
Example #29
Source File: TaskSettingsComponent.java From JHelper with GNU Lesser General Public License v3.0 | 5 votes |
public void setTaskData(TaskData taskData) { removeAll(); name = new JTextField(taskData.getName()); name.setEnabled(canChangeName); className = new JTextField(taskData.getClassName()); cppPath = new FileSelector( project, taskData.getCppPath(), RelativeFileChooserDescriptor.fileChooser(project.getBaseDir()) ); input = new StreamConfigurationPanel( taskData.getInput(), StreamConfiguration.StreamType.values(), "input.txt", listener ); output = new StreamConfigurationPanel( taskData.getOutput(), StreamConfiguration.OUTPUT_TYPES, "output.txt", listener ); testType = new ComboBox<>(TestType.values()); testType.setSelectedItem(taskData.getTestType()); add(LabeledComponent.create(name, "Task name")); add(LabeledComponent.create(className, "Class name")); add(LabeledComponent.create(cppPath, "Path")); add(LabeledComponent.create(input, "Input")); add(LabeledComponent.create(output, "Output")); add(LabeledComponent.create(testType, "Test type")); UIUtils.mirrorFields(name, className); UIUtils.mirrorFields(name, cppPath.getTextField(), TaskData.defaultCppPathFormat(project)); }
Example #30
Source File: DvcsStrategyPanel.java From consulo with Apache License 2.0 | 5 votes |
public DvcsStrategyPanel() { setLayout(new BorderLayout()); myReferenceStrategyCombobox = new ComboBox(); DefaultComboBoxModel comboModel = new DefaultComboBoxModel(VcsPushReferenceStrategy.values()); myReferenceStrategyCombobox.setModel(comboModel); JPanel bottomPanel = new JPanel(new FlowLayout()); JLabel referenceStrategyLabel = new JLabel("Push Reference Strategy: "); bottomPanel.add(referenceStrategyLabel, FlowLayout.LEFT); bottomPanel.add(myReferenceStrategyCombobox); add(bottomPanel, BorderLayout.WEST); }