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

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

Introduction

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

Prototype

public static int showDialog(String message, @Nls(capitalization = Nls.Capitalization.Title) String title,
        String @NotNull [] options, int defaultOptionIndex, @Nullable Icon icon,
        @Nullable DialogWrapper.DoNotAskOption doNotAskOption) 

Source Link

Document

Use this method only if you do not know project or component

Usage

From source file:org.jetbrains.plugins.groovy.mvc.MvcFramework.java

License:Apache License

@Nullable
protected GeneralCommandLine getCreationCommandLine(Module module) {
    String message = "Create default " + getDisplayName() + " directory structure in module '"
            + module.getName() + "'?";
    final int result = Messages.showDialog(module.getProject(), message,
            "Create " + getDisplayName() + " application",
            new String[] { "Run 'create-&app'", "Run 'create-&plugin'", "&Cancel" }, 0, getIcon());
    if (result < 0 || result > 1) {
        return null;
    }/*from  w w w  .java 2  s .c  o m*/

    return createCommandAndShowErrors(null, module, true,
            new MvcCommand(result == 0 ? "create-app" : "create-plugin"));
}