List of usage examples for com.intellij.openapi.ui MultiLineLabelUI MultiLineLabelUI
MultiLineLabelUI
From source file:com.eightbitmage.moonscript.module.MoonSdkChooserPanel.java
License:Apache License
public MoonSdkChooserPanel(final Project project) { myJdkChooser = new JdkChooserPanel(project); setLayout(new GridBagLayout()); setBorder(BorderFactory.createEtchedBorder()); final JLabel label = new JLabel(MoonBundle.message("sdk.chooser.luabinaries.prompt")); label.setUI(new MultiLineLabelUI()); add(label, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(8, 10, 8, 10), 0, 0)); final JLabel jdkLabel = new JLabel(MoonBundle.message("sdk.chooser.select.sdk.prompt")); jdkLabel.setFont(UIUtil.getLabelFont().deriveFont(Font.BOLD)); add(jdkLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(8, 10, 0, 10), 0, 0)); add(myJdkChooser, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(2, 10, 10, 5), 0, 0)); JButton configureButton = new JButton(MoonBundle.message("sdk.chooser.configure.button")); add(configureButton, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(2, 0, 10, 5), 0, 0)); configureButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { myJdkChooser.editJdkTable(); }/* w w w. j av a2 s. c om*/ }); myJdkChooser.setAllowedJdkTypes(new SdkType[] { MoonSdkType.getInstance() }); // IDEAX final Sdk selectedJdk = project == null ? null : ProjectRootManager.getInstance(project).getProjectSdk(); final Sdk selectedJdk = project == null ? null : ProjectRootManager.getInstance(project).getProjectJdk(); myJdkChooser.updateList(selectedJdk, null); }
From source file:com.intellij.debugger.ui.RunHotswapDialog.java
License:Apache License
protected JComponent createNorthPanel() { JLabel label = new JLabel(DebuggerBundle.message("hotswap.dialog.run.prompt")); JPanel panel = new JPanel(new BorderLayout()); panel.add(label, BorderLayout.CENTER); Icon icon = UIUtil.getQuestionIcon(); if (icon != null) { label.setIcon(icon);//from w w w . j a v a 2 s .co m label.setIconTextGap(7); } if (myDisplayHangWarning) { final JLabel warningLabel = new JLabel( "WARNING! " + DebuggerBundle.message("hotswap.dialog.hang.warning")); warningLabel.setUI(new MultiLineLabelUI()); panel.add(warningLabel, BorderLayout.SOUTH); } return panel; }
From source file:com.intellij.ide.actions.StartUseVcsDialog.java
License:Apache License
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);/* w w w . j a v a 2s.c o m*/ ++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; }
From source file:com.intellij.ide.hierarchy.MethodHierarchyBrowserBase.java
License:Apache License
protected static JPanel createStandardLegendPanel(final String methodDefinedText, final String methodNotDefinedLegallyText, final String methodShouldBeDefined) { final JPanel panel = new JPanel(new GridBagLayout()); JLabel label;//from w ww . j a v a 2 s . c om final GridBagConstraints gc = new GridBagConstraints(0, 0, 1, 1, 1, 0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(3, 5, 0, 5), 0, 0); 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; }
From source file:com.intellij.ide.util.importProject.RootsDetectionStep.java
License:Apache License
protected JComponent createResultsPanel() { final JPanel panel = new JPanel(new GridBagLayout()); myDetectedRootsChooser = new DetectedRootsChooser(); myDetectedRootsChooser.addSelectionListener(new DetectedRootsChooser.RootSelectionListener() { @Override/*www . ja v a2 s . co m*/ public void selectionChanged() { updateSelectedTypes(); } }); final String text = IdeBundle.message("label.project.roots.have.been.found"); final JLabel label = new JLabel(text); label.setUI(new MultiLineLabelUI()); panel.add(label, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(8, 10, 0, 10), 0, 0)); panel.add(myDetectedRootsChooser.getComponent(), new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 1.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(8, 10, 8, 10), 0, 0)); final JButton markAllButton = new JButton(IdeBundle.message("button.mark.all")); panel.add(markAllButton, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 10, 8, 2), 0, 0)); final JButton unmarkAllButton = new JButton(IdeBundle.message("button.unmark.all")); panel.add(unmarkAllButton, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 8, 10), 0, 0)); markAllButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { myDetectedRootsChooser.setAllElementsMarked(true); } }); unmarkAllButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { myDetectedRootsChooser.setAllElementsMarked(false); } }); myResultPanel = new JPanel(new CardLayout()); myResultPanel.add(ROOTS_FOUND_CARD, panel); JPanel notFoundPanel = new JPanel(new BorderLayout()); notFoundPanel.setBorder(IdeBorderFactory.createEmptyBorder(5)); notFoundPanel.add(BorderLayout.NORTH, new MultiLineLabel(IdeBundle.message("label.project.roots.not.found"))); myResultPanel.add(ROOTS_NOT_FOUND_CARD, notFoundPanel); return myResultPanel; }
From source file:com.intellij.ide.util.projectWizard.NameLocationStep.java
License:Apache License
public NameLocationStep(WizardContext wizardContext, JavaModuleBuilder builder, ModulesProvider modulesProvider, Icon icon, @NonNls String helpId) { myWizardContext = wizardContext;/*from w ww .j a v a2 s.c om*/ myBuilder = builder; myModulesProvider = modulesProvider; myIcon = icon; myHelpId = helpId; myPanel = new JPanel(new GridBagLayout()); myPanel.setBorder(BorderFactory.createEtchedBorder()); final String text = IdeBundle.message("prompt.please.specify.module.name.and.content.root"); final JLabel textLabel = new JLabel(text); textLabel.setUI(new MultiLineLabelUI()); myPanel.add(textLabel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(8, 10, 8, 10), 0, 0)); myNamePathComponent = new NamePathComponent(IdeBundle.message("label.module.name"), IdeBundle.message("label.module.content.root"), 'M', 'r', IdeBundle.message("title.select.module.content.root"), ""); //if (ModuleType.J2EE_APPLICATION.equals(moduleType)) { // myNamePathComponent.setPathComponentVisible(false); //} myPanel.add(myNamePathComponent, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(8, 10, 0, 10), 0, 0)); final JLabel label = new JLabel(IdeBundle.message("label.module.file.will.be.saved.in")); myPanel.add(label, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 2, 1, 1.0, 1.0, GridBagConstraints.SOUTHWEST, GridBagConstraints.HORIZONTAL, new Insets(30, 10, 0, 10), 0, 0)); myTfModuleFilePath = new JTextField(); myTfModuleFilePath.setEditable(false); final Insets borderInsets = myTfModuleFilePath.getBorder().getBorderInsets(myTfModuleFilePath); myTfModuleFilePath.setBorder(BorderFactory.createEmptyBorder(borderInsets.top, borderInsets.left, borderInsets.bottom, borderInsets.right)); final FieldPanel fieldPanel = createFieldPanel(myTfModuleFilePath, null, null); myPanel.add(fieldPanel, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 10, 10, 0), 0, 0)); JButton browseButton = new JButton(IdeBundle.message("button.change.directory")); browseButton.addActionListener(new BrowseModuleFileDirectoryListener(myTfModuleFilePath)); myPanel.add(browseButton, new GridBagConstraints(1, GridBagConstraints.RELATIVE, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 10, 10), 0, 0)); final DocumentListener documentListener = new DocumentAdapter() { protected void textChanged(DocumentEvent e) { updateModuleFilePathField(); } }; myNamePathComponent.getNameComponent().getDocument().addDocumentListener(documentListener); myNamePathComponent.getPathComponent().getDocument().addDocumentListener(documentListener); myNamePathComponent.getPathComponent().getDocument().addDocumentListener(new DocumentAdapter() { public void textChanged(DocumentEvent event) { myWizardContext.requestWizardButtonsUpdate(); } }); }
From source file:com.intellij.ide.util.projectWizard.ProjectJdkStep.java
License:Apache License
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); }//w ww . j a v a2 s .c o m }; panel.add(label, new GridBagConstraints(0, GridBagConstraints.RELATIVE, 1, 1, 1, 0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 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, new Insets(0, 0, 0, 0), 0, 0)); return panel; }
From source file:com.intellij.refactoring.changeSignature.DefaultValueChooser.java
License:Apache License
public DefaultValueChooser(Project project, String name, String defaultValue) { super(project); new RadioUpDownListener(myLeaveBlankRadioButton, myFeelLuckyRadioButton, myUseValueRadioButton); final ActionListener actionListener = new ActionListener() { @Override/*from w w w . ja v a2 s. c o m*/ public void actionPerformed(ActionEvent e) { myValueEditor.setEnabled(myUseValueRadioButton.isSelected()); if (myUseValueRadioButton.isSelected()) { myValueEditor.selectAll(); myValueEditor.requestFocus(); } } }; myLeaveBlankRadioButton.addActionListener(actionListener); myFeelLuckyRadioButton.addActionListener(actionListener); myUseValueRadioButton.addActionListener(actionListener); setTitle("Default value for parameter \"" + name + "\" needed"); myLeaveBlankRadioButton.setSelected(true); myValueEditor.setEnabled(false); myFeelLuckyDescription.setText("Variables of the same type would be searched in the method call place.\n" + "When exactly one variable is found, it would be used.\n" + "Otherwise parameter place would be left blank."); myFeelLuckyDescription.setUI(new MultiLineLabelUI()); myBlankDescription.setUI(new MultiLineLabelUI()); myValueEditor.setText(defaultValue); init(); }
From source file:com.intellij.refactoring.ui.YesNoPreviewUsagesDialog.java
License:Apache License
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);/* w w w . j a v a 2 s . com*/ label.setIconTextGap(7); } return panel; }
From source file:com.intellij.refactoring.util.RefactoringMessageDialog.java
License:Apache License
@Override protected JComponent createNorthPanel() { JLabel label = new JLabel(myMessage); label.setUI(new MultiLineLabelUI()); JPanel panel = new JPanel(new BorderLayout(10, 0)); if (myIcon != null) { panel.add(new JLabel(myIcon), BorderLayout.WEST); panel.add(label, BorderLayout.CENTER); } else {//from w w w .j a v a 2s .c o m panel.add(label, BorderLayout.WEST); } return panel; }