Example usage for com.vaadin.server FontAwesome UPLOAD

List of usage examples for com.vaadin.server FontAwesome UPLOAD

Introduction

In this page you can find the example usage for com.vaadin.server FontAwesome UPLOAD.

Prototype

FontAwesome UPLOAD

To view the source code for com.vaadin.server FontAwesome UPLOAD.

Click Source Link

Usage

From source file:annis.gui.AdminUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {
    super.init(request);

    getPage().setTitle("ANNIS Adminstration");

    WebResource rootResource = Helper.getAnnisWebResource();

    UserManagement userManagement = new UserManagement();
    userManagement.setRootResource(rootResource);
    GroupManagement groupManagement = new GroupManagement();
    groupManagement.setRootResource(rootResource);
    CorpusManagement corpusManagement = new CorpusManagement();
    corpusManagement.setRootResource(rootResource);

    boolean isLoggedIn = Helper.getUser() != null;

    corpusAdminPanel = new CorpusAdminPanel();
    corpusController = new CorpusController(corpusManagement, corpusAdminPanel, this, isLoggedIn);

    userManagementPanel = new UserManagementPanel();
    userController = new UserController(userManagement, userManagementPanel, this, isLoggedIn);

    groupManagementPanel = new GroupManagementPanel();
    groupManagementController = new GroupController(groupManagement, corpusManagement, groupManagementPanel,
            this, userManagementPanel, isLoggedIn);

    boolean kickstarter = Boolean.parseBoolean(
            getSession().getConfiguration().getInitParameters().getProperty("kickstarterEnvironment", "false"));

    importPanel = new ImportPanel(!kickstarter, Helper.getUser() != null);

    tabSheet = new TabSheet();
    tabSheet.addTab(importPanel, "Import Corpus", FontAwesome.UPLOAD);
    tabSheet.addTab(corpusAdminPanel, "Corpus management", FontAwesome.LIST_ALT);

    if (!kickstarter) {
        tabSheet.addTab(userManagementPanel, "User management", FontAwesome.USER);
        tabSheet.addTab(groupManagementPanel, "Group management", FontAwesome.USERS);
    }//from  w w w  . ja v  a 2s  .  c  o m

    tabSheet.setSizeFull();

    tabSheet.addSelectedTabChangeListener(this);

    MainToolbar toolbar = new MainToolbar(null);
    addExtension(toolbar.getScreenshotExtension());
    toolbar.addLoginListener(AdminUI.this);

    layout = new VerticalLayout(toolbar, tabSheet);
    layout.setSizeFull();

    layout.setExpandRatio(toolbar, 0.0f);
    layout.setExpandRatio(tabSheet, 1.0f);

    tabSheet.addStyleName(ValoTheme.TABSHEET_FRAMED);

    setContent(layout);

    getPage().addUriFragmentChangedListener(this);

    selectTabFromFragment(getPage().getUriFragment());

}

From source file:annis.gui.AdminView.java

License:Apache License

public AdminView(AnnisUI ui) {
    Page.getCurrent().setTitle("ANNIS Adminstration");

    UserManagement userManagement = new UserManagement();
    userManagement.setWebResourceProvider(AdminView.this);
    GroupManagement groupManagement = new GroupManagement();
    groupManagement.setWebResourceProvider(AdminView.this);
    CorpusManagement corpusManagement = new CorpusManagement();
    corpusManagement.setWebResourceProvider(AdminView.this);

    boolean isLoggedIn = Helper.getUser() != null;

    corpusAdminPanel = new CorpusAdminPanel();
    corpusController = new CorpusController(corpusManagement, corpusAdminPanel, this, isLoggedIn);

    userManagementPanel = new UserManagementPanel();
    userController = new UserController(userManagement, userManagementPanel, this, isLoggedIn);

    groupManagementPanel = new GroupManagementPanel();
    groupManagementController = new GroupController(groupManagement, corpusManagement, groupManagementPanel,
            this, userManagementPanel, isLoggedIn);

    importPanel = new ImportPanel();

    tabSheet = new TabSheet();
    tabSheet.addTab(importPanel, "Import Corpus", FontAwesome.UPLOAD);
    tabSheet.addTab(corpusAdminPanel, "Corpus management", FontAwesome.LIST_ALT);
    tabSheet.addTab(userManagementPanel, "User management", FontAwesome.USER);
    tabSheet.addTab(groupManagementPanel, "Group management", FontAwesome.USERS);

    tabSheet.setSizeFull();//w w w.  ja  va 2s .  co m

    tabSheet.addSelectedTabChangeListener(AdminView.this);

    addComponents(tabSheet);
    setSizeFull();

    setExpandRatio(tabSheet, 1.0f);

    tabSheet.addStyleName(ValoTheme.TABSHEET_FRAMED);

}

