Package com.sun.bookstore6.model

Examples of com.sun.bookstore6.model.ImageArea


        UIComponent component) throws IOException {
        if ((context == null) || (component == null)) {
            throw new NullPointerException();
        }

        AreaComponent area = (AreaComponent) component;
        String targetImageId = area.findComponent(area.getTargetImage())
                                   .getClientId(context);
        ImageArea iarea = (ImageArea) area.getValue();
        ResponseWriter writer = context.getResponseWriter();
        StringBuffer sb = null;

        writer.startElement("area", area);
        writer.writeAttribute(
            "alt",
            iarea.getAlt(),
            "alt");
        writer.writeAttribute(
            "coords",
            iarea.getCoords(),
            "coords");
        writer.writeAttribute(
            "shape",
            iarea.getShape(),
            "shape");
        sb = new StringBuffer("document.forms[0]['").append(targetImageId)
                                                    .append("'].src='");
        sb.append(
                getURI(
                        context,
                        (String) area.getAttributes().get("onmouseout")));
        sb.append("'");
        writer.writeAttribute(
            "onmouseout",
            sb.toString(),
            "onmouseout");
        sb = new StringBuffer("document.forms[0]['").append(targetImageId)
                                                    .append("'].src='");
        sb.append(
                getURI(
                        context,
                        (String) area.getAttributes().get("onmouseover")));
        sb.append("'");
        writer.writeAttribute(
            "onmouseover",
            sb.toString(),
            "onmouseover");
View Full Code Here


        UIComponent component) throws IOException {
        if ((context == null) || (component == null)) {
            throw new NullPointerException();
        }

        AreaComponent area = (AreaComponent) component;
        String targetImageId = area.findComponent(area.getTargetImage())
                                   .getClientId(context);
        ImageArea iarea = (ImageArea) area.getValue();
        ResponseWriter writer = context.getResponseWriter();
        StringBuffer sb = null;

        writer.startElement("area", area);
        writer.writeAttribute(
            "alt",
            iarea.getAlt(),
            "alt");
        writer.writeAttribute(
            "coords",
            iarea.getCoords(),
            "coords");
        writer.writeAttribute(
            "shape",
            iarea.getShape(),
            "shape");
        sb = new StringBuffer("document.forms[0]['").append(targetImageId)
                                                    .append("'].src='");
        sb.append(
                getURI(
                        context,
                        (String) area.getAttributes().get("onmouseout")));
        sb.append("'");
        writer.writeAttribute(
            "onmouseout",
            sb.toString(),
            "onmouseout");
        sb = new StringBuffer("document.forms[0]['").append(targetImageId)
                                                    .append("'].src='");
        sb.append(
                getURI(
                        context,
                        (String) area.getAttributes().get("onmouseover")));
        sb.append("'");
        writer.writeAttribute(
            "onmouseover",
            sb.toString(),
            "onmouseover");
View Full Code Here

    }

    protected void setProperties(UIComponent component) {
        super.setProperties(component);

        AreaComponent area = (AreaComponent) component;

        if (alt != null) {
            if (!alt.isLiteralText()) {
                area.setValueExpression("alt", alt);
            } else {
                area.setAlt(alt.getExpressionString());
            }
        }

        if (coords != null) {
            if (!coords.isLiteralText()) {
                area.setValueExpression("coords", coords);
            } else {
                area.setCoords(coords.getExpressionString());
            }
        }

        if (onmouseout != null) {
            if (!onmouseout.isLiteralText()) {
                area.setValueExpression("onmouseout", onmouseout);
            } else {
                area.getAttributes()
                    .put(
                    "onmouseout",
                    onmouseout.getExpressionString());
            }
        }

        if (onmouseover != null) {
            if (!onmouseover.isLiteralText()) {
                area.setValueExpression("onmouseover", onmouseover);
            } else {
                area.getAttributes()
                    .put(
                    "onmouseover",
                    onmouseover.getExpressionString());
            }
        }

        if (shape != null) {
            if (!shape.isLiteralText()) {
                area.setValueExpression("shape", shape);
            } else {
                area.setShape(shape.getExpressionString());
            }
        }

        if (styleClass != null) {
            if (!styleClass.isLiteralText()) {
                area.setValueExpression("styleClass", styleClass);
            } else {
                area.getAttributes()
                    .put(
                    "styleClass",
                    styleClass.getExpressionString());
            }
        }

        if (area instanceof ValueHolder) {
            ValueHolder valueHolder = (ValueHolder) component;

            if (value != null) {
                if (!value.isLiteralText()) {
                    area.setValueExpression("value", value);
                } else {
                    valueHolder.setValue(value.getExpressionString());
                }
            }
        }

        // target image is required
        area.setValueExpression("targetImage", targetImage);
    }
View Full Code Here

        UIComponent component) {
        if ((context == null) || (component == null)) {
            throw new NullPointerException();
        }

        MapComponent map = (MapComponent) component;

        String key = getName(context, map);
        String value = (String) context.getExternalContext()
                                       .getRequestParameterMap()
                                       .get(key);

        if (value != null) {
            map.setCurrent(value);
        }
    }
View Full Code Here

        UIComponent component) throws IOException {
        if ((context == null) || (component == null)) {
            throw new NullPointerException();
        }

        MapComponent map = (MapComponent) component;
        ResponseWriter writer = context.getResponseWriter();

        writer.startElement("map", map);
        writer.writeAttribute(
            "name",
            map.getId(),
            "id");
    }
View Full Code Here

        UIComponent component) throws IOException {
        if ((context == null) || (component == null)) {
            throw new NullPointerException();
        }

        MapComponent map = (MapComponent) component;
        ResponseWriter writer = context.getResponseWriter();

        writer.startElement("input", map);
        writer.writeAttribute("type", "hidden", null);
        writer.writeAttribute(
View Full Code Here

    }

    protected void setProperties(UIComponent component) {
        super.setProperties(component);

        MapComponent map = (MapComponent) component;

        if (styleClass != null) {
            if (!styleClass.isLiteralText()) {
                map.setValueExpression("styleClass", styleClass);
            } else {
                map.getAttributes()
                   .put(
                    "styleClass",
                    styleClass.getExpressionString());
            }
        }

        if (actionListener != null) {
            map.addActionListener(
                    new MethodExpressionActionListener(actionListener));
        }

        if (action != null) {
            map.setActionExpression(action);
        }

        if (immediate != null) {
            if (!immediate.isLiteralText()) {
                map.setValueExpression("immediate", immediate);
            } else {
                map.setImmediate(
                        new Boolean(immediate.getExpressionString())
                        .booleanValue());
            }
        }
    }
View Full Code Here

        return this.name;
    }

    public CreditCardConverter getCreditCard() {
        if (creditCard == null) {
            return new CreditCardConverter();
        }

        return creditCard;
    }
View Full Code Here

        } else if ((previous != null)
                && (current != null)
                && (previous.equals(current))) {
            return;
        } else {
            this.queueEvent(new AreaSelectedEvent(this));
        }
    }
View Full Code Here

    //
    // ActionListener handlers
    //
    public void chooseLocaleFromMap(ActionEvent actionEvent) {
        AreaSelectedEvent event = (AreaSelectedEvent) actionEvent;
        String current = event.getMapComponent()
                              .getCurrent();
        FacesContext context = FacesContext.getCurrentInstance();
        context.getViewRoot()
               .setLocale((Locale) locales.get(current));
    }
View Full Code Here

TOP

Related Classes of com.sun.bookstore6.model.ImageArea

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.