Package org.geoserver.web.wicket

Examples of org.geoserver.web.wicket.Icon


                    Property<WorkspaceInfo> property) {
                if ( property == NAME ) {
                    return workspaceLink(id, itemModel);
                } else if (property == DEFAULT) {
                    if(getCatalog().getDefaultWorkspace().equals(itemModel.getObject()))
                        return new Icon(id, CatalogIconFactory.ENABLED_ICON);
                    else
                        return new Label(id, "");
                }
               
                throw new IllegalArgumentException("No such property "+ property.getName());
View Full Code Here


                updateImportLink(importLink, taskTable, target);
            }
        });
        add(selectPanel);

        add(new Icon("icon",new DataIconModel(imp.getData())));
        add(new Label("title", new DataTitleModel(imp))
          .add(new AttributeModifier("title", new DataTitleModel(imp, false))));
       
        add(dialog = new GeoServerDialog("dialog"));
    }
View Full Code Here

                            ImporterWebUtils.importer().changed(model.getObject());
                        };
                    });
                }
            }.add(new Label("name", new PropertyModel(model, "layer.name")))
             .add(new Icon("icon",new DataIconModel(model.getObject().getData()))));
        }
View Full Code Here

                addFilter(newFilter);

                target.addComponent(container);
            }
        };
        addStyleFilterLink.add(new Icon("addIcon", GWCIconFactory.ADD_ICON));
        add(addStyleFilterLink);
       
        // FIXME: make this extensible so new kinds of filter can be supported by
        ArrayList<Class<? extends ParameterFilter>> filterTypes =
                new ArrayList<Class<? extends ParameterFilter>>();
        filterTypes.add(StringParameterFilter.class);
        filterTypes.add(FloatParameterFilter.class);
        filterTypes.add(RegexParameterFilter.class);
       
       
        availableFilterTypes = new DropDownChoice<Class<? extends ParameterFilter>>
            (       "availableFilterTypes",
                    new Model<Class<? extends ParameterFilter>>(),
                    new Model<ArrayList<Class<? extends ParameterFilter>>>(filterTypes),
                    new IChoiceRenderer<Class<? extends ParameterFilter>>() {

                        /** serialVersionUID */
                        private static final long serialVersionUID = 1L;

                        @Override
                        public Object getDisplayValue(
                                Class<? extends ParameterFilter> object) {
                            String resource = "ParameterFilterEditor.filtername."
                                    +object.getCanonicalName();
                            try {
                                // Try to look up a localized name for the class
                                return getLocalizer().getString(resource,
                                        ParameterFilterEditor.this);
                            } catch (MissingResourceException ex) {
                                // Use the simple name as a backup
                                if(LOGGER.isLoggable(Level.CONFIG))
                                    LOGGER.log(Level.CONFIG, "Could not find localization resource"+
                                " for ParameterFilter subclass "+object.getCanonicalName());
                               
                                return object.getSimpleName();
                            }
                        }

                        @Override
                        public String getIdValue(
                                Class<? extends ParameterFilter> object,
                                int index) {
                            return Integer.toString(index);
                        }
               
            });
        availableFilterTypes.setOutputMarkupId(true);
        add(availableFilterTypes);
       
        newFilterKey = new TextField<String>("newFilterKey", Model.of(""));
        add(newFilterKey);
       
        // TODO update this to eliminate keys that are in use
        final RepeatingView commonKeys = new RepeatingView("commonKeys");
        for(String key: COMMON_KEYS) {
            commonKeys.add(new Label(commonKeys.newChildId(), key));
        }
        add(commonKeys);
       
        GeoServerAjaxFormLink addFilterLink = new GeoServerAjaxFormLink("addFilter") {
            private static final long serialVersionUID = 1L;

            @Override
            protected void onClick(AjaxRequestTarget target, Form form) {
                availableFilterTypes.processInput();
                newFilterKey.processInput();
                String key = newFilterKey.getModelObject();
                if(key == null || key.isEmpty()){
                    ParamResourceModel rm = new ParamResourceModel("ParameterFilterEditor.nonEmptyFilter", null, "");
                    error(rm.getString());
                }else{
                    Class<? extends ParameterFilter> type = availableFilterTypes.getModelObject();

                    try {
                        ParameterFilter newFilter = type.getConstructor().newInstance();
                        newFilter.setKey(key);
                        addFilter(newFilter);
                        newFilterKey.setModel(Model.of("")); // Reset the key field
                    } catch (NoSuchMethodException ex) {
                        LOGGER.log(Level.WARNING, "No Default Constructor for "+type ,ex);
                    } catch (InvocationTargetException ex) {
                        LOGGER.log(Level.WARNING, "Could not execute default Constructor for "+type ,ex);
                    } catch (SecurityException ex) {
                        LOGGER.log(Level.WARNING, "Could not execute default Constructor for "+type ,ex);
                    } catch (InstantiationException ex) {
                        LOGGER.log(Level.WARNING, "Could not execute default Constructor for "+type ,ex);
                    } catch (IllegalAccessException ex) {
                        LOGGER.log(Level.WARNING, "Could not execute default Constructor for "+type ,ex);
                    }
                }
                target.addComponent(container);
            }
        };
        addFilterLink.add(new Icon("addIcon", GWCIconFactory.ADD_ICON));
        add(addFilterLink);
    }