From source file:com.cavisson.gui.dashboard.components.controls.MenuBars.java

License:Apache License

static MenuBar getMenuBar() {
    Command click = new Command() {
        @Override//  www.j a v  a2 s  .c  o  m
        public void menuSelected(MenuItem selectedItem) {
            Notification.show("Clicked " + selectedItem.getText());
        }
    };

    MenuBar menubar = new MenuBar();
    menubar.setWidth("100%");
    final MenuBar.MenuItem file = menubar.addItem("File", null);
    final MenuBar.MenuItem newItem = file.addItem("New", null);
    file.addItem("Open file...", click);
    file.addSeparator();

    newItem.addItem("File", click);
    newItem.addItem("Folder", click);
    newItem.addItem("Project...", click);

    file.addItem("Close", click);
    file.addItem("Close All", click);
    file.addSeparator();

    file.addItem("Save", click);
    file.addItem("Save As...", click);
    file.addItem("Save All", click);

    final MenuBar.MenuItem edit = menubar.addItem("Edit", null);
    edit.addItem("Undo", click);
    edit.addItem("Redo", click).setEnabled(false);
    edit.addSeparator();

    edit.addItem("Cut", click);
    edit.addItem("Copy", click);
    edit.addItem("Paste", click);
    edit.addSeparator();

    final MenuBar.MenuItem find = edit.addItem("Find/Replace", null);

    find.addItem("Google Search", click);
    find.addSeparator();
    find.addItem("Find/Replace...", click);
    find.addItem("Find Next", click);
    find.addItem("Find Previous", click);

    Command check = new Command() {
        @Override
        public void menuSelected(MenuItem selectedItem) {
            Notification.show(selectedItem.isChecked() ? "Checked" : "Unchecked");
        }
    };

    final MenuBar.MenuItem view = menubar.addItem("View", null);
    view.addItem("Show Status Bar", check).setCheckable(true);
    MenuItem title = view.addItem("Show Title Bar", check);
    title.setCheckable(true);
    title.setChecked(true);
    view.addItem("Customize Toolbar...", click);
    view.addSeparator();

    view.addItem("Actual Size", click);
    view.addItem("Zoom In", click);
    view.addItem("Zoom Out", click);

    TestIcon testIcon = new TestIcon(50);

    MenuItem fav = menubar.addItem("", check);
    fav.setIcon(testIcon.get());
    fav.setStyleName("icon-only");
    fav.setCheckable(true);
    fav.setChecked(true);

    fav = menubar.addItem("", check);
    fav.setIcon(testIcon.get());
    fav.setStyleName("icon-only");
    fav.setCheckable(true);
    fav.setCheckable(true);

    menubar.addItem("Attach", click).setIcon(FontAwesome.PAPERCLIP);
    menubar.addItem("Undo", click).setIcon(FontAwesome.UNDO);
    MenuItem redo = menubar.addItem("Redo", click);
    redo.setIcon(FontAwesome.REPEAT);
    redo.setEnabled(false);
    menubar.addItem("Upload", click).setIcon(FontAwesome.UPLOAD);

    return menubar;
}

From source file:com.esofthead.mycollab.module.file.view.components.ResourcesDisplayComponent.java

License:Open Source License

