Package org.geoserver.web.wicket

Examples of org.geoserver.web.wicket.SimpleAjaxLink


        ResourceModel resRemove = new ResourceModel("removeStore", "Remove");

        ParamResourceModel confirmRemove = new ParamResourceModel("confirmRemoveStoreX", this, info
                .getName());

        SimpleAjaxLink linkPanel = new ConfirmationAjaxLink(id, null, resRemove, confirmRemove) {
            public void onClick(AjaxRequestTarget target) {
                getCatalog().remove((StoreInfo) itemModel.getObject());
                target.addComponent(StorePanel.this);
            }
        };
View Full Code Here


        @Override
        protected Component getComponentForProperty(String id, IModel itemModel,
                Property<StyleInfo> property) {
            final StyleInfo style = (StyleInfo) itemModel.getObject();
            if ( property == NAME ) {
                return new SimpleAjaxLink( id, NAME.getModel( itemModel ) ) {
                    @Override
                    public void onClick(AjaxRequestTarget target) {
                        handleStyle(style, target);
                    }
                };
View Full Code Here

        @Override
        protected Component getComponentForProperty(String id, final IModel itemModel,
                Property<LayerInfo> property) {
            IModel model = property.getModel( itemModel );
            if ( NAME == property ) {
                return new SimpleAjaxLink( id, model ) {
                    @Override
                    protected void onClick(AjaxRequestTarget target) {
                        LayerInfo layer = (LayerInfo) itemModel.getObject();
                        handleLayer( layer, target );
                    }
View Full Code Here

        } else {
            styleName = null;
        }
           
        // build and returns the link, but disable it if the style is the default
        SimpleAjaxLink link = new SimpleAjaxLink( id, new Model(styleName)) {

            @Override
            public void onClick(AjaxRequestTarget target) {
                popupWindow.setInitialHeight( 375 );
                popupWindow.setInitialWidth( 525 );
                popupWindow.setTitle(new ParamResourceModel("chooseStyle", this));
                popupWindow.setContent( new StyleListPanel( popupWindow.getContentId() ) {
                    @Override
                    protected void handleStyle(StyleInfo style, AjaxRequestTarget target) {
                        popupWindow.close( target );
                       
                        LayerGroupEntry entry = (LayerGroupEntry) itemModel.getObject();
                        entry.setStyle( style );
                       
                        //redraw
                        target.addComponent( layerTable );
                    }
                });
                popupWindow.show(target);
            }

        };
        link.getLink().setEnabled(!defaultStyle);
        return link;
    }
View Full Code Here

        form.add(importAllLink());
       
    }
   
    SimpleAjaxLink resourceChooserLink(String id, IModel itemModel, IModel label) {
        return new SimpleAjaxLink(id, itemModel, label) {

            @Override
            protected void onClick(AjaxRequestTarget target) {
                LayerResource resource = (LayerResource) getDefaultModelObject();
                setResponsePage(new ResourceConfigurationPage(
View Full Code Here

                popup.setContent(new MultipleLayerChooser(popup.getContentId(), CssDemoPage.this));
                popup.show(target);
            }
        });
        ParamResourceModel associateToLayer = new ParamResourceModel("CssDemoPage.associateDefaultStyle", this, styleNameModel, layerNameModel);
        final SimpleAjaxLink associateDefaultStyle = new SimpleAjaxLink("associate.default.style", new Model(), associateToLayer) {
            public void onClick(final AjaxRequestTarget linkTarget) {
                final Component theComponent = this;
                dialog.setResizable(false);
                dialog.setHeightUnit("em");
                dialog.setWidthUnit("em");
                dialog.setInitialHeight(7);
                dialog.setInitialWidth(50);
                dialog.showOkCancel(linkTarget, new DialogDelegate() {
                    boolean success = false;
                   
                    @Override
                    protected boolean onSubmit(AjaxRequestTarget target, Component contents) {
                        layer.setDefaultStyle(style);
                        getCatalog().save(layer);
                        theComponent.setEnabled(false);
                        success = true;
                        return true;
                    }
                   
                    @Override
                    public void onClose(AjaxRequestTarget target) {
                        super.onClose(target);
                        target.addComponent(theComponent);
                        if(success) {
                            CssDemoPage.this.info(new ParamResourceModel("CssDemoPage.styleAssociated",  CssDemoPage.this, styleNameModel, layerNameModel).getString());
                            target.addComponent(getFeedbackPanel());                          
                        }
                    }
                   
                    @Override
                    protected Component getContents(String id) {
                        ParamResourceModel confirm = new ParamResourceModel("CssDemoPage.confirmAssocation", CssDemoPage.this, styleNameModel.getObject(),
                                layerNameModel.getObject(), layer.getDefaultStyle().getName());
                        return new Label(id, confirm);
                    }
                });
            }
        };
        associateDefaultStyle.setOutputMarkupId(true);
        if(layer.getDefaultStyle().equals(style)) {
            associateDefaultStyle.setEnabled(false);
        }
       
        mainContent.add(associateDefaultStyle);

View Full Code Here

        form.add(saveLink());
        form.add(cancelLink());
    }

    protected Component removeLink(String id, IModel itemModel) {
        SimpleAjaxLink link = new SimpleAjaxLink(id, itemModel, new ParamResourceModel("remove", this)) {
           
            @Override
            protected void onClick(AjaxRequestTarget target) {
                // remove the link
                AggregateTypeConfiguration config = form.getModelObject();
View Full Code Here

        };
        return link;
    }
   
    protected Component makeDefaultLink(String id, IModel itemModel) {
        return new SimpleAjaxLink(id, itemModel, new ParamResourceModel("makeDefault", this)) {
           
            @Override
            protected void onClick(AjaxRequestTarget target) {
                // remove the link
                AggregateTypeConfiguration config = form.getModelObject();
View Full Code Here

        };
        return link;
    }
   
    protected Component editLink(String id, IModel itemModel) {
        SimpleAjaxLink link = new SimpleAjaxLink(id, itemModel, new PropertyModel<String>(itemModel, "name")) {
           
            @Override
            protected void onClick(AjaxRequestTarget target) {
                setResponsePage(new ConfigEditPage(AggregateStoreEditPanel.this, (AggregateTypeConfiguration) getModelObject()));               
            }
View Full Code Here

        return null;
    }

    @SuppressWarnings("unchecked")
    SimpleAjaxLink createFixCRSLink(String id, final IModel<ImportTask> itemModel) {
        return new SimpleAjaxLink(id, new Model("Fix...")) {
            @Override
            protected void onClick(AjaxRequestTarget target) {
                dialog.showOkCancel(target, new DialogDelegate() {

                    @Override
View Full Code Here

TOP

Related Classes of org.geoserver.web.wicket.SimpleAjaxLink

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.