use of com.intellij.openapi.ui.MultiLineLabelUI in project intellij-community by JetBrains.
the class ChooseModulesDialog method createNorthPanel.
protected JComponent createNorthPanel() {
BorderLayoutPanel panel = JBUI.Panels.simplePanel(15, 10);
if (myIcon != null) {
JLabel iconLabel = new JLabel(myIcon);
panel.addToLeft(JBUI.Panels.simplePanel().addToTop(iconLabel));
}
BorderLayoutPanel messagePanel = JBUI.Panels.simplePanel();
if (myMessage != null) {
JLabel textLabel = new JLabel(myMessage);
textLabel.setBorder(JBUI.Borders.emptyBottom(5));
textLabel.setUI(new MultiLineLabelUI());
messagePanel.addToTop(textLabel);
}
panel.add(messagePanel, BorderLayout.CENTER);
final JScrollPane jScrollPane = ScrollPaneFactory.createScrollPane();
jScrollPane.setViewportView(myView);
jScrollPane.setPreferredSize(JBUI.size(300, 80));
panel.addToBottom(jScrollPane);
return panel;
}
use of com.intellij.openapi.ui.MultiLineLabelUI in project intellij-community by JetBrains.
the class MethodHierarchyBrowserBase method createStandardLegendPanel.
protected static JPanel createStandardLegendPanel(final String methodDefinedText, final String methodNotDefinedLegallyText, final String methodShouldBeDefined) {
final JPanel panel = new JPanel(new GridBagLayout());
final GridBagConstraints gc = new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(3, 5, 0, 5), 0, 0);
JLabel label = new JLabel(methodDefinedText, AllIcons.Hierarchy.MethodDefined, SwingConstants.LEFT);
label.setUI(new MultiLineLabelUI());
label.setIconTextGap(10);
panel.add(label, gc);
gc.gridy++;
label = new JLabel(methodNotDefinedLegallyText, AllIcons.Hierarchy.MethodNotDefined, SwingConstants.LEFT);
label.setUI(new MultiLineLabelUI());
label.setIconTextGap(10);
panel.add(label, gc);
gc.gridy++;
label = new JLabel(methodShouldBeDefined, AllIcons.Hierarchy.ShouldDefineMethod, SwingConstants.LEFT);
label.setUI(new MultiLineLabelUI());
label.setIconTextGap(10);
panel.add(label, gc);
return panel;
}
use of com.intellij.openapi.ui.MultiLineLabelUI in project intellij-community by JetBrains.
the class YesNoPreviewUsagesDialog method createNorthPanel.
protected JComponent createNorthPanel() {
JLabel label = new JLabel(myMessage);
label.setUI(new MultiLineLabelUI());
JPanel panel = new JPanel(new BorderLayout());
panel.add(label, BorderLayout.CENTER);
Icon icon = Messages.getQuestionIcon();
if (icon != null) {
label.setIcon(icon);
label.setIconTextGap(7);
}
return panel;
}
use of com.intellij.openapi.ui.MultiLineLabelUI in project intellij-community by JetBrains.
the class SourcePathsStep method createComponentForEmptyRootCase.
private JComponent createComponentForEmptyRootCase() {
final JPanel panel = new JPanel(new GridBagLayout());
final String text = IdeBundle.message("prompt.please.specify.java.sources.directory");
final JLabel label = new JLabel(text);
label.setUI(new MultiLineLabelUI());
panel.add(label, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, JBUI.insets(8, 10, 0, 10), 0, 0));
myRbCreateSource = new JRadioButton(IdeBundle.message("radio.create.source.directory"), true);
panel.add(myRbCreateSource, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, JBUI.insets(8, 10, 0, 10), 0, 0));
myTfSourceDirectoryName = new JTextField(suggestSourceDirectoryName());
final JLabel srcPathLabel = new JLabel(IdeBundle.message("prompt.enter.relative.path.to.module.content.root", File.separator));
panel.add(srcPathLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, JBUI.insets(8, 30, 0, 0), 0, 0));
final FileChooserDescriptor chooserDescriptor = FileChooserDescriptorFactory.createSingleFolderDescriptor();
chooserDescriptor.withTreeRootVisible(true);
final FieldPanel fieldPanel = createFieldPanel(myTfSourceDirectoryName, null, new BrowsePathListener(myTfSourceDirectoryName, chooserDescriptor));
panel.add(fieldPanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, JBUI.insets(8, 30, 0, 10), 0, 0));
myRbNoSource = new JRadioButton(IdeBundle.message("radio.do.not.create.source.directory"), true);
panel.add(myRbNoSource, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, JBUI.insets(8, 10, 0, 10), 0, 0));
final JLabel fullPathLabel = new JLabel(IdeBundle.message("label.source.directory"));
panel.add(fullPathLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.SOUTHWEST, GridBagConstraints.NONE, JBUI.insets(8, 10, 0, 10), 0, 0));
myTfFullPath = new JTextField();
myTfFullPath.setEditable(false);
myTfFullPath.setOpaque(false);
final Insets borderInsets = myTfFullPath.getBorder().getBorderInsets(myTfFullPath);
myTfFullPath.setBorder(BorderFactory.createEmptyBorder(borderInsets.top, borderInsets.left, borderInsets.bottom, borderInsets.right));
panel.add(myTfFullPath, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.SOUTHWEST, GridBagConstraints.HORIZONTAL, JBUI.insets(8, 10), 0, 0));
ButtonGroup group = new ButtonGroup();
group.add(myRbCreateSource);
group.add(myRbNoSource);
myTfSourceDirectoryName.getDocument().addDocumentListener(new DocumentAdapter() {
public void textChanged(DocumentEvent event) {
updateFullPathField();
}
});
myRbCreateSource.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
final boolean enabled = e.getStateChange() == ItemEvent.SELECTED;
srcPathLabel.setEnabled(enabled);
fieldPanel.setEnabled(enabled);
fullPathLabel.setVisible(enabled);
myTfFullPath.setVisible(enabled);
if (enabled) {
IdeFocusManager.getGlobalInstance().doWhenFocusSettlesDown(() -> {
IdeFocusManager.getGlobalInstance().requestFocus(myTfSourceDirectoryName, true);
});
}
}
});
return panel;
}
use of com.intellij.openapi.ui.MultiLineLabelUI in project intellij-community by JetBrains.
the class ProjectJdkStep method getComponent.
public JComponent getComponent() {
final JLabel label = new JLabel(IdeBundle.message("prompt.please.select.project.jdk"));
label.setUI(new MultiLineLabelUI());
final JPanel panel = new JPanel(new GridBagLayout()) {
public Dimension getPreferredSize() {
return new Dimension(-1, 200);
}
};
panel.add(label, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, JBUI.emptyInsets(), 0, 0));
myJDKsComponent.setBorder(BorderFactory.createEmptyBorder(4, 0, 0, 0));
panel.add(myJDKsComponent, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, JBUI.emptyInsets(), 0, 0));
return panel;
}
Aggregations