Package org.openfaces.component.tagcloud

Examples of org.openfaces.component.tagcloud.TagCloud


    }

    @Override
    public void setComponentProperties(FacesContext facesContext, UIComponent component) {
        super.setComponentProperties(facesContext, component);
        TagCloud cloud = (TagCloud) component;
        setActionProperty(facesContext, cloud);
        setActionListener(facesContext, cloud);

        setStringProperty(component, "converter");
View Full Code Here


        return "success";
    }

    public void processAction(ActionEvent event) {
        actionListenerCounter++;
        TagCloud cloud = (TagCloud) event.getComponent();
        Map<String, Object> requestMap = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
        var = (Item) requestMap.get(cloud.getVar());
    }
View Full Code Here

    public void setMaxFontSize(Integer maxFontSize) {
        this.maxFontSize = maxFontSize;
    }

    public void processAction(ActionEvent event) {
        TagCloud cloud = (TagCloud) event.getComponent();
        Map<String, Object> requestMap = FacesContext.getCurrentInstance().getExternalContext().getRequestMap();
        var = (Item) requestMap.get(cloud.getVar());
    }
View Full Code Here

    private static final String DEFAULT_ID_FIELD = "::id";

    @Override
    public void decode(FacesContext context, UIComponent component) {
        Map<String, String> requestParameters = context.getExternalContext().getRequestParameterMap();
        TagCloud cloud = (TagCloud) component;
        String clientId = cloud.getClientId(context);

        if (requestParameters.containsKey(clientId+DEFAULT_ID_FIELD)) {
            String id = requestParameters.get(clientId+DEFAULT_ID_FIELD);
            String preId = cloud.getClientId(context) + TagCloud.DEFAULT_ITEM_ID_PREFIX;
            int index = preId.length();
            if (index < id.length() && preId.equals(id.substring(0, index))) {
                cloud.queueEvent(new ActionEvent(cloud));
                cloud.selectItemObject(context, id.substring(index));
            }
        }
    }
View Full Code Here

            throws IOException {
        if (AjaxUtil.getSkipExtraRenderingOnPortletsAjax(context))
            return;

        Components.generateIdIfNotSpecified(component);
        TagCloud cloud = (TagCloud) component;

        if ((cloud.getItemUrl() != null &&  cloud.getRender() != null))
            throw new FacesException("Both attributes 'itemUrl' and 'renderer' cannot be set in the <o:tagCloud> component at the same time");

        String clientId = cloud.getClientId(context);
        ResponseWriter writer = context.getResponseWriter();
        Rendering.writeStandardEvents(writer, cloud);

        writer.startElement("div", cloud);
        writeAttribute(writer, "id", clientId);

        writeAttribute(writer, "class", getTagCloudStyleClass(context, cloud));
        writeAttribute(writer, "style", cloud.getStyle());
        encodeScripts(context, cloud);
        encodeIdField(context, cloud);
        encodeLayout(context, cloud);
    }
View Full Code Here

    public void encodeEnd(FacesContext context, UIComponent component)
            throws IOException {
        ResponseWriter writer = context.getResponseWriter();
        writer.endElement("div");
        writer.flush();
        TagCloud tagCloud = (TagCloud) component;
        List<UIComponent> children = tagCloud.getChildren();
        List<TagCloudItem> items = tagCloud.getTagCloudItems(context);
        for (TagCloudItem tagCloudItem : items) {
            children.remove(tagCloudItem);
        }
    }
View Full Code Here

* @author : roman.nikolaienko
*/
public abstract class AbstractTagCloudLayoutRender extends RendererBase {

    public void renderLayout(FacesContext context, UIComponent component) throws IOException {
        TagCloud cloud = (TagCloud) component;

        List<TagCloudItem> items = cloud.getTagCloudItems(context);

        TagsOrderingStrategy orderingStrategy;
        if (cloud.getLayout().equals(Layout.SPHERE)) {
            orderingStrategy = new TagsWeightReverseOrdering();
        } else {
            orderingStrategy = AbstractTagsOrderingStrategy.getInstance(cloud.getOrder());
        }
        orderingStrategy.order(items);

        renderItems(context, cloud, items);
    }
View Full Code Here

TOP

Related Classes of org.openfaces.component.tagcloud.TagCloud

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.