public ResourcesDisplayComponent(final String rootPath, final Folder rootFolder) {
    this.setSpacing(true);
    this.baseFolder = rootFolder;
    this.rootPath = rootPath;
    externalResourceService = ApplicationContextUtil.getSpringBean(ExternalResourceService.class);
    externalDriveService = ApplicationContextUtil.getSpringBean(ExternalDriveService.class);
    resourceService = ApplicationContextUtil.getSpringBean(ResourceService.class);

    VerticalLayout mainBodyLayout = new VerticalLayout();
    mainBodyLayout.setSpacing(true);/*from w  w  w . j  a va2  s .co  m*/
    mainBodyLayout.addStyleName("box-no-border-left");

    // file breadcrum ---------------------
    HorizontalLayout breadcrumbContainer = new HorizontalLayout();
    breadcrumbContainer.setMargin(false);
    fileBreadCrumb = new FileBreadcrumb(rootPath);
    breadcrumbContainer.addComponent(fileBreadCrumb);
    mainBodyLayout.addComponent(breadcrumbContainer);

    // Construct controllGroupBtn
    controllGroupBtn = new MHorizontalLayout().withMargin(new MarginInfo(false, false, false, true));

    final Button selectAllBtn = new Button();
    selectAllBtn.addStyleName(UIConstants.THEME_BROWN_LINK);
    selectAllBtn.setIcon(FontAwesome.SQUARE_O);
    selectAllBtn.setData(false);
    selectAllBtn.setImmediate(true);
    selectAllBtn.setDescription("Select all");

    selectAllBtn.addClickListener(new ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            if (!(Boolean) selectAllBtn.getData()) {
                selectAllBtn.setIcon(FontAwesome.CHECK_SQUARE_O);
                selectAllBtn.setData(true);
                resourcesContainer.setAllValues(true);
            } else {
                selectAllBtn.setData(false);
                selectAllBtn.setIcon(FontAwesome.SQUARE_O);
                resourcesContainer.setAllValues(false);
            }
        }
    });
    controllGroupBtn.with(selectAllBtn).withAlign(selectAllBtn, Alignment.MIDDLE_LEFT);

    Button goUpBtn = new Button("Up");
    goUpBtn.setIcon(FontAwesome.ARROW_UP);

    goUpBtn.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            Folder parentFolder;
            if (baseFolder instanceof ExternalFolder) {
                if (baseFolder.getPath().equals("/")) {
                    parentFolder = baseFolder;
                } else {
                    parentFolder = externalResourceService.getParentResourceFolder(
                            ((ExternalFolder) baseFolder).getExternalDrive(), baseFolder.getPath());
                }
            } else if (!baseFolder.getPath().equals(rootPath)) {
                parentFolder = resourceService.getParentFolder(baseFolder.getPath());
            } else {
                parentFolder = baseFolder;
            }

            resourcesContainer.constructBody(parentFolder);
            baseFolder = parentFolder;
            fileBreadCrumb.gotoFolder(baseFolder);
        }
    });
    goUpBtn.setDescription("Back to parent folder");
    goUpBtn.setStyleName(UIConstants.THEME_BROWN_LINK);
    goUpBtn.setDescription("Go up");

    controllGroupBtn.with(goUpBtn).withAlign(goUpBtn, Alignment.MIDDLE_LEFT);

    ButtonGroup navButton = new ButtonGroup();
    navButton.addStyleName(UIConstants.THEME_BROWN_LINK);
    Button createBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_CREATE),
            new Button.ClickListener() {
                private static final long serialVersionUID = 1L;

                @Override
                public void buttonClick(ClickEvent event) {
                    AddNewFolderWindow addnewFolderWindow = new AddNewFolderWindow();
                    UI.getCurrent().addWindow(addnewFolderWindow);
                }
            });
    createBtn.setIcon(FontAwesome.PLUS);
    createBtn.addStyleName(UIConstants.THEME_BROWN_LINK);
    createBtn.setDescription("Create new folder");
    createBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.PUBLIC_DOCUMENT_ACCESS));
    navButton.addButton(createBtn);

    Button uploadBtn = new Button("Upload", new ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            MultiUploadContentWindow multiUploadWindow = new MultiUploadContentWindow();
            UI.getCurrent().addWindow(multiUploadWindow);
        }
    });
    uploadBtn.setIcon(FontAwesome.UPLOAD);
    uploadBtn.addStyleName(UIConstants.THEME_BROWN_LINK);
    uploadBtn.setDescription("Upload");

    uploadBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.PUBLIC_DOCUMENT_ACCESS));
    navButton.addButton(uploadBtn);

    Button downloadBtn = new Button("Download");

    LazyStreamSource streamSource = new LazyStreamSource() {
        private static final long serialVersionUID = 1L;

        @Override
        protected StreamSource buildStreamSource() {
            Collection<Resource> selectedResources = getSelectedResources();
            return StreamDownloadResourceUtil.getStreamSourceSupportExtDrive(selectedResources);
        }

        @Override
        public String getFilename() {
            Collection<Resource> selectedResources = getSelectedResources();
            return StreamDownloadResourceUtil.getDownloadFileName(selectedResources);
        }
    };
    OnDemandFileDownloader downloaderExt = new OnDemandFileDownloader(streamSource);
    downloaderExt.extend(downloadBtn);

    downloadBtn.setIcon(FontAwesome.DOWNLOAD);
    downloadBtn.addStyleName(UIConstants.THEME_BROWN_LINK);
    downloadBtn.setDescription("Download");
    downloadBtn.setEnabled(AppContext.canRead(RolePermissionCollections.PUBLIC_DOCUMENT_ACCESS));
    navButton.addButton(downloadBtn);

    Button moveToBtn = new Button("Move", new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            Collection<Resource> selectedResources = getSelectedResources();
            if (CollectionUtils.isNotEmpty(selectedResources)) {
                MoveResourceWindow moveResourceWindow = new MoveResourceWindow(selectedResources);
                UI.getCurrent().addWindow(moveResourceWindow);
            } else {
                NotificationUtil.showWarningNotification("Please select at least one item to move");
            }
        }
    });
    moveToBtn.setIcon(FontAwesome.ARROWS);
    moveToBtn.addStyleName(UIConstants.THEME_BROWN_LINK);
    moveToBtn.setEnabled(AppContext.canWrite(RolePermissionCollections.PUBLIC_DOCUMENT_ACCESS));
    moveToBtn.setDescription("Move to");
    navButton.addButton(moveToBtn);

    Button deleteBtn = new Button(AppContext.getMessage(GenericI18Enum.BUTTON_DELETE),
            new Button.ClickListener() {
                private static final long serialVersionUID = 1L;

                @Override
                public void buttonClick(ClickEvent event) {
                    Collection<Resource> selectedResources = getSelectedResources();
                    if (CollectionUtils.isEmpty(selectedResources)) {
                        NotificationUtil.showWarningNotification("Please select at least one item to delete");
                    } else {
                        deleteResourceAction();
                    }
                }
            });
    deleteBtn.setIcon(FontAwesome.TRASH_O);
    deleteBtn.addStyleName(UIConstants.THEME_RED_LINK);
    deleteBtn.setDescription("Delete resource");
    deleteBtn.setEnabled(AppContext.canAccess(RolePermissionCollections.PUBLIC_DOCUMENT_ACCESS));

    navButton.addButton(deleteBtn);
    controllGroupBtn.addComponent(navButton);

    mainBodyLayout.addComponent(controllGroupBtn);

    resourcesContainer = new ResourcesContainer(baseFolder);

    mainBodyLayout.addComponent(resourcesContainer);
    this.addComponent(mainBodyLayout);
}

