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.theoryinpractice.testng.configuration.browser.MethodBrowser.java

License:Apache License

@Override
protected String showDialog() {
    String className = editor.getClassName();
    if (className.trim().length() == 0) {
        Messages.showMessageDialog(getField(), "Set class name first", "Cannot Browse Methods",
                Messages.getInformationIcon());
        return null;
    }/* w  w w.  ja  v a2  s  .c o m*/
    PsiClass psiclass = editor.getModuleSelector().findClass(className);
    if (psiclass == null) {
        Messages.showMessageDialog(getField(), "Class " + className + " does not exist",
                "Cannot Browse Methods", Messages.getInformationIcon());
        return null;
    } else {
        PsiMethod psimethod = MethodList.showDialog(psiclass, getField());
        return psimethod == null ? null : psimethod.getName();
    }
}

From source file:core.DeviceManager.java

License:Apache License

public void adbInit() throws NullAndroidHomeException {
    String androidHome = null;//from  w w w  . ja v a 2s.c  o m

    androidHome = findAndroidHome();

    if (androidHome == null) {
        Messages.showMessageDialog(mProject,
                "Cannot Find $ANDROID_HOME or Android SDK\nPlease set $ANDROID_HOME and restart",
                "Android Property Manager", Messages.getInformationIcon());
        System.out.println("Cannot Find ANDROID_HOME");
        throw new NullAndroidHomeException();
    }

    AndroidDebugBridge.initIfNeeded(false);

    File adbPath = new File(androidHome, "platform-tools" + File.separator + "adb");
    try {
        mADB = AndroidDebugBridge.createBridge(adbPath.getCanonicalPath(), true);

    } catch (IOException e) {
        e.printStackTrace();
    }

    AndroidDebugBridge.addDeviceChangeListener(new AndroidDebugBridge.IDeviceChangeListener() {
        @Override
        public void deviceConnected(IDevice iDevice) {
            Device device = new Device(iDevice);
            PluginViewFactory.getInstance().setHint("Device is Connected");
            String deviceName = device.getSerialNumber();
            if (!mDevices.containsKey(deviceName)) {
                mDevices.put(deviceName, device);
            }
            System.out.println("Device Connected : " + deviceName);
            PluginViewFactory pluginViewFactory = PluginViewFactory.getInstance();
            if (pluginViewFactory != null) {
                pluginViewFactory.updateDeviceListComboBox();
            }
        }

        @Override
        public void deviceDisconnected(IDevice iDevice) {
            //  mCurrentDevice = null;
            System.out.println("DeviceDisconnected");
            PluginViewFactory pluginViewFactory = PluginViewFactory.getInstance();
            mDevices.remove(iDevice.getSerialNumber());
            if (pluginViewFactory != null) {
                pluginViewFactory.updateDeviceListComboBox();
            }
        }

        @Override
        public void deviceChanged(IDevice iDevice, int i) {
            System.out.println("DeviceChanged : " + iDevice.getName());
            PluginViewFactory pluginViewFactory = PluginViewFactory.getInstance();
            if (pluginViewFactory != null && IDevice.CHANGE_STATE == i) {
                pluginViewFactory.SelectedDeviceChanged();
            }
        }
    });
}

From source file:core.DeviceManager.java

License:Apache License

public void setPropertyValue(String name, String value) throws NullValueException {
    if ("".equals(value)) {
        Messages.showMessageDialog(mProject, "Cannot set property : value cannot be null.", "Error",
                Messages.getInformationIcon());
        throw new NullValueException();
    }//from w w w .  j a v a  2s  .  c om
    mDevice.setPropertyValue(name, value);
}

From source file:de.fu_berlin.inf.dpp.intellij.ui.menu.AboutSarosHandler.java

License:Open Source License

@Override
public void actionPerformed(AnActionEvent e) {
    Project project = e.getData(PlatformDataKeys.PROJECT);

    Messages.showMessageDialog(project, "Saros plugin for IntelliJ. \n Still under Development.", "About Saros",
            Messages.getInformationIcon());
}

From source file:io.ballerina.plugins.idea.completion.inserthandlers.AutoImportInsertHandler.java

License:Open Source License

