Example usage for com.vaadin.ui VerticalSplitPanel VerticalSplitPanel

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

Introduction

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

Prototype

public VerticalSplitPanel(Component firstComponent, Component secondComponent) 

Source Link

Document

Creates a horizontal split panel containing the given components.

Usage

From source file:org.ikasan.dashboard.ui.administration.window.PolicyAssociationMappingSearchWindow.java

License:BSD License

/**
  * Helper method to initialise this object.
  * //  w w w . j ava 2  s .co m
  * @param message
  */
protected void init() {
    this.setHeight("80%");
    this.setWidth("80%");
    this.setModal(true);

    this.mappingConfigurationSearchPanel.setWidth("100%");
    VerticalLayout topPanelLayout = new VerticalLayout();
    topPanelLayout.setWidth(100, Unit.PERCENTAGE);
    topPanelLayout.setMargin(true);
    topPanelLayout.setHeight("100%");
    topPanelLayout.addComponent(this.mappingConfigurationSearchPanel);

    HorizontalLayout bottomPanelLayout = new HorizontalLayout();
    bottomPanelLayout.setSizeFull();
    bottomPanelLayout.addComponent(this.mappingConfigurationSearchResultsPanel);

    this.verticalSplitPanel = new VerticalSplitPanel(topPanelLayout, bottomPanelLayout);
    this.verticalSplitPanel.setSizeFull();
    this.verticalSplitPanel.setSplitPosition(320, Unit.PIXELS);
    this.verticalSplitPanel.setLocked(true);
    this.verticalSplitPanel.addStyleName(ValoTheme.SPLITPANEL_LARGE);
    this.setContent(verticalSplitPanel);
}

From source file:org.ikasan.dashboard.ui.mappingconfiguration.panel.MappingConfigurationPanel.java

License:BSD License

/**
 * Helper method to initialise this object.
 */// w w w . ja v a2  s .c o  m
@SuppressWarnings("serial")
protected void init() {
    layout = new GridLayout(5, 6);
    layout.setSpacing(true);
    layout.setMargin(true);
    layout.setWidth("100%");

    this.addStyleName(ValoTheme.PANEL_BORDERLESS);

    paramQueriesLayout = new VerticalLayout();

    toolBarLayout = new HorizontalLayout();
    toolBarLayout.setWidth("100%");

    Button linkButton = new Button();

    linkButton.setIcon(VaadinIcons.REPLY_ALL);
    linkButton.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    linkButton.setDescription("Return to search results");
    linkButton.addStyleName(ValoTheme.BUTTON_BORDERLESS);

    linkButton.addClickListener(new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            Navigator navigator = new Navigator(UI.getCurrent(), menuLayout.getContentContainer());

            for (IkasanUIView view : topLevelNavigator.getIkasanViews()) {
                navigator.addView(view.getPath(), view.getView());
            }

            saveRequiredMonitor.manageSaveRequired("mappingView");

            navigator = new Navigator(UI.getCurrent(), mappingNavigator.getContainer());

            for (IkasanUIView view : mappingNavigator.getIkasanViews()) {
                navigator.addView(view.getPath(), view.getView());
            }
        }
    });

    toolBarLayout.addComponent(linkButton);
    toolBarLayout.setExpandRatio(linkButton, 0.865f);

    this.editButton.setIcon(VaadinIcons.EDIT);
    this.editButton.setDescription("Edit the mapping configuration");
    this.editButton.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    this.editButton.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    this.editButton.setVisible(false);
    this.editButton.addClickListener(new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            setEditable(true);
            mappingConfigurationFunctionalGroup.editButtonPressed();
        }
    });

    toolBarLayout.addComponent(this.editButton);
    toolBarLayout.setExpandRatio(this.editButton, 0.045f);

    this.saveButton.setIcon(VaadinIcons.HARDDRIVE);
    this.saveButton.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    this.saveButton.setDescription("Save the mapping configuration");
    this.saveButton.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    this.saveButton.setVisible(false);
    this.saveButton.addClickListener(new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            try {
                logger.info("Save button clicked!!");
                save();
                setEditable(false);
                Notification.show("Changes Saved!", "", Notification.Type.HUMANIZED_MESSAGE);
                mappingConfigurationFunctionalGroup.saveOrCancelButtonPressed();
            } catch (InvalidValueException e) {
                // We can ignore this one as we have already dealt with the
                // validation messages using the validation framework.
            } catch (Exception e) {
                StringWriter sw = new StringWriter();
                PrintWriter pw = new PrintWriter(sw);
                e.printStackTrace(pw);

                Notification.show("Cauget exception trying to save a Mapping Configuration!", sw.toString(),
                        Notification.Type.ERROR_MESSAGE);
            }
        }
    });

    toolBarLayout.addComponent(this.saveButton);
    toolBarLayout.setExpandRatio(this.saveButton, 0.045f);

    this.cancelButton.setIcon(VaadinIcons.CLOSE_CIRCLE);
    this.cancelButton.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    this.cancelButton.setDescription("Cancel the current edit");
    this.cancelButton.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    this.cancelButton.setVisible(false);
    this.cancelButton.addClickListener(new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            setEditable(false);
            mappingConfigurationFunctionalGroup.saveOrCancelButtonPressed();

            Navigator navigator = new Navigator(UI.getCurrent(), menuLayout.getContentContainer());

            for (IkasanUIView view : topLevelNavigator.getIkasanViews()) {
                navigator.addView(view.getPath(), view.getView());
            }

            saveRequiredMonitor.manageSaveRequired("mappingView");

            navigator = new Navigator(UI.getCurrent(), mappingNavigator.getContainer());

            for (IkasanUIView view : mappingNavigator.getIkasanViews()) {
                navigator.addView(view.getPath(), view.getView());
            }
        }
    });

    toolBarLayout.addComponent(this.cancelButton);
    toolBarLayout.setExpandRatio(this.cancelButton, 0.045f);

    FileDownloader fd = new FileDownloader(this.getMappingConfigurationExportStream());
    fd.extend(exportMappingConfigurationButton);

    this.exportMappingConfigurationButton.setIcon(VaadinIcons.DOWNLOAD_ALT);
    this.exportMappingConfigurationButton.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    this.exportMappingConfigurationButton.setDescription("Export the current mapping configuration");
    this.exportMappingConfigurationButton.addStyleName(ValoTheme.BUTTON_BORDERLESS);
    toolBarLayout.addComponent(this.exportMappingConfigurationButton);
    toolBarLayout.setExpandRatio(this.exportMappingConfigurationButton, 0.045f);

    final GridLayout contentLayout = new GridLayout(1, 2);
    contentLayout.setWidth("100%");

    contentLayout.addComponent(toolBarLayout);
    contentLayout.addComponent(createMappingConfigurationForm());

    VerticalSplitPanel vpanel = new VerticalSplitPanel(contentLayout, createTableLayout(false));
    vpanel.setStyleName(ValoTheme.SPLITPANEL_LARGE);

    paramQueriesLayout.setSpacing(true);

    Label configValueLabels = new Label("Source Configuration Value Queries:");
    layout.addComponent(configValueLabels, 2, 2, 3, 2);
    Panel queryParamsPanel = new Panel();
    queryParamsPanel.addStyleName(ValoTheme.PANEL_BORDERLESS);
    queryParamsPanel.setHeight(100, Unit.PIXELS);
    queryParamsPanel.setWidth(100, Unit.PERCENTAGE);
    queryParamsPanel.setContent(paramQueriesLayout);
    this.layout.addComponent(queryParamsPanel, 2, 3, 3, 5);

    vpanel.setSplitPosition(325, Unit.PIXELS);
    this.setContent(vpanel);
    this.setSizeFull();
}

