Example usage for com.vaadin.ui Alignment MIDDLE_LEFT

List of usage examples for com.vaadin.ui Alignment MIDDLE_LEFT

Introduction

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

Prototype

Alignment MIDDLE_LEFT

To view the source code for com.vaadin.ui Alignment MIDDLE_LEFT.

Click Source Link

Usage

From source file:com.skysql.manager.ui.PanelInfo.java

License:Open Source License

/**
 * Creates the charts layout./*from w w w.j av a2 s  . c  om*/
 */
private void createChartsLayout() {

    chartsLayout = new VerticalLayout();
    chartsLayout.addStyleName("chartsLayout");
    chartsLayout.setHeight("100%");
    chartsLayout.setSpacing(true);
    addComponent(chartsLayout);

    final HorizontalLayout chartsHeaderLayout = new HorizontalLayout();
    chartsHeaderLayout.setStyleName("panelHeaderLayout");
    chartsHeaderLayout.setWidth("100%");
    chartsHeaderLayout.setSpacing(true);
    chartsHeaderLayout.setMargin(new MarginInfo(false, true, false, true));
    chartsLayout.addComponent(chartsHeaderLayout);

    chartControls = new ChartControls();
    chartControls.addIntervalSelectionListener(chartIntervalListener);
    chartControls.addThemeSelectionListener(chartThemeListener);
    chartsHeaderLayout.addComponent(chartControls);
    chartsHeaderLayout.setComponentAlignment(chartControls, Alignment.MIDDLE_LEFT);

    final HorizontalLayout buttonsLayout = new HorizontalLayout();
    buttonsLayout.setSpacing(true);
    chartsHeaderLayout.addComponent(buttonsLayout);
    chartsHeaderLayout.setComponentAlignment(buttonsLayout, Alignment.MIDDLE_RIGHT);

    SettingsDialog settingsDialog = new SettingsDialog("Edit Monitors...", "Monitors");
    final Button editMonitorsButton = settingsDialog.getButton();
    editMonitorsButton.setVisible(false);
    buttonsLayout.addComponent(editMonitorsButton);

    final Button addChartButton = new Button("Add Chart...");
    addChartButton.setVisible(false);
    buttonsLayout.addComponent(addChartButton);
    addChartButton.addClickListener(new Button.ClickListener() {

        public void buttonClick(ClickEvent event) {
            new ChartsDialog(chartsArrayLayout, null);
        }
    });

    final Button editButton = new Button("Edit");
    editButton.setDescription("Enter Editing mode");
    final Button saveButton = new Button("Done");
    saveButton.setDescription("Exit Editing mode");
    buttonsLayout.addComponent(editButton);
    editButton.addClickListener(new Button.ClickListener() {

        public void buttonClick(ClickEvent event) {
            buttonsLayout.replaceComponent(editButton, saveButton);
            chartsArrayLayout.setDragMode(LayoutDragMode.CLONE);
            chartsArrayLayout.setEditable(true);
            chartsHeaderLayout.setStyleName("panelHeaderLayout-editable");
            editMonitorsButton.setVisible(true);
            addChartButton.setVisible(true);
            OverviewPanel overviewPanel = getSession().getAttribute(OverviewPanel.class);
            overviewPanel.setEnabled(false);

        }
    });

    saveButton.addClickListener(new Button.ClickListener() {

        public void buttonClick(ClickEvent event) {
            buttonsLayout.replaceComponent(saveButton, editButton);
            chartsArrayLayout.setDragMode(LayoutDragMode.NONE);
            chartsArrayLayout.setEditable(false);
            chartsHeaderLayout.setStyleName("panelHeaderLayout");
            editMonitorsButton.setVisible(false);
            addChartButton.setVisible(false);
            OverviewPanel overviewPanel = getSession().getAttribute(OverviewPanel.class);
            overviewPanel.setEnabled(true);
            refresh();
        }
    });

    final Button expandButton = new NativeButton();
    expandButton.setStyleName("expandButton");
    expandButton.setDescription("Expand/Reduce viewing area");
    buttonsLayout.addComponent(expandButton);
    buttonsLayout.setComponentAlignment(expandButton, Alignment.MIDDLE_CENTER);
    expandButton.addClickListener(new Button.ClickListener() {

        public void buttonClick(ClickEvent event) {
            isExpanded = !isExpanded;

            AnimatorProxy proxy = getSession().getAttribute(AnimatorProxy.class);
            proxy.addListener(new AnimationListener() {
                public void onAnimation(AnimationEvent event) {
                    Component component = event.getComponent();
                    component.setVisible(isExpanded ? false : true);
                }
            });
            //            OverviewPanel overviewPanel = getSession().getAttribute(OverviewPanel.class);
            //            if (!isExpanded) {
            //               overviewPanel.setVisible(isExpanded ? false : true);
            //            }
            //            proxy.animate(overviewPanel, isExpanded ? AnimType.ROLL_UP_CLOSE : AnimType.ROLL_DOWN_OPEN).setDuration(500).setDelay(100);
            //
            //            TopPanel topPanel = getSession().getAttribute(TopPanel.class);
            //            if (!isExpanded) {
            //               topPanel.setVisible(isExpanded ? false : true);
            //            }
            //            proxy.animate(topPanel, isExpanded ? AnimType.ROLL_UP_CLOSE : AnimType.ROLL_DOWN_OPEN).setDuration(500).setDelay(100);

            VerticalLayout topMid = getSession().getAttribute(VerticalLayout.class);
            if (!isExpanded) {
                topMid.setVisible(isExpanded ? false : true);
            }
            proxy.animate(topMid, isExpanded ? AnimType.ROLL_UP_CLOSE : AnimType.ROLL_DOWN_OPEN)
                    .setDuration(500).setDelay(100);

            expandButton.setStyleName(isExpanded ? "contractButton" : "expandButton");
        }
    });

    chartsPanel = new Panel();
    chartsPanel.setSizeFull();
    chartsPanel.addStyleName(Runo.PANEL_LIGHT);
    chartsLayout.addComponent(chartsPanel);
    chartsLayout.setExpandRatio(chartsPanel, 1.0f);

}