From source file:com.example.testzbox.vista.TabCarga.java

private Plupload uploadContents() {

    Plupload uploader = new Plupload("Cargar", FontAwesome.UPLOAD);
    uploader.setPreventDuplicates(true);
    uploader.setUploadPath("D:\\vaadin\\TestZBox\\upload");
    uploader.setMaxFileSize("5mb");

    //show notification after file is uploaded
    uploader.addFileUploadedListener(new Plupload.FileUploadedListener() {
        @Override//from   w  w  w . jav  a  2 s  . c  o m
        public void onFileUploaded(PluploadFile file) {

            /**
             * CAMBIAR EL NOMBRE DEL ARCHIVO QUE SE SUBE, YA QUE NO RESPETA
             * EL NOMBRE DEL ARCHIVO ORIGINAL
             */
            File uploadedFile = (File) file.getUploadedFile();
            System.out.println("uploadedFile = " + uploadedFile);
            // NOMBRE CORRECTO
            String realName = file.getName();
            // NOMBRE INCORRECTO
            String falseName = uploadedFile.getName();
            // PATH DEL ARCHIVO
            String pathFile = uploadedFile.getAbsolutePath();
            pathFile = pathFile.substring(0, pathFile.lastIndexOf("\\"));
            System.out.println("pathFile = " + pathFile);
            // SE CREAN LOS OBJETIPOS DE TIPO FILE DE CADA UNO
            File fileFalse = new File(pathFile + "\\" + falseName);
            File fileReal = new File(pathFile + "\\" + realName);
            // SE REALIZA EL CAMBIO DE NOMBRE DEL ARCHIVO
            boolean cambio = fileFalse.renameTo(fileReal);

            lblPathArchivo.setCaption(fileReal.toString());

        }
    });

    //update upload progress
    uploader.addUploadProgressListener(new Plupload.UploadProgressListener() {
        @Override
        public void onUploadProgress(PluploadFile file) {

            progressBar.setWidth("128px");
            //progressBar.setStyleName(ValoTheme.PROGRESSBAR_POINT);
            progressBar.setVisible(true);

            progressBar.setValue(new Long(file.getPercent()).floatValue() / 100);
            progressBar.setDescription(file.getPercent() + "%");

            System.out.println("I'm uploading " + file.getName() + " and I'm at " + file.getPercent() + "%");

            lblExtensionArchivo.setCaption(file.getName().substring(file.getName().lastIndexOf('.') + 1));
        }
    });

    //autostart the uploader after addind files
    uploader.addFilesAddedListener(new Plupload.FilesAddedListener() {
        @Override
        public void onFilesAdded(PluploadFile[] files) {
            progressBar.setValue(0f);
            progressBar.setVisible(true);
            uploader.start();
        }
    });

    //notify, when the upload process is completed
    uploader.addUploadCompleteListener(new Plupload.UploadCompleteListener() {
        @Override
        public void onUploadComplete() {
            System.out.println("upload is completed!");
        }
    });

    //handle errors
    uploader.addErrorListener(new Plupload.ErrorListener() {
        @Override
        public void onError(PluploadError error) {
            Notification.show("There was an error: " + error.getMessage(), Notification.Type.ERROR_MESSAGE);
        }
    });

    return uploader;
}