From source file:org.ikasan.dashboard.ui.mappingconfiguration.panel.MappingConfigurationView.java

License:BSD License

/**
 * Helper method to initialise this object.
 *//*ww w .  j  a v a 2  s.  c o m*/
protected void init() {
    this.setSizeFull();

    HorizontalLayout topContainer = new HorizontalLayout();
    topContainer.setSizeFull();
    topContainer.setMargin(true);
    topContainer.addComponent(this.searchPanel);
    HorizontalLayout bottomContainer = new HorizontalLayout();
    bottomContainer.setMargin(true);
    bottomContainer.setSizeFull();
    bottomContainer.addComponent(this.viewComponentContainer);

    final Button hideFilterButton = new Button();
    hideFilterButton.setIcon(VaadinIcons.MINUS);
    hideFilterButton.setCaption("Hide Filter");
    hideFilterButton.setStyleName(ValoTheme.BUTTON_LINK);
    hideFilterButton.addStyleName(ValoTheme.BUTTON_SMALL);

    final Button showFilterButton = new Button();
    showFilterButton.setIcon(VaadinIcons.PLUS);
    showFilterButton.setCaption("Show Filter");
    showFilterButton.addStyleName(ValoTheme.BUTTON_LINK);
    showFilterButton.addStyleName(ValoTheme.BUTTON_SMALL);
    showFilterButton.setVisible(false);

    hideFilterButton.addClickListener(new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            hideFilterButton.setVisible(false);
            showFilterButton.setVisible(true);
            splitPosition = verticalSplitPanel.getSplitPosition();
            splitUnit = verticalSplitPanel.getSplitPositionUnit();
            verticalSplitPanel.setSplitPosition(0, Unit.PIXELS);
        }
    });

    showFilterButton.addClickListener(new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            hideFilterButton.setVisible(true);
            showFilterButton.setVisible(false);
            verticalSplitPanel.setSplitPosition(splitPosition, splitUnit);
        }
    });

    GridLayout filterButtonLayout = new GridLayout(2, 1);
    filterButtonLayout.setHeight(25, Unit.PIXELS);
    filterButtonLayout.addComponent(hideFilterButton, 0, 0);
    filterButtonLayout.addComponent(showFilterButton, 1, 0);

    this.verticalSplitPanel = new VerticalSplitPanel(topContainer, bottomContainer);
    this.verticalSplitPanel.addStyleName(ValoTheme.SPLITPANEL_LARGE);
    this.verticalSplitPanel.setSizeFull();
    this.verticalSplitPanel.setSplitPosition(260, Unit.PIXELS);

    GridLayout wrapper = new GridLayout(1, 2);
    wrapper.setRowExpandRatio(0, .01f);
    wrapper.setRowExpandRatio(1, .99f);
    wrapper.setSizeFull();
    wrapper.addComponent(filterButtonLayout);
    wrapper.setComponentAlignment(filterButtonLayout, Alignment.MIDDLE_RIGHT);
    wrapper.addComponent(verticalSplitPanel);

    this.setContent(wrapper);
}

