Package org.apache.wicket.markup.html.form

Examples of org.apache.wicket.markup.html.form.TextArea


    Form form = new Form("form", new CompoundPropertyModel(domainObject));
    add(form);
   
    form.add(new TextField("text"));
    form.add(new CheckBox("checkbox"));
    form.add(new TextArea("textarea"));
    form.add(new Button("submit"));
  }
View Full Code Here


            Fragment f = new Fragment("editor", "text", this);
            DropDownChoice mimeChoice = new DropDownChoice("mime", new PropertyModel(
                    getDefaultModel(), "mime"), mimeTypes);
            f.add(mimeChoice);

            f.add(new TextArea("textarea", valueModel));
            add(f);
        } else if (pt == ParameterType.VECTOR_LAYER) {
            // an internal vector layer
            valueModel.setObject(new VectorLayerConfiguration());
            Fragment f = new Fragment("editor", "vectorLayer", this);
View Full Code Here

            Fragment f = new Fragment("editor", "text", this);
            DropDownChoice mimeChoice = new DropDownChoice("mime", new PropertyModel(
                    getDefaultModel(), "mime"), mimeTypes);
            f.add(mimeChoice);

            f.add(new TextArea("textarea", valueModel));
            add(f);
        } else if (pt == ParameterType.VECTOR_LAYER) {
            // an internal vector layer
            if (!(valueModel.getObject() instanceof VectorLayerConfiguration)) {
                valueModel.setObject(new VectorLayerConfiguration());
            }

            new PropertyModel(getDefaultModel(), "mime").setObject("text/xml");
            Fragment f = new Fragment("editor", "vectorLayer", this);
            DropDownChoice layer = new DropDownChoice("layer", new PropertyModel(valueModel,
                    "layerName"), getVectorLayerNames());
            f.add(layer);
            add(f);
        } else if (pt == ParameterType.RASTER_LAYER) {
            // an internal raster layer
            if (!(valueModel.getObject() instanceof RasterLayerConfiguration)) {
                valueModel.setObject(new RasterLayerConfiguration());
            }

            Fragment f = new Fragment("editor", "rasterLayer", this);
            final DropDownChoice layer = new DropDownChoice("layer", new PropertyModel(valueModel,
                    "layerName"), getRasterLayerNames());
            f.add(layer);
            add(f);

            // we need to update the raster own bounding box as wcs requests
            // mandate a spatial extent (why oh why???)
            layer.add(new AjaxFormComponentUpdatingBehavior("onchange") {

                @Override
                protected void onUpdate(AjaxRequestTarget target) {
                    String name = layer.getDefaultModelObjectAsString();
                    LayerInfo li = GeoServerApplication.get().getCatalog().getLayerByName(name);
                    ReferencedEnvelope spatialDomain = li.getResource().getNativeBoundingBox();
                    ((RasterLayerConfiguration) valueModel.getObject())
                            .setSpatialDomain(spatialDomain);
                }
            });
        } else if (pt == ParameterType.REFERENCE) {
            // an external reference
            if (!(valueModel.getObject() instanceof ReferenceConfiguration)) {
                valueModel.setObject(new ReferenceConfiguration());
            }

            Fragment f = new Fragment("editor", "reference", this);
            final DropDownChoice method = new DropDownChoice("method", new PropertyModel(
                    valueModel, "method"), Arrays.asList(ReferenceConfiguration.Method.GET,
                    ReferenceConfiguration.Method.POST));
            f.add(method);

            DropDownChoice mimeChoice = new DropDownChoice("mime", new PropertyModel(valueModel,
                    "mime"), mimeTypes);
            f.add(mimeChoice);

            f.add(new TextField("url", new PropertyModel(valueModel, "url")).setRequired(true));
            final TextArea body = new TextArea("body", new PropertyModel(valueModel, "body"));
            add(body);

            final WebMarkupContainer bodyContainer = new WebMarkupContainer("bodyContainer");
            f.add(bodyContainer);
            bodyContainer.setOutputMarkupId(true);
            bodyContainer.add(body);
            bodyContainer.setVisible(false);

            method.add(new AjaxFormComponentUpdatingBehavior("onchange") {

                @Override
                protected void onUpdate(AjaxRequestTarget target) {
                    boolean post = method.getModelObject() == ReferenceConfiguration.Method.POST;
                    bodyContainer.setVisible(post);
                    body.setRequired(post);
                    target.addComponent(ComplexInputPanel.this);
                }
            });

            add(f);
        } else if (pt == ParameterType.SUBPROCESS) {
            if (!(valueModel.getObject() instanceof ExecuteRequest)) {
                valueModel.setObject(new ExecuteRequest());
            }

            Fragment f = new Fragment("editor", "subprocess", this);
            f.add(new AjaxLink("edit") {

                @Override
                public void onClick(AjaxRequestTarget target) {
                    subprocesswindow.setDefaultModel(valueModel);
                    subprocesswindow.show(target);
                }
            });

            final TextArea xml = new TextArea("xml");
            if (((ExecuteRequest) valueModel.getObject()).processName != null) {
                try {
                    xml.setModelObject(getExecuteXML());
                } catch (Throwable t) {
                    xml.setModel(new Model(""));
                }
            } else {
                xml.setModel(new Model(""));
            }
            xml.setOutputMarkupId(true);
            f.add(xml);

            subprocesswindow.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {

                public void onClose(AjaxRequestTarget target) {
                    // turn the GUI request into an actual WPS request
                    xml.setModelObject(getExecuteXML());

                    target.addComponent(xml);
                }

            });
