use of com.intellij.openapi.wm.IdeFrame in project intellij-community by JetBrains.
the class PluginManager method reportPluginError.
public static void reportPluginError() {
if (myPluginError != null) {
String title = IdeBundle.message("title.plugin.error");
Notifications.Bus.notify(new Notification(title, title, myPluginError, NotificationType.ERROR, new NotificationListener() {
@SuppressWarnings("AssignmentToStaticFieldFromInstanceMethod")
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
notification.expire();
String description = event.getDescription();
if (EDIT.equals(description)) {
PluginManagerConfigurable configurable = new PluginManagerConfigurable(PluginManagerUISettings.getInstance());
IdeFrame ideFrame = WindowManagerEx.getInstanceEx().findFrameFor(null);
ShowSettingsUtil.getInstance().editConfigurable((JFrame) ideFrame, configurable);
return;
}
List<String> disabledPlugins = getDisabledPlugins();
if (myPlugins2Disable != null && DISABLE.equals(description)) {
for (String pluginId : myPlugins2Disable) {
if (!disabledPlugins.contains(pluginId)) {
disabledPlugins.add(pluginId);
}
}
} else if (myPlugins2Enable != null && ENABLE.equals(description)) {
disabledPlugins.removeAll(myPlugins2Enable);
PluginManagerMain.notifyPluginsUpdated(null);
}
try {
saveDisabledPlugins(disabledPlugins, false);
} catch (IOException ignore) {
}
myPlugins2Enable = null;
myPlugins2Disable = null;
}
}));
myPluginError = null;
}
}
use of com.intellij.openapi.wm.IdeFrame in project intellij-community by JetBrains.
the class WindowSystemPlaybackCall method findProject.
public static AsyncResult<Project> findProject() {
final AsyncResult<Project> project = new AsyncResult<>();
final IdeFocusManager fm = IdeFocusManager.getGlobalInstance();
fm.doWhenFocusSettlesDown(() -> {
Component parent = UIUtil.findUltimateParent(fm.getFocusOwner());
if (parent instanceof IdeFrame) {
IdeFrame frame = (IdeFrame) parent;
if (frame.getProject() != null) {
project.setDone(frame.getProject());
return;
}
}
project.setRejected();
});
return project;
}
use of com.intellij.openapi.wm.IdeFrame in project intellij-community by JetBrains.
the class DumbServiceImpl method showDumbModeNotification.
@Override
public void showDumbModeNotification(@NotNull final String message) {
UIUtil.invokeLaterIfNeeded(() -> {
final IdeFrame ideFrame = WindowManager.getInstance().getIdeFrame(myProject);
if (ideFrame != null) {
StatusBarEx statusBar = (StatusBarEx) ideFrame.getStatusBar();
statusBar.notifyProgressByBalloon(MessageType.WARNING, message, null, null);
}
});
}
use of com.intellij.openapi.wm.IdeFrame in project intellij-community by JetBrains.
the class AnnotateDiffViewerAction method showNotification.
private static void showNotification(@NotNull DiffViewerBase viewer, @NotNull Notification notification) {
JComponent component = viewer.getComponent();
Window window = UIUtil.getWindow(component);
if (window instanceof IdeFrame && NotificationsManagerImpl.findWindowForBalloon(viewer.getProject()) == window) {
notification.notify(viewer.getProject());
return;
}
Balloon balloon = NotificationsManagerImpl.createBalloon(component, notification, false, true, BalloonLayoutData.fullContent(), viewer);
Dimension componentSize = component.getSize();
Dimension balloonSize = balloon.getPreferredSize();
int width = Math.min(balloonSize.width, componentSize.width);
int height = Math.min(balloonSize.height, componentSize.height);
// top-right corner, 20px to the edges
RelativePoint point = new RelativePoint(component, new Point(componentSize.width - 20 - width / 2, 20 + height / 2));
balloon.show(point, Balloon.Position.above);
}
use of com.intellij.openapi.wm.IdeFrame in project intellij-community by JetBrains.
the class GitCheckoutProcessor method checkout.
@Override
public boolean checkout(@NotNull final Map<String, String> parameters, @NotNull final VirtualFile parentDirectory, @NotNull String directoryName) {
ProgressManager.getInstance().getProgressIndicator().setText(DvcsBundle.message("cloning.repository", parameters));
IdeFrame frame = IdeFocusManager.getGlobalInstance().getLastFocusedFrame();
Project project = frame == null || frame.getProject() == null ? ProjectManager.getInstance().getDefaultProject() : frame.getProject();
return GitCheckoutProvider.doClone(project, Git.getInstance(), directoryName, parentDirectory.getPath(), parameters.get("url"));
}
Aggregations