Examples of TextParamPanel


Examples of org.geoserver.web.data.store.panel.TextParamPanel

            String keyName) {
        if (keyName.contains("Color"))
            return new ColorPickerPanel(id, new MapModel(paramsModel, keyName),
                    new org.apache.wicket.model.ResourceModel(keyName, keyName), false);
        else
            return new TextParamPanel(id, new MapModel(paramsModel, keyName),
                    new org.apache.wicket.model.ResourceModel(keyName, keyName), false);
    }
View Full Code Here

Examples of org.geoserver.web.data.store.panel.TextParamPanel

        Panel parameterPanel;
        if("dbtype".equals(paramName) || "filetype".equals(paramName)) {
            // skip the two well known discriminators
            IModel model = new MapModel(paramsModel, paramName);
            TextParamPanel tp = new TextParamPanel(componentId,
                    model, new ResourceModel(paramLabel, paramLabel), required);
            tp.setVisible(false);
            parameterPanel = tp;
        } else  if ("namespace".equals(paramName)) {
            IModel namespaceModel = new NamespaceParamModel(paramsModel, paramName);
            IModel paramLabelModel = new ResourceModel(paramLabel, paramLabel);
            parameterPanel = new NamespacePanel(componentId, namespaceModel, paramLabelModel, true);
        } else if (Boolean.class == binding) {
            // TODO Add prefix for better i18n?
            parameterPanel = new CheckBoxParamPanel(componentId, new MapModel(paramsModel,
                    paramName), new ResourceModel(paramLabel, paramLabel));

        } else if (String.class == binding && paramMetadata.isPassword()) {
            parameterPanel = new PasswordParamPanel(componentId, new MapModel(paramsModel,
                    paramName), new ResourceModel(paramLabel, paramLabel), required);
        } else {
            IModel model;
            if("url".equalsIgnoreCase(paramName)) {
                model = new URLModel(paramsModel, paramName);
            } else {
                model = new MapModel(paramsModel, paramName);
            }
           
            TextParamPanel tp = new TextParamPanel(componentId,
                    model, new ResourceModel(paramLabel, paramLabel), required);
            // if it can be a reference to the local filesystem make sure it's valid
            if (paramName.equalsIgnoreCase("url")) {
                tp.getFormComponent().add(new FileExistsValidator());
            }
            // make sure the proper value is returned, but don't set it for strings otherwise
            // we incur in a wicket bug (the empty string is not converter back to a null)
            // GR: it doesn't work for File neither.
            // AA: better not mess with files, the converters turn data dir relative to
            // absolute and bye bye data dir portability
            if (binding != null && !String.class.equals(binding) && !File.class.equals(binding)
                    && !URL.class.equals(binding)) {
                tp.getFormComponent().setType(binding);
            }
            parameterPanel = tp;
        }
        return parameterPanel;
    }
View Full Code Here

Examples of org.geoserver.web.data.store.panel.TextParamPanel

        form = new Form("form", model);
        add(form);

        // name
        PropertyModel nameModel = new PropertyModel(model, "name");
        final TextParamPanel namePanel = new TextParamPanel("namePanel", nameModel,
                new ResourceModel("dataSrcName", "Data Source Name"), true);

        form.add(namePanel);

        // description and enabled
        form.add(new TextParamPanel("descriptionPanel", new PropertyModel(model,
                "description"), new ResourceModel("description", "Description"), false));
        form.add(new CheckBoxParamPanel("enabledPanel", new PropertyModel(model, "enabled"),
                new ResourceModel("enabled", "Enabled")));
        // a custom converter will turn this into a namespace url
        workspacePanel = new WorkspacePanel("workspacePanel",
                new PropertyModel(model, "workspace"), new ResourceModel("workspace", "Workspace"),
                true);
        form.add(workspacePanel);
       
        capabilitiesURL = new TextParamPanel("capabilitiesURL", new PropertyModel(form.getModelObject(), "capabilitiesURL"),
                new ParamResourceModel("capabilitiesURL", AbstractWMSStorePage.this), true);
        form.add(capabilitiesURL);

        // cancel/submit buttons
        form.add(new BookmarkablePageLink("cancel", StorePage.class));
        form.add(saveLink());
        form.setDefaultButton(saveLink());

        // feedback panel for error messages
        form.add(new FeedbackPanel("feedback"));

        StoreNameValidator storeNameValidator = new StoreNameValidator(workspacePanel
                .getFormComponent(), namePanel.getFormComponent(), store.getId());
        form.add(storeNameValidator);
    }
View Full Code Here

Examples of org.geoserver.web.data.store.panel.TextParamPanel

             */
            final IModel paramValue = new MapModel(paramsModel, TABLE_NAME);
            final String resourceKey = RESOURCE_KEY_PREFIX + "." + TABLE_NAME;
            final IModel paramLabelModel = new ResourceModel(resourceKey, TABLE_NAME);
            final boolean required = true;
            TextParamPanel tableNamePanel;
            tableNamePanel = new TextParamPanel(panelId, paramValue, paramLabelModel, required);
            add(tableNamePanel);

            tableNameComponent = tableNamePanel.getFormComponent();
            tableNameComponent.setEnabled(false);

            final String titleKey = resourceKey + ".title";
            ResourceModel titleModel = new ResourceModel(titleKey);
            String title = String.valueOf(titleModel.getObject());

            tableNamePanel.add(new SimpleAttributeModifier("title", title));
        }

        return tableNameComponent;
    }
View Full Code Here