@Override
public void handleInsert(@NotNull InsertionContext context, @NotNull LookupElement item) {
    ApplicationManager.getApplication().invokeLater(() -> {
        CommandProcessor.getInstance().runUndoTransparentAction(() -> {
            PsiElement element = item.getPsiElement();
            if (element == null) {
                return;
            }// w w w .ja  va  2s  .c  om
            String organizationName = element.getUserData(BallerinaCompletionUtils.ORGANIZATION_NAME);
            if (!(element instanceof PsiDirectory)) {
                return;
            }
            String packageName = ((PsiDirectory) element).getName();
            PsiFile file = context.getFile();
            if (!(file instanceof BallerinaFile)) {
                return;
            }
            Editor editor = context.getEditor();
            Project project = editor.getProject();
            if (suggestAlias) {
                alias = Messages.showInputDialog(project,
                        "Package '" + ((PsiDirectory) element).getName()
                                + "' already imported. Please enter an alias:",
                        "Enter Alias", Messages.getInformationIcon());
                if (alias == null || alias.isEmpty()) {
                    Messages.showErrorDialog("Alias cannot be null or empty.", "Error");
                    return;
                }
            }
            // Import the package.
            autoImport(context, organizationName, packageName, alias);
            if (project == null) {
                return;
            }
            if (!isCompletionCharAtSpace(editor)) {
                if (suggestAlias) {
                    // InsertHandler inserts the old package name. So we need to change it to the new alias.
                    PsiElement currentPackageName = file.findElementAt(context.getStartOffset());
                    if (currentPackageName != null) {
                        if (alias == null || alias.isEmpty()) {
                            return;
                        }
                        ApplicationManager.getApplication().runWriteAction(() -> {
                            // Add a new identifier node.
                            PsiElement identifier = BallerinaElementFactory.createIdentifierFromText(project,
                                    alias);
                            currentPackageName.getParent().addBefore(identifier, currentPackageName);
                            // Delete the current identifier node.
                            currentPackageName.delete();
                        });
                    }
                }
                if (myTriggerAutoPopup) {
                    ApplicationManager.getApplication().runWriteAction(() -> {
                        PsiDocumentManager.getInstance(project)
                                .doPostponedOperationsAndUnblockDocument(editor.getDocument());
                        EditorModificationUtil.insertStringAtCaret(editor, ":");
                        PsiDocumentManager.getInstance(project).commitDocument(editor.getDocument());
                    });
                }
            } else {
                editor.getCaretModel().moveToOffset(editor.getCaretModel().getOffset() + 1);
            }
            // Invoke the popup.
            if (myTriggerAutoPopup) {
                // We need to invoke the popup with a delay. Otherwise it might not show.
                ApplicationManager.getApplication().invokeLater(
                        () -> AutoPopupController.getInstance(project).autoPopupMemberLookup(editor, null));
            }
        });
    });
}

From source file:jetbrains.communicator.idea.IDEAFacade.java

License:Apache License

@Override
public void showMessage(String title, String message) {
    Messages.showMessageDialog(message, title, Messages.getInformationIcon());
}

From source file:myActions.HelloWorldAction.java

License:Apache License

public void actionPerformed(AnActionEvent event) {
    // Project project = event.getData(PlatformDataKeys.PROJECT);
    Messages.showMessageDialog("Hello World!", "Information", Messages.getInformationIcon());
}

From source file:myPlugin.src.TextBoxes.java

License:Apache License

public void actionPerformed(AnActionEvent event) {
    Project project = event.getData(PlatformDataKeys.PROJECT);
    String txt = Messages.showInputDialog(project, "Android Class Name", "Android Class Name",
            Messages.getQuestionIcon());
    String recommendation = "";
    rulesForClass = parser.getRuleForClass(rules, txt);
    int i = 1;/*from   w ww .  ja v  a2  s  .c  o m*/
    for (Rule rule : rulesForClass) {
        recommendation += i + ") " + rule.right_hand_side + "\t Confidece: " + rule.confidence + "\n\n";
        i++;
    }
    Messages.showMessageDialog(project, recommendation, "Recommended Intent Actions",
            Messages.getInformationIcon());
}

From source file:net.groboclown.idea.p4ic.ui.config.P4ConfigPanel.java

License:Apache License

private void checkConnection() {
    runBackgroundAwtAction(myCheckConnectionSpinner, new BackgroundAwtAction<Collection<Builder>>() {
        @Override//from  ww w. ja  v a  2  s  . c  o m
        public Collection<Builder> runBackgroundProcess() {
            final ConfigSet sources = getValidConfigs();
            final List<Builder> problems = new ArrayList<Builder>();
            problems.addAll(sources.invalid);
            for (Entry<ProjectConfigSource, Exception> entry : ConnectionUIConfiguration
                    .findConnectionProblems(sources.valid, ServerConnectionManager.getInstance()).entrySet()) {
                final VcsException err;
                //noinspection ThrowableResultOfMethodCallIgnored
                if (entry.getValue() instanceof VcsException) {
                    err = (VcsException) entry.getValue();
                } else {
                    err = new P4FileException(entry.getValue());
                }
                problems.add(entry.getKey().causedError(err));
            }
            return problems;
        }

        @Override
        public void runAwtProcess(final Collection<Builder> problems) {
            if (problems != null && problems.isEmpty()) {
                Messages.showMessageDialog(myProject,
                        P4Bundle.message("configuration.dialog.valid-connection.message"),
                        P4Bundle.message("configuration.dialog.valid-connection.title"),
                        Messages.getInformationIcon());
            } else if (problems != null) {
                reportConfigProblems(problems);
            }
        }
    });
}

From source file:net.groboclown.idea.p4ic.v2.ui.alerts.AbstractErrorHandler.java

License:Apache License

protected void goOffline() {
    serverConnectedController.disconnect();
    Messages.showMessageDialog(getProject(), P4Bundle.message("dialog.offline.went-offline.message"),
            P4Bundle.message("dialog.offline.went-offline.title"), Messages.getInformationIcon());
}