use of com.intellij.util.ui.FormBuilder in project Perl5-IDEA by Camelcade.
the class MasonSettingsConfigurable method createComponent.
@Nullable
@Override
public JComponent createComponent() {
FormBuilder builder = FormBuilder.createFormBuilder();
builder.getPanel().setLayout(new VerticalFlowLayout());
createGlobalsComponent(builder);
createAutobaseNamesComponent(builder);
return builder.getPanel();
}
use of com.intellij.util.ui.FormBuilder in project Perl5-IDEA by Camelcade.
the class HTMLMasonSettingsConfigurable method createCustomTagsComponent.
protected void createCustomTagsComponent(FormBuilder builder) {
myTagNameColumnInfo myTagNameColumnInfo = new myTagNameColumnInfo();
customTagsModel = new ListTableModel<>(myTagNameColumnInfo, new myTagRoleColumInfo());
myTagNameColumnInfo.setCustomTagsModel(customTagsModel);
customTagsTable = new JBTable(customTagsModel);
final TableColumn secondColumn = customTagsTable.getColumnModel().getColumn(1);
ComboBoxTableRenderer<HTMLMasonCustomTagRole> roleComboBoxTableRenderer = new ComboBoxTableRenderer<HTMLMasonCustomTagRole>(HTMLMasonCustomTagRole.values()) {
@Override
protected String getTextFor(@NotNull HTMLMasonCustomTagRole value) {
return value.getTitle();
}
@Override
public boolean isCellEditable(EventObject event) {
if (event instanceof MouseEvent) {
return ((MouseEvent) event).getClickCount() >= 1;
}
return true;
}
};
secondColumn.setCellRenderer(roleComboBoxTableRenderer);
secondColumn.setCellEditor(roleComboBoxTableRenderer);
builder.addLabeledComponent(new JLabel("Custom tags that mimics built-in HTML::Mason tags:"), ToolbarDecorator.createDecorator(customTagsTable).setAddAction(anActionButton -> {
final TableCellEditor cellEditor = customTagsTable.getCellEditor();
if (cellEditor != null) {
cellEditor.stopCellEditing();
}
final TableModel model = customTagsTable.getModel();
int indexToEdit = -1;
for (HTMLMasonCustomTag entry : customTagsModel.getItems()) {
if (StringUtil.isEmpty(entry.getText())) {
indexToEdit = customTagsModel.indexOf(entry);
break;
}
}
if (indexToEdit == -1) {
customTagsModel.addRow(new HTMLMasonCustomTag("customTag" + customTagsModel.getItems().size(), HTMLMasonCustomTagRole.PERL));
indexToEdit = model.getRowCount() - 1;
}
TableUtil.editCellAt(customTagsTable, indexToEdit, 0);
}).disableDownAction().disableUpAction().setPreferredSize(JBUI.size(0, PerlConfigurationUtil.WIDGET_HEIGHT)).createPanel());
}
use of com.intellij.util.ui.FormBuilder in project Perl5-IDEA by Camelcade.
the class HTMLMasonSettingsConfigurable method createComponent.
@Nullable
@Override
public JComponent createComponent() {
FormBuilder builder = FormBuilder.createFormBuilder();
builder.getPanel().setLayout(new VerticalFlowLayout());
defaulthandlerName = new JTextField();
builder.addLabeledComponent(new JLabel("Default handler name:"), defaulthandlerName);
autohandlerName = new JTextField();
builder.addLabeledComponent(new JLabel("Auto-handler name:"), autohandlerName);
createGlobalsComponent(builder);
createSubstitutedExtensionsComponent(builder);
createCustomTagsComponent(builder);
return builder.getPanel();
}
use of com.intellij.util.ui.FormBuilder in project azure-tools-for-java by Microsoft.
the class FunctionTriggerChooserStep method getComponent.
@Override
public JComponent getComponent() {
final FormBuilder builder = new FormBuilder();
builder.addComponent(new JBLabel("Choose Functions Triggers:"));
triggerList = new CheckBoxList<>();
setupFunctionTriggers();
final BorderLayoutPanel customPanel = JBUI.Panels.simplePanel(10, 0);
customPanel.addToTop(triggerList);
builder.addComponent(customPanel);
final JPanel panel = new JPanel(new BorderLayout());
panel.add(builder.getPanel(), "North");
return panel;
}
Aggregations