Search in sources :

Example 1 with MultiLineLabelUI

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;
}
Also used : MultiLineLabelUI(com.intellij.openapi.ui.MultiLineLabelUI) KeyEvent(java.awt.event.KeyEvent) GridBagConstraints(java.awt.GridBagConstraints) CollectionComboBoxModel(com.intellij.ui.CollectionComboBoxModel) InputMethodListener(java.awt.event.InputMethodListener) KeyListener(java.awt.event.KeyListener) InputMethodEvent(java.awt.event.InputMethodEvent)

Example 2 with MultiLineLabelUI

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;
}
Also used : MultiLineLabelUI(com.intellij.openapi.ui.MultiLineLabelUI) Nullable(org.jetbrains.annotations.Nullable)

Example 3 with MultiLineLabelUI

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;
}
Also used : MultiLineLabelUI(com.intellij.openapi.ui.MultiLineLabelUI) JBLabel(com.intellij.ui.components.JBLabel) NotNull(org.jetbrains.annotations.NotNull)

Example 4 with MultiLineLabelUI

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;
}
Also used : MultiLineLabelUI(com.intellij.openapi.ui.MultiLineLabelUI) PathMacroListEditor(com.intellij.application.options.pathMacros.PathMacroListEditor)

Example 5 with MultiLineLabelUI

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;
}
Also used : MultiLineLabelUI(com.intellij.openapi.ui.MultiLineLabelUI) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent)

Aggregations

MultiLineLabelUI (com.intellij.openapi.ui.MultiLineLabelUI)20 ActionEvent (java.awt.event.ActionEvent)3 ActionListener (java.awt.event.ActionListener)3 Nullable (org.jetbrains.annotations.Nullable)3 NotNull (org.jetbrains.annotations.NotNull)2 PathMacroListEditor (com.intellij.application.options.pathMacros.PathMacroListEditor)1 JavaModuleSourceRoot (com.intellij.ide.util.projectWizard.importSources.JavaModuleSourceRoot)1 FileChooserDescriptor (com.intellij.openapi.fileChooser.FileChooserDescriptor)1 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)1 Task (com.intellij.openapi.progress.Task)1 MultiLineLabel (com.intellij.openapi.ui.ex.MultiLineLabel)1 CollectionComboBoxModel (com.intellij.ui.CollectionComboBoxModel)1 DocumentAdapter (com.intellij.ui.DocumentAdapter)1 FieldPanel (com.intellij.ui.FieldPanel)1 JBLabel (com.intellij.ui.components.JBLabel)1 JBLoadingPanel (com.intellij.ui.components.JBLoadingPanel)1 Chunk (com.intellij.util.Chunk)1 Table (com.intellij.util.ui.Table)1 BorderLayoutPanel (com.intellij.util.ui.components.BorderLayoutPanel)1 GridBagConstraints (java.awt.GridBagConstraints)1