Package org.apache.wicket.model

Examples of org.apache.wicket.model.StringResourceModel


            String version = String.valueOf(new ResourceModel("version").getObject());
            String contactEmail = contact.getContactEmail();
            HashMap<String, String>params = new HashMap<String, String>();
            params.put("version", version);
            params.put("contactEmail", contactEmail);
            Label label = new Label("footerMessage", new StringResourceModel("GeoServerHomePage.footer", this, new Model(params)));
            label.setEscapeModelStrings(false);
            add(label);
        }
       
        Authentication auth = getSession().getAuthentication();
View Full Code Here


        form.add(new CheckBox("stdOutLogging", new PropertyModel( loggingInfoModel, "stdOutLogging")));
        form.add(new TextField("loggingLocation", new PropertyModel( loggingInfoModel, "location")) );
       
        form.add(new TextField("featureTypeCacheSize"));
       
        Button submit = new Button("submit", new StringResourceModel("submit", this, null)) {
            @Override
            public void onSubmit() {
                GeoServer gs = getGeoServer();
                gs.save( (GeoServerInfo) globalInfoModel.getObject() );
                gs.save( (LoggingInfo) loggingInfoModel.getObject() );
View Full Code Here

        List<DemoLinkInfo> links = getGeoServerApplication().getBeansOfType(DemoLinkInfo.class);
        add(new ListView("demoList", links){
            public void populateItem(ListItem item){
                final DemoLinkInfo info = (DemoLinkInfo)item.getModelObject();
                item.add(new BookmarkablePageLink("theLink", info.getComponentClass())
                .add(new Label("theTitle", new StringResourceModel(info.getTitleKey(), (Component)null, null))));
                item.add(new Label("theDescription", new StringResourceModel(info.getDescriptionKey(), (Component)null, null)));
            }
        });

    }
View Full Code Here

        };
       
        Form form = new Form( "form", new CompoundPropertyModel(infoModel));
        add(form);
       
        form.add(new Label("service.enabled", new StringResourceModel("service.enabled", this, null, new Object[]{
            getServiceName()
        })));
        form.add(new TextField("maintainer"));
        TextField onlineResource = new TextField("onlineResource");
        onlineResource.add(new UrlValidator());
        form.add(onlineResource);
        form.add(new CheckBox("enabled"));
        form.add(new CheckBox("citeCompliant"));
        form.add(new TextField("title"));
        form.add(new TextArea("abstract"));
        form.add(new KeywordsEditor("keywords", LiveCollectionModel.list(new PropertyModel(infoModel, "keywords"))));
        form.add(new TextField("fees"));
        form.add(new TextField("accessConstraints"));
       
        build(infoModel, form);
       
        SubmitLink submit = new SubmitLink("submit",new StringResourceModel( "save", (Component)null, null) ) {
            @Override
            public void onSubmit() {
                handleSubmit((T)infoModel.getObject());
                setResponsePage(GeoServerHomePage.class);
            }
        };
        form.add(submit);
       
        Button cancel = new Button( "cancel", new StringResourceModel( "cancel", (Component)null, null) ) {
            public void onSubmit() {
                setResponsePage(GeoServerHomePage.class);
            }
        };
        form.add( cancel );
