Example usage for com.vaadin.ui HorizontalSplitPanel HorizontalSplitPanel

List of usage examples for com.vaadin.ui HorizontalSplitPanel HorizontalSplitPanel

Introduction

In this page you can find the example usage for com.vaadin.ui HorizontalSplitPanel HorizontalSplitPanel.

Prototype

public HorizontalSplitPanel() 

Source Link

Document

Creates an empty horizontal split panel.

Usage

From source file:com.zklogtool.web.components.SnapshotView.java

License:Apache License

@AutoGenerated
private HorizontalSplitPanel buildHorizontalSplitPanel_1() {
    // common part: create layout
    horizontalSplitPanel_1 = new HorizontalSplitPanel();
    horizontalSplitPanel_1.setImmediate(false);
    horizontalSplitPanel_1.setWidth("100.0%");
    horizontalSplitPanel_1.setHeight("100.0%");

    // verticalLayout_1
    verticalLayout_1 = buildVerticalLayout_1();
    horizontalSplitPanel_1.addComponent(verticalLayout_1);

    // verticalLayout_2
    verticalLayout_2 = buildVerticalLayout_2();
    horizontalSplitPanel_1.addComponent(verticalLayout_2);

    return horizontalSplitPanel_1;
}

From source file:com.zklogtool.web.components.TransactionLogView.java

License:Apache License

@AutoGenerated
private HorizontalSplitPanel buildHorizontalSplitPanel_2() {
    // common part: create layout
    horizontalSplitPanel_2 = new HorizontalSplitPanel();
    horizontalSplitPanel_2.setImmediate(false);
    horizontalSplitPanel_2.setWidth("100.0%");
    horizontalSplitPanel_2.setHeight("100.0%");

    // filterTable
    filterTable = new FilterTable();
    filterTable.setImmediate(false);/*  w  ww .  ja  v a  2 s.  c  o  m*/
    filterTable.setWidth("100.0%");
    filterTable.setHeight("100.0%");
    horizontalSplitPanel_2.addComponent(filterTable);

    // verticalLayout_1
    verticalLayout_1 = buildVerticalLayout_1();
    horizontalSplitPanel_2.addComponent(verticalLayout_1);

    return horizontalSplitPanel_2;
}

From source file:de.catma.ui.analyzer.AnalyzerView.java

License:Open Source License

private void initComponents() {
    setSizeFull();//  w  ww. j av a2 s . c  om

    Component searchPanel = createSearchPanel();

    Component convenienceButtonPanel = createConvenienceButtonPanel();

    VerticalLayout searchAndConveniencePanel = new VerticalLayout();
    searchAndConveniencePanel.setSpacing(true);
    searchAndConveniencePanel.setMargin(true);
    searchAndConveniencePanel.addComponent(searchPanel);
    searchAndConveniencePanel.addComponent(convenienceButtonPanel);

    Component documentsPanel = createDocumentsPanel();

    HorizontalSplitPanel topPanel = new HorizontalSplitPanel();
    topPanel.setSplitPosition(70);
    topPanel.addComponent(searchAndConveniencePanel);
    topPanel.addComponent(documentsPanel);
    addComponent(topPanel);

    setExpandRatio(topPanel, 0.25f);

    Component resultPanel = createResultPanel();
    resultPanel.setSizeFull();

    addComponent(resultPanel);
    setExpandRatio(resultPanel, 0.75f);
}

From source file:de.catma.ui.analyzer.MarkupResultPanel.java

License:Open Source License

