use of com.intellij.notification.Notification in project intellij-plugins by JetBrains.
the class FlexmojosImporter method doShowFlexConfigWarning.
private synchronized void doShowFlexConfigWarning(final Project project) {
final NotificationListener listener = new NotificationListener() {
public void hyperlinkUpdate(@NotNull final Notification notification, @NotNull final HyperlinkEvent event) {
Messages.showWarningDialog(project, FlexBundle.message("flexmojos.warning.detailed"), FlexBundle.message("flexmojos.project.import"));
notification.expire();
}
};
myFlexConfigNotification = new Notification("Maven", FlexBundle.message("flexmojos.project.import"), FlexBundle.message("flexmojos.warning.short"), NotificationType.WARNING, listener);
myFlexConfigNotification.notify(project);
}
use of com.intellij.notification.Notification in project intellij-plugins by JetBrains.
the class Flexmojos4GenerateConfigTask method showWarningWithDetails.
private static void showWarningWithDetails(final Project project, final String details) {
final NotificationListener listener = new NotificationListener.Adapter() {
@Override
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) {
Messages.showErrorDialog(project, FlexBundle.message("flexmojos4.details.start", details), FlexBundle.message("flexmojos.project.import"));
notification.expire();
}
};
new Notification("Maven", FlexBundle.message("flexmojos.project.import"), FlexBundle.message("flexmojos4.warning.with.link"), NotificationType.WARNING, listener).notify(project);
}
use of com.intellij.notification.Notification in project intellij-plugins by JetBrains.
the class FlexDebugProcess method openFlexUnitConnections.
private void openFlexUnitConnections(final int socketPolicyPort, final int port) {
try {
myPolicyFileConnection = new SwfPolicyFileConnection();
myPolicyFileConnection.open(socketPolicyPort);
myFlexUnitConnection = new FlexUnitConnection();
myFlexUnitConnection.addListener(new FlexUnitConnection.Listener() {
@Override
public void statusChanged(FlexUnitConnection.ConnectionStatus status) {
if (status == FlexUnitConnection.ConnectionStatus.CONNECTION_FAILED) {
getSession().stop();
}
}
@Override
public void onData(String line) {
getProcessHandler().notifyTextAvailable(line + "\n", ProcessOutputTypes.STDOUT);
}
@Override
public void onFinish() {
getProcessHandler().detachProcess();
}
});
myFlexUnitConnection.open(port);
} catch (ExecutionException e) {
Notifications.Bus.notify(new Notification(DEBUGGER_GROUP_ID, FlexBundle.message("flex.debugger.startup.error"), FlexBundle.message("flexunit.startup.error", e.getMessage()), NotificationType.ERROR), getSession().getProject());
myFlexUnitConnection = null;
myPolicyFileConnection = null;
}
}
use of com.intellij.notification.Notification in project intellij-plugins by JetBrains.
the class DesignerApplicationManager method notifyUser.
static void notifyUser(boolean debug, @NotNull String text, @NotNull Project project, @Nullable final Consumer<String> handler) {
Notification notification = new Notification(FlashUIDesignerBundle.message("plugin.name"), getOpenActionTitle(debug), text, NotificationType.ERROR, handler == null ? null : new NotificationListener() {
@Override
public void hyperlinkUpdate(@NotNull Notification notification, @NotNull HyperlinkEvent event) {
if (event.getEventType() != HyperlinkEvent.EventType.ACTIVATED) {
return;
}
notification.expire();
if ("help".equals(event.getDescription())) {
HelpManager.getInstance().invokeHelp("flex.ui.designer.launch");
} else {
handler.consume(event.getDescription());
}
}
});
notification.notify(project);
}
use of com.intellij.notification.Notification in project android by JetBrains.
the class InstantRunTest method changeManifest.
/**
* Verifies that instant run works as expected when AndroidManifest is changed.
* <p>
* This is run to qualify releases. Please involve the test team in substantial changes.
* <p>
* TR ID: C14581585
* <p>
* <pre>
* Test Steps:
* 1. Import SimpleApplication.
* 2. Update the gradle plugin version if necessary for testing purpose.
* 3. Create an AVD with a system image API 21 or above.
* 4. Run on the AVD
* 5. Verify 1.
* 6. Edit AndroidManifest.
* 7. Run again.
* 8. Verify 2.
* Verify:
* 1. Make sure the right app is installed and started in Run tool window.
* 2. Make sure the instant run is applied in EventLog tool window.
* </pre>
*/
@RunIn(TestGroup.QA)
@Test
public void changeManifest() throws Exception {
IdeFrameFixture ideFrameFixture = guiTest.importSimpleApplication();
updateGradleVersion(guiTest.getProjectPath());
createAVD();
ideFrameFixture.runApp(APP_NAME).selectDevice(AVD_NAME).clickOk();
ideFrameFixture.getRunToolWindow().findContent(APP_NAME).waitForOutput(new PatternTextMatcher(RUN_OUTPUT), 120);
ideFrameFixture.getEditor().open("app/src/main/AndroidManifest.xml", EditorFixture.Tab.EDITOR).moveBetween("", "<application").enterText("<uses-permission android:name=\"android.permission.INTERNET\" /\n");
ideFrameFixture.waitForGradleProjectSyncToFinish().findRunApplicationButton().click();
ideFrameFixture.getRunToolWindow().findContent(APP_NAME).waitForOutput(new PatternTextMatcher(RUN_OUTPUT), 120);
Wait.seconds(1).expecting("The notification is showing").until(() -> {
try {
Notification notification = Iterables.getLast(EventLog.getLogModel(ideFrameFixture.getProject()).getNotifications());
assertThat(notification.getContent()).matches(INSTANT_RUN_NOTIFICATION_REGEX);
return true;
} catch (Exception e) {
System.out.println(e.getClass().toString());
return false;
}
});
}
Aggregations