Examples of IMessageManager


Examples of org.eclipse.ui.forms.IMessageManager

    @Override
    protected void refreshFromModel() {
        lock.modifyOperation(new Runnable() {
            public void run() {
                IMessageManager messages = getManagedForm().getMessageManager();
                messages.removeMessage(MESSAGE_KEY, cmbFramework);
                try {
                    frameworkViewer.setInput(Central.getWorkspace());
                } catch (Exception e) {
                    messages.addMessage(MESSAGE_KEY, "Unable to load OSGi Framework list. " + e.getMessage(), null, IMessageProvider.ERROR, cmbFramework);
                }

                selectedFramework = model.getRunFw();
                if (selectedFramework == null)
                    selectedFramework = "";
View Full Code Here

Examples of org.eclipse.ui.forms.IMessageManager

            }
        }
    }

    private void reloadRepos() {
        final IMessageManager messages = getManagedForm().getMessageManager();
        messages.removeMessage(MESSAGE_KEY, viewer.getControl());
        allRepos.clear();

        try {
            allRepos.addAll(Central.getWorkspace().getPlugins(Repository.class));
        } catch (Exception e) {
            messages.addMessage(MESSAGE_KEY, "Repository List: Unable to load OSGi Repositories. " + e.getMessage(), e, IMessageProvider.ERROR, viewer.getControl());

            // Load the repos and clear the error message if the Workspace is initialised later.
            Central.onWorkspaceInit(new Function<Workspace,Void>() {
                public Void run(final Workspace ws) {
                    SWTConcurrencyUtil.execForControl(viewer.getControl(), true, new Runnable() {
                        public void run() {
                            allRepos.clear();
                            allRepos.addAll(ws.getPlugins(Repository.class));
                            messages.removeMessage(MESSAGE_KEY, viewer.getControl());
                        }
                    });
                    return null;
                }
            });
View Full Code Here

Examples of org.eclipse.ui.forms.IMessageManager

    void reportProblemsInHeader() {
        IManagedForm mform = getManagedForm();
        if (mform == null)
            return;

        IMessageManager manager = mform.getMessageManager();
        manager.removeMessages();

        for (Entry<String,Integer> entry : messageSeverityMap.entrySet()) {
            // severities in IMessageProvider are 1 higher than in IMarker
            int mappedSeverity = entry.getValue() + 1;

            IAction[] fixes = messageFixesMap.get(entry.getKey()); // may be null

            manager.addMessage(entry.getKey(), entry.getKey(), fixes, mappedSeverity);
        }
    }
View Full Code Here

Examples of org.eclipse.ui.forms.IMessageManager

        }
    }

    @Override
    public void validate() {
        IMessageManager msgs = getManagedForm().getMessageManager();
        msgs.setDecorationPosition(SWT.TOP | SWT.RIGHT);

        String noStarWarning = null;
        String actionMessage = null;
        List<ImportPattern> patterns = getClauses();
        if (!patterns.isEmpty()) {
            for (Iterator<ImportPattern> iter = patterns.iterator(); iter.hasNext();) {
                ImportPattern pattern = iter.next();
                if (pattern.getName().equals("*") && iter.hasNext()) {
                    noStarWarning = "The catch-all pattern \"*\" should be in the last position.";
                    actionMessage = "Move \"*\" pattern to the last position.";
                    break;
                }
            }

            if (noStarWarning == null) {
                ImportPattern last = patterns.get(patterns.size() - 1);
                if (!last.getName().equals("*")) {
                    noStarWarning = "The catch-all pattern \"*\" should be present and in the last position.";
                    actionMessage = "Add missing \"*\" pattern.";
                }
            }
        }
        if (noStarWarning != null) {
            msgs.addMessage("_warning_no_star", noStarWarning, new FixMissingStarsAction(actionMessage), IMessageProvider.WARNING);
        } else {
            msgs.removeMessage("_warning_no_star");
        }
    }
View Full Code Here

Examples of org.eclipse.ui.forms.IMessageManager

                lock.ifNotModifying(new Runnable() {
                    public void run() {
                        addDirtyProperty(Constants.BUNDLE_ACTIVATOR);
                    }
                });
                IMessageManager msgs = getManagedForm().getMessageManager();
                String activatorError = null;
                int activatorErrorLevel = IMessageProvider.ERROR;

                String activatorClassName = txtActivator.getText();
                if (activatorClassName != null && activatorClassName.length() > 0) {
                    try {
                        IJavaProject javaProject = getJavaProject();
                        if (javaProject == null) {
                            activatorError = "Cannot validate activator class name, the bnd file is not in a Java project.";
                            activatorErrorLevel = IMessageProvider.WARNING;
                        } else {
                            IType activatorType = javaProject.findType(activatorClassName);
                            if (activatorType == null) {
                                activatorError = "The activator class name is not known in this project.";
                                activatorErrorLevel = IMessageProvider.ERROR;
                            }
                        }
                    } catch (JavaModelException e) {
                        logger.logError("Error looking up activator class name: " + activatorClassName, e);
                    }
                }

                if (activatorError != null) {
                    msgs.addMessage(UNKNOWN_ACTIVATOR_ERROR_KEY, activatorError, null, activatorErrorLevel, txtActivator);
                } else {
                    msgs.removeMessage(UNKNOWN_ACTIVATOR_ERROR_KEY, txtActivator);
                }

                checkActivatorIncluded();
            }
        });