private void initComponents() {
    setSizeFull();//from w  w w .ja  va 2s . c o  m

    HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
    splitPanel.setSizeFull();
    VerticalLayout leftComponent = new VerticalLayout();
    leftComponent.setSpacing(true);
    leftComponent.setSizeFull();

    resultTable = new TreeTable();
    resultTable.setSelectable(true);
    resultTable.setMultiSelect(true);
    HierarchicalContainer container = new HierarchicalContainer();
    container.setItemSorter(new PropertyDependentItemSorter(TreePropertyName.caption,
            new PropertyToTrimmedStringCIComparator()));

    resultTable.setContainerDataSource(container);

    resultTable.addContainerProperty(TreePropertyName.caption, String.class, null);
    resultTable.setColumnHeader(TreePropertyName.caption, "Tag Definition");

    resultTable.addContainerProperty(TreePropertyName.sourcedocument, String.class, null);
    resultTable.setColumnHeader(TreePropertyName.sourcedocument, "Source Document");

    resultTable.addContainerProperty(TreePropertyName.markupcollection, String.class, null);
    resultTable.setColumnHeader(TreePropertyName.markupcollection, "Markup Collection");

    resultTable.addContainerProperty(TreePropertyName.phrase, String.class, null);
    resultTable.setColumnHeader(TreePropertyName.phrase, "Phrase");

    resultTable.addContainerProperty(TreePropertyName.propertyname, String.class, null);
    resultTable.setColumnHeader(TreePropertyName.propertyname, "Property");

    resultTable.addContainerProperty(TreePropertyName.propertyvalue, String.class, null);
    resultTable.setColumnHeader(TreePropertyName.propertyvalue, "Property value");

    resultTable.addContainerProperty(TreePropertyName.frequency, Integer.class, null);
    resultTable.setColumnHeader(TreePropertyName.frequency, "Frequency");
    resultTable.addContainerProperty(TreePropertyName.visible, AbstractComponent.class, null);
    resultTable.setColumnHeader(TreePropertyName.visible, "Visible in Kwic");

    resultTable.setItemCaptionPropertyId(TreePropertyName.caption);
    resultTable.setPageLength(10); //TODO: config
    resultTable.setSizeFull();
    resultTable.setColumnCollapsingAllowed(true);
    resultTable.setColumnCollapsible(TreePropertyName.caption, false);
    resultTable.setColumnCollapsible(TreePropertyName.sourcedocument, true);
    resultTable.setColumnCollapsible(TreePropertyName.markupcollection, true);
    resultTable.setColumnCollapsible(TreePropertyName.phrase, true);
    resultTable.setColumnCollapsible(TreePropertyName.propertyname, true);
    resultTable.setColumnCollapsible(TreePropertyName.propertyvalue, true);
    resultTable.setColumnCollapsible(TreePropertyName.frequency, false);
    resultTable.setColumnCollapsible(TreePropertyName.visible, false);

    //TODO: a description generator that shows the version of a Tag
    //      resultTable.setItemDescriptionGenerator(generator);

    leftComponent.addComponent(resultTable);
    leftComponent.setExpandRatio(resultTable, 1.0f);

    HorizontalLayout buttonPanel = new HorizontalLayout();
    buttonPanel.setSpacing(true);
    buttonPanel.setWidth("100%");

    btDist = new Button();
    btDist.setIcon(new ClassResource("ui/analyzer/resources/chart.gif", getApplication()));
    buttonPanel.addComponent(btDist);

    btResultExcelExport = new Button();
    btResultExcelExport.setIcon(new ThemeResource("../images/table-excel.png"));
    btResultExcelExport.setDescription("Export all Query result data as an Excel spreadsheet.");
    buttonPanel.addComponent(btResultExcelExport);

    cbFlatTable = new CheckBox("flat table", false);
    cbFlatTable.setImmediate(true);

    buttonPanel.addComponent(cbFlatTable);
    buttonPanel.setComponentAlignment(cbFlatTable, Alignment.MIDDLE_RIGHT);
    buttonPanel.setExpandRatio(cbFlatTable, 1f);

    btSelectAll = new Button("Select all for Kwic");

    buttonPanel.addComponent(btSelectAll);
    buttonPanel.setComponentAlignment(btSelectAll, Alignment.MIDDLE_RIGHT);
    //      buttonPanel.setExpandRatio(btSelectAll, 1f);
    btDeselectAll = new Button("Deselect all for Kwic");
    buttonPanel.addComponent(btDeselectAll);
    buttonPanel.setComponentAlignment(btDeselectAll, Alignment.MIDDLE_RIGHT);

    leftComponent.addComponent(buttonPanel);

    splitPanel.addComponent(leftComponent);

    VerticalLayout rightComponent = new VerticalLayout();
    rightComponent.setSpacing(true);
    rightComponent.setSizeFull();

    this.kwicPanel = new KwicPanel(repository, relevantUserMarkupCollectionProvider, true);
    rightComponent.addComponent(kwicPanel);
    rightComponent.setExpandRatio(kwicPanel, 1f);

    HorizontalLayout kwicButtonPanel = new HorizontalLayout();
    kwicButtonPanel.setSpacing(true);
    kwicButtonPanel.setWidth("100%");

    btKwicExcelExport = new Button();
    btKwicExcelExport.setIcon(new ThemeResource("../images/table-excel.png"));
    btKwicExcelExport.setDescription("Export all Query result data as an Excel spreadsheet.");
    kwicButtonPanel.addComponent(btKwicExcelExport);
    kwicButtonPanel.setComponentAlignment(btKwicExcelExport, Alignment.MIDDLE_LEFT);

    btUntagResults = new Button("Untag selected Kwics");
    kwicButtonPanel.addComponent(btUntagResults);
    kwicButtonPanel.setComponentAlignment(btUntagResults, Alignment.MIDDLE_RIGHT);
    kwicButtonPanel.setExpandRatio(btUntagResults, 1f);

    Label helpLabel = new Label();
    helpLabel.setIcon(new ClassResource("ui/resources/icon-help.gif", getApplication()));
    helpLabel.setWidth("20px");

    helpLabel.setDescription("<h3>Hints</h3>" + "<h4>Tagging search results</h4>"
            + "You can tag the search results in the Kwic-view: "
            + "<p>First select one or more rows and then drag the desired "
            + "Tag from the Tag Manager over the Kwic-results.</p>" + "<h4>Take a closer look</h4>"
            + "You can jump to the location in the full text by double "
            + "clicking on a row in the Kwic-view.");
    kwicButtonPanel.addComponent(helpLabel);

    kwicButtonPanel.setComponentAlignment(helpLabel, Alignment.MIDDLE_RIGHT);

    rightComponent.addComponent(kwicButtonPanel);
    rightComponent.setComponentAlignment(kwicButtonPanel, Alignment.MIDDLE_RIGHT);

    splitPanel.addComponent(rightComponent);

    addComponent(splitPanel);
}