View Full Code Here

        add(logoutForm);
        logoutForm.add(new Label("username", anonymous ? "Nobody" : user.getName()));

        // home page link
        add( new BookmarkablePageLink( "home", GeoServerHomePage.class )
            .add( new Label( "label", new StringResourceModel( "home", (Component)null, null ) )  ) );
       
        // dev buttons
        DeveloperToolbar devToolbar = new DeveloperToolbar("devButtons");
        add(devToolbar);
        devToolbar.setVisible(Application.DEVELOPMENT.equalsIgnoreCase(
                getApplication().getConfigurationType()));
       
        final Map<Category,List<MenuPageInfo>> links = splitByCategory(
            filterSecured(getGeoServerApplication().getBeansOfType(MenuPageInfo.class))
        );

        List<MenuPageInfo> standalone = links.containsKey(null)
            ? links.get(null)
            : new ArrayList<MenuPageInfo>();
        links.remove(null);

        List<Category> categories = new ArrayList(links.keySet());
        Collections.sort(categories);

        add(new ListView("category", categories){
            public void populateItem(ListItem item){
                Category category = (Category)item.getModelObject();
                item.add(new Label("category.header", new StringResourceModel(category.getNameKey(), (Component) null, null)));
                item.add(new ListView("category.links", links.get(category)){
                    public void populateItem(ListItem item){
                        MenuPageInfo info = (MenuPageInfo)item.getModelObject();
                        BookmarkablePageLink link = new BookmarkablePageLink("link", info.getComponentClass());
                        link.add(new AttributeModifier("title", true, new StringResourceModel(info.getDescriptionKey(), (Component) null, null)));
                        link.add(new Label("link.label", new StringResourceModel(info.getTitleKey(), (Component) null, null)));
                        Image image;
                        if(info.getIcon() != null) {
                            image = new Image("link.icon", new ResourceReference(info.getComponentClass(), info.getIcon()));
                        } else {
                            image = new Image("link.icon", new ResourceReference(GeoServerBasePage.class, "img/icons/silk/wrench.png"));
                        }
                        image.add(new AttributeModifier("alt", true, new ParamResourceModel(info.getTitleKey(), null)));
                        link.add(image);
                        item.add(link);
                    }
                });
            }
        });

        add(new ListView("standalone", standalone){
                    public void populateItem(ListItem item){
                        MenuPageInfo info = (MenuPageInfo)item.getModelObject();
                        BookmarkablePageLink link = new BookmarkablePageLink("link", info.getComponentClass());
                        link.add(new AttributeModifier("title", true, new StringResourceModel(info.getDescriptionKey(), (Component) null, null)));
                        link.add(new Label("link.label", new StringResourceModel(info.getTitleKey(), (Component) null, null)));
                        item.add(link);
                       
                    }
                }
        );
View Full Code Here

                StyleInfo s = (StyleInfo) object;
                if ( StyleInfo.DEFAULT_POINT.equals( s.getName() ) ||
                    StyleInfo.DEFAULT_LINE.equals( s.getName() ) ||
                    StyleInfo.DEFAULT_POLYGON.equals( s.getName() ) ||
                    StyleInfo.DEFAULT_RASTER.equals( s.getName() ) ) {
                    return new StringResourceModel("cantRemoveDefaultStyle", StylePage.this, null );
                }
                return null;
            }
        });
        removal.setOutputMarkupId(true);
View Full Code Here

       
        add(reloadWarningDialog = new ModalWindow("reloadWarningDialog"));
        reloadWarningDialog.setPageCreator(new ModalWindow.PageCreator() {
            public Page createPage() {
                return new ReloadWarningDialog(
                    new StringResourceModel("featureTypeReloadWarning", FeatureResourceConfigurationPanel.this, null));
            }
        });
        reloadWarningDialog.setTitle(new StringResourceModel("warning", (Componentnull, null));
        reloadWarningDialog.setInitialHeight(100);
        reloadWarningDialog.setInitialHeight(200);
       
    }
View Full Code Here

     * @param model
     * @param params
     * @return
     */
    public static String localize(String key, IModel model, Object... params) {
        StringResourceModel rm = new StringResourceModel(key, null, model, params) {
            @Override
            public void setLocalizer(Localizer localizer) {
                super.setLocalizer(localizer);
                // crude hack to force into the StringResoruceLoader to grab a locale,
                // which is needed to format numbers with the MessageFormat approach
                // See also: https://issues.apache.org/jira/browse/WICKET-1719
                load();
            }
        };
        rm.setLocalizer(GeoServerApplication.get().getResourceSettings().getLocalizer());
        return rm.getString();
    }
View Full Code Here

        // collect the objects that will be removed (besides the roots)
        Catalog catalog = GeoServerApplication.get().getCatalog();
        CascadeRemovalReporter visitor = new CascadeRemovalReporter(catalog);
        for (Iterator<CatalogInfo> i = (Iterator<CatalogInfo>) roots.iterator(); i.hasNext();) {
            CatalogInfo root = i.next();
            StringResourceModel reason = canRemove(root);
            if ( reason != null ) {
                notRemoved.put(root, reason);
                i.remove();
            }
            else {
View Full Code Here

        ListView lv = new ListView("notRemovedList", items) {
           
            @Override
            protected void populateItem(ListItem item) {
                CatalogInfo object = (CatalogInfo) item.getModelObject();
                StringResourceModel reason = notRemoved.get(object);
                item.add( new Label( "name", name(object) ) );
                item.add( new Label( "reason", reason));
            }
        };
        return lv;
View Full Code Here

TOP

Related Classes of org.apache.wicket.model.StringResourceModel

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.