本文整理匯總了Java中com.intellij.ui.components.JBLabel類的典型用法代碼示例。如果您正苦於以下問題:Java JBLabel類的具體用法?Java JBLabel怎麽用?Java JBLabel使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
JBLabel類屬於com.intellij.ui.components包,在下文中一共展示了JBLabel類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createCustomPanel
import com.intellij.ui.components.JBLabel; //導入依賴的package包/類
@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();
}
示例2: createIssuesComponentsTreeView
import com.intellij.ui.components.JBLabel; //導入依賴的package包/類
private JComponent createIssuesComponentsTreeView() {
issuesCount = new JBLabel("Issues (0) ");
JPanel componentsTreePanel = new JBPanel(new BorderLayout()).withBackground(UIUtil.getTableBackground());
JLabel componentsTreeTitle = new JBLabel(" Components Tree");
componentsTreeTitle.setFont(componentsTreeTitle.getFont().deriveFont(TITLE_FONT_SIZE));
componentsTreePanel.add(componentsTreeTitle, BorderLayout.LINE_START);
componentsTreePanel.add(issuesCount, BorderLayout.LINE_END);
issuesCountPanel = new JBPanel().withBackground(UIUtil.getTableBackground());
issuesCountPanel.setLayout(new BoxLayout(issuesCountPanel, BoxLayout.Y_AXIS));
issuesComponentsTree.setCellRenderer(new IssuesTreeCellRenderer());
issuesComponentsTree.expandRow(0);
issuesComponentsTree.setRootVisible(false);
issuesTreeExpansionListener = new IssuesTreeExpansionListener(issuesComponentsTree, issuesCountPanel, issuesCountPanels);
JBPanel treePanel = new JBPanel(new BorderLayout()).withBackground(UIUtil.getTableBackground());
TreeSpeedSearch treeSpeedSearch = new TreeSpeedSearch(issuesComponentsTree);
treePanel.add(treeSpeedSearch.getComponent(), BorderLayout.WEST);
treePanel.add(issuesCountPanel, BorderLayout.CENTER);
JScrollPane treeScrollPane = ScrollPaneFactory.createScrollPane(treePanel);
treeScrollPane.getVerticalScrollBar().setUnitIncrement(SCROLL_BAR_SCROLLING_UNITS);
return new TitledPane(JSplitPane.VERTICAL_SPLIT, TITLE_LABEL_SIZE, componentsTreePanel, treeScrollPane);
}
示例3: createLicensesComponentsTreeView
import com.intellij.ui.components.JBLabel; //導入依賴的package包/類
private JComponent createLicensesComponentsTreeView() {
JPanel componentsTreePanel = new JBPanel(new BorderLayout());
componentsTreePanel.setBackground(UIUtil.getTableBackground());
JLabel componentsTreeTitle = new JBLabel(" Components Tree");
componentsTreeTitle.setFont(componentsTreeTitle.getFont().deriveFont(TITLE_FONT_SIZE));
componentsTreePanel.add(componentsTreeTitle, BorderLayout.WEST);
licensesComponentsTree.expandRow(0);
licensesComponentsTree.setRootVisible(false);
licensesComponentsTree.setCellRenderer(new LicensesTreeCellRenderer());
TreeSpeedSearch treeSpeedSearch = new TreeSpeedSearch(licensesComponentsTree);
JScrollPane treeScrollPane = ScrollPaneFactory.createScrollPane(treeSpeedSearch.getComponent());
treeScrollPane.getVerticalScrollBar().setUnitIncrement(SCROLL_BAR_SCROLLING_UNITS);
return new TitledPane(JSplitPane.VERTICAL_SPLIT, TITLE_LABEL_SIZE, componentsTreePanel, treeScrollPane);
}
示例4: addJtext
import com.intellij.ui.components.JBLabel; //導入依賴的package包/類
private static void addJtext(JPanel panel, int place, String header, String text) {
JLabel headerLabel = new JBLabel(header);
headerLabel.setOpaque(true);
headerLabel.setBackground(UIUtil.getTableBackground());
headerLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
c.anchor = GridBagConstraints.NORTHWEST;
c.ipadx = 20;
c.ipady = 3;
c.gridy = place;
panel.add(headerLabel, c);
c.gridx = 1;
c.weightx = 0.9;
panel.add(createJTextArea(text, true), c);
}
示例5: initUi
import com.intellij.ui.components.JBLabel; //導入依賴的package包/類
private void initUi(String myName, String toolTip) {
myNameLabel = new JBLabel(myName);
myNameLabel.setIcon(AllIcons.General.Filter);
JLabel arrow = new JBLabel(AllIcons.Ide.Statusbar_arrows);
setToolTipText(toolTip);
setDefaultForeground();
setFocusable(true);
setBorder(createUnfocusedBorder());
setLayout(new BoxLayout(this, BoxLayout.X_AXIS));
add(myNameLabel);
add(Box.createHorizontalStrut(GAP_BEFORE_ARROW));
add(arrow);
revalidate();
repaint();
showPopupMenuOnClick();
indicateHovering();
indicateFocusing();
}
示例6: createUIComponents
import com.intellij.ui.components.JBLabel; //導入依賴的package包/類
private void createUIComponents() {
impexLabel = new JBLabel();
impexLabel.setBorder(IdeBorderFactory.createTitledBorder(HybrisI18NBundleUtils.message(
"hybris.import.settings.impex.title"), false));
hybrisRemoteControlLabel = new JBLabel();
hybrisRemoteControlLabel.setBorder(IdeBorderFactory.createTitledBorder(HybrisI18NBundleUtils.message(
"hybris.import.settings.tools.remote.title"), false));
projectImportLabel = new JBLabel();
projectImportLabel.setBorder(IdeBorderFactory.createTitledBorder(HybrisI18NBundleUtils.message(
"hybris.import.settings.project.title")));
junkListPanel = new JunkListPanel("hybris.import.settings.junk.directory.name", new ArrayList<String>());
junkDirectoriesPanel = junkListPanel;
projectTreeViewSettingsLabel = new JBLabel();
projectTreeViewSettingsLabel.setBorder(IdeBorderFactory.createTitledBorder(HybrisI18NBundleUtils.message(
"hybris.project.view.tree.settings")));
}
開發者ID:AlexanderBartash,項目名稱:hybris-integration-intellij-idea-plugin,代碼行數:18,代碼來源:HybrisApplicationSettingsForm.java
示例7: createUIComponents
import com.intellij.ui.components.JBLabel; //導入依賴的package包/類
private void createUIComponents() {
defaultExtensionLabel = new JBLabel(TesterBundle.message("settings.defaultExtension"));
defaultExtensionCombobox = new ComboBox<>(new String[]{"phpt", "php"});
bootstrapFileLabel = new JBLabel(TesterBundle.message("settings.bootstrapFile"));
bootstrapFileField = new TextFieldWithBrowseButton();
bootstrapFileField.addBrowseFolderListener(null, null, project, FileChooserDescriptorFactory.createSingleFileDescriptor("php"));
namespaceMappingTable = new NamespaceMappingTable(project);
namespaceMappingPanel = ToolbarDecorator.createDecorator(namespaceMappingTable.getTableView(), new ElementProducer<TesterNamespaceMapping>() {
@Override
public TesterNamespaceMapping createElement() {
return new TesterNamespaceMapping();
}
@Override
public boolean canCreateElement() {
return true;
}
}).createPanel();
namespaceMappingPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, JBColor.LIGHT_GRAY), TesterBundle.message("settings.namespaceMappings.title")));
}
示例8: createUIComponents
import com.intellij.ui.components.JBLabel; //導入依賴的package包/類
private void createUIComponents() {
phpInterpreter = new PhpInterpreterComboBox(project, null);
phpInterpreter.setModel(PhpInterpretersManagerImpl.getInstance(project).getInterpreters(), null);
phpInterpreter.setNoItemText("<default project interpreter>");
interpreterOptions = new PhpConfigurationOptionsComponent();
phpIniPath = new TextFieldWithBrowseButton();
phpIniPath.addBrowseFolderListener(null, null, project, FileChooserDescriptorFactory.createSingleFileDescriptor("ini"));
useSystemPhpIniCheckbox = new JBCheckBox(TesterBundle.message("runConfiguration.editor.testEnv.useSystemPhpIni"));
interpreterLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.testEnv.interpreter"));
interpreterOptionsLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.testEnv.interpreterOptions"));
pathToPhpIniLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.testEnv.phpIni"));
}
示例9: createUIComponents
import com.intellij.ui.components.JBLabel; //導入依賴的package包/類
private void createUIComponents() {
testScope = new TextFieldWithBrowseButton();
testScope.addBrowseFolderListener(null, null, project, FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor());
testerExecutable = new TextFieldWithBrowseButton();
testerExecutable.addBrowseFolderListener(null, null, project, FileChooserDescriptorFactory.createSingleFileOrFolderDescriptor());
testerOptions = new RawCommandLineEditor();
testerOptions.setDialogCaption("Options");
userSetupScript = new TextFieldWithBrowseButton();
userSetupScript.addBrowseFolderListener(null, null, project, FileChooserDescriptorFactory.createSingleFileDescriptor("php"));
testScopeLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.tester.testScope"));
testerExecutableLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.tester.testerExecutable"));
testerOptionsLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.tester.testerOptions"));
setupScriptLabel = new JBLabel(TesterBundle.message("runConfiguration.editor.tester.setupScript"));
}
示例10: createUIComponents
import com.intellij.ui.components.JBLabel; //導入依賴的package包/類
private void createUIComponents() {
testTargetTextField = new EditorTextField("", getProject(), FileTypes.PLAIN_TEXT);
namespaceComboBox = new PhpNamespaceComboBox(getProject(), "", getDisposable());
directoryComboBox = new PhpPsrDirectoryComboBox(getProject()) {
@Override
public void init(@NotNull VirtualFile baseDir, @NotNull String namespace) {
super.init(baseDir, namespace);
ProjectFileIndex index = ProjectRootManager.getInstance(TesterNewTestCaseDialog.this.getProject()).getFileIndex();
this.setDirectoriesFilter(index::isInTestSourceContent);
this.updateDirectories(TesterNewTestCaseDialog.this.getNamespace());
}
};
classToTestLabel = new JBLabel(TesterBundle.message("dialog.newTestCase.label.classToTest"));
testClassLabel = new JBLabel(TesterBundle.message("dialog.newTestCase.label.testClass"));
namespaceLabel = new JBLabel(TesterBundle.message("dialog.newTestCase.label.namespace"));
fileNameLabel = new JBLabel(TesterBundle.message("dialog.newTestCase.label.fileName"));
directoryLabel = new JBLabel(TesterBundle.message("dialog.newTestCase.label.directory"));
testTargetCompletionHint = new JBLabel(UIUtil.ComponentStyle.MINI);
namespaceCompletionHint = new JBLabel(UIUtil.ComponentStyle.MINI);
directoryCompletionHint = new JBLabel(UIUtil.ComponentStyle.MINI);
}
示例11: createViews
import com.intellij.ui.components.JBLabel; //導入依賴的package包/類
private void createViews() {
etfName = new EditorTextField(Localizer.get("ExampleName"));
btnTry = new JButton(Localizer.get("TryIt"));
jlResult = new JBLabel(Localizer.get("ResultWillBeHere"));
etfName.setAlignmentX(Component.CENTER_ALIGNMENT);
etfName.setAlignmentY(Component.CENTER_ALIGNMENT);
btnTry.setAlignmentX(Component.CENTER_ALIGNMENT);
btnTry.setAlignmentY(Component.CENTER_ALIGNMENT);
jlResult.setAlignmentX(Component.CENTER_ALIGNMENT);
jlResult.setAlignmentY(Component.CENTER_ALIGNMENT);
btnTry.addMouseListener(new ClickListener() {
@Override
public void mouseClicked(MouseEvent e) {
jlResult.setText(ScriptExecutor.runScript(etfCode.getText(), etfName.getText()));
}
});
}
示例12: buildFavouritesUI
import com.intellij.ui.components.JBLabel; //導入依賴的package包/類
private void buildFavouritesUI() {
resetFavourites();
createFavouriteRadioButtons();
if (!listButtons.isEmpty()) {
cbCompactNames = new JCheckBox(Localizer.get("label.CompactNames"), isCompactNames);
cbCompactNames.addItemListener(e -> {
isCompactNames = e.getStateChange() == ItemEvent.SELECTED;
buildFavouritesUI();
});
favouritesPanel.add(new SeparatorComponent(), new CC().growX().spanX().wrap());
favouritesPanel.add(new JBLabel(Localizer.get("label.Favourites")), new CC().growX().spanX().pushX().wrap().alignX("center"));
favouritesPanel.add(cbCompactNames, new CC().spanX().wrap().gapY("0", "10pt"));
for (JBRadioButton radioButton : listButtons) {
favouritesPanel.add(radioButton, new CC().growX().spanX().wrap());
}
listButtons.get(0).doClick();
} else {
rbFromPath.doClick();
}
}
示例13: doShowError
import com.intellij.ui.components.JBLabel; //導入依賴的package包/類
private static void doShowError(String title, String description, DialogBuilder builder) {
builder.setTitle(title);
final JTextArea textArea = new JTextArea();
textArea.setEditable(false);
textArea.setText(description);
textArea.setWrapStyleWord(false);
textArea.setLineWrap(true);
final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(textArea);
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
final JPanel panel = new JPanel(new BorderLayout(10, 0));
panel.setPreferredSize(new Dimension(600, 400));
panel.add(scrollPane, BorderLayout.CENTER);
panel.add(new JBLabel("Details:", Messages.getErrorIcon(), SwingConstants.LEFT), BorderLayout.NORTH);
builder.setCenterPanel(panel);
builder.setButtonsAlignment(SwingConstants.CENTER);
builder.addOkAction();
builder.show();
}
示例14: createCenterPanel
import com.intellij.ui.components.JBLabel; //導入依賴的package包/類
@Override
protected JComponent createCenterPanel() {
final JPanel panel = new JPanel(new BorderLayout(UIUtil.DEFAULT_HGAP, UIUtil.DEFAULT_VGAP));
myList = new JBList(myNamedElements);
myList.setCellRenderer(new FQNameCellRenderer());
panel.add(ScrollPaneFactory.createScrollPane(myList), BorderLayout.CENTER);
panel.add(new JBLabel(myContainsClassesOnly ?
CodeInsightBundle.message("dialog.paste.on.import.text") :
CodeInsightBundle.message("dialog.paste.on.import.text2"), SMALL, BRIGHTER), BorderLayout.NORTH);
final JPanel buttonPanel = new JPanel(new VerticalFlowLayout());
final JButton okButton = new JButton(CommonBundle.getOkButtonText());
getRootPane().setDefaultButton(okButton);
buttonPanel.add(okButton);
final JButton cancelButton = new JButton(CommonBundle.getCancelButtonText());
buttonPanel.add(cancelButton);
panel.setPreferredSize(JBUI.size(500, 400));
return panel;
}
示例15: createDestinationRootPanel
import com.intellij.ui.components.JBLabel; //導入依賴的package包/類
@Override
protected JPanel createDestinationRootPanel() {
final List<VirtualFile> sourceRoots = JavaProjectRootsUtil.getSuitableDestinationSourceRoots(myProject);
if (sourceRoots.size() <= 1) return super.createDestinationRootPanel();
final JPanel panel = new JPanel(new BorderLayout());
panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0));
final JBLabel label = new JBLabel(RefactoringBundle.message("target.destination.folder"));
panel.add(label, BorderLayout.NORTH);
label.setLabelFor(myDestinationFolderComboBox);
myDestinationFolderComboBox.setData(myProject, myTargetDirectory, new Pass<String>() {
@Override
public void pass(String s) {
}
}, ((PackageNameReferenceEditorCombo)myPackageNameField).getChildComponent());
panel.add(myDestinationFolderComboBox, BorderLayout.CENTER);
return panel;
}