View Full Code Here

                target.addComponent(table);
                target.addComponent(availableGridSets);
            }
        };
        addGridsubsetLink.add(new Icon("addIcon", GWCIconFactory.ADD_ICON));
        add(addGridsubsetLink);

        availableGridSets = new DropDownChoice<String>("availableGridsets", new Model<String>(),
                gridSetNames);
        availableGridSets.setOutputMarkupId(true);
View Full Code Here

                    Property<WorkspaceInfo> property) {
                if ( property == NAME ) {
                    return workspaceLink(id, itemModel);
                } else if (property == DEFAULT) {
                    if(getCatalog().getDefaultWorkspace().equals(itemModel.getObject()))
                        return new Icon(id, CatalogIconFactory.ENABLED_ICON);
                    else
                        return new Label(id, "");
                }
               
                throw new IllegalArgumentException("No such property "+ property.getName());
View Full Code Here

                    return editRoleLink(id, itemModel, property);
                } else if (RoleListProvider.ParentPropertyName.equals(property.getName())) {
                        return editParentRoleLink(id, itemModel, property);                   
                } else if (property == RoleListProvider.HASROLEPARAMS) {
                    if((Boolean) property.getModel(itemModel).getObject())
                        return new Icon(id, CatalogIconFactory.ENABLED_ICON);
                    else
                        return new Label(id, "");
                }
                throw new RuntimeException("Uknown property " + property);
            }
View Full Code Here

                    Property<GeoServerUserGroup> property) {
                if (property == GroupListProvider.GROUPNAME) {
                    return editGroupLink(id, itemModel, property);
                } else if (property == GroupListProvider.ENABLED) {
                    if((Boolean) property.getModel(itemModel).getObject())
                        return new Icon(id, CatalogIconFactory.ENABLED_ICON);
                    else
                        return new Label(id, "");
                }
                throw new RuntimeException("Uknown property " + property);
            }
View Full Code Here

                return removeLink(id,itemModel);
            }

   
            if(Boolean.TRUE.equals(property.getModel(itemModel).getObject()))
                return new Icon(id, CatalogIconFactory.ENABLED_ICON);

            if(Boolean.FALSE.equals(property.getModel(itemModel).getObject()))                               
                return new Label(id, "");
           
            return new Label(id, property.getModel(itemModel));           
View Full Code Here

        if (property == UserListProvider.USERNAME) {
            return editUserLink(id, itemModel, property);
        } else if (property == UserListProvider.ENABLED) {
            if((Boolean) property.getModel(itemModel).getObject())
                return new Icon(id, CatalogIconFactory.ENABLED_ICON);
            else
                return new Label(id, "");
        } else if (property == UserListProvider.HASATTRIBUTES) {
            if((Boolean) property.getModel(itemModel).getObject())
                return new Icon(id, CatalogIconFactory.ENABLED_ICON);
            else
                return new Label(id, "");                   
        }               
        throw new RuntimeException("Uknown property " + property);
    }
View Full Code Here

TOP

Related Classes of org.geoserver.web.wicket.Icon

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.