Package javax.faces.component.html

Examples of javax.faces.component.html.HtmlGraphicImage


        Facelet at = f.getFacelet("attribute.xml");

        UIViewRoot root = faces.getViewRoot();
        at.apply(faces, root);

        HtmlGraphicImage graphic1 = (HtmlGraphicImage) root
                .findComponent("graphic1");
        HtmlGraphicImage graphic2 = (HtmlGraphicImage) root
                .findComponent("graphic2");

        assertNotNull("graphic1", graphic1);
        assertNotNull("graphic2", graphic2);

        assertEquals("graphic1 title", "literal", graphic1.getTitle());
        assertEquals("graphic2 title", title, graphic2.getTitle());
    }
View Full Code Here


        UIViewRoot root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root, "testSimpleThisResourceReference.xhtml");

        UINamingContainer compositeComponent = (UINamingContainer) root.findComponent("cc1");
        Assert.assertNotNull(compositeComponent);
        HtmlGraphicImage gi = (HtmlGraphicImage) compositeComponent.getFacet(UIComponent.COMPOSITE_FACET_NAME).findComponent("gi");
        Assert.assertNotNull(gi);
       
        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
        facesContext.setResponseWriter(mrw);
View Full Code Here


    @Override
    protected UIComponent createComponentToTest()
    {
        return new HtmlGraphicImage();
    }
View Full Code Here

    }

    @NotNull
    public static HtmlGraphicImage addGraphicImage(@NotNull
    UIComponent parent, FacesComponentIdFactory idFactory, String url, String alt) {
        HtmlGraphicImage image = FacesComponentUtility.createComponent(HtmlGraphicImage.class, idFactory);
        image.setUrl(url);
        image.setAlt(alt);
        image.setTitle(alt);
        parent.getChildren().add(image);
        return image;
    }
View Full Code Here

        HtmlMenuItem quickLinksItem = new HtmlMenuItem();
        quickLinksItem.setSubmitMode("none");
        quickLinksItem.setId(descriptor.getMenuItemId());

        HtmlOutputLink link;
        HtmlGraphicImage image;

        if (descriptor.getMonitoringUrl() != null /* && LookupUtil.getSystemManager().isMonitoringEnabled()*/) {
            link = FacesComponentUtility.addOutputLink(quickLinksItem, null, descriptor.getMonitoringUrl());
            image = FacesComponentUtility.addGraphicImage(link, null, "/images/icons/Monitor_grey_16.png", "Monitor");
            image.setStyle(STYLE_QUICK_LINKS_ICON);
        }

        if (descriptor.getInventoryUrl() != null) {
            link = FacesComponentUtility.addOutputLink(quickLinksItem, null, descriptor.getInventoryUrl());
            image = FacesComponentUtility.addGraphicImage(link, null, "/images/icons/Inventory_grey_16.png",
                "Inventory");
            image.setStyle(STYLE_QUICK_LINKS_ICON);
        }

        if (descriptor.getAlertsUrl() != null /*&& LookupUtil.getSystemManager().isMonitoringEnabled()*/) {
            link = FacesComponentUtility.addOutputLink(quickLinksItem, null, descriptor.getAlertsUrl());
            image = FacesComponentUtility.addGraphicImage(link, null, "/images/icons/Alert_grey_16.png", "Alerts");
            image.setStyle(STYLE_QUICK_LINKS_ICON);
        }

        if (descriptor.getConfigurationUrl() != null && facets.isConfiguration()) {
            link = FacesComponentUtility.addOutputLink(quickLinksItem, null, descriptor.getConfigurationUrl());
            image = FacesComponentUtility.addGraphicImage(link, null, "/images/icons/Configure_grey_16.png",
                "Configuration");
            image.setStyle(STYLE_QUICK_LINKS_ICON);
        }

        if (descriptor.getOperationUrl() != null && facets.isOperation()) {
            link = FacesComponentUtility.addOutputLink(quickLinksItem, null, descriptor.getOperationUrl());
            image = FacesComponentUtility.addGraphicImage(link, null, "/images/icons/Operation_grey_16.png",
                "Operations");
            image.setStyle(STYLE_QUICK_LINKS_ICON);
        }

        if (descriptor.getEventUrl() != null && facets.isEvent()) {
            link = FacesComponentUtility.addOutputLink(quickLinksItem, null, descriptor.getEventUrl());
            image = FacesComponentUtility.addGraphicImage(link, null, "/images/icons/Events_grey_16.png", "Events");
            image.setStyle(STYLE_QUICK_LINKS_ICON);
        }

        if (descriptor.getContentUrl() != null && facets.isContent()) {
            link = FacesComponentUtility.addOutputLink(quickLinksItem, null, descriptor.getContentUrl());
            image = FacesComponentUtility.addGraphicImage(link, null, "/images/icons/Content_grey_16.png", "Content");
            image.setStyle(STYLE_QUICK_LINKS_ICON);
        }

        menu.getChildren().add(quickLinksItem);
    }
View Full Code Here

        UIViewRoot root = facesContext.getViewRoot();
        vdl.buildView(facesContext, root, "testSimpleThisResourceReference.xhtml");

        UINamingContainer compositeComponent = (UINamingContainer) root.findComponent("cc1");
        Assert.assertNotNull(compositeComponent);
        HtmlGraphicImage gi = (HtmlGraphicImage) compositeComponent.getFacet(UIComponent.COMPOSITE_FACET_NAME).findComponent("gi");
        Assert.assertNotNull(gi);
       
        StringWriter sw = new StringWriter();
        MockResponseWriter mrw = new MockResponseWriter(sw);
        facesContext.setResponseWriter(mrw);
View Full Code Here