From source file:org.ikasan.dashboard.ui.mappingconfiguration.panel.NewMappingConfigurationPanel.java

License:BSD License

/**
 * Helper method to initialise this object.
 *///from w  w  w.ja va 2s  .c  o m
@SuppressWarnings("serial")
protected void init() {
    layout = new GridLayout(5, 6);
    layout.setSpacing(true);
    layout.setMargin(true);
    layout.setWidth("100%");

    this.addStyleName(ValoTheme.PANEL_BORDERLESS);

    this.parameterQueryTextFields = new ArrayList<TextField>();

    this.typeComboBox.setReadOnly(false);
    this.clientComboBox.setReadOnly(false);
    this.sourceContextComboBox.setReadOnly(false);
    this.targetContextComboBox.setReadOnly(false);
    super.clientComboBox.unselect(super.clientComboBox.getValue());
    super.sourceContextComboBox.unselect(super.sourceContextComboBox.getValue());
    super.targetContextComboBox.unselect(super.targetContextComboBox.getValue());
    super.typeComboBox.unselect(super.typeComboBox.getValue());

    super.mappingConfigurationFunctionalGroup.editButtonPressed();

    super.mappingConfiguration = new MappingConfiguration();
    this.mappingConfigurationConfigurationValuesTable.populateTable(mappingConfiguration);

    HorizontalLayout toolBarLayout = new HorizontalLayout();
    toolBarLayout.setWidth("100%");

    Label spacerLabel = new Label("");
    toolBarLayout.addComponent(spacerLabel);
    toolBarLayout.setExpandRatio(spacerLabel, 0.865f);

    this.editButton.setIcon(VaadinIcons.EDIT);
    this.editButton.setDescription("Edit the mapping configuration");
    this.editButton.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    this.editButton.addStyleName(ValoTheme.BUTTON_BORDERLESS);

    toolBarLayout.addComponent(editButton);
    toolBarLayout.setExpandRatio(editButton, 0.045f);

    this.saveButton.setIcon(VaadinIcons.HARDDRIVE);
    this.saveButton.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    this.saveButton.setDescription("Save the mapping configuration");
    this.saveButton.addStyleName(ValoTheme.BUTTON_BORDERLESS);

    toolBarLayout.addComponent(saveButton);
    toolBarLayout.setExpandRatio(saveButton, 0.045f);

    this.cancelButton.setIcon(VaadinIcons.CLOSE_CIRCLE);
    this.cancelButton.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    this.cancelButton.setDescription("Cancel the current edit");
    this.cancelButton.addStyleName(ValoTheme.BUTTON_BORDERLESS);

    toolBarLayout.addComponent(this.cancelButton);
    toolBarLayout.setExpandRatio(this.cancelButton, 0.045f);

    final VerticalLayout contentLayout = new VerticalLayout();

    contentLayout.addComponent(toolBarLayout);
    contentLayout.addComponent(createMappingConfigurationForm());

    VerticalSplitPanel vpanel = new VerticalSplitPanel(contentLayout, createTableLayout(false));
    vpanel.setStyleName(ValoTheme.SPLITPANEL_LARGE);

    Button addParametersButton = new Button();
    addParametersButton.setIcon(VaadinIcons.FORM);
    addParametersButton.addStyleName(ValoTheme.BUTTON_ICON_ONLY);
    addParametersButton.setDescription(
            "Add new key location queries. The number of fields created corresponds to the number of query parameters.");
    addParametersButton.addStyleName(ValoTheme.BUTTON_BORDERLESS);

    addParametersButton.addClickListener(new Button.ClickListener() {
        public void buttonClick(ClickEvent event) {
            addParamQueryFields();
        }
    });

    paramQueriesLayout.removeAllComponents();
    //        paramQueriesLayout.addComponent(addParametersButton);
    paramQueriesLayout.setSpacing(true);

    Label configValueLabels = new Label("Source Configuration Value Queries:");
    layout.addComponent(configValueLabels, 2, 2);
    layout.addComponent(addParametersButton, 3, 2);

    Panel queryParamsPanel = new Panel();
    queryParamsPanel.addStyleName(ValoTheme.PANEL_BORDERLESS);
    queryParamsPanel.setHeight(140, Unit.PIXELS);
    queryParamsPanel.setWidth(100, Unit.PERCENTAGE);
    queryParamsPanel.setContent(paramQueriesLayout);
    this.layout.addComponent(queryParamsPanel, 2, 3, 3, 5);

    vpanel.setSplitPosition(325, Unit.PIXELS);
    this.setContent(vpanel);
    this.setSizeFull();

}