Package org.geotools.data.aggregate

Examples of org.geotools.data.aggregate.AggregateTypeConfiguration


public class ConfigNewPage extends AbstractConfigPage {

    public ConfigNewPage(AggregateStoreEditPanel master) {
        super(master);
        initUI(new AggregateTypeConfiguration(""));
    }
View Full Code Here


     */
    protected void initUI(AggregateTypeConfiguration config) {
        // we need to clone the config since the table will modify it directly, it's not like
        // a normal form component
        originalConfig = config;
        configModel = new Model<AggregateTypeConfiguration>(new AggregateTypeConfiguration(config));
        form = new Form<AggregateTypeConfiguration>("form", new CompoundPropertyModel(configModel));
        add(form);
        name = new TextField("name");
        name.setOutputMarkupId(true);
        name.setRequired(true);
View Full Code Here

        SimpleAjaxLink link = new SimpleAjaxLink(id, itemModel, new ParamResourceModel("remove", this)) {
           
            @Override
            protected void onClick(AjaxRequestTarget target) {
                // remove the link
                AggregateTypeConfiguration config = form.getModelObject();
                config.getSourceTypes().remove(getModelObject());
                // refresh the whole form (lazy, we could add a container around the table)
                target.addComponent(sources);
            }
        };
        return link;
View Full Code Here

        return new SimpleAjaxLink(id, itemModel, new ParamResourceModel("makeDefault", this)) {
           
            @Override
            protected void onClick(AjaxRequestTarget target) {
                // remove the link
                AggregateTypeConfiguration config = form.getModelObject();
                config.setPrimarySourceType((SourceType) getModelObject());
                // refresh the whole form (lazy, we could add a container around the table)
                target.addComponent(sources);
            }
        };
    }
View Full Code Here

    private Component addConfigLink() {
        return new AjaxLink<Void>("addType") {

            @Override
            public void onClick(AjaxRequestTarget target) {
                AggregateTypeConfiguration config = form.getModelObject();
                String storeName = stores.getModelObject().getName();
                String typeName = types.getModelObject();
                stores.setModelObject(null);
                types.setModelObject(null);
                config.addSourceType(storeName, typeName);
                if(name.getModelObject() == null || "".equals(name.getModelObject())) {
                    name.setModelObject(typeName);
                    target.addComponent(name);
                }
                // refresh the whole table
View Full Code Here

    private SubmitLink saveLink() {
        return new SubmitLink("save") {
            @Override
            public void onSubmit() {
                AggregateTypeConfiguration config = form.getModelObject();
                List<SourceType> stypes = config.getSourceTypes();
                if(stypes == null || stypes.size() == 0) {
                    error(new ParamResourceModel("atLeastOneSource", AbstractConfigPage.this).getString());
                } else  if (AbstractConfigPage.this.onSubmit()) {
                    originalConfig.copyFrom(config);
                    setResponsePage(master.getPage());
View Full Code Here

        };
        return link;
    }

    Component removeLink(String id, IModel itemModel) {
        final AggregateTypeConfiguration entry = (AggregateTypeConfiguration) itemModel.getObject();
        ImageAjaxLink link = new ImageAjaxLink( id, new ResourceReference( GeoServerApplication.class, "img/icons/silk/delete.png") ) {
            @Override
            protected void onClick(AjaxRequestTarget target) {
               
                configs.remove( entry );
                target.addComponent( configTable );
            }
           
            @Override
            protected IAjaxCallDecorator getAjaxCallDecorator() {
                return new AjaxPreprocessingCallDecorator(null) {

                    @Override
                    public CharSequence preDecorateScript(CharSequence script) {
                        String msg = new ParamResourceModel("confirmTypeRemoval",
                                AggregateStoreEditPanel.this, entry.getName()).getString();
                        return "if(!confirm('" + msg +"')) return false;" + script;
                    }
                };
            }
        };
View Full Code Here

TOP

Related Classes of org.geotools.data.aggregate.AggregateTypeConfiguration

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.