View Full Code Here

    static class TextAreaPanel extends Panel {

        public TextAreaPanel(String id, IModel textAreaModel) {
            super(id);
           
            add(new TextArea("textArea", textAreaModel));
        }
View Full Code Here

                        MarkupContainer parent = item.getParent();
                        // drill down into the containers to get the actual form components we want
                        final DropDownChoice dd = (DropDownChoice) ((Fragment) ((ListItem) parent
                                .get(3))
                                .get(0)).get(0);
                        final TextArea ta = (TextArea) ((Fragment) ((ListItem) parent.get(4))
                                .get(0)).get(0);
                        dd.add(new OnChangeAjaxBehavior() {

                            @Override
                            protected void onUpdate(AjaxRequestTarget target) {
                                DefaultValuePolicy currentPolicy = (DefaultValuePolicy) dd
                                        .getConvertedInput();
                                ta.setVisible(DefaultValuePolicy.EXPRESSION.equals(currentPolicy));
                                target.addComponent(ta);
                                target.addComponent(table);
                            }
                        });
                    }
View Full Code Here

        add(mapPanel = new OpenLayersMapPanel("map", layer));

        Form form = new Form("form");
        add(form);
       
        form.add(sldTextArea = new TextArea("editor", new PropertyModel(this, "sld")));
        sldTextArea.setOutputMarkupId(true);
        //sldTextArea.add(new EditAreaBehavior());
       
        updateSLD();
       
View Full Code Here

                target.addComponent(outputTextArea);
            }
           
        };
        form.add(clear);
        outputTextArea = new TextArea("output", new PropertyModel(this, "output")) {
            @Override
            protected void onComponentTag(ComponentTag tag) {
                super.onComponentTag(tag);
                tag.put("onkeypress", "if (event.keyCode == 13) { " +
                    "document.getElementById('" + execute.getMarkupId() + "').click();" +
View Full Code Here

        name.setRequired(true);
        groupName = layerGroup.getName();
        form.add(name);

        form.add(new TextField("title"));
        form.add(new TextArea("abstract"));
       
        final DropDownChoice<WorkspaceInfo> wsChoice =
                new DropDownChoice("workspace", new WorkspacesModel(), new WorkspaceChoiceRenderer());
        wsChoice.setNullValid(true);
        if (!isAuthenticatedAsAdmin()) {
View Full Code Here

    static class ExceptionPanel extends Panel {

        public ExceptionPanel(String id, final Exception ex) {
            super(id);
            add(new Label("message", ex.getLocalizedMessage()));
            add(new TextArea("stackTrace", new Model(handleStackTrace(ex))));
            add(new AjaxLink("copy") {
                @Override
                public void onClick(AjaxRequestTarget target) {
                    String text = handleStackTrace(ex);
                    StringSelection selection = new StringSelection(text);
View Full Code Here

        TextField lines = new TextField("lines", new PropertyModel(this, "lines"));
        lines.add(new MinimumValidator(1));
        form.add(lines);

        TextArea logs = new TextArea("logs", new GSLogsModel());
        logs.setOutputMarkupId(true);
        logs.setMarkupId("logs");
        add(logs);

        add(new Link("download") {

            @Override
View Full Code Here

TOP

Related Classes of org.apache.wicket.markup.html.form.TextArea

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.