From source file:com.example.themes.valo.MenuBars.java

License:Apache License

static MenuBar getMenuBar() {
    Command click = new Command() {
        @Override//w w  w  .j a  v  a2s.c  o m
        public void menuSelected(MenuItem selectedItem) {
            Notification.show("Clicked " + selectedItem.getText());
        }
    };

    MenuBar menubar = new MenuBar();
    menubar.setWidth("100%");
    final MenuBar.MenuItem file = menubar.addItem("Draft", null);
    final MenuBar.MenuItem newItem = file.addItem("New", null);
    file.addItem("Open file...", click);
    file.addSeparator();

    newItem.addItem("File", click);
    newItem.addItem("Folder", click);
    newItem.addItem("Project...", click);

    file.addItem("Close", click);
    file.addItem("Close All", click);
    file.addSeparator();

    file.addItem("Save", click);
    file.addItem("Save As...", click);
    file.addItem("Save All", click);

    final MenuBar.MenuItem edit = menubar.addItem("Edit", null);
    edit.addItem("Undo", click);
    edit.addItem("Redo", click).setEnabled(false);
    edit.addSeparator();

    edit.addItem("Cut", click);
    edit.addItem("Copy", click);
    edit.addItem("Paste", click);
    edit.addSeparator();

    final MenuBar.MenuItem find = edit.addItem("Find/Replace", null);

    find.addItem("Google Search", click);
    find.addSeparator();
    find.addItem("Find/Replace...", click);
    find.addItem("Find Next", click);
    find.addItem("Find Previous", click);

    Command check = new Command() {
        @Override
        public void menuSelected(MenuItem selectedItem) {
            Notification.show(selectedItem.isChecked() ? "Checked" : "Unchecked");
        }
    };

    final MenuBar.MenuItem view = menubar.addItem("View", null);
    view.addItem("Show Status Bar", check).setCheckable(true);
    MenuItem title = view.addItem("Show Title Bar", check);
    title.setCheckable(true);
    title.setChecked(true);
    view.addItem("Customize Toolbar...", click);
    view.addSeparator();

    view.addItem("Actual Size", click);
    view.addItem("Zoom In", click);
    view.addItem("Zoom Out", click);

    TestIcon testIcon = new TestIcon(50);

    MenuItem fav = menubar.addItem("", check);
    fav.setIcon(testIcon.get());
    fav.setStyleName("icon-only");
    fav.setCheckable(true);
    fav.setChecked(true);

    fav = menubar.addItem("", check);
    fav.setIcon(testIcon.get());
    fav.setStyleName("icon-only");
    fav.setCheckable(true);
    fav.setCheckable(true);

    menubar.addItem("Attach", click).setIcon(FontAwesome.PAPERCLIP);
    menubar.addItem("Undo", click).setIcon(FontAwesome.UNDO);
    MenuItem redo = menubar.addItem("Redo", click);
    redo.setIcon(FontAwesome.REPEAT);
    redo.setEnabled(false);
    menubar.addItem("Upload", click).setIcon(FontAwesome.UPLOAD);

    return menubar;
}

From source file:com.mycollab.module.file.view.ResourcesDisplayComponent.java

License:Open Source License

