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

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

Introduction

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

Prototype

@NotNull
    public static Icon getInformationIcon() 

Source Link

Usage

From source file:com.compoundtheory.intellij.tmux.actions.SelectPaneAction.java

License:Apache License

public void actionPerformed(AnActionEvent e) {
    //Messages.showMessageDialog("Selected " + target, "Information", Messages.getInformationIcon());
    TmuxPlugin.currentTarget = this.target;

    Messages.showMessageDialog("Tmux Pane '" + this.title + "' selected.", "Tmux Pane Selected",
            Messages.getInformationIcon());
}

From source file:com.denimgroup.threadfix.plugins.intellij.dialog.ConfigDialog.java

License:Mozilla Public License

private static String getUrl(AnActionEvent e, String text, String url) {
    Project project = e.getData(PlatformDataKeys.PROJECT);
    return Messages.showInputDialog(project, text, Constants.URL_CONFIG_TITLE, Messages.getInformationIcon(),
            url, UrlValidator.INSTANCE);
}

From source file:com.denimgroup.threadfix.plugins.intellij.dialog.ConfigDialog.java

License:Mozilla Public License

private static String getApiKey(AnActionEvent e, String message, String key) {
    Project project = e.getData(PlatformDataKeys.PROJECT);
    return Messages.showInputDialog(project, message, Constants.API_KEY_TITLE, Messages.getInformationIcon(),
            key, null);//from  ww w . j a  va 2 s .  co m
}

From source file:com.gideon.tools.debug.state.RemoteStateState.java

License:Open Source License

@Override
public ExecutionResult execute(final Executor executor, @NotNull final ProgramRunner runner)
        throws ExecutionException {

    String serverUrl = configuration.getServerUrl();
    String classPath = configuration.getClassPath();
    boolean isDebug = configuration.isDebug();
    JavaPsiFacade facade = JavaPsiFacade.getInstance(myProject);
    PsiClass aClass = facade.findClass(classPath, GlobalSearchScope.projectScope(myProject));
    if (aClass == null) {
        String msg = String.format("class: %s not found!", classPath);
        Messages.showMessageDialog(myProject, msg, "Error", Messages.getInformationIcon());
        return null;
    }// ww  w .  ja v  a  2 s .com
    Module module = ModuleUtil.findModuleForPsiElement(aClass);

    String moduleOutputPath = CompilerPaths.getModuleOutputPath(module, configuration.isTest());
    String filePath = classPath.replace(".", "/");
    String classFilePath = String.format("%s/%s.class", moduleOutputPath, filePath);
    File file = FileUtils.getFile(classFilePath);
    if (!file.exists()) {
        String msg = String.format("class file path: {} not exists!", classFilePath);
        Messages.showMessageDialog(myProject, msg, "Error Message", Messages.getInformationIcon());
    }
    ConsoleView consoleView = toolWindowUtil.showConsoleToolWindow(myProject, configuration.getName());
    if (isDebug) {
        String debugMsg = String.format("server url:%s\nclass path: %s\nclass file path: %s\n", serverUrl,
                classPath, classFilePath);
        consoleView.print(debugMsg, ConsoleViewContentType.SYSTEM_OUTPUT);
    }
    consoleView.print("=========== remote output ===========\n", ConsoleViewContentType.SYSTEM_OUTPUT);

    InputStream is = null;
    try {
        is = new FileInputStream(classFilePath);
        byte[] b = new byte[is.available()];
        is.read(b);
        is.close();
        String classValue = new String(b, "iso-8859-1");
        String result = HttpUtils.postRequest(serverUrl, classValue);
        consoleView.print(result, ConsoleViewContentType.SYSTEM_OUTPUT);
        consoleView.print("\n", ConsoleViewContentType.SYSTEM_OUTPUT);
    } catch (Exception e) {
        consoleView.print(e.getMessage(), ConsoleViewContentType.SYSTEM_OUTPUT);
        consoleView.print("\n", ConsoleViewContentType.SYSTEM_OUTPUT);
    }

    return null;
}

From source file:com.google.cloud.tools.intellij.debugger.ProjectRepositoryValidator.java

License:Apache License

