use of com.intellij.openapi.ui.LabeledComponent in project intellij-community by JetBrains.
the class DependsOnGroupsInspection method createOptionsPanel.
@Override
@Nullable
public JComponent createOptionsPanel() {
final LabeledComponent<JTextField> definedGroups = new LabeledComponent<>();
definedGroups.setText("&Defined Groups");
final JTextField textField = new JTextField(StringUtil.join(ArrayUtil.toStringArray(groups), ","));
textField.getDocument().addDocumentListener(new DocumentAdapter() {
@Override
protected void textChanged(final DocumentEvent e) {
groups.clear();
String text = textField.getText();
if (!StringUtil.isEmptyOrSpaces(text)) {
ContainerUtil.addAll(groups, text.split("[, ]"));
}
}
});
definedGroups.setComponent(textField);
final JPanel optionsPanel = new JPanel(new BorderLayout());
optionsPanel.add(definedGroups, BorderLayout.NORTH);
return optionsPanel;
}
Aggregations