Examples of org.geoserver.web.data.store.panel.TextParamPanel

        final String paramName = param.key;
        final String resourceKey = getClass().getSimpleName() + "." + paramName;

        final boolean required = param.required;

        final TextParamPanel textParamPanel = new TextParamPanel(paramName, new MapModel(
                paramsModel, paramName), new ResourceModel(resourceKey, paramName), required);
        textParamPanel.getFormComponent().setType(param.type);

        String defaultTitle = String.valueOf(param.title);

        ResourceModel titleModel = new ResourceModel(resourceKey + ".title", defaultTitle);
        String title = String.valueOf(titleModel.getObject());

        textParamPanel.add(new SimpleAttributeModifier("title", title));

        add(textParamPanel);
        return textParamPanel.getFormComponent();
    }
View Full Code Here

Examples of org.geoserver.web.data.store.panel.TextParamPanel

        setDefaultModel(model);

        final IModel paramsModel = new PropertyModel(model, "connectionParameters");
        new MapModel(paramsModel, CONFIGURATION.key).setObject(null);

        add(new TextParamPanel("parallelism", new MapModel(paramsModel, PARALLELISM.key),
                new ParamResourceModel("parallelism", this), true));

        add(new CheckBoxParamPanel("tolerateErrors", new MapModel(paramsModel,
                TOLERATE_CONNECTION_FAILURE.key), new ParamResourceModel("tolerateErrors", this)));
View Full Code Here

Examples of org.geoserver.web.data.store.panel.TextParamPanel

        advancedConfigPanel.setOutputMarkupId(true);
        advancedConfigPanel.setVisible(false);
        configsContainer.add(advancedConfigPanel);

        // TODO: Check whether this constructor is properly setup
        final TextParamPanel url = new TextParamPanel("urlPanel", new PropertyModel(paramsModel, "URL"),
                new ResourceModel("url", "URL"), true);
        final FormComponent urlFormComponent = url.getFormComponent();
        urlFormComponent.add(new FileExistsValidator());
        add(url);
       
        // enabled flag, and show the rest only if enabled is true
        IModel<Boolean> enabledModel = new Model<Boolean>(false);
View Full Code Here

Examples of org.geoserver.web.data.store.panel.TextParamPanel

        final String resourceKey = getClass().getSimpleName() + "." + paramName;

        final boolean required = true;

        final TextParamPanel textParamPanel = new TextParamPanel(paramName, new MapModel(
                paramsModel, paramName), new ResourceModel(resourceKey, paramName), required);
        textParamPanel.getFormComponent().setType(String.class);

        String defaultTitle = paramName;

        ResourceModel titleModel = new ResourceModel(resourceKey + ".title", defaultTitle);
        String title = String.valueOf(titleModel.getObject());

        textParamPanel.add(new SimpleAttributeModifier("title", title));

        add(textParamPanel);
        return textParamPanel.getFormComponent();
    }
View Full Code Here

Examples of org.geoserver.web.data.store.panel.TextParamPanel

    }
   
    private FormComponent addTextPanel(final IModel paramsModel, final String paramName, final String paramTitle, final boolean required) {
        final String resourceKey = getClass().getSimpleName() + "." + paramName;

        final TextParamPanel textParamPanel = new TextParamPanel(paramName, new MapModel(
                paramsModel, paramTitle), new ResourceModel(resourceKey, paramName), required);
        textParamPanel.getFormComponent().setType(String.class/*param.type*/);

        String defaultTitle = paramTitle;

        ResourceModel titleModel = new ResourceModel(resourceKey + ".title", defaultTitle);
        String title = String.valueOf(titleModel.getObject());

        textParamPanel.add(new SimpleAttributeModifier("title", title));

        add(textParamPanel);
        return textParamPanel.getFormComponent();
    }
View Full Code Here

Examples of org.geoserver.web.data.store.panel.TextParamPanel

        paramsForm.add(new Label("storeType", format.getName()));
        paramsForm.add(new Label("storeTypeDescription", format.getDescription()));

        // name
        PropertyModel nameModel = new PropertyModel(model, "name");
        final TextParamPanel namePanel = new TextParamPanel("namePanel", nameModel,
                new ResourceModel("AbstractCoverageStorePage.dataSrcName", "Data Source Name"), true);

        paramsForm.add(namePanel);

        // description and enabled
        paramsForm.add(new TextParamPanel("descriptionPanel", new PropertyModel(model,
                "description"), new ResourceModel("AbstractCoverageStorePage.description", "Description"), false));
        paramsForm.add(new CheckBoxParamPanel("enabledPanel", new PropertyModel(model, "enabled"),
                new ResourceModel("enabled", "Enabled")));
        // a custom converter will turn this into a namespace url
        workspacePanel = new WorkspacePanel("workspacePanel",
                new PropertyModel(model, "workspace"), new ResourceModel("workspace", "Workspace"),
                true);
        paramsForm.add(workspacePanel);

        final StoreEditPanel storeEditPanel;
        {
            /*
             * Here's where the extension point is applied in order to give extensions a chance to
             * provide custom behavior/components for the coverage form other than the default
             * single "url" input field
             */
            GeoServerApplication app = getGeoServerApplication();
            storeEditPanel = StoreExtensionPoints.getStoreEditPanel("parametersPanel", paramsForm,
                    store, app);
        }
        paramsForm.add(storeEditPanel);

        // cancel/submit buttons
        paramsForm.add(new BookmarkablePageLink<StorePage>("cancel", StorePage.class));
        paramsForm.add(saveLink());
        paramsForm.setDefaultButton(saveLink());

        // feedback panel for error messages
        paramsForm.add(new FeedbackPanel("feedback"));

        StoreNameValidator storeNameValidator = new StoreNameValidator(workspacePanel
                .getFormComponent(), namePanel.getFormComponent(), store.getId());
        paramsForm.add(storeNameValidator);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.