Package com.volantis.mcs.interaction.diagnostic

Examples of com.volantis.mcs.interaction.diagnostic.ProxyDiagnostic


        Proxy proxy = mapper.dataFromItem(item);

        if (proxy != null) {
            List diagnostics = proxy.getDiagnostics();
            if (diagnostics != null && !diagnostics.isEmpty()) {
                ProxyDiagnostic diag = (ProxyDiagnostic) diagnostics.get(0);
                toolTip = diag.getMessage().toString();
            }
        }

        return toolTip;
    }
View Full Code Here


        resource.deleteMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);

        if (diagnostics != null && !diagnostics.isEmpty()) {
            Iterator it = diagnostics.iterator();
            while (it.hasNext()) {
                ProxyDiagnostic diagnostic = (ProxyDiagnostic) it.next();
                IMarker marker = resource.createMarker(IMarker.PROBLEM);
                marker.setAttribute(IMarker.MESSAGE,
                        diagnostic.getMessage().getMessage());
                marker.setAttribute(IMarker.SEVERITY, IMarker.SEVERITY_ERROR);
                marker.setAttribute(DIAGNOSTIC_PATH_KEY,
                        diagnostic.getProxy().getPathFromRoot().getAsString());
            }
        }
    }
View Full Code Here

    public boolean equals(Object obj) {
        if (!(obj instanceof ProxyDiagnostic)) {
            return false;
        }

        ProxyDiagnostic other = (ProxyDiagnostic) obj;
        if (getLevel() != other.getLevel()) {
            return false;
        }
        if (getProxy() != other.getProxy()) {
            return false;
        }
        if (!getMessage().equals(other.getMessage())) {
            return false;
        }

        return true;
    }
View Full Code Here

        return diagnostics == null ? 0 : diagnostics.size();
    }

    public Object getValueAt(int rowIndex, int columnIndex) {
        List diagnostics = proxy.getDiagnostics();
        ProxyDiagnostic diagnostic = (ProxyDiagnostic) diagnostics.get(rowIndex);
        if (columnIndex == 0) {
            return diagnostic.getMessage();
        }

        return null;
    }
View Full Code Here

        final Proxy firstNameProxy = root.getPropertyProxy(Person.FIRST_NAME);
        final Proxy lastNameProxy = root.getPropertyProxy(Person.LAST_NAME);
        final Proxy ageProxy = root.getPropertyProxy(Person.AGE);
        final Proxy addressProxy = root.getPropertyProxy(Person.ADDRESS);

        final ProxyDiagnostic firstNameDiagnostic = new ProxyDiagnosticImpl(
                DiagnosticLevel.ERROR,
                firstNameProxy,
                modelFactory.createMessage("not.set", "firstName"));
        final ProxyDiagnostic lastNameDiagnostic = new ProxyDiagnosticImpl(
                DiagnosticLevel.ERROR,
                lastNameProxy,
                modelFactory.createMessage("not.set", "lastName"));
        final ProxyDiagnostic ageDiagnostic = new ProxyDiagnosticImpl(
                DiagnosticLevel.ERROR,
                ageProxy,
                modelFactory.createMessage(
                        "out.of.range",
                        new Object[]{
                            new Integer(0),
                            new Integer(100000),
                            new Integer(-10)
                        }));
        final ProxyDiagnostic addressDiagnostic = new ProxyDiagnosticImpl(
                DiagnosticLevel.ERROR,
                addressProxy,
                modelFactory.createMessage("not.set", "address"));

        // Check the diagnostics on the proxies for the properties.
View Full Code Here

    private void checkDiagnostics(Proxy proxy, List expectedDiagnostics) {
        System.out.println("\nChecking diagnostics for " + proxy.getPathAsString());
        List diagnostics = proxy.getDiagnostics();
        for (int i = 0; i < diagnostics.size(); i++) {
            ProxyDiagnostic diagnostic = (ProxyDiagnostic) diagnostics.get(i);
            System.out.println(diagnostic);
        }

        assertEquals(
                "Mismatching diagnostics", expectedDiagnostics, diagnostics);
View Full Code Here

            InternalProxy internalProxy = (InternalProxy)
                    proxy.getEnclosingProxy(path);
            if (internalProxy == null) {
                // System.out.println("Unknown path: " + path.getAsString());
            } else {
                ProxyDiagnostic proxyDiagnostic = new ProxyDiagnosticImpl(
                        diagnostic.getLevel(), internalProxy,
                        diagnostic.getMessage());
                internalProxy.addDiagnostic(proxyDiagnostic);
            }
        }
View Full Code Here

TOP

Related Classes of com.volantis.mcs.interaction.diagnostic.ProxyDiagnostic

Copyright © 2018 www.massapicom. 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.