From source file:com.skysql.manager.ui.RunningTask.java

License:Open Source License

/**
 * Instantiates a new running task./*w w w.  j  a va 2 s.  co  m*/
 *
 * @param command the command
 * @param nodeInfo the node info
 * @param commandSelect the command select
 */
RunningTask(String command, NodeInfo nodeInfo, ListSelect commandSelect) {
    this.command = command;
    this.nodeInfo = nodeInfo;
    this.commandSelect = commandSelect;

    ManagerUI.log("RunningTask - command: " + command + ", node: " + nodeInfo.getName());

    if (command == null) {
        observerMode = true;
        taskRecord = nodeInfo.getTask();
        command = taskRecord.getCommand();
        this.command = command;
    }

    nodeInfo.setCommandTask(this);

    containerLayout = new VerticalLayout();
    containerLayout.addStyleName("containerLayout");
    containerLayout.setSizeFull();

    scriptingLayout = new HorizontalLayout();
    scriptingLayout.setSpacing(true);
    scriptingLayout.setSizeFull();
    containerLayout.addComponent(scriptingLayout);
    containerLayout.setComponentAlignment(scriptingLayout, Alignment.MIDDLE_LEFT);

    // COLUMN 1. PARAMETERS
    Commands.Command commandEnum = Commands.Command.valueOf(command);
    switch (commandEnum) {
    case backup:
    case connect:
    case restore:
        if (observerMode) {
            //            parametersLayout = new HorizontalLayout();
            //            parametersLayout.addComponent(new Label("Parameters: " + taskRecord.getParams()));
            //            scriptingLayout.addComponent(parametersLayout);
            //            scriptingLayout.setComponentAlignment(parametersLayout, Alignment.MIDDLE_LEFT);
        } else {
            parametersLayout = new ParametersLayout(this, nodeInfo, commandEnum);
            scriptingLayout.addComponent(parametersLayout);
            scriptingLayout.setComponentAlignment(parametersLayout, Alignment.TOP_LEFT);
        }
        break;
    default:
        break;
    }

    // COLUMN 2. CONTROLS
    // controls = taskRun.getControls(); this is for when they are server-side driven
    scriptingControlsLayout = new ScriptingControlsLayout(this, new Controls[] { Controls.Run, Controls.Stop });
    scriptingLayout.addComponent(scriptingControlsLayout);
    scriptingLayout.setComponentAlignment(scriptingControlsLayout, Alignment.MIDDLE_LEFT);

    // TODO: this needs to be done properly
    if (observerMode) {
        scriptingControlsLayout.enableControls(true, Controls.Stop);
    } else {
        if (parametersLayout == null || parametersLayout.isParameterReady()) {
            scriptingControlsLayout.enableControls(true, Controls.Run);
        }
    }

    // COLUMN 3. PROGRESS & RESULT
    scriptingProgressLayout = new ScriptingProgressLayout(this, observerMode);
    scriptingLayout.addComponent(scriptingProgressLayout);
    scriptingLayout.setComponentAlignment(scriptingProgressLayout, Alignment.MIDDLE_LEFT);

    if (observerMode) {
        scriptingProgressLayout.buildProgress(taskRecord, command, taskRecord.getSteps());
        activateTimer();
    } else {
        scriptingProgressLayout.buildProgress(taskRecord, command, nodeInfo.getCommands().getSteps(command));
    }

}

