use of com.intellij.openapi.ui.VerticalFlowLayout 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.openapi.ui.VerticalFlowLayout in project Perl5-IDEA by Camelcade.
the class PerlContentEntriesTreeEditor method createComponent.
@NotNull
@Override
public JComponent createComponent() {
JPanel panel = new JPanel(new VerticalFlowLayout());
panel.add(myTreePanel);
return panel;
}
use of com.intellij.openapi.ui.VerticalFlowLayout in project sonarlint-intellij by SonarSource.
the class SonarLintAboutPanel method createTelemetryPanel.
private JComponent createTelemetryPanel() {
// tooltip
final HyperlinkLabel link = new HyperlinkLabel("");
link.setHyperlinkText("See a ", "sample of the data", "");
link.addHyperlinkListener(new HyperlinkAdapter() {
@Override
protected void hyperlinkActivated(HyperlinkEvent e) {
final JLabel label = new JLabel("<html><pre>{\n" + " \"days_since_installation\": 120,\n" + " \"days_of_use\": 40,\n" + " \"sonarlint_version\": \"2.9\",\n" + " \"sonarlint_product\": \"SonarLint IntelliJ\",\n" + " \"connected_mode_used\": true\n" + " \"system_time\":\"2018-06-27T16:31:49.173+01:00\",\n" + " \"install_time\":\"2018-02-27T16:30:49.124+01:00\"\n" + " \"analyses\":[{\"language\":\"java\",\"rate_per_duration\":{\"0-300\":100,\"300-500\":0,\"500-1000\":0,\"1000-2000\":0,\"2000-4000\":0,\"4000+\":0}}]\n" + "}</pre><html>");
label.setBorder(HintUtil.createHintBorder());
label.setBackground(HintUtil.INFORMATION_COLOR);
label.setOpaque(true);
HintManager.getInstance().showHint(label, RelativePoint.getNorthWestOf(link), HintManager.HIDE_BY_ANY_KEY | HintManager.HIDE_BY_TEXT_CHANGE, -1);
}
});
// info
JBLabel info = new JBLabel("<html>By sharing anonymous SonarLint usage statistics, you help us understand how SonarLint is used so " + "we can improve the plugin to work even better for you. We don't collect source code, IP addresses, or any personally identifying " + "information. And we don't share the data with anyone else.</html>");
// checkbox
enableCheckBox = new JCheckBox("Share anonymous SonarLint statistics");
enableCheckBox.setFocusable(false);
JPanel tickOptions = new JPanel(new VerticalFlowLayout());
tickOptions.setBorder(BorderFactory.createEmptyBorder(0, 0, 4, 0));
tickOptions.add(enableCheckBox);
// all telemetry together
JPanel infoPanel = new JPanel(new GridBagLayout());
infoPanel.setBorder(IdeBorderFactory.createTitledBorder("Statistics"));
GridBagConstraints c = new GridBagConstraints();
c.gridheight = 1;
c.gridx = 0;
c.gridy = 0;
c.anchor = GridBagConstraints.NORTH;
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 1.0f;
infoPanel.add(info, c);
c.gridy = 1;
c.anchor = GridBagConstraints.WEST;
c.fill = GridBagConstraints.HORIZONTAL;
infoPanel.add(link, c);
c.gridy = 2;
c.weighty = 1.0f;
c.anchor = GridBagConstraints.WEST;
c.fill = GridBagConstraints.BOTH;
infoPanel.add(tickOptions, c);
return infoPanel;
}
use of com.intellij.openapi.ui.VerticalFlowLayout in project sonarlint-intellij by SonarSource.
the class SonarLintGlobalOptionsPanel method createTopPanel.
private JPanel createTopPanel() {
autoTrigger = new JCheckBox("Automatically trigger analysis");
autoTrigger.setFocusable(false);
JPanel tickOptions = new JPanel(new VerticalFlowLayout());
tickOptions.setBorder(BorderFactory.createEmptyBorder(0, 0, 4, 0));
tickOptions.add(autoTrigger);
return tickOptions;
}
use of com.intellij.openapi.ui.VerticalFlowLayout in project android by JetBrains.
the class DeviceConfiguratorPanel method createUIComponents.
private void createUIComponents() {
myQualifierOptionsPanel = new JPanel(new CardLayout());
final JPanel leftPanel = new JPanel(new BorderLayout(JBUI.scale(5), JBUI.scale(5)));
myAvailableQualifiersList = new JBList();
myAvailableQualifiersList.setMinimumSize(JBUI.size(10, 10));
JBLabel label = new JBLabel(AndroidBundle.message("android.layout.preview.edit.configuration.available.qualifiers.label"));
label.setLabelFor(myAvailableQualifiersList);
leftPanel.add(label, BorderLayout.NORTH);
leftPanel.add(new JBScrollPane(myAvailableQualifiersList, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER), BorderLayout.CENTER);
final JPanel rightPanel = new JPanel(new BorderLayout(JBUI.scale(5), JBUI.scale(5)));
myChosenQualifiersList = new JBList();
myChosenQualifiersList.setMinimumSize(JBUI.size(10, 10));
label = new JBLabel(AndroidBundle.message("android.layout.preview.edit.configuration.choosen.qualifiers.label"));
label.setLabelFor(myChosenQualifiersList);
rightPanel.add(label, BorderLayout.NORTH);
rightPanel.add(new JBScrollPane(myChosenQualifiersList, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER), BorderLayout.CENTER);
final JPanel buttonsPanel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.MIDDLE, 0, 0, true, false));
myAddQualifierButton = new JButton(">>");
buttonsPanel.add(myAddQualifierButton);
myRemoveQualifierButton = new JButton("<<");
buttonsPanel.add(myRemoveQualifierButton);
final int gap = 5;
final JPanel listsPanel = new JPanel(new AbstractLayoutManager() {
@SuppressWarnings("NonPrivateFieldAccessedInSynchronizedContext")
@Override
public Dimension preferredLayoutSize(Container target) {
synchronized (target.getTreeLock()) {
final Dimension leftPref = leftPanel.getPreferredSize();
final Dimension rightPref = rightPanel.getPreferredSize();
final Dimension middlePref = buttonsPanel.getPreferredSize();
final Insets insets = target.getInsets();
final int width = leftPref.width + middlePref.width + rightPref.width + insets.left + insets.right + gap * 2;
final int height = Math.max(leftPref.height, Math.max(rightPref.height, middlePref.height)) + insets.top + insets.bottom;
return new Dimension(width, height);
}
}
@SuppressWarnings("NonPrivateFieldAccessedInSynchronizedContext")
@Override
public void layoutContainer(Container target) {
synchronized (target.getTreeLock()) {
final Insets insets = target.getInsets();
int top = insets.top;
int bottom = target.getHeight() - insets.bottom;
int left = insets.left;
int right = target.getWidth() - insets.right;
final int middleWidth = buttonsPanel.getPreferredSize().width + gap * 2;
final int listWidth = (right - left - middleWidth) / 2;
final int height = bottom - top;
leftPanel.setSize(listWidth, height);
rightPanel.setSize(listWidth, height);
buttonsPanel.setSize(middleWidth, height);
leftPanel.setBounds(left, top, listWidth, height);
rightPanel.setBounds(right - listWidth, top, listWidth, height);
buttonsPanel.setBounds(left + listWidth + gap, top, middleWidth - gap * 2, height);
}
}
});
listsPanel.add(leftPanel);
listsPanel.add(buttonsPanel);
listsPanel.add(rightPanel);
add(listsPanel, BorderLayout.CENTER);
add(myQualifierOptionsPanel, BorderLayout.EAST);
}
Aggregations