Java 类com.intellij.openapi.ui.MultiLineLabelUI 实例源码

项目:intellij-ce-playground    文件:RunHotswapDialog.java   
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);
    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;
}
项目:intellij-ce-playground    文件:OptionsMessageDialog.java   
protected JComponent createNorthPanel() {
  JPanel panel = new JPanel(new BorderLayout(15, 0));
  if (myIcon != null) {
    JLabel iconLabel = new JLabel(myIcon);
    Container container = new Container();
    container.setLayout(new BorderLayout());
    container.add(iconLabel, BorderLayout.NORTH);
    panel.add(container, BorderLayout.WEST);
  }

  if (myMessage != null) {
    JLabel textLabel = new JLabel(myMessage);
    textLabel.setUI(new MultiLineLabelUI());
    panel.add(textLabel, BorderLayout.CENTER);
  }
  return panel;
}
项目:intellij-ce-playground    文件:ChooseModulesDialog.java   
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;
}
项目:tools-idea    文件:RunHotswapDialog.java   
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);
    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;
}
项目:tools-idea    文件:OptionsMessageDialog.java   
protected JComponent createNorthPanel() {
  JPanel panel = new JPanel(new BorderLayout(15, 0));
  if (myIcon != null) {
    JLabel iconLabel = new JLabel(myIcon);
    Container container = new Container();
    container.setLayout(new BorderLayout());
    container.add(iconLabel, BorderLayout.NORTH);
    panel.add(container, BorderLayout.WEST);
  }

  if (myMessage != null) {
    JLabel textLabel = new JLabel(myMessage);
    textLabel.setUI(new MultiLineLabelUI());
    panel.add(textLabel, BorderLayout.CENTER);
  }
  return panel;
}
项目:tools-idea    文件:ChooseModulesDialog.java   
protected JComponent createNorthPanel() {
  JPanel panel = new JPanel(new BorderLayout(15, 10));
  if (myIcon != null) {
    JLabel iconLabel = new JLabel(myIcon);
    Container container = new Container();
    container.setLayout(new BorderLayout());
    container.add(iconLabel, BorderLayout.NORTH);
    panel.add(container, BorderLayout.WEST);
  }

  JPanel messagePanel = new JPanel(new BorderLayout());
  if (myMessage != null) {
    JLabel textLabel = new JLabel(myMessage);
    textLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 5, 0));
    textLabel.setUI(new MultiLineLabelUI());
    messagePanel.add(textLabel, BorderLayout.NORTH);
  }
  panel.add(messagePanel, BorderLayout.CENTER);

  final JScrollPane jScrollPane = ScrollPaneFactory.createScrollPane();
  jScrollPane.setViewportView(myView);
  jScrollPane.setPreferredSize(new Dimension(300, 80));
  panel.add(jScrollPane, BorderLayout.SOUTH);
  return panel;
}
项目:consulo    文件:OptionsMessageDialog.java   
protected JComponent createNorthPanel() {
  JPanel panel = new JPanel(new BorderLayout(15, 0));
  if (myIcon != null) {
    JLabel iconLabel = new JLabel(myIcon);
    Container container = new Container();
    container.setLayout(new BorderLayout());
    container.add(iconLabel, BorderLayout.NORTH);
    panel.add(container, BorderLayout.WEST);
  }

  if (myMessage != null) {
    JLabel textLabel = new JLabel(myMessage);
    textLabel.setUI(new MultiLineLabelUI());
    panel.add(textLabel, BorderLayout.CENTER);
  }
  return panel;
}
项目:consulo-java    文件:RunHotswapDialog.java   
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);
    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;
}
项目:lua-for-idea    文件:LuaSdkChooserPanel.java   
public LuaSdkChooserPanel(final Project project) {
    myJdkChooser = new JdkChooserPanel(project);

    setLayout(new GridBagLayout());
    setBorder(BorderFactory.createEtchedBorder());

    final JLabel label = new JLabel(LuaBundle.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(LuaBundle.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(LuaBundle.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();
        }
    });

    myJdkChooser.setAllowedJdkTypes(new SdkType[]{LuaSdkType.getInstance()});

    final Sdk selectedJdk = project == null ? null : ProjectRootManager.getInstance(project).getProjectSdk();

    myJdkChooser.fillList(LuaSdkType.getInstance(), null);
    if (selectedJdk != null) {
        myJdkChooser.selectJdk(selectedJdk);
    }
}
项目:intellij-ce-playground    文件:YesNoPreviewUsagesDialog.java   
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;
}
项目:intellij-ce-playground    文件:ProjectJdkStep.java   
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, 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;
}
项目:intellij-ce-playground    文件:GenerateAntBuildDialog.java   
private void initChunksPanel() {
  List<Chunk<Module>> chunks = getCycleChunks();
  if (chunks.isEmpty()) {
    return;
  }
  myChunksPanel.setLayout(new BorderLayout());
  myChunksPanel.setBorder(
    IdeBorderFactory.createTitledBorder(CompilerBundle.message("generate.ant.build.dialog.cyclic.modules.table.title"),
                                        true));
  JLabel textLabel = new JLabel(CompilerBundle.message("generate.ant.build.dialog.cyclic.modules.table.description"));
  textLabel.setUI(new MultiLineLabelUI());
  textLabel.setBorder(IdeBorderFactory.createEmptyBorder(4, 4, 6, 4));
  myChunksPanel.add(textLabel, BorderLayout.NORTH);

  myTableModel = new MyTableModel(chunks);
  myTable = new Table(myTableModel);
  final MyTableCellRenderer cellRenderer = new MyTableCellRenderer();
  final TableColumn nameColumn = myTable.getColumnModel().getColumn(MyTableModel.NAME_COLUMN);
  nameColumn.setCellEditor(ComboBoxTableCellEditor.INSTANCE);
  nameColumn.setCellRenderer(cellRenderer);
  final TableColumn labelColumn = myTable.getColumnModel().getColumn(MyTableModel.NUMBER_COLUMN);
  labelColumn.setCellRenderer(cellRenderer);

  final Dimension preferredSize = new Dimension(myTable.getPreferredSize());
  preferredSize.height = (myTableModel.getRowCount() + 2) * myTable.getRowHeight() + myTable.getTableHeader().getHeight();

  final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTable);
  scrollPane.setPreferredSize(preferredSize);
  myChunksPanel.add(scrollPane, BorderLayout.CENTER);
}
项目:intellij-ce-playground    文件:UndefinedMacrosConfigurable.java   
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;
}
项目:intellij-ce-playground    文件:RefactoringMessageDialog.java   
@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 {
    panel.add(label, BorderLayout.WEST);
  }
  return panel;
}
项目:intellij-ce-playground    文件:ChangelistMoveOfferDialog.java   
protected JComponent createCenterPanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  final JLabel label = new JLabel(VcsBundle.message("changes.commit.partial.offer.to.move.text"));
  label.setUI(new MultiLineLabelUI());
  label.setIconTextGap(10);
  label.setIcon(Messages.getQuestionIcon());
  panel.add(label, BorderLayout.CENTER);
  panel.add(Box.createVerticalStrut(10), BorderLayout.SOUTH);
  return panel;
}
项目:intellij-ce-playground    文件:AbstractSelectFilesDialog.java   
@Nullable
private JLabel createPromptLabel() {
  if (myPrompt != null) {
    final JLabel label = new JLabel(myPrompt);
    label.setUI(new MultiLineLabelUI());
    label.setBorder(new EmptyBorder(5, 1, 5, 1));
    return label;
  }
  return null;
}
项目:intellij-ce-playground    文件:StartUseVcsDialog.java   
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;
}
项目:intellij-ce-playground    文件:MethodHierarchyBrowserBase.java   
protected static JPanel createStandardLegendPanel(final String methodDefinedText,
                                                  final String methodNotDefinedLegallyText,
                                                  final String methodShouldBeDefined) {
  final JPanel panel = new JPanel(new GridBagLayout());

  JLabel label;
  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;
}
项目:intellij-ce-playground    文件:DefaultValueChooser.java   
public DefaultValueChooser(Project project, String name, String defaultValue) {
  super(project);
  new RadioUpDownListener(myLeaveBlankRadioButton, myFeelLuckyRadioButton, myUseValueRadioButton);
  final ActionListener actionListener = new ActionListener() {
    @Override
    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();
}
项目:intellij-ce-playground    文件:GitUntrackedFilesHelper.java   
@Nullable
@Override
protected JComponent createNorthPanel() {
  JLabel label = new JLabel(myPrompt);
  label.setUI(new MultiLineLabelUI());
  label.setBorder(new EmptyBorder(5, 1, 5, 1));
  return label;
}
项目:intellij-ce-playground    文件:IntersectingLocalChangesPanel.java   
private void initUI() {
  final DefaultMutableTreeNode root = new DefaultMutableTreeNode();

  myJTree = new JTree(root);
  myJTree.setRootVisible(false);
  myJTree.setShowsRootHandles(false);
  myJTree.setCellRenderer(new ChangesBrowserNodeRenderer(myProject, true, false));

  TreeModelBuilder builder = new TreeModelBuilder(myProject, true);
  final DefaultTreeModel treeModel = builder.buildModelFromFilePaths(myFilesToShow);
  myJTree.setModel(treeModel);

  myJTree.expandPath(new TreePath(root.getPath()));

  final JLabel label = new JLabel(myText) {
    @Override
    public Dimension getPreferredSize() {
      final Dimension superValue = super.getPreferredSize();
      return new Dimension((int) superValue.getWidth(), (int) (superValue.getHeight() * 1.7));
    }
  };
  label.setUI(new MultiLineLabelUI());
  label.setBackground(UIUtil.getTextFieldBackground());
  label.setVerticalTextPosition(JLabel.TOP);
  myPanel.setBackground(UIUtil.getTextFieldBackground());
  myPanel.add(label, BorderLayout.NORTH);
  myPanel.add(myJTree, BorderLayout.CENTER);

  EditSourceOnDoubleClickHandler.install(myJTree);
  EditSourceOnEnterKeyHandler.install(myJTree);

  final EditSourceAction editSourceAction = new EditSourceAction();
  editSourceAction.registerCustomShortcutSet(CommonShortcuts.getEditSource(), myPanel);
}
项目:intellij-ce-playground    文件:ChangeFormatDialog.java   
@Nullable
@Override
protected JPanel getBottomAuxiliaryPanel() {
  if (! myWcRootIsAbove) {
    return null;
  }
  final JPanel result = new JPanel(new GridBagLayout());

  GridBagConstraints gb = new GridBagConstraints();

  gb.insets = new Insets(2, 2, 2, 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;
}
项目:intellij-ce-playground    文件:QuickMergeWayOptionsPanel.java   
public QuickMergeWayOptionsPanel() {
  myMergeAllButton.addActionListener(setCodeAndClose(QuickMergeContentsVariants.all));
  myQuickManualSelectButton.addActionListener(setCodeAndClose(QuickMergeContentsVariants.showLatest));
  mySelectWithPreFilterButton.addActionListener(setCodeAndClose(QuickMergeContentsVariants.select));
  myCancelButton.addActionListener(setCodeAndClose(QuickMergeContentsVariants.cancel));

  myAllNotMergedRevisionsLabel.setUI(new MultiLineLabelUI());
  myShowsAllRevisionsFromLabel.setUI(new MultiLineLabelUI());
  myFindsWhereOneOfLabel.setUI(new MultiLineLabelUI());

  myAllNotMergedRevisionsLabel.setBorder(BorderFactory.createEmptyBorder(0,0,10,0));
  myShowsAllRevisionsFromLabel.setBorder(BorderFactory.createEmptyBorder(0,0,10,0));
  myFindsWhereOneOfLabel.setBorder(BorderFactory.createEmptyBorder(0,0,10,0));
}
项目:vso-intellij    文件:CheckinParametersForm.java   
private void createUIComponents() {
  myWorkItemsPanel = new WorkItemsPanel(this);
  Disposer.register(this, myWorkItemsPanel);
  // TODO until MultiLineLabel is moved to openapi
  myErrorLabel = new JLabel() {
    public void updateUI() {
      setUI(new MultiLineLabelUI());
    }

    public Dimension getMinimumSize() {
      return getPreferredSize();
    }
  };
  myErrorLabel.setVerticalTextPosition(SwingConstants.TOP);
}
项目:intellij-ocaml    文件:OCamlSdkChooserPanel.java   
public OCamlSdkChooserPanel(final Project project) {
    myJdkChooser = new JdkChooserPanel(project);

    setLayout(new GridBagLayout());
    setBorder(BorderFactory.createEtchedBorder());

    final JLabel label = new JLabel("Specify the OCaml binaries directory");
    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("OCaml SDK version:");
    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("Configure...");
    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();
        }
    });

    myJdkChooser.setAllowedJdkTypes(new SdkType[] { OCamlSdkType.getInstance() });

    final Sdk selectedJdk = project == null ? null : ProjectRootManager.getInstance(project).getProjectJdk();
    myJdkChooser.updateList(selectedJdk, null);
}
项目:fossil4idea    文件:FossilUpdateConfigurable.java   
private void addWarning(JBPanel panel, GridBagConstraints c) {
  if (myWarning != null && myWarning.length() > 0) {
    ++ c.gridy;
    c.gridx = 0;
    c.gridwidth = 2;
    c.fill = GridBagConstraints.HORIZONTAL;
    final JLabel label = new JLabel(new TextUtil().insertLineCuts("Warning: " + myWarning));
    label.setUI(new MultiLineLabelUI());
    label.setForeground(SimpleTextAttributes.ERROR_ATTRIBUTES.getFgColor());
    panel.add(label, c);
  }
}
项目:tools-idea    文件:YesNoPreviewUsagesDialog.java   
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;
}
项目:tools-idea    文件:ProjectJdkStep.java   
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, 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;
}
项目:tools-idea    文件:GenerateAntBuildDialog.java   
private void initChunksPanel() {
  List<Chunk<Module>> chunks = getCycleChunks();
  if (chunks.isEmpty()) {
    return;
  }
  myChunksPanel.setLayout(new BorderLayout());
  myChunksPanel.setBorder(
    IdeBorderFactory.createTitledBorder(CompilerBundle.message("generate.ant.build.dialog.cyclic.modules.table.title"),
                                        true));
  JLabel textLabel = new JLabel(CompilerBundle.message("generate.ant.build.dialog.cyclic.modules.table.description"));
  textLabel.setUI(new MultiLineLabelUI());
  textLabel.setBorder(IdeBorderFactory.createEmptyBorder(4, 4, 6, 4));
  myChunksPanel.add(textLabel, BorderLayout.NORTH);

  myTableModel = new MyTableModel(chunks);
  myTable = new Table(myTableModel);
  final MyTableCellRenderer cellRenderer = new MyTableCellRenderer();
  final TableColumn nameColumn = myTable.getColumnModel().getColumn(MyTableModel.NAME_COLUMN);
  nameColumn.setCellEditor(ComboBoxTableCellEditor.INSTANCE);
  nameColumn.setCellRenderer(cellRenderer);
  final TableColumn labelColumn = myTable.getColumnModel().getColumn(MyTableModel.NUMBER_COLUMN);
  labelColumn.setCellRenderer(cellRenderer);

  final Dimension preferredSize = new Dimension(myTable.getPreferredSize());
  preferredSize.height = (myTableModel.getRowCount() + 2) * myTable.getRowHeight() + myTable.getTableHeader().getHeight();

  final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myTable);
  scrollPane.setPreferredSize(preferredSize);
  myChunksPanel.add(scrollPane, BorderLayout.CENTER);
}
项目:tools-idea    文件:HTTPProxySettingsPanel.java   
public void reset() {
  myNoProxyRb.setSelected(true);  // default
  HttpConfigurable httpConfigurable = myHttpConfigurable;
  myAutoDetectProxyRb.setSelected(httpConfigurable.USE_PROXY_PAC);
  myUseHTTPProxyRb.setSelected(httpConfigurable.USE_HTTP_PROXY);
  myProxyAuthCheckBox.setSelected(httpConfigurable.PROXY_AUTHENTICATION);

  enableProxy(httpConfigurable.USE_HTTP_PROXY);

  myProxyLoginTextField.setText(httpConfigurable.PROXY_LOGIN);
  myProxyPasswordTextField.setText(httpConfigurable.getPlainProxyPassword());

  myProxyPortTextField.setText(Integer.toString(httpConfigurable.PROXY_PORT));
  myProxyHostTextField.setText(httpConfigurable.PROXY_HOST);
  myProxyExceptions.setText(httpConfigurable.PROXY_EXCEPTIONS);

  myRememberProxyPasswordCheckBox.setSelected(httpConfigurable.KEEP_PROXY_PASSWORD);
  mySocks.setSelected(httpConfigurable.PROXY_TYPE_IS_SOCKS);
  myHTTP.setSelected(!httpConfigurable.PROXY_TYPE_IS_SOCKS);

  final boolean showError = !StringUtil.isEmptyOrSpaces(httpConfigurable.LAST_ERROR);
  myErrorLabel.setVisible(showError);
  myErrorLabel.setText(showError ? errorText(httpConfigurable.LAST_ERROR) : "");

  final String oldStyleText = CommonProxy.getMessageFromProps(CommonProxy.getOldStyleProperties());
  myOtherWarning.setVisible(oldStyleText != null);
  if (oldStyleText != null) {
    myOtherWarning.setText(oldStyleText);
    myOtherWarning.setUI(new MultiLineLabelUI());
    myOtherWarning.setIcon(Messages.getWarningIcon());
  }
}
项目:tools-idea    文件:UndefinedMacrosConfigurable.java   
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;
}
项目:tools-idea    文件:RefactoringMessageDialog.java   
@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 {
    panel.add(label, BorderLayout.WEST);
  }
  return panel;
}
项目:tools-idea    文件:ChangelistMoveOfferDialog.java   
protected JComponent createCenterPanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  final JLabel label = new JLabel(VcsBundle.message("changes.commit.partial.offer.to.move.text"));
  label.setUI(new MultiLineLabelUI());
  label.setIconTextGap(10);
  label.setIcon(Messages.getQuestionIcon());
  panel.add(label, BorderLayout.CENTER);
  panel.add(Box.createVerticalStrut(10), BorderLayout.SOUTH);
  return panel;
}
项目:tools-idea    文件:AbstractSelectFilesDialog.java   
@Nullable
private JLabel createPromptLabel() {
  if (myPrompt != null) {
    final JLabel label = new JLabel(myPrompt);
    label.setUI(new MultiLineLabelUI());
    label.setBorder(new EmptyBorder(5, 1, 5, 1));
    return label;
  }
  return null;
}
项目:tools-idea    文件:StartUseVcsDialog.java   
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;
}
项目:tools-idea    文件:MethodHierarchyBrowserBase.java   
protected static JPanel createStandardLegendPanel(final String methodDefinedText,
                                                  final String methodNotDefinedLegallyText,
                                                  final String methodShouldBeDefined) {
  final JPanel panel = new JPanel(new GridBagLayout());

  JLabel label;
  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;
}
项目:tools-idea    文件:DefaultValueChooser.java   
public DefaultValueChooser(Project project, String name, String defaultValue) {
  super(project);
  new RadioUpDownListener(myLeaveBlankRadioButton, myFeelLuckyRadioButton, myUseValueRadioButton);
  final ActionListener actionListener = new ActionListener() {
    @Override
    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();
}
项目:tools-idea    文件:IntersectingLocalChangesPanel.java   
private void initUI() {
  final DefaultMutableTreeNode root = new DefaultMutableTreeNode();

  myJTree = new JTree(root);
  myJTree.setRootVisible(false);
  myJTree.setShowsRootHandles(false);
  myJTree.setCellRenderer(new ChangesBrowserNodeRenderer(myProject, true, false));

  TreeModelBuilder builder = new TreeModelBuilder(myProject, true);
  final DefaultTreeModel treeModel = builder.buildModelFromFilePaths(myFilesToShow);
  myJTree.setModel(treeModel);

  myJTree.expandPath(new TreePath(root.getPath()));

  final JLabel label = new JLabel(myText) {
    @Override
    public Dimension getPreferredSize() {
      final Dimension superValue = super.getPreferredSize();
      return new Dimension((int) superValue.getWidth(), (int) (superValue.getHeight() * 1.7));
    }
  };
  label.setUI(new MultiLineLabelUI());
  label.setBackground(UIUtil.getTextFieldBackground());
  label.setVerticalTextPosition(JLabel.TOP);
  myPanel.setBackground(UIUtil.getTextFieldBackground());
  myPanel.add(label, BorderLayout.NORTH);
  myPanel.add(myJTree, BorderLayout.CENTER);

  EditSourceOnDoubleClickHandler.install(myJTree);
  EditSourceOnEnterKeyHandler.install(myJTree);

  final EditSourceAction editSourceAction = new EditSourceAction();
  editSourceAction.registerCustomShortcutSet(CommonShortcuts.getEditSource(), myPanel);
}
项目:tools-idea    文件:ChangeFormatDialog.java   
@Nullable
@Override
protected JPanel getBottomAuxiliaryPanel() {
  if (! myWcRootIsAbove) {
    return null;
  }
  final JPanel result = new JPanel(new GridBagLayout());

  GridBagConstraints gb = new GridBagConstraints();

  gb.insets = new Insets(2, 2, 2, 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;
}
项目:tools-idea    文件:QuickMergeWayOptionsPanel.java   
public QuickMergeWayOptionsPanel() {
  myMergeAllButton.addActionListener(setCodeAndClose(QuickMergeContentsVariants.all));
  myQuickManualSelectButton.addActionListener(setCodeAndClose(QuickMergeContentsVariants.showLatest));
  mySelectWithPreFilterButton.addActionListener(setCodeAndClose(QuickMergeContentsVariants.select));
  myCancelButton.addActionListener(setCodeAndClose(QuickMergeContentsVariants.cancel));

  myAllNotMergedRevisionsLabel.setUI(new MultiLineLabelUI());
  myShowsAllRevisionsFromLabel.setUI(new MultiLineLabelUI());
  myFindsWhereOneOfLabel.setUI(new MultiLineLabelUI());

  myAllNotMergedRevisionsLabel.setBorder(BorderFactory.createEmptyBorder(0,0,10,0));
  myShowsAllRevisionsFromLabel.setBorder(BorderFactory.createEmptyBorder(0,0,10,0));
  myFindsWhereOneOfLabel.setBorder(BorderFactory.createEmptyBorder(0,0,10,0));
}