From source file:com.skysql.manager.ui.SystemForm.java

License:Open Source License

/**
 * Instantiates a new system form.//from  ww  w .  java  2 s .  co  m
 *
 * @param system the system
 * @param description the description
 * @param commitButton the commit button
 */
SystemForm(final SystemRecord system, String description, final Button commitButton) {
    this.system = system;

    setMargin(new MarginInfo(true, true, false, true));
    setSpacing(false);

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

    Embedded info = new Embedded(null, new ThemeResource("img/info.png"));
    info.addStyleName("infoButton");
    String infoText = "<table border=0 cellspacing=3 cellpadding=0 summary=\"\">\n"
            + "     <tr bgcolor=\"#ccccff\">" + "         <th align=left>Field"
            + "         <th align=left>Description" + "     <tr>" + "         <td><code>Name</code>"
            + "         <td>Name of the system" + "     <tr bgcolor=\"#eeeeff\">"
            + "         <td><code>Type</code>" + "         <td>Type of the system e.g. aws or galera"
            + "     <tr>" + "         <td><code>Database Username</code>"
            + "         <td>System default for database user name" + "     <tr bgcolor=\"#eeeeff\">"
            + "         <td><code>Database Password</code>"
            + "         <td>System default for database password" + "     <tr>"
            + "         <td><code>Replication Username</code>"
            + "         <td>System default for replication user name" + "     <tr bgcolor=\"#eeeeff\">"
            + "         <td><code>Replication Password</code>"
            + "         <td>System default for replication password" + " </table>" + " </blockquote>";
    info.setDescription(infoText);

    formDescription.addComponent(info);
    Label labelDescription = new Label(description);
    formDescription.addComponent(labelDescription);
    formDescription.setComponentAlignment(labelDescription, Alignment.MIDDLE_LEFT);
    addComponent(formDescription);

    addComponent(form);
    form.setImmediate(false);
    form.setFooter(null);
    form.setDescription(null);

    String value;
    if ((value = system.getName()) != null) {
        name.setValue(value);
    }
    form.addField("name", name);
    name.focus();
    name.setImmediate(true);
    name.addValidator(new SystemNameValidator(system.getName()));

    for (String systemType : SystemTypes.getList().keySet()) {
        this.systemType.addItem(systemType);
    }
    systemType.select(system.getSystemType() != null ? system.getSystemType() : SystemTypes.DEFAULT_SYSTEMTYPE);
    systemType.setNullSelectionAllowed(false);
    systemType.setEnabled(false);
    form.addField("systemType", systemType);

    if ((value = system.getDBUsername()) != null) {
        dbUsername.setValue(value);
    } else {
        dbUsername.setValue("skysql");
    }
    form.addField("dbusername", dbUsername);
    dbUsername.setRequired(true);
    dbUsername.setImmediate(true);
    dbUsername.setRequiredError("Database Username is a required field");
    dbUsername.addValidator(new UserNotRootValidator(dbUsername.getCaption()));

    if ((value = system.getDBPassword()) != null) {
        dbPassword.setValue(value);
    }
    form.addField("dbpassword", dbPassword);
    dbPassword.setRequired(true);
    dbPassword.setImmediate(false);
    dbPassword.setRequiredError("Database Password is a required field");

    if ((value = system.getDBPassword()) != null) {
        dbPassword2.setValue(value);
    }
    form.addField("dbpassword2", dbPassword2);
    dbPassword2.setRequired(true);
    dbPassword2.setImmediate(true);
    dbPassword2.setRequiredError("Confirm Password is a required field");
    dbPassword2.addValidator(new Password2Validator(dbPassword));

    if ((value = system.getRepUsername()) != null) {
        repUsername.setValue(value);
    } else {
        repUsername.setValue("repluser");
    }
    form.addField("repusername", repUsername);
    repUsername.setRequired(true);
    repUsername.setImmediate(true);
    repUsername.setRequiredError("Replication Username is a required field");
    repUsername.addValidator(new UserNotRootValidator(repUsername.getCaption()));
    repUsername.addValidator(new UserDifferentValidator(dbUsername));

    if ((value = system.getRepPassword()) != null) {
        repPassword.setValue(value);
    }
    form.addField("reppassword", repPassword);
    repPassword.setRequired(true);
    repPassword.setImmediate(true);
    repPassword.setRequiredError("Replication Password is a required field");
    repPassword.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = 0x4C656F6E6172646FL;

        public void valueChange(ValueChangeEvent event) {
            commitButton.setClickShortcut(KeyCode.ENTER);
        }
    });

    if ((value = system.getRepPassword()) != null) {
        repPassword2.setValue(value);
    }
    form.addField("reppassword2", repPassword2);
    repPassword2.setRequired(true);
    repPassword2.setImmediate(true);
    repPassword2.setRequiredError("Confirm Password is a required field");
    repPassword2.addValidator(new Password2Validator(repPassword));
    repPassword2.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = 0x4C656F6E6172646FL;

        public void valueChange(ValueChangeEvent event) {
            commitButton.focus();
        }
    });

}

