public void setSelection(File selection) { setDefaultModelObject(selection); }
@Override protected void onUpdate(AjaxRequestTarget target) { File selection = choice.getModelObject(); breadcrumbs.setRootFile(selection); updateFileBrowser(selection, target); } });
/** * Action undertaken as a directory is clicked. Default behavior is to drill down into the * directory. * * @param file * @param target */ protected void directoryClicked(File file, AjaxRequestTarget target) { // explicitly change the root model, inform the other components the model has changed DirectoryChooser.this.directory.setObject(file); directoryListingTable.setDirectory(new Model<>(file)); breadcrumbs.setSelection(file); target.add(directoryListingTable); target.add(breadcrumbs); }
breadcrumbs.setOutputMarkupId(true); add(breadcrumbs);
public FileBreadcrumbs(String id, IModel rootFile, IModel currentFile) { super(id, currentFile); this.rootFile = rootFile; add(new ListView("path", new BreadcrumbModel(rootFile, currentFile)) { @Override protected void populateItem(ListItem item) { File file = (File) item.getModelObject(); boolean last = item.getIndex() == getList().size() - 1; // the link to the current path item Label name = new Label("pathItem", file.getName() + "/"); Link link = new IndicatingAjaxFallbackLink("pathItemLink", item .getModel()) { @Override public void onClick(AjaxRequestTarget target) { pathItemClicked((File) getModelObject(), target); } }; link.add(name); item.add(link); link.setEnabled(!last); } }); }
@Override protected void onUpdate(AjaxRequestTarget target) { File selection = (File) choice.getModelObject(); breadcrumbs.setRootFile(selection); updateFileBrowser(selection, target); }
/** * Action undertaken as a directory is clicked. Default behavior is to drill down into * the directory. * @param file * @param target */ protected void directoryClicked(File file, AjaxRequestTarget target) { // explicitly change the root model, inform the other components the model has changed GeoServerFileChooser.this.file.setObject(file); fileTable.getProvider().setDirectory(new Model(file)); breadcrumbs.setSelection(file); target.addComponent(fileTable); target.addComponent(breadcrumbs); }
breadcrumbs.setOutputMarkupId(true); add(breadcrumbs);
public FileBreadcrumbs(String id, IModel<File> rootFile, IModel<File> currentFile) { super(id, currentFile); this.rootFile = rootFile; add( new ListView<File>("path", new BreadcrumbModel(rootFile, currentFile)) { private static final long serialVersionUID = -855582301247703291L; @Override protected void populateItem(ListItem<File> item) { File file = item.getModelObject(); boolean last = item.getIndex() == getList().size() - 1; // the link to the current path item Label name = new Label("pathItem", file.getName() + "/"); Link<File> link = new IndicatingAjaxFallbackLink<File>( "pathItemLink", item.getModel()) { private static final long serialVersionUID = 4295991386838610752L; @Override public void onClick(AjaxRequestTarget target) { pathItemClicked((File) getModelObject(), target); } }; link.add(name); item.add(link); link.setEnabled(!last); } }); }
@Override protected void onUpdate(AjaxRequestTarget target) { File selection = (File) choice.getModelObject(); breadcrumbs.setRootFile(selection); updateFileBrowser(selection, target); } });
/** * Action undertaken as a directory is clicked. Default behavior is to drill down into the * directory. * * @param file * @param target */ protected void directoryClicked(File file, AjaxRequestTarget target) { // explicitly change the root model, inform the other components the model has changed GeoServerFileChooser.this.file.setObject(file); fileTable.getProvider().setDirectory(new Model<File>(file)); breadcrumbs.setSelection(file); target.add(fileTable); target.add(breadcrumbs); }
breadcrumbs.setOutputMarkupId(true); add(breadcrumbs);
public void setSelection(File selection) { setDefaultModelObject(selection); }