use of com.intellij.openapi.wm.IdeFrame in project intellij-community by JetBrains.
the class LineEndingsManager method updateStatusBar.
private void updateStatusBar() {
ApplicationManager.getApplication().invokeLater(() -> {
IdeFrame frame = WindowManager.getInstance().getIdeFrame(myProject);
StatusBar statusBar = frame != null ? frame.getStatusBar() : null;
StatusBarWidget widget = statusBar != null ? statusBar.getWidget("LineSeparator") : null;
if (widget instanceof LineSeparatorPanel) {
FileEditorManagerEvent event = new FileEditorManagerEvent(FileEditorManager.getInstance(myProject), null, null, null, null);
((LineSeparatorPanel) widget).selectionChanged(event);
}
});
}
use of com.intellij.openapi.wm.IdeFrame in project intellij-community by JetBrains.
the class EditorConfigConfigurable method createComponent.
@Nullable
@Override
public JComponent createComponent() {
myEnabled = new JBCheckBox("Enable EditorConfig support");
final JPanel result = new JPanel();
result.setLayout(new BoxLayout(result, BoxLayout.LINE_AXIS));
final JPanel panel = new JPanel(new VerticalFlowLayout());
result.setBorder(IdeBorderFactory.createTitledBorder("EditorConfig", false));
panel.add(myEnabled);
final JLabel warning = new JLabel("EditorConfig may override the IDE code style settings");
warning.setFont(UIUtil.getLabelFont(UIUtil.FontSize.SMALL));
warning.setBorder(IdeBorderFactory.createEmptyBorder(0, 20, 0, 0));
panel.add(warning);
panel.setAlignmentY(Component.TOP_ALIGNMENT);
result.add(panel);
final JButton export = new JButton("Export");
export.addActionListener((event) -> {
final Component parent = UIUtil.findUltimateParent(result);
if (parent instanceof IdeFrame) {
Utils.export(((IdeFrame) parent).getProject());
}
});
export.setAlignmentY(Component.TOP_ALIGNMENT);
result.add(export);
return result;
}
use of com.intellij.openapi.wm.IdeFrame in project intellij-plugins by JetBrains.
the class DocumentProblemManager method report.
// Notification.notify is not suitable for us -
// 1) it is not suitable for content with <ul> tags (due to <p> around message, see NotificationsUtil.buildHtml)
// 2) it is buggy - balloon disappeared while user selects message text
// 3) in any case, event log cannot show our message, may be due to <ul> tags?
// todo fix platform Notification impl or how use it correctly?
public void report(@Nullable final Project project, String message, MessageType messageType) {
//Notification notification = new Notification(FlashUIDesignerBundle.message("plugin.name"),
// title == null ? FlashUIDesignerBundle.message("plugin.name") : title, message, NotificationType.ERROR);
//notification.notify(project);
final Balloon balloon = JBPopupFactory.getInstance().createHtmlTextBalloonBuilder(message, messageType, BrowserHyperlinkListener.INSTANCE).setShowCallout(false).setHideOnAction(false).createBalloon();
ApplicationManager.getApplication().invokeLater(() -> {
Window window = WindowManager.getInstance().getFrame(project);
if (window == null) {
window = JOptionPane.getRootFrame();
}
if (window instanceof IdeFrame) {
BalloonLayout layout = ((IdeFrame) window).getBalloonLayout();
if (layout != null) {
layout.add(balloon);
}
}
});
}
use of com.intellij.openapi.wm.IdeFrame in project intellij-plugins by JetBrains.
the class DartFeedbackBuilder method showErrorNotification.
private static void showErrorNotification(@NotNull Notification notification, @NotNull Project project) {
// Adapted from IdeMessagePanel.showErrorNotification()
IdeFrame myFrame = WindowManager.getInstance().getIdeFrame(project);
BalloonLayout layout = myFrame.getBalloonLayout();
assert layout != null;
BalloonLayoutData layoutData = BalloonLayoutData.createEmpty();
layoutData.fadeoutTime = 5000;
layoutData.fillColor = new JBColor(0XF5E6E7, 0X593D41);
layoutData.borderColor = new JBColor(0XE0A8A9, 0X73454B);
Balloon balloon = NotificationsManagerImpl.createBalloon(myFrame, notification, false, false, new Ref<>(layoutData), project);
layout.add(balloon);
}
Aggregations