From source file:com.skysql.manager.ui.UsersSettings.java

License:Open Source License

/**
 * Instantiates a new users settings.//from   w  w  w . j  ava 2  s .  c o  m
 */
UsersSettings() {
    addStyleName("usersTab");
    setSizeFull();
    setSpacing(true);
    setMargin(true);

    UserObject currentUser = VaadinSession.getCurrent().getAttribute(UserObject.class);
    currentUserID = currentUser.getUserID();

    HorizontalLayout usersLayout = new HorizontalLayout();
    addComponent(usersLayout);
    usersLayout.setSizeFull();
    usersLayout.setSpacing(true);

    // make sure we're working with current info
    userInfo = new UserInfo(null);
    VaadinSession.getCurrent().setAttribute(UserInfo.class, userInfo);

    select = new ListSelect("Users");
    select.setImmediate(true);
    for (UserObject user : userInfo.getUsersList().values()) {
        String id = user.getUserID();
        select.addItem(id);
        if (id.equals(currentUserID)) {
            select.select(id);
            userName.setValue(user.getName());
            selectedUserID = id;
        }
    }
    select.setNullSelectionAllowed(false);
    select.setWidth("14em");
    usersLayout.addComponent(select);
    select.addValueChangeListener(new ValueChangeListener() {
        private static final long serialVersionUID = 0x4C656F6E6172646FL;

        public void valueChange(ValueChangeEvent event) {

            selectedUserID = (String) event.getProperty().getValue();

            if (selectedUserID == null || selectedUserID.equals(currentUserID)) {
                removeUser.setEnabled(false);
            } else {
                removeUser.setEnabled(true);
            }

            if (selectedUserID == null) {
                editUser.setEnabled(false);
                userName.setEnabled(false);
                userName.setValue("");
            } else {
                editUser.setEnabled(true);
                userName.setValue(userInfo.findNameByID(selectedUserID));
                userName.setEnabled(true);
            }
        }
    });

    usersLayout.addLayoutClickListener(new LayoutClickListener() {
        private static final long serialVersionUID = 0x4C656F6E6172646FL;

        public void layoutClick(LayoutClickEvent event) {

            Component child;
            if (event.isDoubleClick() && (child = event.getChildComponent()) != null
                    && (child instanceof ListSelect)) {
                // Get the child component which was double-clicked
                ListSelect select = (ListSelect) child;
                String userID = (String) select.getValue();
                new UserDialog(userInfo, userInfo.getUsersList().get(selectedUserID), thisObject);
            }
        }
    });

    userLayout = new FormLayout();
    usersLayout.addComponent(userLayout);
    usersLayout.setExpandRatio(userLayout, 1.0f);
    userLayout.setSpacing(false);

    userName.setCaption("Full Name:");
    userLayout.addComponent(userName);

    HorizontalLayout userButtonsLayout = new HorizontalLayout();
    userButtonsLayout.setSpacing(true);
    addComponent(userButtonsLayout);

    Button addUser = new Button("Add...");
    addUser.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 0x4C656F6E6172646FL;

        public void buttonClick(ClickEvent event) {
            new UserDialog(userInfo, null, thisObject);
        }
    });
    userButtonsLayout.addComponent(addUser);
    userButtonsLayout.setComponentAlignment(addUser, Alignment.MIDDLE_LEFT);

    removeUser = new Button("Delete");
    removeUser.setEnabled(false);
    removeUser.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 0x4C656F6E6172646FL;

        public void buttonClick(ClickEvent event) {
            removeUser(event);
        }
    });
    userButtonsLayout.addComponent(removeUser);
    userButtonsLayout.setComponentAlignment(removeUser, Alignment.MIDDLE_LEFT);

    editUser = new Button("Edit...");
    editUser.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 0x4C656F6E6172646FL;

        public void buttonClick(ClickEvent event) {
            new UserDialog(userInfo, userInfo.getUsersList().get(selectedUserID), thisObject);
        }
    });
    userButtonsLayout.addComponent(editUser);
    userButtonsLayout.setComponentAlignment(editUser, Alignment.MIDDLE_CENTER);

}