/**
 * Restore the repository to its original state.
 *//*  w w  w  .j a va2 s.  co m*/
public void restoreToOriginalState(final @NotNull Project project) {
    if (repoState.hasSourceRepository()) {
        assert repoState.getSourceRepository() != null;
        final VirtualFile root = repoState.getSourceRepository().getRoot();

        //check for an unstash requirement.
        final Ref<StashInfo> targetStash = new Ref<StashInfo>();
        if (!Strings.isNullOrEmpty(repoState.getStashMessage())) {
            GitStashUtils.loadStashStack(project, root, new Consumer<StashInfo>() {
                @Override
                public void consume(StashInfo stashInfo) {
                    if (!Strings.isNullOrEmpty(stashInfo.getMessage())
                            && stashInfo.getMessage().equals(repoState.getStashMessage())) {
                        targetStash.set(stashInfo);
                    }
                }
            });
        }

        // If an unstash is required, we will always have an original branch name as well.
        if (!Strings.isNullOrEmpty(repoState.getOriginalBranchName())) {
            assert repoState.getOriginalBranchName() != null;
            String branchDisplayName = repoState.getOriginalBranchName();
            if (branchDisplayName.length() > 10) {
                branchDisplayName = branchDisplayName.substring(0, 7) + "...";
            }
            if (Messages.showYesNoDialog(GctBundle.getString("clouddebug.restorestash", branchDisplayName),
                    GctBundle.getString("clouddebug.restorechanges.title"),
                    Messages.getInformationIcon()) == Messages.YES) {
                final GitBrancher brancher = ServiceManager.getService(project, GitBrancher.class);
                brancher.checkout(repoState.getOriginalBranchName(), false,
                        Collections.singletonList(repoState.getSourceRepository()), new Runnable() {
                            @Override
                            public void run() {
                                repoState.getSourceRepository().update();
                                if (!targetStash.isNull()) {
                                    unstash(project, targetStash, root);
                                }
                            }
                        });
            }
        }
    }
}

From source file:com.google.gct.idea.debugger.ProjectRepositoryValidator.java

License:Apache License

public void restoreToOriginalState(final @NotNull Project project) {
    if (myRepoState.hasSourceRepository()) {
        assert myRepoState.getSourceRepository() != null;
        final VirtualFile root = myRepoState.getSourceRepository().getRoot();

        //check for an unstash requirement.
        final Ref<StashInfo> targetStash = new Ref<StashInfo>();
        if (!Strings.isNullOrEmpty(myRepoState.getStashMessage())) {
            GitStashUtils.loadStashStack(project, root, new Consumer<StashInfo>() {
                @Override/*from   w  w  w  . j  av a2 s. c  o  m*/
                public void consume(StashInfo stashInfo) {
                    if (!Strings.isNullOrEmpty(stashInfo.getMessage())
                            && stashInfo.getMessage().equals(myRepoState.getStashMessage())) {
                        targetStash.set(stashInfo);
                    }
                }
            });
        }

        // If an unstash is required, we will always have an original branch name as well.
        if (!Strings.isNullOrEmpty(myRepoState.getOriginalBranchName())) {
            assert myRepoState.getOriginalBranchName() != null;
            String branchDisplayName = myRepoState.getOriginalBranchName();
            if (branchDisplayName.length() > 10) {
                branchDisplayName = branchDisplayName.substring(0, 7) + "...";
            }
            if (Messages.showYesNoDialog(GctBundle.getString("clouddebug.restorestash", branchDisplayName),
                    GctBundle.getString("clouddebug.restorechanges.title"),
                    Messages.getInformationIcon()) == Messages.YES) {
                final GitBrancher brancher = ServiceManager.getService(project, GitBrancher.class);
                brancher.checkout(myRepoState.getOriginalBranchName(),
                        Collections.singletonList(myRepoState.getSourceRepository()), new Runnable() {
                            @Override
                            public void run() {
                                myRepoState.getSourceRepository().update();
                                if (!targetStash.isNull()) {
                                    unstash(project, targetStash, root);
                                }
                            }
                        });
            }
        }
    }
}

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

License:Apache License

