Examples of GeoServerFileChooser


Examples of org.geoserver.web.wicket.browser.GeoServerFileChooser

                        file = new File(dirField.getInput());
                        if(!file.exists())
                            file = null;
                      }
                       
                        GeoServerFileChooser chooser = new GeoServerFileChooser(id, new Model(file));
                        chooser.setFilter(new Model(new ExtensionFileFilter(".shp")));
                        return chooser;
                    }

                    @Override
                    protected boolean onSubmit(AjaxRequestTarget target, Component contents) {
                        GeoServerFileChooser chooser = (GeoServerFileChooser) contents;
                        directory = ((File) chooser.getModelObject()).getAbsolutePath();
                        // clear the raw input of the field won't show the new model value
                        dirField.clearInput();
                        target.addComponent(dirField);
                        return true;
                    }
View Full Code Here

Examples of org.geoserver.web.wicket.browser.GeoServerFileChooser

                gsDialog.setTitle(new Model(windowTitle));
                gsDialog.showOkCancel(target, new GeoServerDialog.DialogDelegate() {

                    @Override
                    protected boolean onSubmit(AjaxRequestTarget target, Component contents) {
                        GeoServerFileChooser chooser = (GeoServerFileChooser) contents;
                        String path = ((File) chooser.getDefaultModelObject()).getAbsolutePath();
                        // clear the raw input of the field won't show the new model value
                        textField.clearInput();
                        textField.setModelValue(new String[] { path });

                        target.addComponent(textField);
                        return true;
                    }

                    @Override
                    public void onClose(AjaxRequestTarget target) {
                        // update the field with the user chosen value
                        target.addComponent(textField);
                    }

                    @Override
                    protected Component getContents(String id) {
                        File file = null;
                        textField.processInput();
                        String input = (String) textField.getConvertedInput();
                        if (input != null && !input.equals("")) {
                            file = new File(input);
                        }

                        GeoServerFileChooser chooser = new GeoServerFileChooser(id, new Model(file));
                        chooser.setFilter(fileFilter);

                        return chooser;
                    }
                });
            }
View Full Code Here

Examples of org.geoserver.web.wicket.browser.GeoServerFileChooser

                String input = (String) textField.getConvertedInput();
                if (input != null && !input.equals("")) {
                    file = new File(input);
                }

                GeoServerFileChooser chooser = new GeoServerFileChooser(dialog.getContentId(), new Model(file)) {
                    protected void fileClicked(File file, AjaxRequestTarget target) {
                      // clear the raw input of the field won't show the new model value
                      textField.clearInput();
                      textField.setModelObject(file.getAbsolutePath());

                      target.addComponent(textField);
                      dialog.close(target);
                    };
                };
                chooser.setFileTableHeight(null);
                chooser.setFilter(fileFilter);
                dialog.setContent(chooser);
                dialog.setTitle(windowTitle);
                dialog.show(target);
            }
View Full Code Here

Examples of org.geoserver.web.wicket.browser.GeoServerFileChooser

                            file = new File(fileField.getInput());
                            if (!file.exists())
                                file = null;
                        }

                        GeoServerFileChooser chooser = new GeoServerFileChooser(id, new Model(file)) {
                            @Override
                            protected void fileClicked(File file, AjaxRequestTarget target) {
                                SpatialFilePanel.this.file = file.getAbsolutePath();
                               
                                fileField.clearInput();
                                fileField.setModelObject(file.getAbsolutePath());

                                target.addComponent(fileField);
                                dialog.close(target);
                            }
                        };

                        initFileChooser(chooser);
                        return chooser;
                    }

                    @Override
                    protected boolean onSubmit(AjaxRequestTarget target, Component contents) {
                        GeoServerFileChooser chooser = (GeoServerFileChooser) contents;
                        file = ((File) chooser.getDefaultModelObject()).getAbsolutePath();

                        // clear the raw input of the field won't show the new model value
                        fileField.clearInput();
                        //fileField.setModelObject(file);
                       
View Full Code Here

Examples of org.geoserver.web.wicket.browser.GeoServerFileChooser

                gsDialog.setTitle(new Model(windowTitle));
                gsDialog.showOkCancel(target, new GeoServerDialog.DialogDelegate() {

                    @Override
                    protected boolean onSubmit(AjaxRequestTarget target, Component contents) {
                        GeoServerFileChooser chooser = (GeoServerFileChooser) contents;
                        String path = ((File) chooser.getDefaultModelObject()).getAbsolutePath();
                        // clear the raw input of the field won't show the new model value
                        textField.clearInput();
                        textField.setModelValue(new String[] { path });

                        target.addComponent(textField);
                        return true;
                    }

                    @Override
                    public void onClose(AjaxRequestTarget target) {
                        // update the field with the user chosen value
                        target.addComponent(textField);
                    }

                    @Override
                    protected Component getContents(String id) {
                        File file = null;
                        textField.processInput();
                        String input = (String) textField.getConvertedInput();
                        if (input != null && !input.equals("")) {
                            file = new File(input);
                        }

                        GeoServerFileChooser chooser = new GeoServerFileChooser(id, new Model(file));
                        chooser.setFilter(fileFilter);

                        return chooser;
                    }
                });
            }
View Full Code Here

Examples of org.geoserver.web.wicket.browser.GeoServerFileChooser

                String input = (String) textField.getConvertedInput();
                if (input != null && !input.equals("")) {
                    file = new File(input);
                }

                GeoServerFileChooser chooser = new GeoServerFileChooser(dialog.getContentId(), new Model(file)) {
                    protected void fileClicked(File file, AjaxRequestTarget target) {
                      // clear the raw input of the field won't show the new model value
                      textField.clearInput();
                      textField.setModelObject(file.getAbsolutePath());

                      target.addComponent(textField);
                      dialog.close(target);
                    };
                };
                chooser.setFileTableHeight(null);
                chooser.setFilter(fileFilter);
                dialog.setContent(chooser);
                dialog.setTitle(windowTitle);
                dialog.show(target);
            }
View Full Code Here

Examples of org.geoserver.web.wicket.browser.GeoServerFileChooser

                String input = (String) textField.getConvertedInput();
                if (input != null && !input.equals("")) {
                    file = new File(input);
                }

                GeoServerFileChooser chooser = new GeoServerFileChooser(modal.getContentId(), new Model(file)) {
                    protected void fileClicked(File file, AjaxRequestTarget target) {
                      // clear the raw input of the field won't show the new model value
                      textField.clearInput();
                      textField.setModelObject(file.getAbsolutePath());

                      target.addComponent(textField);
                      dialog.close(target);
                    };
                };
                chooser.setFileTableHeight(null);
                modal.setContent(chooser);
                modal.setTitle(windowTitle);
                modal.show(target);
            }
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.