{
  if (!(component instanceof HtmlGraphicImage))
  {
    throw new IllegalArgumentException("Component " + component.getClass().getName() + " is no HtmlGraphicImage");
  }
  HtmlGraphicImage comp = (HtmlGraphicImage)component;

  super.setProperties(component);

  if (_dir != null)
  {
    comp.setValueExpression("dir", _dir);
  }
  if (_usemap != null)
  {
    comp.setValueExpression("usemap", _usemap);
  }
  if (_onmousedown != null)
  {
    comp.setValueExpression("onmousedown", _onmousedown);
  }
  if (_onmouseup != null)
  {
    comp.setValueExpression("onmouseup", _onmouseup);
  }
  if (_onclick != null)
  {
    comp.setValueExpression("onclick", _onclick);
  }
  if (_alt != null)
  {
    comp.setValueExpression("alt", _alt);
  }
  if (_onkeydown != null)
  {
    comp.setValueExpression("onkeydown", _onkeydown);
  }
  if (_onmousemove != null)
  {
    comp.setValueExpression("onmousemove", _onmousemove);
  }
  if (_onmouseout != null)
  {
    comp.setValueExpression("onmouseout", _onmouseout);
  }
  if (_onkeypress != null)
  {
    comp.setValueExpression("onkeypress", _onkeypress);
  }
  if (_ismap != null)
  {
    comp.setValueExpression("ismap", _ismap);
  }
  if (_longdesc != null)
  {
    comp.setValueExpression("longdesc", _longdesc);
  }
  if (_onmouseover != null)
  {
    comp.setValueExpression("onmouseover", _onmouseover);
  }
  if (_width != null)
  {
    comp.setValueExpression("width", _width);
  }
  if (_title != null)
  {
    comp.setValueExpression("title", _title);
  }
  if (_url != null)
  {
    comp.setValueExpression("url", _url);
  }
  if (_styleClass != null)
  {
    comp.setValueExpression("styleClass", _styleClass);
  }
  if (_lang != null)
  {
    comp.setValueExpression("lang", _lang);
  }
  if (_ondblclick != null)
  {
    comp.setValueExpression("ondblclick", _ondblclick);
  }
  if (_value != null)
  {
    comp.setValueExpression("value", _value);
  }
  if (_height != null)
  {
    comp.setValueExpression("height", _height);
  }
  if (_style != null)
  {
    comp.setValueExpression("style", _style);
  }
  if (_onkeyup != null)
  {
    comp.setValueExpression("onkeyup", _onkeyup);
  }
}
View Full Code Here

{
  if (!(component instanceof HtmlGraphicImage))
  {
    throw new IllegalArgumentException("Component " + component.getClass().getName() + " is no HtmlGraphicImage");
  }
  HtmlGraphicImage comp = (HtmlGraphicImage)component;

  super.setProperties(component);

  if (_onmouseout != null)
  {
    comp.setValueExpression("onmouseout", _onmouseout);
  }
  if (_title != null)
  {
    comp.setValueExpression("title", _title);
  }
  if (_onmouseup != null)
  {
    comp.setValueExpression("onmouseup", _onmouseup);
  }
  if (_onkeyup != null)
  {
    comp.setValueExpression("onkeyup", _onkeyup);
  }
  if (_url != null)
  {
    comp.setValueExpression("url", _url);
  }
  if (_styleClass != null)
  {
    comp.setValueExpression("styleClass", _styleClass);
  }
  if (_ismap != null)
  {
    comp.setValueExpression("ismap", _ismap);
  }
  if (_dir != null)
  {
    comp.setValueExpression("dir", _dir);
  }
  if (_height != null)
  {
    comp.setValueExpression("height", _height);
  }
  if (_onmousedown != null)
  {
    comp.setValueExpression("onmousedown", _onmousedown);
  }
  if (_onkeypress != null)
  {
    comp.setValueExpression("onkeypress", _onkeypress);
  }
  if (_ondblclick != null)
  {
    comp.setValueExpression("ondblclick", _ondblclick);
  }
  if (_value != null)
  {
    comp.setValueExpression("value", _value);
  }
  if (_style != null)
  {
    comp.setValueExpression("style", _style);
  }
  if (_onmousemove != null)
  {
    comp.setValueExpression("onmousemove", _onmousemove);
  }
  if (_onmouseover != null)
  {
    comp.setValueExpression("onmouseover", _onmouseover);
  }
  if (_width != null)
  {
    comp.setValueExpression("width", _width);
  }
  if (_onkeydown != null)
  {
    comp.setValueExpression("onkeydown", _onkeydown);
  }
  if (_lang != null)
  {
    comp.setValueExpression("lang", _lang);
  }
  if (_usemap != null)
  {
    comp.setValueExpression("usemap", _usemap);
  }
  if (_longdesc != null)
  {
    comp.setValueExpression("longdesc", _longdesc);
  }
  if (_alt != null)
  {
    comp.setValueExpression("alt", _alt);
  }
  if (_onclick != null)
  {
    comp.setValueExpression("onclick", _onclick);
  }
}
View Full Code Here


    @Override
    protected UIComponent createComponentToTest()
    {
        return new HtmlGraphicImage();
    }
View Full Code Here

    public void setUp() throws Exception
    {
        super.setUp();

        graphicImage = new HtmlGraphicImage();

        writer = new MockResponseWriter(new StringWriter(), null, null);
        facesContext.setResponseWriter(writer);

        facesContext.getViewRoot().setRenderKitId(MockRenderKitFactory.HTML_BASIC_RENDER_KIT);
View Full Code Here

TOP

Related Classes of javax.faces.component.html.HtmlGraphicImage

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.