From source file:com.toptal.ui.tab.EntryTab.java

License:Open Source License

/**
 * Builds entry tab.//w w  w  .  j av  a2 s  .  c  o m
 * @return Entry tab.
 * @checkstyle RequireThisCheck (10 lines)
 */
public EntryTab build() {
    this.addComponent(this.toolbar.alignAll(Alignment.MIDDLE_LEFT));
    this.addComponent(this.tbl);
    this.expand(this.tbl);
    this.start.addValueChangeListener(this::onDatesChanged);
    this.end.addValueChangeListener(this::onDatesChanged);
    this.update();
    return this;
}

From source file:com.toptal.ui.tab.UserTab.java

License:Open Source License

/**
 * Builds user tab.//from w ww .jav a2  s. c om
 * @return User tab.
 */
public UserTab build() {
    this.toolbar.hideAddButton();
    this.addComponent(this.toolbar.alignAll(Alignment.MIDDLE_LEFT));
    this.addComponent(this.tbl);
    this.expand(this.tbl);
    this.update();
    return this;
}

From source file:com.toptal.ui.view.MainView.java

License:Open Source License

/**
 * Generates a header for main view./*  ww  w  .j a va2 s.c om*/
 * @return Header.
 */
private HorizontalLayout header() {
    final User user = SecurityUtils.actualUser();
    final Label info = new Label(
            String.format("<h3>Welcome, %s. You are %s.</h3>", user.getName(), user.getRole().text()),
            ContentMode.HTML);
    final Button logout = new MButton(FontAwesome.SIGN_OUT, e -> this.getUi().getAuth().logout());
    return new MHorizontalLayout(info, logout).withAlign(info, Alignment.MIDDLE_LEFT)
            .withAlign(logout, Alignment.MIDDLE_RIGHT).withFullWidth();
}