From source file:de.catma.ui.analyzer.PhraseResultPanel.java

License:Open Source License

private void initComponents() {
    setSizeFull();// w w  w .j  a v a  2 s . com

    HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
    splitPanel.setSizeFull();
    VerticalLayout leftComponent = new VerticalLayout();
    leftComponent.setSpacing(true);
    leftComponent.setSizeFull();

    resultTable = new TreeTable();
    resultTable.setSelectable(true);
    resultTable.setMultiSelect(true);
    HierarchicalContainer container = new HierarchicalContainer();
    container.setItemSorter(new PropertyDependentItemSorter(TreePropertyName.caption,
            new PropertyToTrimmedStringCIComparator()));

    resultTable.setContainerDataSource(container);

    resultTable.addContainerProperty(TreePropertyName.caption, String.class, null);
    resultTable.setColumnHeader(TreePropertyName.caption, "Phrase");
    resultTable.addContainerProperty(TreePropertyName.frequency, Integer.class, null);
    resultTable.setColumnHeader(TreePropertyName.frequency, "Frequency");
    resultTable.addContainerProperty(TreePropertyName.visibleInKwic, AbstractComponent.class, null);
    resultTable.setColumnHeader(TreePropertyName.visibleInKwic, "Visible in Kwic");

    resultTable.setItemCaptionPropertyId(TreePropertyName.caption);
    resultTable.setPageLength(10); //TODO: config
    resultTable.setSizeFull();

    leftComponent.addComponent(resultTable);
    leftComponent.setExpandRatio(resultTable, 1.0f);

    HorizontalLayout buttonPanel = new HorizontalLayout();
    buttonPanel.setSpacing(true);
    buttonPanel.setWidth("100%");

    btDist = new Button();
    btDist.setIcon(new ClassResource("ui/analyzer/resources/chart.gif", getApplication()));
    btDist.setDescription("Show selected phrases as a distribution trend in a " + "chart like visualization.");

    buttonPanel.addComponent(btDist);

    btDoubleTree = new Button();
    btDoubleTree.setIcon(new ClassResource("ui/analyzer/resources/doubletree.gif", getApplication()));
    btDoubleTree.setDescription("Show a selected phrase with a doubletree kwic visualization.");

    buttonPanel.addComponent(btDoubleTree);

    btExcelExport = new Button();
    btExcelExport.setIcon(new ThemeResource("../images/table-excel.png"));
    btExcelExport.setDescription("Export all Query result data as an Excel spreadsheet.");
    buttonPanel.addComponent(btExcelExport);

    btSelectAll = new Button("Select all for Kwic");

    buttonPanel.addComponent(btSelectAll);
    buttonPanel.setComponentAlignment(btSelectAll, Alignment.MIDDLE_RIGHT);
    buttonPanel.setExpandRatio(btSelectAll, 1f);
    btDeselectAll = new Button("Deselect all for Kwic");
    buttonPanel.addComponent(btDeselectAll);
    buttonPanel.setComponentAlignment(btDeselectAll, Alignment.MIDDLE_RIGHT);

    leftComponent.addComponent(buttonPanel);
    splitPanel.addComponent(leftComponent);

    VerticalLayout rightComponent = new VerticalLayout();
    rightComponent.setSpacing(true);
    rightComponent.setSizeFull();

    this.kwicPanel = new KwicPanel(repository, relevantUserMarkupCollectionProvider);
    rightComponent.addComponent(kwicPanel);
    rightComponent.setExpandRatio(kwicPanel, 1f);

    HorizontalLayout kwicButtonPanel = new HorizontalLayout();
    kwicButtonPanel.setSpacing(true);
    kwicButtonPanel.setWidth("100%");

    btKwicExcelExport = new Button();
    btKwicExcelExport.setIcon(new ThemeResource("../images/table-excel.png"));
    btKwicExcelExport.setDescription("Export all Query result data as an Excel spreadsheet.");
    kwicButtonPanel.addComponent(btKwicExcelExport);

    Label helpLabel = new Label();
    helpLabel.setIcon(new ClassResource("ui/resources/icon-help.gif", getApplication()));

    helpLabel.setDescription("<h3>Hints</h3>" + "<h4>Tagging search results</h4>"
            + "You can tag the search results in the Kwic-view: "
            + "<p>First select one or more rows and then drag the desired "
            + "Tag from the Tag Manager over the Kwic-results.</p>" + "<h4>Take a closer look</h4>"
            + "You can jump to the location in the full text by double " + "clicking on a row in the Kwic-view."
            + "<h4>Untag search results</h4>" + "The \"Results by markup\" tab gives you the opportunity "
            + "to untag markup for selected search results in the Kwic-view.");

    kwicButtonPanel.addComponent(helpLabel);
    kwicButtonPanel.setExpandRatio(helpLabel, 1f);
    kwicButtonPanel.setComponentAlignment(helpLabel, Alignment.MIDDLE_RIGHT);

    rightComponent.addComponent(kwicButtonPanel);
    rightComponent.setComponentAlignment(kwicButtonPanel, Alignment.MIDDLE_RIGHT);

    splitPanel.addComponent(rightComponent);
    addComponent(splitPanel);
}