View Full Code Here

Examples of org.eclipse.ui.forms.IMessageManager

                    };
                }
            }
        }

        IMessageManager msgs = getManagedForm().getMessageManager();
        if (warningMessage != null)
            msgs.addMessage(UNINCLUDED_ACTIVATOR_WARNING_KEY, warningMessage, fixes, IMessageProvider.WARNING, txtActivator);
        else
            msgs.removeMessage(UNINCLUDED_ACTIVATOR_WARNING_KEY, txtActivator);
    }
View Full Code Here

Examples of org.eclipse.ui.forms.IMessageManager

    void reportProblemsInHeader() {
        IManagedForm mform = getManagedForm();
        if (mform == null)
            return;

        IMessageManager manager = mform.getMessageManager();
        manager.removeMessages();

        for (Entry<String,Integer> entry : messageSeverityMap.entrySet()) {
            // severities in IMessageProvider are 1 higher than in IMarker
            int mappedSeverity = entry.getValue() + 1;

            IAction[] fixes = messageFixesMap.get(entry.getKey()); // may be null

            manager.addMessage(entry.getKey(), entry.getKey(), fixes, mappedSeverity);
        }
    }
View Full Code Here

Examples of org.eclipse.ui.forms.IMessageManager

    @Override
    protected void refreshFromModel() {
        lock.modifyOperation(new Runnable() {
            public void run() {
                IMessageManager messages = getManagedForm().getMessageManager();
                messages.removeMessage(MESSAGE_KEY, cmbFramework);
                try {
                    frameworkViewer.setInput(Central.getWorkspace());
                } catch (Exception e) {
                    messages.addMessage(MESSAGE_KEY, "Unable to load OSGi Framework list. " + e.getMessage(), null, IMessageProvider.ERROR, cmbFramework);
                }

                selectedFramework = model.getRunFw();
                if (selectedFramework == null)
                    selectedFramework = "";
View Full Code Here

Examples of org.eclipse.ui.forms.IMessageManager

        }
    }

    @Override
    public void validate() {
        IMessageManager msgs = getManagedForm().getMessageManager();
        msgs.setDecorationPosition(SWT.TOP | SWT.RIGHT);

        String noStarWarning = null;
        String actionMessage = null;
        List<ImportPattern> patterns = getClauses();
        if (!patterns.isEmpty()) {
            for (Iterator<ImportPattern> iter = patterns.iterator(); iter.hasNext();) {
                ImportPattern pattern = iter.next();
                if (pattern.getName().equals("*") && iter.hasNext()) {
                    noStarWarning = "The catch-all pattern \"*\" should be in the last position.";
                    actionMessage = "Move \"*\" pattern to the last position.";
                    break;
                }
            }

            if (noStarWarning == null) {
                ImportPattern last = patterns.get(patterns.size() - 1);
                if (!last.getName().equals("*")) {
                    noStarWarning = "The catch-all pattern \"*\" should be present and in the last position.";
                    actionMessage = "Add missing \"*\" pattern.";
                }
            }
        }
        if (noStarWarning != null) {
            msgs.addMessage("_warning_no_star", noStarWarning, new FixMissingStarsAction(actionMessage), IMessageProvider.WARNING);
        } else {
            msgs.removeMessage("_warning_no_star");
        }
    }
View Full Code Here

Examples of org.eclipse.ui.forms.IMessageManager

    public void refresh() {
        subBundleList = model.getSubBndFiles();

        lock.modifyOperation(new Runnable() {
            public void run() {
                IMessageManager msgs = getManagedForm().getMessageManager();
                Control control = getSection().getDescriptionControl();
                if (control == null)
                    control = getSection().getClient();

                if (subBundleList == null || subBundleList.isEmpty()) {
                    button.setGrayed(false);
                    button.setSelection(false);
                    msgs.removeMessage(WARNING_EDITED_MANUALLY, control);
                } else if (subBundleList.size() == 1 && subBundleList.iterator().next().equalsIgnoreCase(ALL_BND)) {
                    button.setGrayed(false);
                    button.setSelection(true);
                    msgs.removeMessage(WARNING_EDITED_MANUALLY, control);
                } else {
                    button.setGrayed(true);
                    button.setSelection(true);
                    msgs.addMessage(WARNING_EDITED_MANUALLY, "The '-sub' setting has been edited manually in the bnd.bnd file. Changing here will override the manually provided setting.", null, IMessageProvider.WARNING, control);
                }
            }
        });
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.