From source file:com.trender.user.component.UserForm.java

public Component ProfilForm() {
    addStyleName("light");
    setWidth(90, Unit.PERCENTAGE);// ww w  . j  av  a2 s  .c  o m

    Label title = new Label();
    title.setStyleName("h2");
    title.setValue("");

    passwordField = new PasswordField(" ");
    passwordField.setInputPrompt("12345678");
    passwordField.setWidth(80, Unit.PERCENTAGE);

    surnameField = new TextField("?");
    surnameField.addValidator(new StringLengthValidator(
            "  , "
                    + "?  2 ?, ?? 45",
            2, 45, false));
    surnameField.addValidator(new RegexpValidator(regexpValue, "   "
            + " ??  ? ?"));
    surnameField.setInputPrompt("?");
    surnameField.setWidth(80, Unit.PERCENTAGE);

    nameField = new TextField("?");
    nameField.addValidator(new StringLengthValidator("  ?, ? "
            + " 2 ?, ?? 45", 2, 45, false));
    nameField.addValidator(new RegexpValidator(regexpValue, "   "
            + " ??  ? ?"));
    nameField.setInputPrompt("?");
    nameField.setWidth(80, Unit.PERCENTAGE);

    performButton = new Button("");
    performButton.setStyleName("v-button-friendly");

    clearButton = new Button("?");
    clearButton.setStyleName("v-button-quiet");

    horizontalLayout = new HorizontalLayout();
    horizontalLayout.addComponent(performButton);
    horizontalLayout.addComponent(clearButton);
    horizontalLayout.setSpacing(true);
    horizontalLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    horizontalLayout.setMargin(new MarginInfo(true, false, false, true));

    addComponent(title);
    addComponent(passwordField);
    addComponent(surnameField);
    addComponent(nameField);
    addComponent(horizontalLayout);

    return this;
}

From source file:com.wintindustries.pfserver.interfaces.view.dashboard.LoadingView.java

public LoadingView() {
    setSizeFull();//  w ww .  j a v  a2  s.co  m
    VerticalLayout center = new VerticalLayout();
    this.addComponent(center);
    this.setComponentAlignment(center, Alignment.MIDDLE_CENTER);

    center.setHeight("180px");
    HorizontalLayout info = new HorizontalLayout();

    Label title = new Label("PFServer Dashboard");
    title.setSizeUndefined();
    title.addStyleName(ValoTheme.LABEL_H4);
    title.addStyleName(ValoTheme.LABEL_COLORED);
    // center.addComponent(title);
    // center.setComponentAlignment(title, Alignment.BOTTOM_CENTER);
    Label loading = new Label("Initalizing");
    loading.addStyleName(ValoTheme.LABEL_H1);
    loading.addStyleName(ValoTheme.LABEL_LIGHT);
    info.addComponent(loading);
    info.addComponent(title);
    info.setComponentAlignment(title, Alignment.MIDDLE_RIGHT);

    center.addComponent(info);
    info.setComponentAlignment(loading, Alignment.MIDDLE_LEFT);
    loading.setWidth("160px");

    center.setComponentAlignment(info, Alignment.MIDDLE_CENTER);
    // center.addComponent(loading);
    // center.setComponentAlignment(loading, Alignment.TOP_CENTER);
    ProgressBar indeterminate = new ProgressBar();
    indeterminate.setIndeterminate(true);
    center.addComponent(indeterminate);
    center.setComponentAlignment(indeterminate, Alignment.TOP_CENTER);

}

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

License:Open Source License

private void initComponents() {
    setSizeFull();/*from w w w .ja v a 2 s  .  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);
}