From source file:de.catma.ui.repository.RepositoryView.java

License:Open Source License

private Component createDocumentsManagerPanel() {

    HorizontalSplitPanel documentsManagerPanel = new HorizontalSplitPanel();
    documentsManagerPanel.setSplitPosition(25);
    documentsManagerPanel.setSizeFull();

    sourceDocumentPanel = new SourceDocumentPanel(repository);

    corpusPanel = new CorpusPanel(repository, new ValueChangeListener() {

        public void valueChange(ValueChangeEvent event) {
            Object value = event.getProperty().getValue();
            sourceDocumentPanel.setSourceDocumentsFilter((Corpus) value);
        }/*from w w  w  . j  a v  a  2s .co  m*/
    });

    documentsManagerPanel.addComponent(corpusPanel);
    documentsManagerPanel.addComponent(sourceDocumentPanel);

    return documentsManagerPanel;
}

From source file:de.catma.ui.tagger.TaggerView.java

License:Open Source License

private void initComponents(Application application) {
    setSizeFull();/*from w  w w  .ja v a2s  . c o  m*/

    VerticalLayout taggerPanel = new VerticalLayout();

    taggerPanel.setSpacing(true);

    Label helpLabel = new Label();

    helpLabel.setIcon(new ClassResource("ui/resources/icon-help.gif", application));
    helpLabel.setWidth("20px");
    helpLabel.setDescription("<h3>Hints</h3>" + "<h4>Tag this Source Document</h4>"
            + "<ol><li>First you have to tell CATMA which Tagset you want to use. "
            + "Open a Tag Library from the Repository Manager and drag a Tagset to the \"Active Tagsets\" section.</li>"
            + "<li>Now you can mark the text sequence you want to tag.</li><li>Click the colored button of the desired Tag to apply it to the marked sequence.</li></ol> "
            + "When you click on a tagged text, i. e. a text that is underlined with colored bars, you should see "
            + "the available Tag Instances in the section on the lower right of this view.");
    pager = new Pager(taggerID, 80, 30);

    tagger = new Tagger(taggerID, pager, this);
    tagger.addStyleName("tagger");
    tagger.setWidth("550px");

    taggerPanel.addComponent(tagger);

    //      Panel actionPanel = new Panel(new HorizontalLayout());
    //      ((HorizontalLayout)actionPanel.getContent()).setSpacing(true);

    HorizontalLayout actionPanel = new HorizontalLayout();
    actionPanel.setSpacing(true);

    taggerPanel.addComponent(actionPanel);

    pagerComponent = new PagerComponent(pager, new PageChangeListener() {

        public void pageChanged(int number) {
            tagger.setPage(number);
        }
    });

    actionPanel.addComponent(helpLabel);

    actionPanel.addComponent(pagerComponent);

    btAnalyze = new Button("Analyze Document");
    btAnalyze.setEnabled(repository instanceof IndexedRepository);
    actionPanel.addComponent(btAnalyze);

    linesPerPageSlider = new Slider("page size zoom", 1, 100, "%");
    linesPerPageSlider.setImmediate(true);
    linesPerPageSlider.setWidth("150px");

    actionPanel.addComponent(linesPerPageSlider);

    markupPanel = new MarkupPanel(repository, new ColorButtonListener() {

        private boolean enabled = false;

        public void colorButtonClicked(TagDefinition tagDefinition) {
            if (enabled) {
                tagger.addTagInstanceWith(tagDefinition);
            } else {
                getWindow().showNotification(
                        "Information", "Please select a User Markup Collection "
                                + " to store your markup first!<br>" + "See 'Active Markup Collections'.",
                        Notification.TYPE_TRAY_NOTIFICATION);
            }
        }

        public void setEnabled(boolean enabled) {
            this.enabled = enabled;
        }
    }, new PropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent evt) {
            boolean selected = evt.getNewValue() != null;
            @SuppressWarnings("unchecked")
            List<TagReference> tagReferences = (List<TagReference>) (selected ? evt.getNewValue()
                    : evt.getOldValue());

            tagger.setVisible(tagReferences, selected);
        }
    }, new PropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent evt) {
            @SuppressWarnings("unchecked")
            Set<TagDefinition> removedTagDefinitions = (Set<TagDefinition>) evt.getOldValue();
            pager.removeTagInstances(removedTagDefinitions);
            tagger.setPage(pager.getCurrentPageNumber());
        }
    });

    HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
    splitPanel.addComponent(taggerPanel);
    splitPanel.addComponent(markupPanel);
    addComponent(splitPanel);
}

