Java 类com.intellij.util.ui.FormBuilder 实例源码

项目:ijphab    文件:PhabricatorRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  myIconProjectsLabel = new JBLabel("Icon Projects:", SwingConstants.RIGHT);
  myIconProjects = TextFieldWithAutoCompletion.create(
    myProject,
    Collections.emptyList(),
    true,
    myRepository.getIconProjects()
  );
  JBLabel descLabel = new JBLabel();
  descLabel.setCopyable(true);
  descLabel.setText("Only one icon is shown for each task. " +
                    "This icon is extracted from the projects the task belongs to.<br>" +
                    "You can specify the projects whose icons will be used first. " +
                    "Separate multiple projects with commas.");
  descLabel.setComponentStyle(UIUtil.ComponentStyle.SMALL);
  return FormBuilder.createFormBuilder()
    .addLabeledComponent(myIconProjectsLabel, myIconProjects)
    .addComponentToRightColumn(descLabel)
    .getPanel();
}
项目:intellij-ce-playground    文件:EditMigrationDialog.java   
protected JComponent createNorthPanel() {
  myNameField = new JTextField(myMigrationMap.getName());
  myNameField.getDocument().addDocumentListener(new DocumentAdapter() {
    protected void textChanged(DocumentEvent e) {
      validateOKButton();
    }
  });

  myDescriptionTextArea = new JTextArea(myMigrationMap.getDescription(), 3, 40) {
    @Override
    public Dimension getMinimumSize() {
      return super.getPreferredSize();
    }
  };
  myDescriptionTextArea.setLineWrap(true);
  myDescriptionTextArea.setWrapStyleWord(true);
  myDescriptionTextArea.setFont(myNameField.getFont());
  myDescriptionTextArea.setBackground(myNameField.getBackground());
  JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myDescriptionTextArea);
  scrollPane.setBorder(myNameField.getBorder());

  return FormBuilder.createFormBuilder()
    .addLabeledComponent(new JLabel(RefactoringBundle.message("migration.map.name.prompt")), myNameField)
    .addLabeledComponent(new JLabel(RefactoringBundle.message("migration.map.description.label")), scrollPane)
    .addVerticalGap(UIUtil.LARGE_VGAP).getPanel();
}
项目:intellij-ce-playground    文件:ExtractClassDialog.java   
protected JComponent createNorthPanel() {
  final JPanel checkboxPanel = new JPanel(new BorderLayout());
  checkboxPanel.add(createInner, BorderLayout.WEST);
  checkboxPanel.add(extractAsEnum, BorderLayout.EAST);
  FormBuilder builder = FormBuilder.createFormBuilder()
    .addComponent(
      JBLabelDecorator.createJBLabelDecorator(RefactorJBundle.message("extract.class.from.label", sourceClass.getQualifiedName()))
        .setBold(true))
    .addLabeledComponent(RefactorJBundle.message("name.for.new.class.label"), classNameField, UIUtil.LARGE_VGAP)
    .addLabeledComponent(new JLabel(), checkboxPanel)
    .addLabeledComponent(RefactorJBundle.message("package.for.new.class.label"), packageTextField);

  if (JavaProjectRootsUtil.getSuitableDestinationSourceRoots(myProject).size() > 1) {
    builder.addLabeledComponent(RefactoringBundle.message("target.destination.folder"), myDestinationFolderComboBox);
  }

  return builder.addVerticalGap(5).getPanel();
}
项目:intellij-ce-playground    文件:CertificateInfoPanel.java   
public CertificateInfoPanel(@NotNull X509Certificate certificate) {
  myCertificateWrapper = new CertificateWrapper(certificate);
  setLayout(new BorderLayout());

  FormBuilder builder = FormBuilder.createFormBuilder();

  // I'm not using separate panels and form builders to preserve alignment of labels
  updateBuilderWithTitle(builder, "Issued To");
  updateBuilderWithPrincipalData(builder, myCertificateWrapper.getSubjectFields());
  updateBuilderWithTitle(builder, "Issued By");
  updateBuilderWithPrincipalData(builder, myCertificateWrapper.getIssuerFields());
  updateBuilderWithTitle(builder, "Validity Period");
  String notBefore = DATE_FORMAT.format(myCertificateWrapper.getNotBefore());
  String notAfter = DATE_FORMAT.format(myCertificateWrapper.getNotAfter());
  builder = builder
    .setIndent(IdeBorderFactory.TITLED_BORDER_INDENT)
    .addLabeledComponent("Valid from:", createColoredComponent(notBefore, "not yet valid", myCertificateWrapper.isNotYetValid()))
    .addLabeledComponent("Valid until:", createColoredComponent(notAfter, "expired", myCertificateWrapper.isExpired()));
  builder.setIndent(0);
  updateBuilderWithTitle(builder, "Fingerprints");
  builder.setIndent(IdeBorderFactory.TITLED_BORDER_INDENT);
  builder.addLabeledComponent("SHA-256:", getTextPane(formatHex(myCertificateWrapper.getSha256Fingerprint())));
  builder.addLabeledComponent("SHA-1:", getTextPane(formatHex(myCertificateWrapper.getSha1Fingerprint())));
  add(builder.getPanel(), BorderLayout.NORTH);
}
项目:intellij-ce-playground    文件:CreatePatchConfigurationPanel.java   
private void initMainPanel() {
  myFileNameField = new TextFieldWithBrowseButton();
  myReversePatchCheckbox = new JCheckBox(VcsBundle.message("create.patch.reverse.checkbox"));
  myEncoding = new ComboBox();
  myIncludeBaseRevisionTextCheckBox = new JCheckBox(VcsBundle.message("create.patch.base.revision", 0));
  myIncludeBaseRevisionTextCheckBox.setToolTipText(VcsBundle.message("create.patch.base.revision.tooltip"));
  myErrorLabel = new JLabel();

  myMainPanel = FormBuilder.createFormBuilder()
    .addLabeledComponent(VcsBundle.message("create.patch.file.path"), myFileNameField)
    .addComponent(myReversePatchCheckbox)
    .addComponent(myIncludeBaseRevisionTextCheckBox)
    .addLabeledComponent(VcsBundle.message("create.patch.encoding"), myEncoding)
    .addComponent(myErrorLabel)
    .getPanel();
}
项目:intellij-ce-playground    文件:CreateLibraryFromFilesAction.java   
public CreateGradleLibraryFromFilesDialog(@NotNull Project project, @NotNull List<OrderRoot> roots) {
  super(project, true);
  setTitle(COMMAND_TITLE);
  myProject = project;
  myRoots = roots;
  mySettingsFile = GradleSettingsFile.get(myProject);

  final FormBuilder builder = LibraryNameAndLevelPanel.createFormBuilder();
  myModulesComboBox = new ModulesComboBox();
  myModulesComboBox.fillModules(myProject);
  myModulesComboBox.setSelectedModule(findModule(roots));
  for (Iterator iter = ((SortedListModel)myModulesComboBox.getModel()).iterator(); iter.hasNext(); ) {
    Module module = (Module)iter.next();
    String path = GradleSettingsFile.getModuleGradlePath(module);
    if (path == null || !mySettingsFile.hasBuildFile(path)) {
      iter.remove();
    }
  }
  builder.addLabeledComponent("&Add to module:", myModulesComboBox);
  myPanel = builder.getPanel();
  init();
}
项目:intellij-ce-playground    文件:GenericRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  myField2Variable = new IdentityHashMap<JTextField, TemplateVariable>();
  FormBuilder builder = FormBuilder.createFormBuilder();
  for (final TemplateVariable variable : myRepository.getTemplateVariables()) {
    if (variable.isShownOnFirstTab()) {
      JTextField field = variable.isHidden() ? new JPasswordField(variable.getValue()) : new JTextField(variable.getValue());
      myField2Variable.put(field, variable);
      installListener(field);
      JBLabel label = new JBLabel(prettifyVariableName(variable.getName()) + ":", SwingConstants.RIGHT);
      label.setAnchor(getAnchor());
      builder.addLabeledComponent(label, field);
    }
  }
  return builder.getPanel();
}
项目:intellij-ce-playground    文件:TrelloRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  myBoardComboBox = new ComboBox(300);
  myBoardLabel = new JBLabel("Board:", SwingConstants.RIGHT);
  myBoardLabel.setLabelFor(myBoardComboBox);

  myListComboBox = new ComboBox(300);
  myListLabel = new JBLabel("List:", SwingConstants.RIGHT);
  myListLabel.setLabelFor(myListComboBox);

  myAllCardsCheckBox = new JBCheckBox("Include cards not assigned to me");

  return FormBuilder.createFormBuilder()
    .addLabeledComponent(myBoardLabel, myBoardComboBox)
    .addLabeledComponent(myListLabel, myListComboBox)
    .addComponentToRightColumn(myAllCardsCheckBox)
    .getPanel();
}
项目:intellij-ce-playground    文件:StringConcatenationArgumentToLogCallInspection.java   
@Nullable
@Override
public JComponent createOptionsPanel() {
  final ComboBox comboBox = new ComboBox(new Object[]{
    InspectionGadgetsBundle.message("all.levels.option"),
    InspectionGadgetsBundle.message("warn.level.and.lower.option"),
    InspectionGadgetsBundle.message("info.level.and.lower.option"),
    InspectionGadgetsBundle.message("debug.level.and.lower.option"),
    InspectionGadgetsBundle.message("trace.level.option")
  });
  comboBox.setSelectedIndex(warnLevel);
  comboBox.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      warnLevel = comboBox.getSelectedIndex();
    }
  });
  final JPanel panel = new JPanel(new BorderLayout());
  panel.add(FormBuilder.createFormBuilder().addLabeledComponent(InspectionGadgetsBundle.message("warn.on.label"), comboBox).getPanel(),
            BorderLayout.NORTH);
  return panel;
}
项目:intellij-ce-playground    文件:NonBooleanMethodNameMayNotStartWithQuestionInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  final ListTable table = new ListTable(new ListWrappingTableModel(questionList, InspectionGadgetsBundle
    .message("boolean.method.name.must.start.with.question.table.column.name")));
  final JPanel tablePanel = UiUtils.createAddRemovePanel(table);

  final CheckBox checkBox1 =
    new CheckBox(InspectionGadgetsBundle.message("ignore.methods.with.boolean.return.type.option"), this, "ignoreBooleanMethods");
  final CheckBox checkBox2 =
    new CheckBox(InspectionGadgetsBundle.message("ignore.methods.overriding.super.method"), this, "onlyWarnOnBaseMethods");

  panel.add(tablePanel, BorderLayout.CENTER);
  panel.add(FormBuilder.createFormBuilder().addComponent(checkBox1).addComponent(checkBox2).getPanel(), BorderLayout.SOUTH);
  return panel;
}
项目:intellij-ce-playground    文件:ParametersPerConstructorInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JFormattedTextField valueField = prepareNumberEditor("m_limit");
  final JComboBox comboBox = new ComboBox(new Object[] {Scope.NONE, Scope.PRIVATE, Scope.PACKAGE_LOCAL, Scope.PROTECTED});
  comboBox.setRenderer(new ListCellRendererWrapper() {
    @Override
    public void customize(JList list, Object value, int index, boolean selected, boolean hasFocus) {
      if (value instanceof Scope) setText(((Scope)value).getText());
    }
  });
  comboBox.setSelectedItem(ignoreScope);
  comboBox.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      ignoreScope = (Scope)comboBox.getSelectedItem();
    }
  });
  comboBox.setPrototypeDisplayValue(Scope.PROTECTED);

  final FormBuilder formBuilder = FormBuilder.createFormBuilder();
  formBuilder.addLabeledComponent(getConfigurationLabel(), valueField);
  formBuilder.addLabeledComponent(InspectionGadgetsBundle.message("constructor.visibility.option"), comboBox);
  final JPanel panel = new JPanel(new BorderLayout());
  panel.add(formBuilder.getPanel(), BorderLayout.NORTH);
  return panel;
}
项目:reviewboard-plugin-for-idea    文件:ReviewBoardSettings.java   
public String getRBSession(String server) {
    JPasswordField pf = new JPasswordField();
    pf.grabFocus();
    JTextField username = new JTextField();
    JPanel panel = FormBuilder.createFormBuilder()
            .addLabeledComponent("User Name:", username)
            .addLabeledComponent("Password:", pf)
            .getPanel();
    int okCxl = JOptionPane.showConfirmDialog(null, panel, "Enter Password", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);

    if (okCxl == JOptionPane.OK_OPTION) {
        String password = new String(pf.getPassword());
        try {
            String cookie = ReviewBoardClient.login(server, username.getText(), password);
            if (cookie != null) {
                getSettings().getState().cookie = cookie;
                return cookie;
            }
        } catch (Exception e1) {
            JOptionPane.showMessageDialog(null, e1.getMessage());
        }
    }
    return null;
}
项目:tools-idea    文件:EditMigrationDialog.java   
protected JComponent createNorthPanel() {
  myNameField = new JTextField(myMigrationMap.getName());
  myNameField.getDocument().addDocumentListener(new DocumentAdapter() {
    protected void textChanged(DocumentEvent e) {
      validateOKButton();
    }
  });

  myDescriptionTextArea = new JTextArea(myMigrationMap.getDescription(), 3, 40) {
    @Override
    public Dimension getMinimumSize() {
      return super.getPreferredSize();
    }
  };
  myDescriptionTextArea.setLineWrap(true);
  myDescriptionTextArea.setWrapStyleWord(true);
  myDescriptionTextArea.setFont(myNameField.getFont());
  myDescriptionTextArea.setBackground(myNameField.getBackground());
  JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(myDescriptionTextArea);
  scrollPane.setBorder(myNameField.getBorder());

  return FormBuilder.createFormBuilder()
    .addLabeledComponent(new JLabel(RefactoringBundle.message("migration.map.name.prompt")), myNameField)
    .addLabeledComponent(new JLabel(RefactoringBundle.message("migration.map.description.label")), scrollPane)
    .addVerticalGap(UIUtil.LARGE_VGAP).getPanel();
}
项目:tools-idea    文件:MantisRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  myProjectLabel = new JBLabel("Project:", SwingConstants.RIGHT);
  myProjectCombobox = new ComboBox(200);
  myProjectCombobox.addItemListener(new ItemListener() {
    @Override
    public void itemStateChanged(final ItemEvent e) {
      updateFilters();
    }
  });
  installListener(myProjectCombobox);
  myFilterLabel = new JBLabel("Filter:", SwingConstants.RIGHT);
  myFilterCombobox = new ComboBox(200);
  installListener(myFilterCombobox);
  updateProjects();
  return FormBuilder.createFormBuilder().addLabeledComponent(myProjectLabel, myProjectCombobox)
    .addLabeledComponent(myFilterLabel, myFilterCombobox).getPanel();
}
项目:tools-idea    文件:NonBooleanMethodNameMayNotStartWithQuestionInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  final ListTable table = new ListTable(new ListWrappingTableModel(questionList, InspectionGadgetsBundle
    .message("boolean.method.name.must.start.with.question.table.column.name")));
  final JPanel tablePanel = UiUtils.createAddRemovePanel(table);

  final CheckBox checkBox1 =
    new CheckBox(InspectionGadgetsBundle.message("ignore.methods.with.boolean.return.type.option"), this, "ignoreBooleanMethods");
  final CheckBox checkBox2 =
    new CheckBox(InspectionGadgetsBundle.message("ignore.methods.overriding.super.method"), this, "onlyWarnOnBaseMethods");

  panel.add(tablePanel, BorderLayout.CENTER);
  panel.add(FormBuilder.createFormBuilder().addComponent(checkBox1).addComponent(checkBox2).getPanel(), BorderLayout.SOUTH);
  return panel;
}
项目:targetprocess-intellij-plugin    文件:TargetProcessRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
    myUseNTLM = new JBCheckBox("Use NTLM Authentication");
    installListener(myUseNTLM);

    myHostLabel = new JBLabel("Host:", SwingConstants.RIGHT);
    myHost = new JTextField();
    myHost.setEnabled(false);
    installListener(myHost);

    myDomainLabel = new JBLabel("Domain:", SwingConstants.RIGHT);
    myDomain = new JTextField();
    myDomain.setEnabled(false);
    installListener(myDomain);

    return FormBuilder.createFormBuilder().addComponentToRightColumn(myUseNTLM, UIUtil.LARGE_VGAP).addLabeledComponent(myHostLabel, myHost)
            .addLabeledComponent(myDomainLabel, myDomain).getPanel();
}
项目:consulo-tasks    文件:GenericRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  myField2Variable = new IdentityHashMap<JTextField, TemplateVariable>();
  FormBuilder builder = FormBuilder.createFormBuilder();
  for (final TemplateVariable variable : myRepository.getTemplateVariables()) {
    if (variable.isShownOnFirstTab()) {
      JTextField field = variable.isHidden() ? new JPasswordField(variable.getValue()) : new JTextField(variable.getValue());
      myField2Variable.put(field, variable);
      installListener(field);
      JBLabel label = new JBLabel(prettifyVariableName(variable.getName()) + ":", SwingConstants.RIGHT);
      label.setAnchor(getAnchor());
      builder.addLabeledComponent(label, field);
    }
  }
  return builder.getPanel();
}
项目:consulo-tasks    文件:MantisRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  myProjectLabel = new JBLabel("Project:", SwingConstants.RIGHT);
  myProjectCombobox = new ComboBox(200);
  myProjectCombobox.addItemListener(new ItemListener() {
    @Override
    public void itemStateChanged(final ItemEvent e) {
      updateFilters();
    }
  });
  installListener(myProjectCombobox);
  myFilterLabel = new JBLabel("Filter:", SwingConstants.RIGHT);
  myFilterCombobox = new ComboBox(200);
  installListener(myFilterCombobox);
  updateProjects();
  return FormBuilder.createFormBuilder().addLabeledComponent(myProjectLabel, myProjectCombobox)
    .addLabeledComponent(myFilterLabel, myFilterCombobox).getPanel();
}
项目:consulo-tasks    文件:UntrustedCertificateWarningDialog.java   
@SuppressWarnings("MethodMayBeStatic")
private FormBuilder updateBuilderWithPrincipalData(FormBuilder builder, X500Principal principal) {
  builder = builder.setIndent(IdeBorderFactory.TITLED_BORDER_INDENT);
  for (String field : principal.getName().split(",")) {
    field = field.trim();
    String[] parts = field.split("=", 2);
    if (parts.length != 2) {
      continue;
    }

    String name = parts[0];
    String value = parts[1];

    String longName = FIELD_ABBREVIATIONS.get(name.toUpperCase());
    if (longName == null) {
      continue;
    }

    builder = builder.addLabeledComponent(String.format("<html>%s (<b>%s</b>)</html>", longName, name), new JBLabel(value));
  }
  return builder.setIndent(0);
}
项目:consulo    文件:CertificateInfoPanel.java   
public CertificateInfoPanel(@Nonnull X509Certificate certificate) {
  myCertificateWrapper = new CertificateWrapper(certificate);
  setLayout(new BorderLayout());

  FormBuilder builder = FormBuilder.createFormBuilder();

  // I'm not using separate panels and form builders to preserve alignment of labels
  updateBuilderWithTitle(builder, "Issued To");
  updateBuilderWithPrincipalData(builder, myCertificateWrapper.getSubjectFields());
  updateBuilderWithTitle(builder, "Issued By");
  updateBuilderWithPrincipalData(builder, myCertificateWrapper.getIssuerFields());
  updateBuilderWithTitle(builder, "Validity Period");
  String notBefore = DATE_FORMAT.format(myCertificateWrapper.getNotBefore());
  String notAfter = DATE_FORMAT.format(myCertificateWrapper.getNotAfter());
  builder = builder
    .setIndent(IdeBorderFactory.TITLED_BORDER_INDENT)
    .addLabeledComponent("Valid from:", createColoredComponent(notBefore, "not yet valid", myCertificateWrapper.isNotYetValid()))
    .addLabeledComponent("Valid until:", createColoredComponent(notAfter, "expired", myCertificateWrapper.isExpired()));
  builder.setIndent(0);
  updateBuilderWithTitle(builder, "Fingerprints");
  builder.setIndent(IdeBorderFactory.TITLED_BORDER_INDENT);
  builder.addLabeledComponent("SHA-256:", getTextPane(formatHex(myCertificateWrapper.getSha256Fingerprint())));
  builder.addLabeledComponent("SHA-1:", getTextPane(formatHex(myCertificateWrapper.getSha1Fingerprint())));
  add(builder.getPanel(), BorderLayout.NORTH);
}
项目:consulo-java    文件:CopyClassDialog.java   
protected JComponent createNorthPanel() {
  myNameField = new EditorTextField("");

  String qualifiedName = getQualifiedName();
  myTfPackage = new PackageNameReferenceEditorCombo(qualifiedName, myProject, RECENTS_KEY, RefactoringBundle.message("choose.destination.package"));
  myTfPackage.setTextFieldPreferredWidth(Math.max(qualifiedName.length() + 5, 40));
  myPackageLabel.setText(RefactoringBundle.message("destination.package"));
  myPackageLabel.setLabelFor(myTfPackage);
  if (myDoClone) {
    myTfPackage.setVisible(false);
    myPackageLabel.setVisible(false);
  }

  final JLabel label = new JLabel(RefactoringBundle.message("target.destination.folder"));
  final boolean isMultipleSourceRoots = ProjectRootManager.getInstance(myProject).getContentSourceRoots().length > 1;
  myDestinationCB.setVisible(!myDoClone && isMultipleSourceRoots);
  label.setVisible(!myDoClone && isMultipleSourceRoots);
  label.setLabelFor(myDestinationCB);

  return FormBuilder.createFormBuilder()
    .addComponent(myInformationLabel)
    .addLabeledComponent(RefactoringBundle.message("copy.files.new.name.label"), myNameField, UIUtil.LARGE_VGAP)
    .addLabeledComponent(myPackageLabel, myTfPackage)
    .addLabeledComponent(label, myDestinationCB)
    .getPanel();
}
项目:consulo-java    文件:NonBooleanMethodNameMayNotStartWithQuestionInspection.java   
@Override
public JComponent createOptionsPanel() {
  final JPanel panel = new JPanel(new BorderLayout());
  final ListTable table = new ListTable(new ListWrappingTableModel(questionList, InspectionGadgetsBundle
    .message("boolean.method.name.must.start.with.question.table.column.name")));
  final JPanel tablePanel = UiUtils.createAddRemovePanel(table);

  final CheckBox checkBox1 =
    new CheckBox(InspectionGadgetsBundle.message("ignore.methods.with.boolean.return.type.option"), this, "ignoreBooleanMethods");
  final CheckBox checkBox2 =
    new CheckBox(InspectionGadgetsBundle.message("ignore.methods.overriding.super.method"), this, "onlyWarnOnBaseMethods");

  panel.add(tablePanel, BorderLayout.CENTER);
  panel.add(FormBuilder.createFormBuilder().addComponent(checkBox1).addComponent(checkBox2).getPanel(), BorderLayout.SOUTH);
  return panel;
}
项目:intellij-ce-playground    文件:AnonymousToInnerDialog.java   
protected JComponent createNorthPanel() {
  myNameField = new NameSuggestionsField(myProject);

  FormBuilder formBuilder = FormBuilder.createFormBuilder()
    .addLabeledComponent(RefactoringBundle.message("anonymousToInner.class.name.label.text"), myNameField);

  if(!myShowCanBeStatic) {
    myCbMakeStatic = new NonFocusableCheckBox(RefactoringBundle.message("anonymousToInner.make.class.static.checkbox.text"));
    myCbMakeStatic.setSelected(true);
    formBuilder.addComponent(myCbMakeStatic);
  }

  return formBuilder.getPanel();
}
项目:intellij-ce-playground    文件:CopyClassDialog.java   
protected JComponent createNorthPanel() {
  myNameField = new EditorTextField("");

  String qualifiedName = getQualifiedName();
  myTfPackage = new PackageNameReferenceEditorCombo(qualifiedName, myProject, RECENTS_KEY, RefactoringBundle.message("choose.destination.package"));
  myTfPackage.setTextFieldPreferredWidth(Math.max(qualifiedName.length() + 5, 40));
  myPackageLabel.setText(RefactoringBundle.message("destination.package"));
  myPackageLabel.setLabelFor(myTfPackage);
  if (myDoClone) {
    myTfPackage.setVisible(false);
    myPackageLabel.setVisible(false);
  }

  final JLabel label = new JLabel(RefactoringBundle.message("target.destination.folder"));
  final boolean isMultipleSourceRoots = JavaProjectRootsUtil.getSuitableDestinationSourceRoots(myProject).size() > 1;
  myDestinationCB.setVisible(!myDoClone && isMultipleSourceRoots);
  label.setVisible(!myDoClone && isMultipleSourceRoots);
  label.setLabelFor(myDestinationCB);

  final JPanel panel = new JPanel(new BorderLayout());
  panel.add(myOpenInEditorCb, BorderLayout.EAST);
  return FormBuilder.createFormBuilder()
    .addComponent(myInformationLabel)
    .addLabeledComponent(RefactoringBundle.message("copy.files.new.name.label"), myNameField, UIUtil.LARGE_VGAP)
    .addLabeledComponent(myPackageLabel, myTfPackage)
    .addLabeledComponent(label, myDestinationCB)
    .addComponent(panel)
    .getPanel();
}
项目:intellij-ce-playground    文件:LibraryEditorDialogBase.java   
@Override
protected JComponent createNorthPanel() {
  String currentName = myLibraryRootsComponent.getLibraryEditor().getName();
  myNameField = new JTextField(currentName);
  myNameField.selectAll();

  FormBuilder formBuilder = FormBuilder.createFormBuilder().addLabeledComponent("&Name:", myNameField);
  addNorthComponents(formBuilder);
  return formBuilder.addVerticalGap(10).getPanel();
}
项目:intellij-ce-playground    文件:JavaResourceRootEditHandlerBase.java   
private ResourceRootPropertiesDialog(@NotNull JComponent parentComponent, @NotNull JavaResourceRootProperties properties) {
  super(parentComponent, true);
  myProperties = properties;
  setTitle(ProjectBundle.message("module.paths.edit.properties.title"));
  myRelativeOutputPathField = new JTextField();
  myIsGeneratedCheckBox = new JCheckBox(UIUtil.replaceMnemonicAmpersand("For &generated resources"));
  myMainPanel = FormBuilder.createFormBuilder()
    .addLabeledComponent("Relative output &path:", myRelativeOutputPathField)
    .addComponent(myIsGeneratedCheckBox)
    .getPanel();
  myRelativeOutputPathField.setText(myProperties.getRelativeOutputPath());
  myRelativeOutputPathField.setColumns(25);
  myIsGeneratedCheckBox.setSelected(myProperties.isForGeneratedSources());
  init();
}
项目:intellij-ce-playground    文件:FrameworkVersionComponent.java   
public FrameworkVersionComponent(final FrameworkSupportModelBase model, final String frameworkOrGroupId,
                                 final List<? extends FrameworkVersion> versions_, String labelText) {
  myModel = model;
  myAllVersions = versions_;
  myMainPanel = new JPanel(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 3, true, false));
  myFrameworkOrGroupId = frameworkOrGroupId;
  myVersionsBox = new ComboBox();
  myVersionsBox.setRenderer(new ListCellRendererWrapper<FrameworkVersion>() {
    @Override
    public void customize(JList list, FrameworkVersion value, int index, boolean selected, boolean hasFocus) {
      setText(value != null ? value.getPresentableName() : "");
    }
  });
  myVersionsBox.addActionListener(new ActionListener() {
    @Override
    public void actionPerformed(ActionEvent e) {
      FrameworkVersion selectedVersion = getSelectedVersion();
      if (selectedVersion != null) {
        model.setSelectedVersion(frameworkOrGroupId, selectedVersion);
      }
    }
  });

  myVersionsPanel = FormBuilder.createFormBuilder().setHorizontalGap(5).addLabeledComponent(labelText, myVersionsBox).getPanel();
  myMainPanel.add(myVersionsPanel);
  updateVersionsList();
}
项目:intellij-ce-playground    文件:ProjectLayoutPanel.java   
@Nullable
protected JComponent createCenterPanel() {
  FormBuilder builder = FormBuilder.createFormBuilder().setVertical(true);
  builder.addLabeledComponent("&Name:", myNameField);
  builder.addLabeledComponent(getSplitDialogChooseFilesPrompt(), myChooser);
  myChooser.setPreferredSize(JBUI.size(450, 300));
  return builder.getPanel();
}
项目:intellij-ce-playground    文件:DeployToServerSettingsEditor.java   
@NotNull
@Override
protected JComponent createEditor() {
  return FormBuilder.createFormBuilder()
    .addLabeledComponent("Server:", myServerComboBox)
    .addLabeledComponent("Deployment:", mySourceComboBox)
    .addComponentFillVertically(myDeploymentSettingsComponent, UIUtil.DEFAULT_VGAP)
    .getPanel();
}
项目:intellij-ce-playground    文件:CertificateInfoPanel.java   
private static void updateBuilderWithPrincipalData(FormBuilder builder, Map<String, String> fields) {
  builder = builder.setIndent(IdeBorderFactory.TITLED_BORDER_INDENT);
  for (CommonField field : CommonField.values()) {
    String value = fields.get(field.getShortName());
    if (value == null) {
      continue;
    }
    String label = String.format("<html>%s (<b>%s</b>)</html>", field.getShortName(), field.getLongName());
    builder = builder.addLabeledComponent(label, new JBLabel(value));
  }
  builder.setIndent(0);
}
项目:intellij-ce-playground    文件:JavaSourceRootEditHandlerBase.java   
private SourceRootPropertiesDialog(@NotNull JComponent parentComponent, @NotNull JavaSourceRootProperties properties) {
  super(parentComponent, true);
  myProperties = properties;
  setTitle(ProjectBundle.message("module.paths.edit.properties.title"));
  myPackagePrefixField = new JTextField();
  myIsGeneratedCheckBox = new JCheckBox(UIUtil.replaceMnemonicAmpersand("For &generated sources"));
  myMainPanel = FormBuilder.createFormBuilder()
    .addLabeledComponent("Package &prefix:", myPackagePrefixField)
    .addComponent(myIsGeneratedCheckBox)
    .getPanel();
  myPackagePrefixField.setText(myProperties.getPackagePrefix());
  myPackagePrefixField.setColumns(25);
  myIsGeneratedCheckBox.setSelected(myProperties.isForGeneratedSources());
  init();
}
项目:intellij-ce-playground    文件:JiraRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  mySearchQueryField = new LanguageTextField(JqlLanguage.INSTANCE, myProject, myRepository.getSearchQuery());
  enableJqlSearchIfSupported();
  installListener(mySearchQueryField);
  mySearchLabel = new JBLabel("Search:", SwingConstants.RIGHT);
  myNoteLabel = new JBLabel();
  myNoteLabel.setComponentStyle(UIUtil.ComponentStyle.SMALL);
  updateNote();
  return FormBuilder.createFormBuilder()
    .addLabeledComponent(mySearchLabel, mySearchQueryField)
    .addComponentToRightColumn(myNoteLabel)
    .getPanel();
}
项目:intellij-ce-playground    文件:RedmineRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  myProjectLabel = new JBLabel("Project:", SwingConstants.RIGHT);
  myProjectCombo = new ComboBox(300);
  //myProjectCombo.setRenderer(new TaskUiUtil.SimpleComboBoxRenderer("Set URL and password/token first"));
  myProjectCombo.setRenderer(new ListCellRendererWrapper<RedmineProjectItem>() {
    @Override
    public void customize(JList list, RedmineProjectItem value, int index, boolean selected, boolean hasFocus) {
      if (value == null) {
        setText("Set URL and password/token first");
      }
      else {
        if (myProjectCombo.isPopupVisible()) {
          //if (value.myLevel == 0 && value.myProject != RedmineRepository.UNSPECIFIED_PROJECT) {
            //setFont(UIUtil.getListFont().deriveFont(Font.BOLD));
          //}
          setText(StringUtil.repeat("   ", value.myLevel) + value.myProject.getName());
        }
        else {
          // Do not indent selected project
          setText(value.myProject.getName());
        }
      }
    }
  });

  myAPIKeyLabel = new JBLabel("API Token:", SwingConstants.RIGHT);
  myAPIKey = new JPasswordField();

  myAllAssigneesCheckBox = new JBCheckBox("Include issues not assigned to me");
  return FormBuilder.createFormBuilder()
    .addLabeledComponent(myAPIKeyLabel, myAPIKey)
    .addLabeledComponent(myProjectLabel, myProjectCombo)
    .addComponentToRightColumn(myAllAssigneesCheckBox)
    .getPanel();
}
项目:intellij-ce-playground    文件:TracRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  mySearchLabel = new JBLabel("Search:", SwingConstants.RIGHT);
  myDefaultSearch = new JTextField();
  installListener(myDefaultSearch);
  return FormBuilder.createFormBuilder().addLabeledComponent(mySearchLabel, myDefaultSearch).getPanel();
}
项目:intellij-ce-playground    文件:GitlabRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  myProjectLabel = new JBLabel("Project:", SwingConstants.RIGHT);
  myProjectComboBox = new ComboBox(300);
  myProjectComboBox.setRenderer(new TaskUiUtil.SimpleComboBoxRenderer("Set server URL and token first"));
  myProjectLabel.setLabelFor(myProjectComboBox);
  return new FormBuilder().addLabeledComponent(myProjectLabel, myProjectComboBox).getPanel();
}
项目:intellij-ce-playground    文件:LighthouseRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  myProjectIDLabel = new JBLabel("Project ID:", SwingConstants.RIGHT);
  myProjectId = new JTextField();
  installListener(myProjectId);
  myAPIKeyLabel = new JBLabel("API Token:", SwingConstants.RIGHT);
  myAPIKey = new JTextField();
  installListener(myAPIKey);
  return FormBuilder.createFormBuilder().addLabeledComponent(myProjectIDLabel, myProjectId).addLabeledComponent(myAPIKeyLabel, myAPIKey)
    .getPanel();
}
项目:intellij-ce-playground    文件:YouTrackRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  mySearchLabel = new JBLabel("Search:", SwingConstants.RIGHT);
  myDefaultSearch = new LanguageTextField(YouTrackLanguage.INSTANCE, myProject, myRepository.getDefaultSearch());
  installListener(myDefaultSearch);
  return FormBuilder.createFormBuilder().addLabeledComponent(mySearchLabel, myDefaultSearch).getPanel();
}
项目:intellij-ce-playground    文件:PivotalTrackerRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  myProjectIDLabel = new JBLabel("Project ID:", SwingConstants.RIGHT);
  myProjectId = new JTextField();
  installListener(myProjectId);
  myAPIKeyLabel = new JBLabel("API Token:", SwingConstants.RIGHT);
  myAPIKey = new JTextField();
  installListener(myAPIKey);
  return FormBuilder.createFormBuilder().addLabeledComponent(myProjectIDLabel, myProjectId).addLabeledComponent(myAPIKeyLabel, myAPIKey)
    .getPanel();
}
项目:intellij-ce-playground    文件:MantisRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  myProjectLabel = new JBLabel("Project:", SwingConstants.RIGHT);
  myProjectCombobox = new ComboBox(200);
  myProjectCombobox.setRenderer(new TaskUiUtil.SimpleComboBoxRenderer("Login first"));
  myFilterLabel = new JBLabel("Filter:", SwingConstants.RIGHT);
  myFilterCombobox = new ComboBox(200);
  myFilterCombobox.setRenderer(new TaskUiUtil.SimpleComboBoxRenderer("Login first"));
  return FormBuilder.createFormBuilder()
    .addLabeledComponent(myProjectLabel, myProjectCombobox)
    .addLabeledComponent(myFilterLabel, myFilterCombobox)
    .getPanel();
}
项目:intellij-ce-playground    文件:BugzillaRepositoryEditor.java   
@Nullable
@Override
protected JComponent createCustomPanel() {
  myProductLabel = new JBLabel("Product:", SwingConstants.RIGHT);
  myProductInput = TextFieldWithAutoCompletion.create(myProject, Collections.<String>emptyList(), true,
                                                      myRepository.getProductName());
  myComponentLabel = new JBLabel("Component:", SwingConstants.RIGHT);
  myComponentInput = TextFieldWithAutoCompletion.create(myProject, Collections.<String>emptyList(), false,
                                                        myRepository.getComponentName());
  return FormBuilder.createFormBuilder()
    .addLabeledComponent(myProductLabel, myProductInput)
    .addLabeledComponent(myComponentLabel, myComponentInput)
    .getPanel();
}