Package org.geoserver.web

Examples of org.geoserver.web.CatalogIconFactory


    @Override
    protected Component getComponentForProperty(String id, IModel itemModel,
            Property<StoreInfo> property) {

        final CatalogIconFactory icons = CatalogIconFactory.get();

        if (property == StoreProvider.DATA_TYPE) {
            final StoreInfo storeInfo = (StoreInfo) itemModel.getObject();

            ResourceReference storeIcon = icons.getStoreIcon(storeInfo);

            Fragment f = new Fragment(id, "iconFragment", StorePanel.this);
            f.add(new Image("storeIcon", storeIcon));

            return f;
        } else if (property == WORKSPACE) {
            return workspaceLink(id, itemModel);
        } else if (property == NAME) {
            return storeNameLink(id, itemModel);
        } else if (property == ENABLED) {
            final StoreInfo storeInfo = (StoreInfo) itemModel.getObject();
            ResourceReference enabledIcon;
            if (storeInfo.isEnabled()) {
                enabledIcon = icons.getEnabledIcon();
            } else {
                enabledIcon = icons.getDisabledIcon();
            }
            Fragment f = new Fragment(id, "iconFragment", StorePanel.this);
            f.add(new Image("storeIcon", enabledIcon));
            return f;
        }
View Full Code Here


    GeoServerTablePanel<LayerInfo> table;
    GeoServerDialog dialog;
    SelectionRemovalLink removal;

    public LayerPage() {
        final CatalogIconFactory icons = CatalogIconFactory.get();
        table = new GeoServerTablePanel<LayerInfo>("table", provider, true) {

            @Override
            protected Component getComponentForProperty(String id, IModel itemModel,
                    Property<LayerInfo> property) {
                if(property == TYPE) {
                    Fragment f = new Fragment(id, "iconFragment", LayerPage.this);
                    f.add(new Image("layerIcon", icons.getSpecificLayerIcon((LayerInfo) itemModel.getObject())));
                    return f;
                } else if(property == WORKSPACE) {
                    return workspaceLink(id, itemModel);
                } else if(property == STORE) {
                    return storeLink(id, itemModel);
                } else if(property == NAME) {
                    return layerLink(id, itemModel);
                } else if(property == ENABLED) {
                    LayerInfo layerInfo = (LayerInfo) itemModel.getObject();
                    // ask for enabled() instead of isEnabled() to account for disabled resource/store
                    boolean enabled = layerInfo.enabled();
                    ResourceReference icon = enabled? icons.getEnabledIcon() : icons.getDisabledIcon();
                    Fragment f = new Fragment(id, "iconFragment", LayerPage.this);
                    f.add(new Image("layerIcon", icon));
                    return f;
                } else if(property == SRS) {
                    return new Label(id, SRS.getModel(itemModel));
View Full Code Here

                    IModel itemModel, Property<Resource> property) {
                if (property == NewLayerPageProvider.NAME) {
                    return new Label(id, property.getModel(itemModel));
                } else if (property == NewLayerPageProvider.PUBLISHED) {
                    final Resource resource = (Resource) itemModel.getObject();
                    final CatalogIconFactory icons = CatalogIconFactory.get();
                    if(resource.isPublished()) {
                        ResourceReference icon = icons.getEnabledIcon();
                        Fragment f = new Fragment(id, "iconFragment", NewLayerPage.this);
                        f.add(new Image("layerIcon", icon));
                        return f;
                    } else {
                        return new Label(id);
View Full Code Here

TOP

Related Classes of org.geoserver.web.CatalogIconFactory

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.