public ResourcesDisplayComponent(final Folder rootFolder) {
    this.baseFolder = rootFolder;
    this.rootPath = rootFolder.getPath();
    externalResourceService = AppContextUtil.getSpringBean(ExternalResourceService.class);
    externalDriveService = AppContextUtil.getSpringBean(ExternalDriveService.class);
    resourceService = AppContextUtil.getSpringBean(ResourceService.class);

    withSpacing(false).withMargin(new MarginInfo(true, false, true, false));
    fileBreadCrumb = new FileBreadcrumb(rootPath);
    fileBreadCrumb.addSearchHandler(criteria -> {
        Resource selectedFolder;/*from  www  .  j  a  v a2s.com*/
        if (StorageNames.DROPBOX.equals(criteria.getStorageName())) {
            selectedFolder = externalResourceService.getCurrentResourceByPath(criteria.getExternalDrive(),
                    criteria.getBaseFolder());
        } else {
            selectedFolder = resourceService.getResource(criteria.getBaseFolder());
        }

        if (selectedFolder == null) {
            throw new DebugException(String.format("Can not find folder with path %s--%s in account",
                    criteria.getBaseFolder(), criteria.getRootFolder(), MyCollabUI.getAccountId()));
        } else if (!(selectedFolder instanceof Folder)) {
            LOG.error(String.format("Expect folder but the result is file %s--%s", criteria.getBaseFolder(),
                    criteria.getRootFolder()));
        } else {
            Folder resultFolder = (Folder) selectedFolder;
            constructBodyItemContainer(resultFolder);
            baseFolder = resultFolder;
        }
    });
    ELabel headerLbl = ELabel.h2(ProjectAssetsManager.getAsset(ProjectTypeConstants.FILE).getHtml() + " "
            + UserUIContext.getMessage(FileI18nEnum.LIST));

    MButton createBtn = new MButton(UserUIContext.getMessage(FileI18nEnum.ACTION_NEW_FOLDER),
            clickEvent -> UI.getCurrent().addWindow(new AddNewFolderWindow())).withIcon(FontAwesome.PLUS)
                    .withStyleName(WebThemes.BUTTON_ACTION)
                    .withVisible(UserUIContext.canWrite(RolePermissionCollections.PUBLIC_DOCUMENT_ACCESS));

    MButton uploadBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_UPLOAD), clickEvent -> {
        MultiUploadContentWindow multiUploadWindow = new MultiUploadContentWindow();
        UI.getCurrent().addWindow(multiUploadWindow);
    }).withIcon(FontAwesome.UPLOAD).withStyleName(WebThemes.BUTTON_ACTION)
            .withVisible(UserUIContext.canWrite(RolePermissionCollections.PUBLIC_DOCUMENT_ACCESS));

    MHorizontalLayout headerLayout = new MHorizontalLayout(headerLbl,
            new MHorizontalLayout(createBtn, uploadBtn)).expand(headerLbl);
    resourcesContainer = new ResourcesContainer();
    MVerticalLayout floatControl = new MVerticalLayout(headerLayout, fileBreadCrumb)
            .withMargin(new MarginInfo(false, false, true, false)).withStyleName("floatControl");
    this.with(floatControl, resourcesContainer);

    fileBreadCrumb.initBreadcrumb();
    resourcesContainer.constructBody(baseFolder);
}

From source file:de.uni_tuebingen.qbic.qbicmainportlet.PatientView.java

License:Open Source License

/**
 * init this view. builds the layout skeleton Menubar Description and others Statisitcs Experiment
 * Table Graph//from w w w.j  a va2 s .c  o m
 */
