Examples of TextParamPanel


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

            final IModel wsLabelModel = new ResourceModel("workspace", "Workspace");
            workspacePanel = new WorkspacePanel("workspacePanel", wsModel, wsLabelModel, true);
        }
        paramsForm.add(workspacePanel);

        final TextParamPanel dataStoreNamePanel;

        dataStoreNamePanel = new TextParamPanel("dataStoreNamePanel", new PropertyModel(model,
                "name"),
                new ResourceModel("AbstractDataAccessPage.dataSrcName", "Data Source Name"), true);
        paramsForm.add(dataStoreNamePanel);

        paramsForm.add(new TextParamPanel("dataStoreDescriptionPanel", new PropertyModel(model,
                "description"), new ResourceModel("AbstractDataAccessPage.description", "Description"), false,
                (IValidator[]) null));

        paramsForm.add(new CheckBoxParamPanel("dataStoreEnabledPanel", new PropertyModel(model,
                "enabled"), new ResourceModel("enabled", "Enabled")));

        {
            /*
             * 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,
                    storeInfo, app);
        }
        paramsForm.add(storeEditPanel);

        paramsForm.add(new FeedbackPanel("feedback"));

        // validate the selected workspace does not already contain a store with the same name
        final String dataStoreInfoId = storeInfo.getId();
        StoreNameValidator storeNameValidator = new StoreNameValidator(workspacePanel
                .getFormComponent(), dataStoreNamePanel.getFormComponent(), dataStoreInfoId);
        paramsForm.add(storeNameValidator);

        paramsForm.add(new BookmarkablePageLink("cancel", StorePage.class));

        paramsForm.add(new AjaxSubmitLink("save", paramsForm) {
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 (options != null && options.size() > 0){
           
            IModel<Serializable> valueModel = new MapModel(paramsModel, paramName);
            IModel<String> labelModel = new ResourceModel(paramLabel, paramLabel);
            parameterPanel = new DropDownChoiceParamPanel(componentId, valueModel, labelModel, options,
                    required);
           
        } 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);
            }
           
            Panel tp;
            if(paramMetadata.isLargeText()) {
                tp = new TextAreaParamPanel(componentId,
                        model, new ResourceModel(paramLabel, paramLabel), required);
            } else {
                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
            FormComponent<String> fc = ((ParamPanel) tp).getFormComponent();
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("AbstractWMSStorePage.dataSrcName", "Data Source Name"), true);

        form.add(namePanel);

        // description and enabled
        form.add(new TextParamPanel("descriptionPanel", new PropertyModel(model,
                "description"), new ResourceModel("AbstractWMSStorePage.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(model, "capabilitiesURL"),
                new ParamResourceModel("capabilitiesURL", AbstractWMSStorePage.this), true);
        form.add(capabilitiesURL);

        // user name
        PropertyModel userModel = new PropertyModel(model, "username");
        usernamePanel = new TextParamPanel("userNamePanel", userModel, new ResourceModel(
                "AbstractWMSStorePage.userName"), false);

        form.add(usernamePanel);

        // password
        PropertyModel passwordModel = new PropertyModel(model, "password");
        form.add(password = new PasswordParamPanel("passwordPanel", passwordModel, new ResourceModel(
                "AbstractWMSStorePage.password"), false));
       
        // max concurrent connections
        final PropertyModel<Boolean> useHttpConnectionPoolModel = new PropertyModel<Boolean>(model,
                "useConnectionPooling");
        CheckBoxParamPanel useConnectionPooling = new CheckBoxParamPanel(
                "useConnectionPoolingPanel", useHttpConnectionPoolModel, new ResourceModel(
                        "AbstractWMSStorePage.useHttpConnectionPooling"));
        form.add(useConnectionPooling);

        PropertyModel<String> connectionsModel = new PropertyModel<String>(model, "maxConnections");
        final TextParamPanel maxConnections = new TextParamPanel("maxConnectionsPanel",
                connectionsModel, new ResourceModel("AbstractWMSStorePage.maxConnections"), true,
                new RangeValidator<Integer>(1, 128));
        maxConnections.setOutputMarkupId(true);
        maxConnections.setEnabled(useHttpConnectionPoolModel.getObject());
        form.add(maxConnections);

        useConnectionPooling.getFormComponent().add(new OnChangeAjaxBehavior() {

            @Override
            protected void onUpdate(AjaxRequestTarget target) {
                boolean enabled = useHttpConnectionPoolModel.getObject();
                maxConnections.setEnabled(enabled);
                target.addComponent(maxConnections);
            }
        });
       
        // connect timeout
        PropertyModel<Integer> connectTimeoutModel = new PropertyModel<Integer>(model, "connectTimeout");
        form.add(new TextParamPanel("connectTimeoutPanel", connectTimeoutModel, new ResourceModel(
                "AbstractWMSStorePage.connectTimeout"), true, new RangeValidator<Integer>(1, 240)));

        // read timeout
        PropertyModel<Integer> readTimeoutModel = new PropertyModel<Integer>(model, "readTimeout");
        form.add(new TextParamPanel("readTimeoutPanel", readTimeoutModel, new ResourceModel(
                "AbstractWMSStorePage.readTimeout"), true, new RangeValidator<Integer>(1, 360)));

        // cancel/submit buttons
        form.add(new BookmarkablePageLink("cancel", StorePage.class));
        form.add(saveLink());
View Full Code Here

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

    public DefaultCoverageStoreEditPanel(final String componentId, final Form storeEditForm) {
        super(componentId, storeEditForm);

        final IModel formModel = storeEditForm.getModel();
        // url
        TextParamPanel url = new TextParamPanel("urlPanel", new PropertyModel(formModel, "URL"),
                new ResourceModel("url", "URL"), true);
        url.getFormComponent().add(new FileExistsValidator());
        add(url);
    }
View Full Code Here

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

        return panel;
    }

    private TextParamPanel tileHeight(IModel<GridSetInfo> model) {
        TextParamPanel panel = new TextParamPanel("tileHeight", new PropertyModel<Integer>(model,
                "tileHeight"), new ResourceModel("AbstractGridSetPage.tileHeight"), true,
                new RangeValidator<Integer>(16, 2048));
        return panel;
    }
View Full Code Here

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

                new RangeValidator<Integer>(16, 2048));
        return panel;
    }

    private TextParamPanel tileWidth(IModel<GridSetInfo> model) {
        TextParamPanel panel = new TextParamPanel("tileWidth", new PropertyModel<Integer>(model,
                "tileWidth"), new ResourceModel("AbstractGridSetPage.tileWidth"), true,
                new RangeValidator<Integer>(16, 2048));
        return panel;
    }
View Full Code Here

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

        }

    }

    private TextParamPanel name(IModel<GridSetInfo> model) {
        TextParamPanel namePanel = new TextParamPanel("name", new PropertyModel<String>(model,
                "name"), new ResourceModel("AbstractGridSetPage.name"), true,
                new UniqueNameValidator(model.getObject().getName()));
        return namePanel;
    }
View Full Code Here

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
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.