use of com.intellij.ui.components.JBLabel in project android by JetBrains.
the class InspectorPanel method createLabel.
private static JLabel createLabel(@NotNull String labelText, @Nullable String tooltip, @Nullable Component component) {
JBLabel label = new JBLabel(labelText);
label.setLabelFor(component);
label.setToolTipText(tooltip);
return label;
}
use of com.intellij.ui.components.JBLabel in project intellij-community by JetBrains.
the class UndoApplyPatchDialog method createCenterPanel.
@Nullable
@Override
protected JComponent createCenterPanel() {
final JPanel panel = new JPanel(new BorderLayout());
int numFiles = myFailedFilePaths.size();
JPanel labelsPanel = new JPanel(new BorderLayout());
String detailedText = numFiles == 0 ? "" : String.format("Failed to apply %s below.<br>", StringUtil.pluralize("file", numFiles));
final JLabel infoLabel = new JBLabel(XmlStringUtil.wrapInHtml(detailedText + "Would you like to rollback all applied?"));
labelsPanel.add(infoLabel, BorderLayout.NORTH);
if (myShouldInformAboutBinaries) {
JLabel warningLabel = new JLabel("Rollback will not affect binaries");
warningLabel.setIcon(UIUtil.getBalloonWarningIcon());
labelsPanel.add(warningLabel, BorderLayout.CENTER);
}
panel.add(labelsPanel, BorderLayout.NORTH);
if (numFiles > 0) {
FilePathChangesTreeList browser = new FilePathChangesTreeList(myProject, myFailedFilePaths, false, false, null, null) {
@Override
public Dimension getPreferredSize() {
return new Dimension(infoLabel.getPreferredSize().width, 50);
}
};
browser.setChangesToDisplay(myFailedFilePaths);
panel.add(ScrollPaneFactory.createScrollPane(browser), BorderLayout.CENTER);
}
return panel;
}
use of com.intellij.ui.components.JBLabel in project intellij-community by JetBrains.
the class PluginConflictDialog method getPluginDescriptionPanel.
@NotNull
private static JPanel getPluginDescriptionPanel(@NotNull PluginId plugin, boolean addUseWord) {
final JPanel panel = new JPanel(new BorderLayout());
final IdeaPluginDescriptor pluginDescriptor = PluginManager.getPlugin(plugin);
if (pluginDescriptor == null) {
panel.add(new JBLabel(plugin.getIdString()), BorderLayout.CENTER);
return panel;
}
final StringBuilder sb = new StringBuilder("<html>");
if (addUseWord) {
sb.append("Use ");
}
sb.append(pluginDescriptor.getName());
if (pluginDescriptor.getVendor() != null) {
sb.append(" by ").append(pluginDescriptor.getVendor());
}
sb.append("</html>");
panel.add(new JBLabel(sb.toString()));
return panel;
}
use of com.intellij.ui.components.JBLabel in project intellij-community by JetBrains.
the class PluginConflictDialog method getDisableAllPanel.
@NotNull
private static JPanel getDisableAllPanel() {
final JPanel panel = new JPanel(new BorderLayout());
panel.add(new JBLabel(DiagnosticBundle.message("error.dialog.conflict.plugin.disable.all")));
return panel;
}
use of com.intellij.ui.components.JBLabel in project intellij-community by JetBrains.
the class InplaceChangeSignature method showBalloon.
protected void showBalloon() {
NonFocusableCheckBox checkBox = new NonFocusableCheckBox(RefactoringBundle.message("delegation.panel.delegate.via.overloading.method"));
checkBox.addActionListener(e -> {
myDelegate = checkBox.isSelected();
updateCurrentInfo();
});
JPanel content = new JPanel(new BorderLayout());
content.add(new JBLabel("Performed signature modifications:"), BorderLayout.NORTH);
content.add(myPreview.getComponent(), BorderLayout.CENTER);
updateMethodSignature(myStableChange);
content.add(checkBox, BorderLayout.SOUTH);
final BalloonBuilder balloonBuilder = JBPopupFactory.getInstance().createDialogBalloonBuilder(content, null).setSmallVariant(true);
myBalloon = balloonBuilder.createBalloon();
myEditor.getScrollingModel().scrollToCaret(ScrollType.MAKE_VISIBLE);
myBalloon.show(new PositionTracker<Balloon>(myEditor.getContentComponent()) {
@Override
public RelativePoint recalculateLocation(Balloon object) {
int offset = myStableChange.getMethod().getTextOffset();
VisualPosition visualPosition = myEditor.offsetToVisualPosition(offset);
Point point = myEditor.visualPositionToXY(new VisualPosition(visualPosition.line, visualPosition.column));
return new RelativePoint(myEditor.getContentComponent(), point);
}
}, Balloon.Position.above);
Disposer.register(myBalloon, () -> {
EditorFactory.getInstance().releaseEditor(myPreview);
myPreview = null;
});
}
Aggregations