use of com.intellij.notification.Notification in project android by JetBrains.
the class MultiModuleThemeEditorTest method testModuleWithoutThemes.
@Test
public void testModuleWithoutThemes() throws IOException {
guiTest.importProjectAndWaitForProjectSyncToFinish("MultiAndroidModule");
final ThemeEditorFixture themeEditor = ThemeEditorGuiTestUtils.openThemeEditor(guiTest.ideFrame());
final JComboBoxFixture modulesComboBox = themeEditor.getModulesComboBox();
modulesComboBox.selectItem("app");
themeEditor.getThemesComboBox().selectItem("AppTheme");
themeEditor.waitForThemeSelection("AppTheme");
modulesComboBox.selectItem("nothemeslibrary");
guiTest.robot().waitForIdle();
final LogModel logModel = EventLog.getLogModel(guiTest.ideFrame().getProject());
for (Notification notification : logModel.getNotifications()) {
assertThat(notification.getType()).isNotEqualTo(NotificationType.ERROR);
}
}
use of com.intellij.notification.Notification in project android by JetBrains.
the class GetAdbAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
Notifications.Bus.notify(new Notification("Android", "ADB", "ADB requested.", NotificationType.INFORMATION));
Project project = getEventProject(e);
File adb = project == null ? null : AndroidSdkUtils.getAdb(project);
if (adb == null) {
return;
}
ListenableFuture<AndroidDebugBridge> bridge = AdbService.getInstance().getDebugBridge(adb);
Futures.addCallback(bridge, new FutureCallback<AndroidDebugBridge>() {
@Override
public void onSuccess(AndroidDebugBridge result) {
Notifications.Bus.notify(new Notification("Android", "ADB", "ADB obtained", NotificationType.INFORMATION));
}
@Override
public void onFailure(Throwable t) {
Notifications.Bus.notify(new Notification("Android", "ADB", "ADB error: " + t.toString(), NotificationType.INFORMATION));
}
});
}
use of com.intellij.notification.Notification in project android by JetBrains.
the class TerminateAdbAction method actionPerformed.
@Override
public void actionPerformed(AnActionEvent e) {
Notifications.Bus.notify(new Notification("Android", "ADB", "ADB terminated", NotificationType.INFORMATION));
AdbService.getInstance().terminateDdmlib();
}
use of com.intellij.notification.Notification in project android by JetBrains.
the class AndroidGradleNotification method showBalloon.
public void showBalloon(@NotNull String title, @NotNull String text, @NotNull NotificationType type, @NotNull NotificationGroup group, @Nullable NotificationListener listener) {
Notification notification = group.createNotification(title, text, type, listener);
Runnable notificationTask = () -> {
if (!myProject.isDisposed() && myProject.isOpen()) {
Notification old = myNotification;
if (old != null) {
boolean similar = Objects.equal(notification.getContent(), old.getContent());
if (similar) {
old.expire();
}
}
myNotification = notification;
notification.notify(myProject);
}
};
Application application = ApplicationManager.getApplication();
if (application.isDispatchThread()) {
notificationTask.run();
} else {
application.invokeLater(notificationTask);
}
}
use of com.intellij.notification.Notification in project Intellij-Plugin by getgauge.
the class GaugeComponent method projectOpened.
@Override
public void projectOpened() {
if (isGaugeProjectDir(new File(this.project.getBasePath()))) {
if (!GaugeVersion.isGreaterOrEqual(MIN_GAUGE_VERSION, false)) {
Notification notification = new Notification("Error", "Unsupported Gauge Version", String.format("This version of Gauge Intellij plugin only works with Gauge version >= %s", MIN_GAUGE_VERSION), NotificationType.ERROR);
Notifications.Bus.notify(notification, this.project);
}
}
}
Aggregations