void initView() {
    patientViewContent = new VerticalLayout();
    patientViewContent.setMargin(new MarginInfo(true, false, false, false));
    // patientViewContent.setMargin(true);

    headerLabel = "";

    patientViewTab = new TabSheet();
    patientViewTab.setHeight("100%");
    patientViewTab.setWidth("100%");

    datasetComponent = new DatasetComponent(datahandler, state, resourceUrl);
    biologicalSamplesComponent = new BiologicalSamplesComponent(datahandler, state, resourceUrl,
            "Biological Samples");
    measuredSamplesComponent = new LevelComponent(datahandler, state, resourceUrl, "Raw Data");
    resultsComponent = new LevelComponent(datahandler, state, resourceUrl, "Results");
    statusComponent = new PatientStatusComponent(datahandler, state, resourceUrl);
    workflowComponent = new WorkflowComponent(wfController);
    uploadComponent = new AttachmentUploadComponent();
    projectInformation = new ProjInformationComponent(datahandler, state, resourceUrl);
    experimentComponent = new ExperimentComponent(datahandler, state, resourceUrl);

    patientViewTab.addStyleName(ValoTheme.TABSHEET_EQUAL_WIDTH_TABS);
    patientViewTab.addStyleName(ValoTheme.TABSHEET_FRAMED);
    patientViewTab.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);

    // patientViewTab.addTab(initDescription()).setIcon(FontAwesome.INFO_CIRCLE);
    patientViewTab.addTab(projectInformation).setIcon(FontAwesome.INFO_CIRCLE);
    patientViewTab.addTab(statusComponent).setIcon(FontAwesome.CHECK_CIRCLE);
    patientViewTab.addTab(initGraphs()).setIcon(FontAwesome.SITEMAP);
    // patientViewTab.addTab(initMemberSection()).setIcon(FontAwesome.USERS);
    // patientViewTab.addTab(initHLALayout()).setIcon(FontAwesome.BARCODE);
    // patientViewTab.addTab(initTable()).setIcon(FontAwesome.FLASK);

    patientViewTab.addTab(experimentComponent).setIcon(FontAwesome.FLASK);
    patientViewTab.addTab(datasetComponent).setIcon(FontAwesome.DATABASE);
    patientViewTab.addTab(biologicalSamplesComponent).setIcon(FontAwesome.TINT);
    patientViewTab.addTab(measuredSamplesComponent).setIcon(FontAwesome.SIGNAL);
    patientViewTab.addTab(resultsComponent).setIcon(FontAwesome.TH_LARGE);
    patientViewTab.addTab(workflowComponent).setIcon(FontAwesome.COGS);
    patientViewTab.addTab(uploadComponent).setIcon(FontAwesome.UPLOAD);

    patientViewTab.setImmediate(true);

    patientViewTab.addSelectedTabChangeListener(new SelectedTabChangeListener() {

        @Override
        public void selectedTabChange(SelectedTabChangeEvent event) {
            TabSheet tab = (TabSheet) event.getSource();

            if (event.getTabSheet().getSelectedTab().getCaption().equals("Project Graph")) {
                loadGraph();
            } else if (event.getTabSheet().getSelectedTab().getCaption().equals("Exp. Steps")) {
                experimentComponent.updateUI(getCurrentBean());
            } else if (event.getTabSheet().getSelectedTab().getCaption().equals("Datasets")) {
                datasetComponent.updateUI("project", getCurrentBean().getId());
            } else if (event.getTabSheet().getSelectedTab().getCaption().equals("Raw Data")) {
                measuredSamplesComponent.updateUI("project", getCurrentBean().getId(), "measured");
            } else if (event.getTabSheet().getSelectedTab().getCaption().equals("Biological Samples")) {
                biologicalSamplesComponent.updateUI(getCurrentBean().getId());
            } else if (event.getTabSheet().getSelectedTab().getCaption().equals("Results")) {
                resultsComponent.updateUI("project", getCurrentBean().getId(), "results");
            } else if (event.getTabSheet().getSelectedTab().getCaption().equals("Status")) {
                statusComponent.updateUI(getCurrentBean());
            } else if (event.getTabSheet().getSelectedTab().getCaption().equals("Workflows")) {
                Map<String, String> args = new HashMap<String, String>();
                args.put("id", getCurrentBean().getId());
                args.put("type", "project");
                workflowComponent.update(args);
            } else if (event.getTabSheet().getSelectedTab().getCaption().equals("Upload Files")) {
                // (get space from currentBean)
                uploadComponent.updateUI(manager, getCurrentBean().getCode(), currentBean.getId().split("/")[1],
                        datahandler.getOpenBisClient());
            } else if (event.getTabSheet().getSelectedTab().getCaption().equals("")) {
                projectInformation.updateUI(getCurrentBean(), "patient");
            }
        }
    });

    patientViewContent.addComponent(patientViewTab);
    this.addComponent(patientViewContent);

}

From source file:de.uni_tuebingen.qbic.qbicmainportlet.ProjectView.java

License:Open Source License

/**
 * init this view. builds the layout skeleton Menubar Description and others Statisitcs Experiment
 * Table Graph//from  ww w . j  a v  a  2s .  c  o m
 */
