use of com.intellij.openapi.ui.ComboBox in project intellij-community by JetBrains.
the class GitlabRepositoryEditor method createCustomPanel.
@Nullable
@Override
protected JComponent createCustomPanel() {
myProjectLabel = new JBLabel("Project:", SwingConstants.RIGHT);
myProjectComboBox = new ComboBox(300);
myProjectComboBox.setRenderer(new TaskUiUtil.SimpleComboBoxRenderer("Set server URL and token first"));
myProjectLabel.setLabelFor(myProjectComboBox);
return new FormBuilder().addLabeledComponent(myProjectLabel, myProjectComboBox).getPanel();
}
use of com.intellij.openapi.ui.ComboBox in project intellij-community by JetBrains.
the class MantisRepositoryEditor method createCustomPanel.
@Nullable
@Override
protected JComponent createCustomPanel() {
myProjectLabel = new JBLabel("Project:", SwingConstants.RIGHT);
myProjectCombobox = new ComboBox(200);
myProjectCombobox.setRenderer(new TaskUiUtil.SimpleComboBoxRenderer("Login first"));
myFilterLabel = new JBLabel("Filter:", SwingConstants.RIGHT);
myFilterCombobox = new ComboBox(200);
myFilterCombobox.setRenderer(new TaskUiUtil.SimpleComboBoxRenderer("Login first"));
return FormBuilder.createFormBuilder().addLabeledComponent(myProjectLabel, myProjectCombobox).addLabeledComponent(myFilterLabel, myFilterCombobox).getPanel();
}
use of com.intellij.openapi.ui.ComboBox in project intellij-community by JetBrains.
the class PyActiveSdkConfigurable method layoutPanel.
private void layoutPanel() {
final GridBagLayout layout = new GridBagLayout();
myMainPanel = new JPanel(layout);
final JLabel interpreterLabel = new JLabel(PyBundle.message("active.sdk.dialog.project.interpreter"));
final JLabel emptyLabel = new JLabel(" ");
mySdkCombo = new ComboBox() {
@Override
public void setSelectedItem(Object item) {
if (SHOW_ALL.equals(item)) {
ApplicationManager.getApplication().invokeLater(() -> {
PythonSdkDetailsDialog moreDialog = myModule == null ? new PythonSdkDetailsDialog(myProject, myAddSdkCallback, getSettingsModifiedCallback()) : new PythonSdkDetailsDialog(myModule, myAddSdkCallback, getSettingsModifiedCallback());
moreDialog.show();
});
return;
}
if (!PySdkListCellRenderer.SEPARATOR.equals(item))
super.setSelectedItem(item);
}
@Override
public void paint(Graphics g) {
try {
putClientProperty("JComboBox.isTableCellEditor", Boolean.FALSE);
super.paint(g);
} finally {
putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
}
}
};
mySdkCombo.putClientProperty("JComboBox.isTableCellEditor", Boolean.TRUE);
final PackagesNotificationPanel notificationsArea = new PackagesNotificationPanel();
final JComponent notificationsComponent = notificationsArea.getComponent();
final Dimension preferredSize = mySdkCombo.getPreferredSize();
mySdkCombo.setPreferredSize(preferredSize);
notificationsArea.hide();
myDetailsButton = new FixedSizeButton();
myDetailsButton.setIcon(PythonIcons.Python.InterpreterGear);
//noinspection SuspiciousNameCombination
myDetailsButton.setPreferredSize(new Dimension(preferredSize.height, preferredSize.height));
myPackagesPanel = new PyInstalledPackagesPanel(myProject, notificationsArea);
final GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
c.insets = new Insets(2, 2, 2, 2);
c.gridx = 0;
c.gridy = 0;
myMainPanel.add(interpreterLabel, c);
c.gridx = 1;
c.gridy = 0;
c.weightx = 0.1;
myMainPanel.add(mySdkCombo, c);
c.insets = new Insets(2, 0, 2, 2);
c.gridx = 2;
c.gridy = 0;
c.weightx = 0.0;
myMainPanel.add(myDetailsButton, c);
final PyCustomSdkUiProvider customUiProvider = PyCustomSdkUiProvider.getInstance();
if (customUiProvider != null) {
myDisposable = Disposer.newDisposable();
customUiProvider.customizeActiveSdkPanel(myProject, mySdkCombo, myMainPanel, c, myDisposable);
}
c.insets = new Insets(2, 2, 0, 2);
c.gridx = 0;
c.gridy++;
c.gridwidth = 3;
c.weightx = 0.0;
myMainPanel.add(emptyLabel, c);
c.gridx = 0;
c.gridy++;
c.weighty = 1.;
c.gridwidth = 3;
c.gridheight = GridBagConstraints.RELATIVE;
c.fill = GridBagConstraints.BOTH;
myMainPanel.add(myPackagesPanel, c);
c.gridheight = GridBagConstraints.REMAINDER;
c.gridx = 0;
c.gridy++;
c.gridwidth = 3;
c.weighty = 0.;
c.fill = GridBagConstraints.HORIZONTAL;
c.anchor = GridBagConstraints.SOUTH;
myMainPanel.add(notificationsComponent, c);
}
use of com.intellij.openapi.ui.ComboBox in project intellij-community by JetBrains.
the class SetBackgroundImageDialog method createUIComponents.
private void createUIComponents() {
ComboBox<String> comboBox = new ComboBox<>(new CollectionComboBoxModel<String>(), 100);
myPathField = new ComboboxWithBrowseButton(comboBox);
}
use of com.intellij.openapi.ui.ComboBox in project intellij-community by JetBrains.
the class FullyQualifiedNamesInJavadocOptionProvider method composePanel.
private void composePanel() {
myPanel = new JPanel(new GridBagLayout());
myComboBox = new ComboBox();
for (QualifyJavadocOptions options : QualifyJavadocOptions.values()) {
myComboBox.addItem(options);
}
myComboBox.setRenderer(new ListCellRendererWrapper() {
@Override
public void customize(final JList list, final Object value, final int index, final boolean selected, final boolean hasFocus) {
if (value instanceof QualifyJavadocOptions) {
setText(((QualifyJavadocOptions) value).getPresentableText());
}
}
});
JLabel title = new JLabel(ApplicationBundle.message("radio.use.fully.qualified.class.names.in.javadoc"));
myPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 0));
GridBagConstraints left = new GridBagConstraints();
left.anchor = GridBagConstraints.WEST;
GridBagConstraints right = new GridBagConstraints();
right.anchor = GridBagConstraints.WEST;
right.weightx = 1.0;
right.insets = JBUI.insetsLeft(5);
myPanel.add(title, left);
myPanel.add(myComboBox, right);
}
Aggregations