From source file:de.fzi.fhemapi.view.vaadin.ui.HWindow.java

License:Apache License

@AutoGenerated
private HorizontalSplitPanel buildHorizontalSplitPanel_2() {
    // common part: create layout
    mainSplitPanel = new HorizontalSplitPanel();
    mainSplitPanel.setImmediate(false);/*w  ww.jav a 2s .co  m*/
    mainSplitPanel.setWidth("100.0%");
    mainSplitPanel.setHeight("100.0%");
    mainSplitPanel.setMargin(false);

    VerticalLayout leftPanelLayout = new VerticalLayout();
    leftPanelLayout.setWidth("100%");
    leftPanelLayout.setHeight("-1");
    leftPanelLayout.setImmediate(false);
    mainSplitPanel.addComponent(leftPanelLayout);

    leftPanelLayout.addComponent(buildMenuBar());

    // devicesTree
    devicesTree = new Tree();
    devicesTree.setImmediate(false);
    devicesTree.setWidth("-1px");
    devicesTree.setHeight("-1px");
    leftPanelLayout.addComponent(devicesTree);

    // verticalLayout_1
    mainSplitPanel.addComponent(new HorizontalLayout());

    return mainSplitPanel;
}

From source file:de.unioninvestment.portal.explorer.view.vfs.VFSMainView.java

License:Apache License

public VFSMainView(ConfigBean cb, VFSFileExplorerPortlet instance) throws Exception {

    final String vfsUrl = cb.getVfsUrl();
    if (vfsUrl.length() != 0) {
        removeAllComponents();/*from  ww w  .jav  a 2 s. com*/
        explorerPanel.setStyleName(Reindeer.PANEL_LIGHT);
        filePanel.setStyleName(Reindeer.PANEL_LIGHT);
        FileSystemOptions opts = new FileSystemOptions();

        logger.log(Level.INFO, "Check Type ");

        if (cb.getVfsType().equalsIgnoreCase("FTP") || cb.getVfsType().equalsIgnoreCase("SFTP")) {
            if (cb.getUsername() != null && cb.getUsername().length() > 0) {
                StaticUserAuthenticator auth = new StaticUserAuthenticator(null, cb.getUsername(),
                        cb.getPassword());
                DefaultFileSystemConfigBuilder.getInstance().setUserAuthenticator(opts, auth);
            }
        }

        if (cb.getVfsType().equalsIgnoreCase("FTP")) {
            FtpFileSystemConfigBuilder.getInstance().setUserDirIsRoot(opts, true);
            FtpFileSystemConfigBuilder.getInstance().setPassiveMode(opts, true);
        }

        if (cb.getVfsType().equalsIgnoreCase("SFTP")) {
            SftpFileSystemConfigBuilder.getInstance().setUserDirIsRoot(opts, true);
            if (cb.getKeyfile() != null && cb.getKeyfile().length() > 0) {
                logger.log(Level.INFO, "Keyfile " + cb.getKeyfile());
                SftpFileSystemConfigBuilder.getInstance().setStrictHostKeyChecking(opts, "no");
                File keyFile = new File(cb.getKeyfile());
                SftpFileSystemConfigBuilder.getInstance().setIdentities(opts, new File[] { keyFile });

            }

            SftpFileSystemConfigBuilder.getInstance().setProxyType(opts,
                    SftpFileSystemConfigBuilder.PROXY_HTTP);
            if (cb.getProxyHost() != null && cb.getProxyHost().length() > 0) {
                SftpFileSystemConfigBuilder.getInstance().setProxyHost(opts, cb.getProxyHost());
                logger.log(Level.INFO, "ProxyHost " + cb.getProxyHost());
            }
            if (cb.getProxyPort() != null && cb.getProxyPort().length() > 0) {
                SftpFileSystemConfigBuilder.getInstance().setProxyPort(opts,
                        Integer.valueOf(cb.getProxyPort()));
                logger.log(Level.INFO, "ProxyPort " + cb.getProxyPort());
            }
        }

        DefaultFileSystemManager fsManager = null;
        fsManager = getManager();

        final HorizontalSplitPanel panel = new HorizontalSplitPanel();
        panel.setHeight(500, UNITS_PIXELS);
        panel.setWidth(1400, UNITS_PIXELS);
        panel.setSplitPosition(350, Sizeable.UNITS_PIXELS);
        panel.setFirstComponent(explorerPanel);
        panel.setSecondComponent(filePanel);
        addComponent(panel);

        final Embedded image = new Embedded();
        image.setType(Embedded.TYPE_IMAGE);
        image.setSource(FOLDER);
        image.setHeight(15, Sizeable.UNITS_PIXELS);

        explorerPanel.setSizeFull();
        filePanel.setSizeFull();
        explorerPanel.addComponent(tree);

        filePanel.addComponent(new TableView(instance, fsManager, opts, cb));
        tree.setImmediate(true);

        tree.addListener(new ItemClickEvent.ItemClickListener() {

            private static final long serialVersionUID = 1L;

            @Override
            public void itemClick(ItemClickEvent event) {
                VFSFileExplorerPortlet app = (VFSFileExplorerPortlet) getApplication();
                String newDir = (String) event.getItemId();
                app.getEventBus().fireEvent(new TableChangedEvent(newDir));
            }
        });

        scanDirectory(fsManager, opts, vfsUrl);
    } else {

        addComponent(new Label("Please configure Portlet !"));
    }
}

