本文整理汇总了Java中com.intellij.util.ui.FormBuilder.createFormBuilder方法的典型用法代码示例。如果您正苦于以下问题:Java FormBuilder.createFormBuilder方法的具体用法?Java FormBuilder.createFormBuilder怎么用?Java FormBuilder.createFormBuilder使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.ui.FormBuilder
的用法示例。
在下文中一共展示了FormBuilder.createFormBuilder方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CertificateInfoPanel
import com.intellij.util.ui.FormBuilder; //导入方法依赖的package包/类
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);
}
示例2: createCustomPanel
import com.intellij.util.ui.FormBuilder; //导入方法依赖的package包/类
@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();
}
示例3: createOptionsPanel
import com.intellij.util.ui.FormBuilder; //导入方法依赖的package包/类
@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;
}
示例4: CertificateInfoPanel
import com.intellij.util.ui.FormBuilder; //导入方法依赖的package包/类
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);
}
示例5: UntrustedCertificateWarningDialog
import com.intellij.util.ui.FormBuilder; //导入方法依赖的package包/类
public UntrustedCertificateWarningDialog(@NotNull X509Certificate certificate, @NotNull String storePath, @NotNull String password) {
super((Project)null, false);
myCertificate = certificate;
myPath = FileUtil.toCanonicalPath(storePath);
myPassword = password;
FormBuilder builder = FormBuilder.createFormBuilder();
// I'm not using separate panels and form builders to preserve alignment of labels
builder = updateBuilderWithTitle(builder, "Issued To");
builder = updateBuilderWithPrincipalData(builder, myCertificate.getSubjectX500Principal());
builder = updateBuilderWithTitle(builder, "Issued By");
builder = updateBuilderWithPrincipalData(builder, myCertificate.getIssuerX500Principal());
builder = updateBuilderWithTitle(builder, "Validity Period");
builder = builder
.setIndent(IdeBorderFactory.TITLED_BORDER_INDENT)
.addLabeledComponent("Valid from", new JBLabel(DATE_FORMAT.format(myCertificate.getNotBefore())))
.addLabeledComponent("Valid until", new JBLabel(DATE_FORMAT.format(myCertificate.getNotAfter())));
myCertificateInfoPanel.add(builder.getPanel(), BorderLayout.CENTER);
setTitle("Untrusted Server's Certificate");
setOKButtonText("Accept");
setCancelButtonText("Reject");
myWarningSign.setIcon(AllIcons.General.WarningDialog);
Messages.installHyperlinkSupport(myNoticePane);
// myNoticePane.setFont(myNoticePane.getFont().deriveFont((float)FontSize.SMALL.getSize()));
myNoticePane.setText(
String.format("<html><p><small>" +
"Accepted certificate will be saved in truststore <code>%s</code> with password <code>%s</code>" +
"</small></p><html>",
myPath, myPassword));
init();
LOG.debug("Preferred size: " + getPreferredSize());
}
示例6: createEditor
import com.intellij.util.ui.FormBuilder; //导入方法依赖的package包/类
@NotNull
@Override
protected JComponent createEditor()
{
myProgramParametersPanel = new CommonProgramParametersPanel();
myModuleComboBox = new JComboBox();
myModuleComboBox.setRenderer(new ModuleListCellRenderer());
for(Module module : ModuleManager.getInstance(myProject).getModules())
{
if(ModuleUtilCore.getExtension(module, DotNetModuleExtension.class) != null)
{
myModuleComboBox.addItem(module);
}
}
myModuleComboBox.addItemListener(new ItemListener()
{
@Override
public void itemStateChanged(ItemEvent e)
{
if(e.getStateChange() == ItemEvent.SELECTED)
{
myProgramParametersPanel.setModuleContext((Module) myModuleComboBox.getSelectedItem());
}
}
});
FormBuilder formBuilder = FormBuilder.createFormBuilder();
formBuilder.addLabeledComponent("Module", myModuleComboBox);
myProgramParametersPanel.add(formBuilder.getPanel());
return myProgramParametersPanel;
}
示例7: createFormBuilder
import com.intellij.util.ui.FormBuilder; //导入方法依赖的package包/类
public static FormBuilder createFormBuilder() {
return FormBuilder.createFormBuilder();
}