void initView() {
    projectview_content = new VerticalLayout();
    projectview_content.setMargin(new MarginInfo(true, false, false, false));

    // labelContent = new VerticalLayout();
    // labelContent.setMargin(new MarginInfo(true, false, true, false));

    headerLabel = "";

    // labelContent.addComponent(headerLabel);
    // projectview_content.addComponent(labelContent);

    projectview_tab = new TabSheet();
    projectview_tab.setWidth("100%");
    projectview_tab.setHeight("100%");

    datasetComponent = new DatasetComponent(datahandler, state, resourceUrl);
    biologicalSamplesComponent = new BiologicalSamplesComponent(datahandler, state, resourceUrl,
            "Biological Samples");
    measuredSamplesComponent = new LevelComponent(datahandler, state, resourceUrl, "Raw Data");
    resultsComponent = new LevelComponent(datahandler, state, resourceUrl, "Results");
    workflowComponent = new WorkflowComponent(wfController);
    uploadComponent = new AttachmentUploadComponent();
    projectInformation = new ProjInformationComponent(datahandler, state, resourceUrl);
    experimentComponent = new ExperimentComponent(datahandler, state, resourceUrl);

    // add styles to tab sheet
    projectview_tab.addStyleName(ValoTheme.TABSHEET_EQUAL_WIDTH_TABS);
    projectview_tab.addStyleName(ValoTheme.TABSHEET_FRAMED);
    // projectview_tab.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);

    // add tabs to tabsheet
    projectview_tab.addTab(projectInformation).setIcon(FontAwesome.INFO_CIRCLE);
    projectview_tab.addTab(initGraphs()).setIcon(FontAwesome.SITEMAP);
    // projectview_tab.addTab(initMemberSection()).setIcon(FontAwesome.USERS);

    projectview_tab.addTab(experimentComponent).setIcon(FontAwesome.FLASK);
    projectview_tab.addTab(datasetComponent).setIcon(FontAwesome.DATABASE);
    projectview_tab.addTab(biologicalSamplesComponent).setIcon(FontAwesome.TINT);
    projectview_tab.addTab(measuredSamplesComponent).setIcon(FontAwesome.SIGNAL);
    projectview_tab.addTab(resultsComponent).setIcon(FontAwesome.TH_LARGE);
    projectview_tab.addTab(workflowComponent).setIcon(FontAwesome.COGS);
    projectview_tab.addTab(uploadComponent).setIcon(FontAwesome.UPLOAD);

    projectview_tab.setImmediate(true);

    projectview_tab.addSelectedTabChangeListener(new SelectedTabChangeListener() {

        @Override
        public void selectedTabChange(SelectedTabChangeEvent event) {
            if (event.getTabSheet().getSelectedTab().getCaption().equals("Project Graph")) {
                loadGraph();
            } else if (event.getTabSheet().getSelectedTab().getCaption().equals("Exp. Steps")) {
                experimentComponent.updateUI(getCurrentBean());
            } else if (event.getTabSheet().getSelectedTab().getCaption().equals("Datasets")) {
                datasetComponent.updateUI(navigateToLabel, getCurrentBean().getId());
            } else if (event.getTabSheet().getSelectedTab().getCaption().equals("Raw Data")) {
                measuredSamplesComponent.updateUI(navigateToLabel, getCurrentBean().getId(), "measured");
            } else if (event.getTabSheet().getSelectedTab().getCaption().equals("Biological Samples")) {
                biologicalSamplesComponent.updateUI(getCurrentBean().getId());
            } else if (event.getTabSheet().getSelectedTab().getCaption().equals("Results")) {
                resultsComponent.updateUI(navigateToLabel, getCurrentBean().getId(), "results");
            } else if (event.getTabSheet().getSelectedTab().getCaption().equals("Workflows")) {
                Map<String, String> args = new HashMap<String, String>();
                args.put("id", getCurrentBean().getId());
                args.put("type", navigateToLabel);
                workflowComponent.update(args);
            } else if (event.getTabSheet().getSelectedTab().getCaption().equals("Upload Files")) {
                // (get space from currentBean)
                uploadComponent.updateUI(manager, getCurrentBean().getCode(), currentBean.getId().split("/")[1],
                        datahandler.getOpenBisClient());
            } else if (event.getTabSheet().getSelectedTab().getCaption().equals("")) {
                projectInformation.updateUI(getCurrentBean(), "project");
            }
        }
    });

    // projectview_content.addComponent(initMenuBar());
    projectview_content.addComponent(projectview_tab);
    // projectview_content.addComponent(initDescription());
    // projectview_content.addComponent(initStatistics());
    // projectview_content.addComponent(initTable());
    // projectview_content.addComponent(initButtonLayout());

    // projectview_content.addComponent(initGraph());

    // use the component that is returned by initTable
    // projectview_content.setComponentAlignment(this.table, Alignment.TOP_CENTER);
    // projectview_content.setWidth("100%");
    this.addComponent(projectview_content);
}

From source file:org.eclipse.hawkbit.ui.artifacts.upload.UploadLayout.java

License:Open Source License

private void setUploadStatusButtonIconToFinished() {
    if (uploadStatusButton == null) {
        return;/*from  www.ja v a 2s. co m*/
    }
    uploadStatusButton.removeStyleName(SPUIStyleDefinitions.UPLOAD_PROGRESS_INDICATOR_STYLE);
    uploadStatusButton.setIcon(FontAwesome.UPLOAD);
}