use of com.intellij.openapi.ui.MultiLineLabelUI in project intellij-community by JetBrains.
the class AddRepositoryLocationDialog method createCenterPanel.
protected JComponent createCenterPanel() {
JLabel selectText = new JLabel(message("repository.browser.add.location.prompt"));
selectText.setUI(new MultiLineLabelUI());
JPanel mainPanel = new JPanel(new GridBagLayout());
GridBagConstraints gb = new GridBagConstraints(0, 0, 1, 1, 1, 0, NORTHWEST, NONE, insets(5), 0, 0);
mainPanel.add(selectText, gb);
++gb.gridy;
myCombo = new ComboBox<>(new CollectionComboBoxModel<>(myPreviousLocations));
myCombo.setEditable(true);
myCombo.setMinimumSize(size(250, 20));
gb.fill = HORIZONTAL;
mainPanel.add(myCombo, gb);
gb.fill = NONE;
myComboField = (JTextField) myCombo.getEditor().getEditorComponent();
myComboField.addInputMethodListener(new InputMethodListener() {
public void inputMethodTextChanged(InputMethodEvent event) {
validateMe();
}
public void caretPositionChanged(InputMethodEvent event) {
validateMe();
}
});
myComboField.addKeyListener(new KeyListener() {
public void keyTyped(KeyEvent e) {
validateMe();
}
public void keyPressed(KeyEvent e) {
validateMe();
}
public void keyReleased(KeyEvent e) {
validateMe();
}
});
myCombo.addActionListener(e -> validateMe());
validateMe();
JPanel wrapper = new JPanel(new GridBagLayout());
wrapper.add(mainPanel, new GridBagConstraints(0, 0, 1, 1, 1, 1, NORTHWEST, HORIZONTAL, emptyInsets(), 0, 0));
wrapper.setPreferredSize(size(400, 70));
return wrapper;
}
use of com.intellij.openapi.ui.MultiLineLabelUI in project intellij-community by JetBrains.
the class ChangeFormatDialog method getBottomAuxiliaryPanel.
@Nullable
@Override
protected JPanel getBottomAuxiliaryPanel() {
if (!myWcRootIsAbove) {
return null;
}
final JPanel result = new JPanel(new GridBagLayout());
GridBagConstraints gb = new GridBagConstraints();
gb.insets = JBUI.insets(2);
gb.weightx = 1;
gb.weighty = 0;
gb.gridwidth = 2;
gb.gridheight = 1;
gb.gridx = 0;
gb.gridy = 0;
gb.anchor = GridBagConstraints.WEST;
gb.fill = GridBagConstraints.HORIZONTAL;
final JLabel iconLabel = new JLabel(Messages.getWarningIcon());
result.add(iconLabel, gb);
++gb.gridx;
JLabel warningLabel = new JLabel(SvnBundle.message("label.working.copy.root.outside.text"));
warningLabel.setFont(warningLabel.getFont().deriveFont(Font.BOLD));
warningLabel.setUI(new MultiLineLabelUI());
result.add(warningLabel);
return result;
}
use of com.intellij.openapi.ui.MultiLineLabelUI in project intellij-community by JetBrains.
the class IntersectingLocalChangesPanel method createLabel.
@NotNull
private static JBLabel createLabel(@NotNull String text) {
JBLabel label = new JBLabel(text) {
@Override
public Dimension getPreferredSize() {
Dimension size = super.getPreferredSize();
return new Dimension(size.width, (int) (size.height * 1.7));
}
};
label.setUI(new MultiLineLabelUI());
label.setBackground(UIUtil.getTextFieldBackground());
label.setVerticalTextPosition(SwingConstants.TOP);
return label;
}
use of com.intellij.openapi.ui.MultiLineLabelUI in project intellij-community by JetBrains.
the class UndefinedMacrosConfigurable method createComponent.
public JComponent createComponent() {
final JPanel mainPanel = new JPanel(new BorderLayout());
// important: do not allow to remove or change macro name for already defined macros befor project is loaded
myEditor = new PathMacroListEditor(myUndefinedMacroNames);
final JComponent editorPanel = myEditor.getPanel();
mainPanel.add(editorPanel, BorderLayout.CENTER);
final JLabel textLabel = new JLabel(myText);
textLabel.setUI(new MultiLineLabelUI());
textLabel.setBorder(IdeBorderFactory.createEmptyBorder(6, 6, 6, 6));
mainPanel.add(textLabel, BorderLayout.NORTH);
return mainPanel;
}
use of com.intellij.openapi.ui.MultiLineLabelUI in project intellij-community by JetBrains.
the class StartUseVcsDialog method createCenterPanel.
protected JComponent createCenterPanel() {
final JLabel selectText = new JLabel(VcsBundle.message("dialog.enable.version.control.integration.select.vcs.label.text"));
selectText.setUI(new MultiLineLabelUI());
final JPanel mainPanel = new JPanel(new GridBagLayout());
final GridBagConstraints gb = new GridBagConstraints(0, 0, 1, 1, 0, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0);
mainPanel.add(selectText, gb);
++gb.gridx;
gb.anchor = GridBagConstraints.NORTHEAST;
myVcsCombo = new VcsCombo(prepareComboData());
mainPanel.add(myVcsCombo, gb);
myVcsCombo.addActionListener(new ActionListener() {
public void actionPerformed(final ActionEvent e) {
validateVcs();
}
});
validateVcs();
final JLabel helpText = new JLabel(VcsBundle.message("dialog.enable.version.control.integration.hint.text"));
helpText.setUI(new MultiLineLabelUI());
helpText.setForeground(UIUtil.getInactiveTextColor());
gb.anchor = GridBagConstraints.NORTHWEST;
gb.gridx = 0;
++gb.gridy;
gb.gridwidth = 2;
mainPanel.add(helpText, gb);
final JPanel wrapper = new JPanel(new GridBagLayout());
wrapper.add(mainPanel, new GridBagConstraints(0, 0, 1, 1, 1, 1, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
return wrapper;
}
Aggregations