private Icon getIcon(NotificationType type) {
    switch (type) {
    case INFORMATION:
        return Messages.getInformationIcon();
    case WARNING:
        return Messages.getWarningIcon();
    case ERROR:/*w  w w .  j  a  v  a2  s  .  c  o  m*/
    default:
        return Messages.getErrorIcon();
    }
}

From source file:com.hp.alm.ali.idea.services.EntityService.java

License:Apache License

public Entity lockEntity(Entity entity, boolean silent) {
    Entity locked = doLock(new EntityRef(entity), silent);
    if (locked != null) {
        if (!locked.matches(entity)) {
            if (!silent) {
                Messages.showDialog(//from  www. ja va  2s.c o m
                        "Item has been recently modified on the server. Local values have been updated to match the up-to-date revision.",
                        "Entity Update", new String[] { "Continue" }, 0, Messages.getInformationIcon());
            }
            fireEntityLoaded(locked, EntityListener.Event.GET);
        }
    }
    return locked;
}

From source file:com.imaginea.betterdocs.BetterDocsWindow.java

License:Apache License

@Override
public void createToolWindowContent(Project project, ToolWindow toolWindow) {
    toolWindow.setIcon(Messages.getInformationIcon());
    DefaultMutableTreeNode root = new DefaultMutableTreeNode(PROJECTS);

    JTree jTree = new JTree(root);
    jTree.setVisible(false);/*from w  w w  .  j ava 2  s  .c  om*/
    jTree.setAutoscrolls(true);
    jTree.setForeground(new JBColor(new Color(100, 155, 155), new Color(100, 155, 155)));

    Document document = EditorFactory.getInstance().createDocument("");
    Editor windowEditor = EditorFactory.getInstance().createEditor(document, project,
            FileTypeManager.getInstance().getFileTypeByExtension("java"), false);

    BetterDocsAction action = new BetterDocsAction();
    action.setTree(jTree);
    action.setWindowEditor(windowEditor);

    DefaultActionGroup group = new DefaultActionGroup();
    group.add(action);
    JComponent toolBar = ActionManager.getInstance().createActionToolbar("BetterDocs", group, true)
            .getComponent();

    EditorToggleAction toggleAction = new EditorToggleAction();
    DefaultActionGroup moveGroup = new DefaultActionGroup();
    moveGroup.add(toggleAction);

    FormLayout layout = new FormLayout(PREF_PREF_GROW, PREF_PREF);

    CellConstraints cc = new CellConstraints();

    JBScrollPane jTreeScrollPane = new JBScrollPane();
    jTreeScrollPane.setViewportView(jTree);
    jTreeScrollPane.setAutoscrolls(true);
    jTreeScrollPane.setBackground(new Color(255, 0, 0));
    jTreeScrollPane.setPreferredSize(new Dimension(200, 300));

    JPanel jPanel = new JPanel(layout);
    jPanel.setVisible(true);
    jPanel.add(toolBar, cc.xy(1, 1));
    jPanel.add(jTreeScrollPane, cc.xy(2, 1));

    JBScrollPane jbScrollPane = new JBScrollPane();
    jbScrollPane.setViewportView(windowEditor.getComponent());

    final JSplitPane jSplitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, jbScrollPane, jPanel);
    jSplitPane.setDividerLocation(0.5);
    toggleAction.setjSplitPane(jSplitPane);

    toolWindow.getComponent().getParent().add(jSplitPane);
}

From source file:com.intellij.application.options.colors.FontOptions.java

License:Apache License

public static void showReadOnlyMessage(JComponent parent, final boolean sharedScheme) {
    if (!sharedScheme) {
        Messages.showMessageDialog(parent,
                ApplicationBundle.message("error.readonly.scheme.cannot.be.modified"),
                ApplicationBundle.message("title.cannot.modify.readonly.scheme"),
                Messages.getInformationIcon());
    } else {// www .  ja  v  a  2 s .  c  om
        Messages.showMessageDialog(parent, ApplicationBundle.message("error.shared.scheme.cannot.be.modified"),
                ApplicationBundle.message("title.cannot.modify.readonly.scheme"),
                Messages.getInformationIcon());
    }
}