use of com.intellij.util.ui.FormBuilder 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.util.ui.FormBuilder in project intellij-community by JetBrains.
the class ExtractClassDialog method createNorthPanel.
protected JComponent createNorthPanel() {
final JPanel checkboxPanel = new JPanel(new BorderLayout());
checkboxPanel.add(createInner, BorderLayout.WEST);
checkboxPanel.add(extractAsEnum, BorderLayout.EAST);
FormBuilder builder = FormBuilder.createFormBuilder().addComponent(JBLabelDecorator.createJBLabelDecorator(RefactorJBundle.message("extract.class.from.label", sourceClass.getQualifiedName())).setBold(true)).addLabeledComponent(RefactorJBundle.message("name.for.new.class.label"), classNameField, UIUtil.LARGE_VGAP).addLabeledComponent(new JLabel(), checkboxPanel).addLabeledComponent(RefactorJBundle.message("package.for.new.class.label"), packageTextField);
if (JavaProjectRootsUtil.getSuitableDestinationSourceRoots(myProject).size() > 1) {
builder.addLabeledComponent(RefactoringBundle.message("target.destination.folder"), myDestinationFolderComboBox);
}
return builder.addVerticalGap(5).getPanel();
}
use of com.intellij.util.ui.FormBuilder in project Perl5-IDEA by Camelcade.
the class TemplateToolkitSettingsConfigurable method createComponent.
@Nullable
@Override
public JComponent createComponent() {
FormBuilder builder = FormBuilder.createFormBuilder();
builder.getPanel().setLayout(new VerticalFlowLayout());
builder.addLabeledComponent(PerlBundle.message("ttk2.label.opentag"), startTagField = new JTextField());
builder.addLabeledComponent(PerlBundle.message("ttk2.label.closetag"), endTagField = new JTextField());
builder.addLabeledComponent(PerlBundle.message("ttk2.label.outlinetag"), outlineTagField = new JTextField());
builder.addComponent(enableAnycaseCheckBox = new JCheckBox(PerlBundle.message("ttk2.label.enableanycase")));
// noinspection Since15
substitutedExtensionsModel = new CollectionListModel<>();
substitutedExtensionsList = new JBList<>(substitutedExtensionsModel);
substitutedExtensionsPanel = PerlConfigurationUtil.createSubstituteExtensionPanel(substitutedExtensionsModel, substitutedExtensionsList);
builder.addLabeledComponent(new JLabel(PerlBundle.message("ttk2.configuration.extension")), substitutedExtensionsPanel);
return builder.getPanel();
}
use of com.intellij.util.ui.FormBuilder in project Perl5-IDEA by Camelcade.
the class AbstractMasonSettingsConfigurable method createGlobalsComponent.
public void createGlobalsComponent(FormBuilder builder) {
globalsModel = new ListTableModel<>(new myVariableNameColumnInfo(), new myVariableTypeColumnInfo());
globalsTable = new JBTable(globalsModel);
builder.addLabeledComponent(new JLabel("Components global variables (allow_globals option):"), ToolbarDecorator.createDecorator(globalsTable).setAddAction(anActionButton -> {
final TableCellEditor cellEditor = globalsTable.getCellEditor();
if (cellEditor != null) {
cellEditor.stopCellEditing();
}
final TableModel model = globalsTable.getModel();
int indexToEdit = -1;
for (VariableDescription variableDescription : globalsModel.getItems()) {
if (StringUtil.isEmpty(variableDescription.variableName)) {
indexToEdit = globalsModel.indexOf(variableDescription);
break;
}
}
if (indexToEdit == -1) {
globalsModel.addRow(new VariableDescription());
indexToEdit = model.getRowCount() - 1;
}
TableUtil.editCellAt(globalsTable, indexToEdit, 0);
}).disableDownAction().disableUpAction().setPreferredSize(JBUI.size(0, PerlConfigurationUtil.WIDGET_HEIGHT)).createPanel());
}
use of com.intellij.util.ui.FormBuilder in project ballerina by ballerina-lang.
the class BallerinaAutoImportConfigurable method createComponent.
@Nullable
@Override
public JComponent createComponent() {
FormBuilder builder = FormBuilder.createFormBuilder();
myCbShowImportPopup = new JCheckBox(ApplicationBundle.message("checkbox.show.import.popup"));
myCbAddUnambiguousImports = new JCheckBox(ApplicationBundle.message("checkbox.add.unambiguous.imports.on.the.fly"));
builder.addComponent(myCbShowImportPopup);
builder.addComponent(myCbAddUnambiguousImports);
JPanel result = new JPanel(new BorderLayout());
result.add(builder.getPanel(), BorderLayout.NORTH);
if (myIsDialog) {
result.setPreferredSize(new Dimension(300, -1));
}
return result;
}
Aggregations