Package nextapp.echo2.app.componentxml

Examples of nextapp.echo2.app.componentxml.InvalidPropertyException


            } else {
                return null;
            }
        } catch (ClassNotFoundException ex) {
            // Should not occur.
            throw new InvalidPropertyException("Object class not found.", ex)
        }
    }
View Full Code Here


    if (propertyElement.hasAttribute("value")) {
      return new HttpImageReference(propertyElement.getAttribute("value"));
    } else {
      Element httpImageReferenceElement = DomUtil.getChildElementByTagName(propertyElement, "http-image-reference");
      if (!httpImageReferenceElement.hasAttribute("uri")) {
        throw new InvalidPropertyException("Invalid HttpImageReference property (uri not specified).", null);
      }
      String url = httpImageReferenceElement.getAttribute("uri");
      Extent width = null;
      if (httpImageReferenceElement.hasAttribute("width")) {
        width = ExtentPeer.toExtent(httpImageReferenceElement.getAttribute("width"));
View Full Code Here

    throws InvalidPropertyException {
        try {
            int colorValue = Integer.parseInt(value.substring(1), 16);
            return new Color(colorValue);
        } catch (IndexOutOfBoundsException ex) {
            throw new InvalidPropertyException("Invalid color value: " + value, ex);
        } catch (NumberFormatException ex) {
            throw new InvalidPropertyException("Invalid color value: " + value, ex);
        }
    }
View Full Code Here

     */
    public Object getValue(ClassLoader classLoader, Class objectClass, Element propertyElement)
    throws InvalidPropertyException {
        Element fillImageElement = DomUtil.getChildElementByTagName(propertyElement, "fill-image");
        if (fillImageElement == null) {
            throw new InvalidPropertyException("Invalid FillImage property.", null);
        }
       
        Extent offsetX = fillImageElement.hasAttribute("horizontal")
                ? ExtentPeer.toExtent(fillImageElement.getAttribute("horizontal")) : null;
        Extent offsetY = fillImageElement.hasAttribute("vertical")
                ? ExtentPeer.toExtent(fillImageElement.getAttribute("vertical")) : null;
       
        int repeat;
        String repeatString = fillImageElement.getAttribute("repeat");
        if ("horizontal".equals(repeatString)) {
            repeat = FillImage.REPEAT_HORIZONTAL;
        } else if ("vertical".equals(repeatString)) {
            repeat = FillImage.REPEAT_VERTICAL;
        } else if ("none".equals(repeatString)) {
            repeat = FillImage.NO_REPEAT;
        } else {
            repeat = FillImage.REPEAT;
        }
       
        Element imageElement = DomUtil.getChildElementByTagName(fillImageElement, "image");
        if (imageElement == null) {
            throw new InvalidPropertyException("Invalid FillImage property.", null);
        }
        String imageType = imageElement.getAttribute("type");
        PropertyLoader propertyLoader = PropertyLoader.forClassLoader(classLoader);
       
        Class propertyClass;
        try {
            propertyClass = Class.forName(imageType, true, classLoader);
        } catch (ClassNotFoundException ex) {
            throw new InvalidPropertyException("Invalid FillImage property (type \"" + imageType + "\" not found.", ex);
        }
       
        Object imagePropertyValue = propertyLoader.getPropertyValue(FillImage.class, propertyClass, imageElement);
        if (!(imagePropertyValue instanceof ImageReference)) {
            throw new InvalidPropertyException("Invalid FillImage property (type \"" + imageType
                    + "\" is not an ImageReference.", null);
        }

        ImageReference imageReference = (ImageReference) imagePropertyValue;
        FillImage fillImage = new FillImage(imageReference, offsetX, offsetY, repeat);
View Full Code Here

     */
    public Object getValue(ClassLoader classLoader, Class objectClass, Element propertyElement)
    throws InvalidPropertyException {
        Element fillImageBorderElement = DomUtil.getChildElementByTagName(propertyElement, "fill-image-border");
        if (fillImageBorderElement == null) {
            throw new InvalidPropertyException("Invalid FillImageBorder property.", null);
        }

        FillImageBorder fillImageBorder = new FillImageBorder();
        PropertyLoader propertyLoader = PropertyLoader.forClassLoader(classLoader);
       
View Full Code Here

                writeMethod.invoke(layoutData, new Object[]{propertyStyle.getProperty(propertyName)});
            }
           
            return layoutData;
        } catch (ClassNotFoundException ex) {
            throw new InvalidPropertyException("Unable to process properties.", ex);
        } catch (ComponentXmlException ex) {
            throw new InvalidPropertyException("Unable to process properties.", ex);
        } catch (InstantiationException ex) {
            throw new InvalidPropertyException("Unable to process properties.", ex);
        } catch (IllegalAccessException ex) {
            throw new InvalidPropertyException("Unable to process properties.", ex);
        } catch (IllegalArgumentException ex) {
            throw new InvalidPropertyException("Unable to process properties.", ex);
        } catch (InvocationTargetException ex) {
            throw new InvalidPropertyException("Unable to process properties.", ex);
        }
    }
View Full Code Here

            return new ResourceImageReference(propertyElement.getAttribute("value"));
        } else {
            Element resourceImageReferenceElement = DomUtil.getChildElementByTagName(propertyElement,
                    "resource-image-reference");
            if (!resourceImageReferenceElement.hasAttribute("resource")) {
                throw new InvalidPropertyException("Invalid ResourceImageReference property (resource not specified).", null);
            }
            String resource = resourceImageReferenceElement.getAttribute("resource");
            String contentType = null;
            if (resourceImageReferenceElement.hasAttribute("content-type")) {
                contentType = resourceImageReferenceElement.getAttribute("content-type");
View Full Code Here

    protected void addAction(String actionCommand) {
        EventListener[] listeners = listenerList.getListeners(ActionListener.class);
        for (int i = 0; i < listeners.length; i++) {
            ActionListener actionListener = (ActionListener) listeners[i];
            try {
                actionListener.actionPerformed(new ActionEvent(JbsDialogWindow.this, actionCommand));
            } catch (Throwable t) {
                logger.error("Error adding action.",t);
            }
        }
    }
View Full Code Here

    protected void addAction(String actionCommand) {
        EventListener[] listeners = listenerList.getListeners(ActionListener.class);
        for (int i = 0; i < listeners.length; i++) {
            ActionListener actionListener = (ActionListener) listeners[i];
            try {
                actionListener.actionPerformed(new ActionEvent(PnEditJbsObject.this, actionCommand));
            } catch (Throwable t) {
                logger.error("Error adding action.",t);
            }
        }
    }
View Full Code Here

        EventListener[] listeners = listenerList.getListeners(ActionListener.class);
        for (int i = 0; i < listeners.length; i++) {
            ActionListener actionListener = (ActionListener) listeners[i];
            try {
                actionListener.actionPerformed(
                        new ActionEvent(JbsOptionPane.this, getActionCommand((Component) e.getSource())));
            } catch (Throwable t) {
                ExceptionHandler.handle(t);
            }
        }
View Full Code Here

TOP

Related Classes of nextapp.echo2.app.componentxml.InvalidPropertyException

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.