Java tutorial
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package com.wintindustries.pfserver.interfaces.view.dashboard; import com.vaadin.navigator.View; import com.vaadin.navigator.ViewChangeListener; import com.vaadin.server.Page; import com.vaadin.ui.Alignment; import com.vaadin.ui.Grid; import com.vaadin.ui.Label; import com.vaadin.ui.Notification; import com.vaadin.ui.Table; import com.vaadin.ui.TreeTable; import com.vaadin.ui.VerticalLayout; import com.wintindustries.pdffilter.PFData.PFDataSource; import com.wintindustries.pdffilter.PFLocation.PFFolder; import com.wintindustries.pdffilter.pfcore.PFCore; import com.wintindustries.pfserver.interfaces.container.PFFolderContainer; import com.wintindustries.pfserver.interfaces.container.PFFolderProxy; import com.wintindustries.pfserver.interfaces.container.PFFolderProxyContainer; import com.wintindustries.pdffilter.PFData.PFSessionManager; /** * * @author Admin */ public class FolderView extends VerticalLayout implements View { TreeTable table; public FolderView() { setSizeFull(); table = Tables(); table.setVisible(false); this.addComponent(table); this.setComponentAlignment(table, Alignment.MIDDLE_CENTER); } public FolderView(PFFolder folder) { this(); table.setContainerDataSource(new PFFolderContainer(folder.getFolders())); } public TreeTable Tables() { TreeTable table = new TreeTable(); table.setSelectable(true); table.setMultiSelect(true); table.setSortEnabled(true); table.setHeight("100%"); table.setWidth("90%"); table.addStyleName("no-vertical-lines"); table.addStyleName("no-horizontal-lines"); table.addStyleName("borderless"); return table; } public void loadFolder(String identifier) { PFDataSource source = PFFolderProxy.getDataSourceFromIdentifier(identifier); source.getDatabase().getSessionManager().OpenSession(); PFFolder targetFolder = PFFolderProxy.getPFFolderFromIdentifier(identifier); PFFolderProxyContainer proxyContainer = new PFFolderProxyContainer(targetFolder, source); System.out.println("DDDDDR: " + source.getDatabase().getSessionManager()); source.getDatabase().getSessionManager().CloseSession(); table.setContainerDataSource(proxyContainer); table.setVisible(true); } @Override public void enter(ViewChangeListener.ViewChangeEvent event) { // throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates. if (event.getParameters() == null || event.getParameters().isEmpty()) { this.addComponent(new EmptyView()); return; } else { this.loadFolder(event.getParameters()); Notification note = new Notification("Notificaton", event.getParameters().toString(), Notification.Type.TRAY_NOTIFICATION); note.show(Page.getCurrent()); } // event.getParameters())); } }