Example usage for com.intellij.openapi.ui Messages OK_BUTTON

List of usage examples for com.intellij.openapi.ui Messages OK_BUTTON

Introduction

In this page you can find the example usage for com.intellij.openapi.ui Messages OK_BUTTON.

Prototype

String OK_BUTTON

To view the source code for com.intellij.openapi.ui Messages OK_BUTTON.

Click Source Link

Document

Use {code #getOkButton() } instead

Usage

From source file:com.android.tools.idea.updater.configure.SdkUpdaterConfigurable.java

License:Apache License

private static boolean confirmChange(HtmlBuilder message) {
    String[] options = { Messages.OK_BUTTON, Messages.CANCEL_BUTTON };
    Icon icon = AllIcons.General.Warning;

    // I would use showOkCancelDialog but Mac sheet panels do not gracefully handle long messages and their buttons can display offscreen
    return Messages.showIdeaMessageDialog(null, message.getHtml(), "Confirm Change", options, 0, icon,
            null) == Messages.OK;// w w  w.j ava 2  s. c  om
}

From source file:com.headwire.aem.tooling.intellij.communication.MessageManager.java

License:Apache License

public void showAlert(@NotNull final NotificationType type, @NotNull final String title,
        @NotNull final String message) {
    // Make sure the Message is also placed inside the Log Console
    sendNotification(title, message, type);
    ApplicationManager.getApplication().invokeLater(new Runnable() {
        public void run() {
            Messages.showDialog(myProject, message, title, new String[] { Messages.OK_BUTTON }, 0,
                    getIcon(type));/*from   w w  w  .j  av  a  2s .  co  m*/
        }
    });
}

From source file:io.flutter.run.LaunchState.java

License:Open Source License

private RunContentDescriptor launch(@NotNull ExecutionEnvironment env) throws ExecutionException {
    FileDocumentManager.getInstance().saveAllDocuments();

    // Set our FlutterLaunchMode up in the ExecutionEnvironment.
    if (RunMode.fromEnv(env).isProfiling()) {
        FlutterLaunchMode.addToEnvironment(env, FlutterLaunchMode.PROFILE);
    }//from  w ww. j ava2 s. c  o m

    final Project project = getEnvironment().getProject();
    final FlutterDevice device = DeviceService.getInstance(project).getSelectedDevice();
    final FlutterApp app = callback.createApp(device);

    if (device == null) {
        Messages.showDialog(project,
                "No connected devices found; please connect a device, or see flutter.io/setup for getting started instructions.",
                "No Connected Devices Found", new String[] { Messages.OK_BUTTON }, 0,
                AllIcons.General.InformationDialog);

        return null;
    }

    // Cache for use in console configuration.
    FlutterApp.addToEnvironment(env, app);

    // Remember the run configuration that started this process.
    app.getProcessHandler().putUserData(FLUTTER_RUN_CONFIG_KEY, runConfig);

    final ExecutionResult result = setUpConsoleAndActions(app);

    // For Bazel run configurations,
    // where the console is not null,
    // and we find the expected process handler type,
    // print the command line command to the console.
    if (runConfig instanceof BazelRunConfig && app.getConsole() != null
            && app.getProcessHandler() instanceof OSProcessHandler) {
        final String commandLineString = ((OSProcessHandler) app.getProcessHandler()).getCommandLine().trim();
        if (StringUtil.isNotEmpty(commandLineString)) {
            app.getConsole().print(commandLineString + "\n", ConsoleViewContentType.NORMAL_OUTPUT);
        }
    }

    device.bringToFront();

    // Check for and display any analysis errors when we launch an app.
    if (env.getRunProfile() instanceof SdkRunConfig) {
        final Class dartExecutionHelper = classForName(
                "com.jetbrains.lang.dart.ide.runner.DartExecutionHelper");
        if (dartExecutionHelper != null) {
            final String message = ("<a href='open.dart.analysis'>Analysis issues</a> may affect "
                    + "the execution of '" + env.getRunProfile().getName() + "'.");
            final SdkRunConfig config = (SdkRunConfig) env.getRunProfile();
            final SdkFields sdkFields = config.getFields();
            final MainFile mainFile = MainFile.verify(sdkFields.getFilePath(), env.getProject()).get();

            DartExecutionHelper.displayIssues(project, mainFile.getFile(), message,
                    env.getRunProfile().getIcon());
        }
    }

    final FlutterLaunchMode launchMode = FlutterLaunchMode.fromEnv(env);
    if (launchMode.supportsDebugConnection()) {
        return createDebugSession(env, app, result).getRunContentDescriptor();
    } else {
        return new RunContentBuilder(result, env).showRunContent(env.getContentToReuse());
    }
}