From source file:dhbw.ka.mwi.businesshorizon2.ui.initialscreen.InitialScreenViewImpl.java

License:Open Source License

/**
 * Diese Methode setzt das Layout fr den Screen fest sowie den Titel der Anwendung.
 * Zustzlich wird hier noch das Men erzeugt und die Buttons, um ein Projekt zu bearbeiten,
 * ein neues anzulegen oder ein bestehendes zu lschen.
 *
 * @author Christian Scherer, Mirko Gpfrich, Marco Glaser
 *//*from   w  w w . ja  v a  2 s .c o  m*/
private void generateUi() {

    mainLayout = new VerticalLayout();
    leftLayout = new HorizontalLayout();
    rightLayout = new VerticalLayout();
    topRightLayout = new HorizontalLayout();
    leftContentLayout = new VerticalLayout();
    bottomLeftLayout = new VerticalLayout();
    bottomRightLayout = new VerticalLayout();
    bottomRightLayout.setHeight(90, UNITS_PERCENTAGE);
    bottomRightLayout.setWidth(100, UNITS_PERCENTAGE);
    bottomRightLayout.addStyleName("horizontalBottom");
    bottomLayout = new VerticalLayout();
    gap = new Label();
    leftContainerSpacing = new VerticalLayout();
    progressBar = new Embedded(null);
    progressBarGap = new Label();
    splitter = new Label("<hr style='border:none;background-color:black;height:2px'>", Label.CONTENT_XHTML);
    splitter2 = new Label("<hr style='border:none;background-color:black;height:2px'>", Label.CONTENT_XHTML);
    menuButtonsLayout = new HorizontalLayout();
    homeButtonLayout = new VerticalLayout();
    logoutButtonLayout = new VerticalLayout();
    homeButton = new Button();
    logoutButton = new Button();
    homeButtonLabel = new Label("Startseite");
    logoutButtonLabel = new Label("Ausloggen");
    descriptionLayout = new VerticalLayout();
    bottomGap = new Label();
    faqLayout = new HorizontalLayout();
    homeIcon = new Embedded(null, new ThemeResource("./images/icons/newIcons/1418766062_house_home-128.png"));
    middleGap = new Label();

    mainLayout.setSizeFull();
    mainLayout.setStyleName("mainLayout");
    leftLayout.setSizeFull();
    leftLayout.setStyleName("leftContainer");
    rightLayout.setSizeFull();
    rightLayout.setStyleName("rightContainer");
    bottomLayout.setSizeFull();
    bottomLeftLayout.setSizeFull();
    //      bottomRightLayout.setWidth(90, UNITS_PERCENTAGE);
    //      bottomRightLayout.setStyleName("projectDetailsLayout");
    topRightLayout.setSizeFull();
    leftContentLayout.setSizeFull();
    progressBar.setSizeUndefined();
    progressBar.setVisible(false);
    //   leftContentLayout.setHeight(Sizeable.SIZE_UNDEFINED, 0);

    leftLogoLayout = new VerticalLayout();
    logo = new Embedded(null, new ThemeResource("images/logo_businesshorizon_vertical.png"));

    gap.setHeight("10px");
    bottomGap.setHeight("40px");
    middleGap.setHeight("10px");
    progressBarGap.setHeight("15px");
    leftContainerSpacing.setSizeFull();

    homeIcon.setWidth(70, UNITS_PIXELS);
    homeIcon.setHeight(70, UNITS_PIXELS);

    seitenLabel = new Label("Startseite");
    seitenLabel.setStyleName("seitenLabel");
    seitenLabel.setWidth(Sizeable.SIZE_UNDEFINED, 0);
    descriptionLabel = new Label("bersicht ber alle Projekte");
    descriptionLabel.setStyleName("descriptionLabel");
    descriptionLabel.setWidth(Sizeable.SIZE_UNDEFINED, 0);
    descriptionLayout.setWidth(100, UNITS_PERCENTAGE);
    descriptionLayout.setHeight(80, UNITS_PIXELS);
    splitter.setWidth(98, UNITS_PERCENTAGE);
    splitter2.setWidth(98, UNITS_PERCENTAGE);
    menuButtonsLayout.setWidth(100, UNITS_PERCENTAGE);
    menuButtonsLayout.setHeight(Sizeable.SIZE_UNDEFINED, 0);
    homeButtonLayout.setSizeFull();
    logoutButtonLayout.setSizeFull();
    homeButton.setHeight(30, UNITS_PIXELS);
    homeButton.setWidth(30, UNITS_PIXELS);
    homeButton.setStyleName("homeButton");
    logoutButton.setHeight(30, UNITS_PIXELS);
    logoutButton.setWidth(30, UNITS_PIXELS);
    logoutButton.setStyleName("logoutButton");
    homeButtonLabel.setWidth(Sizeable.SIZE_UNDEFINED, 0);
    homeButtonLabel.setStyleName("topBarButtonLabel");
    logoutButtonLabel.setWidth(Sizeable.SIZE_UNDEFINED, 0);
    logoutButtonLabel.setStyleName("topBarButtonLabel");
    faqLayout.setWidth(100, UNITS_PERCENTAGE);
    faqLayout.setHeight(50, UNITS_PIXELS);

    horizontalSplitPanel = new HorizontalSplitPanel();
    horizontalSplitPanel.setSplitPosition(30, UNITS_PERCENTAGE);
    horizontalSplitPanel.setLocked(true);
    horizontalSplitPanel.setStyleName("horizontalMain");
    verticalSplitPanel = new VerticalSplitPanel();
    verticalSplitPanel.setSplitPosition(126, UNITS_PIXELS);
    verticalSplitPanel.setLocked(true);
    verticalSplitPanel.setWidth(90, UNITS_PERCENTAGE);
    verticalSplitPanel.setHeight(100, UNITS_PERCENTAGE);
    horizontalSplitPanelRight = new HorizontalSplitPanel();
    horizontalSplitPanelRight.setSplitPosition(30, UNITS_PERCENTAGE);
    horizontalSplitPanelRight.setLocked(true);
    horizontalSplitPanelRight.addStyleName("horizontalBottom");
    horizontalSplitPanelRight.setHeight(90, UNITS_PERCENTAGE);
    horizontalSplitPanelRight.setWidth(100, UNITS_PERCENTAGE);

    descriptionLayout.addComponent(descriptionLabel);
    leftLogoLayout.addComponent(logo);
    leftContentLayout.addComponent(gap);
    leftContentLayout.addComponent(homeIcon);
    leftContentLayout.addComponent(seitenLabel);
    leftContentLayout.addComponent(splitter);
    leftContentLayout.addComponent(descriptionLayout);
    leftContentLayout.addComponent(splitter2);
    leftContentLayout.addComponent(middleGap);
    leftContentLayout.addComponent(menuButtonsLayout);
    leftContentLayout.addComponent(progressBarGap);
    leftContentLayout.addComponent(progressBar);
    leftContentLayout.addComponent(leftContainerSpacing);
    leftContentLayout.addComponent(bottomGap);
    leftContentLayout.setExpandRatio(leftContainerSpacing, 1.0f);
    leftLayout.addComponent(leftLogoLayout);
    leftLayout.addComponent(leftContentLayout);
    leftLayout.setExpandRatio(leftContentLayout, 1.0f);
    descriptionLayout.setComponentAlignment(descriptionLabel, Alignment.MIDDLE_CENTER);
    leftLogoLayout.setComponentAlignment(logo, Alignment.MIDDLE_CENTER);
    leftContentLayout.setComponentAlignment(homeIcon, Alignment.TOP_CENTER);
    leftContentLayout.setComponentAlignment(seitenLabel, Alignment.TOP_CENTER);
    leftContentLayout.setComponentAlignment(progressBar, Alignment.MIDDLE_CENTER);
    //      leftContentLayout.setComponentAlignment(descriptionLabel, Alignment.TOP_CENTER);
    menuButtonsLayout.addComponent(homeButtonLayout);
    menuButtonsLayout.addComponent(logoutButtonLayout);
    homeButtonLayout.addComponent(homeButton);
    homeButtonLayout.addComponent(homeButtonLabel);
    logoutButtonLayout.addComponent(logoutButton);
    logoutButtonLayout.addComponent(logoutButtonLabel);

    homeButtonLayout.setComponentAlignment(homeButton, Alignment.TOP_CENTER);
    homeButtonLayout.setComponentAlignment(homeButtonLabel, Alignment.MIDDLE_CENTER);
    logoutButtonLayout.setComponentAlignment(logoutButton, Alignment.TOP_CENTER);
    logoutButtonLayout.setComponentAlignment(logoutButtonLabel, Alignment.MIDDLE_CENTER);

    leftLogoLayout.setWidth(Sizeable.SIZE_UNDEFINED, 0);
    leftLogoLayout.setHeight(100, UNITS_PERCENTAGE);
    leftContentLayout.setSizeFull();

    rightLayout.addComponent(verticalSplitPanel);
    bottomLayout.addComponent(horizontalSplitPanelRight);

    horizontalSplitPanel.addComponent(leftLayout);
    horizontalSplitPanel.addComponent(rightLayout);

    verticalSplitPanel.addComponent(topRightLayout);
    verticalSplitPanel.addComponent(bottomLayout);

    //      horizontalSplitPanelRight.setSecondComponent(bottomRightLayout);

    rightLayout.setComponentAlignment(verticalSplitPanel, Alignment.MIDDLE_CENTER);
    bottomLayout.setComponentAlignment(horizontalSplitPanelRight, Alignment.MIDDLE_CENTER);

    mainLayout.addComponent(horizontalSplitPanel);

    homeButton.addListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            ConfirmDialog.show(event.getButton().getWindow(), "Warnung",
                    "Beim Abbruch gehen Ihre Eingaben verloren! Mchten Sie zur Startseite zurckkehren?",
                    "Okay", "Abbrechen", new ConfirmDialog.Listener() {

                        private static final long serialVersionUID = 1L;

                        @Override
                        public void onClose(ConfirmDialog dialog) {
                            if (dialog.isConfirmed()) {
                                presenter.showInitialScreen();
                            } else {

                            }
                        }
                    });

        }

    });

    logoutButton.addListener(new ClickListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            ConfirmDialog.show(event.getButton().getWindow(), "Warnung",
                    "Mchten Sie sich wirklich ausloggen?", "Okay", "Abbrechen", new ConfirmDialog.Listener() {

                        private static final long serialVersionUID = 1L;

                        @Override
                        public void onClose(ConfirmDialog dialog) {
                            if (dialog.isConfirmed()) {
                                presenter.doLogout();
                            } else {

                            }
                        }
                    });
        }

    });

    setContent(mainLayout);

    addProjectButton = new TopBarButton("addProjectButton", "Neues Projekt");
    addProjectButton.addLabel("hinzufgen");
    addProjectButtonListener = new ClickListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            presenter.showProjectCreationScreen();
            String[] desc = new String[2];
            desc[0] = "Geben Sie hier den Namen und";
            desc[1] = "eine Beschreibung ein";
            setPageDescription("./images/icons/newIcons/1418831401_circle_add_plus-128.png",
                    "Neues Projekt anlegen", desc);
        }

    };
    addTopButton(addProjectButton, addProjectButtonListener);

    editProjectButton = new TopBarButton("editProjectButton", "Projekt bearbeiten");
    editProjectButtonListener = new ClickListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            presenter.showProjectEditScreen();
            String[] desc = new String[2];
            desc[0] = "ndern Sie hier Name oder";
            desc[1] = "Beschreibung des Projekts";
            setPageDescription("./images/icons/newIcons/1418765965_editor_pencil_pen_edit_write-128.png",
                    "Projekt bearbeiten", desc);
        }

    };
    addTopButton(editProjectButton, editProjectButtonListener);
    deleteProjectButton = new TopBarButton("deleteProjectButton", "Projekt lschen");
    deleteProjectButton.setButtonWidth(25);
    deleteProjectButtonListener = new ClickListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            final Project project = projectProxy.getSelectedProject();

            logger.debug("Projekt-loeschen Button aus dem Hauptfenster aufgerufen.");

            ConfirmDialog.show(getWindow(), project.getName() + " lschen?",
                    "Wollen sie das Projekt wirklich lschen?", "Ja", "Nein", new ConfirmDialog.Listener() {

                        private static final long serialVersionUID = 1L;

                        @Override
                        public void onClose(ConfirmDialog dialog) {
                            if (dialog.isConfirmed()) {
                                presenter.removeProject(project);
                            } else {

                            }
                        }
                    });

        }

    };
    addTopButton(deleteProjectButton, deleteProjectButtonListener);

    createImportButton();
    topRightLayout.addComponent(importButton);
    topRightLayout.setComponentAlignment(importButton, Alignment.MIDDLE_CENTER);

    exportButton = new TopBarButton("exportButton", "Projekte");
    exportButton.addLabel("exportieren");
    exportButtonListener = new ClickListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            File exportFile = presenter.exportProjects();
            event.getButton().getWindow().open(new Downloader(exportFile, getApplication()));
        }

    };
    addTopButton(exportButton, exportButtonListener);

    topBarSpacing = new VerticalLayout();
    topBarSpacing.setSizeFull();
    topRightLayout.addComponent(topBarSpacing);
    topRightLayout.setExpandRatio(topBarSpacing, 1.0f);

}