Example usage for com.vaadin.ui VerticalSplitPanel setStyleName

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

Introduction

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

Prototype

@Override
    public void setStyleName(String style) 

Source Link

Usage

From source file:fi.jasoft.feedreader.ui.ReaderUI.java

License:Apache License

@Override
protected void init(WrappedRequest request) {

    // Create data tables
    feedTable = createFeedsTable();//from  ww  w.j av  a  2s  .c  o m
    entryTable = createEntriesTable();

    // Create the main horizontal split panel
    HorizontalSplitPanel content = new HorizontalSplitPanel();
    content.setStyleName(Reindeer.SPLITPANEL_SMALL);
    content.setSizeFull();
    setContent(content);

    // Create the content of the left part of the main split panel
    VerticalLayout vl = new VerticalLayout();
    vl.setSizeFull();
    vl.addComponent(feedTable);

    Button addFeedBtn = new Button("Add RSS/Atom feed", new Button.ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            addFeed();
        }
    });
    addFeedBtn.setWidth("100%");
    vl.addComponent(addFeedBtn);
    vl.setExpandRatio(feedTable, 1);

    content.setFirstComponent(vl);
    content.setSplitPosition(30);

    // Create and set the content of the right part of the main split panel
    VerticalSplitPanel rightPane = new VerticalSplitPanel();
    rightPane.setStyleName(Reindeer.SPLITPANEL_SMALL);
    rightPane.setSizeFull();

    rightPane.addComponent(entryTable);

    entryPanel.setSizeFull();
    rightPane.addComponent(entryPanel);

    content.addComponent(rightPane);
    rightPane.setSplitPosition(30);

    if (feeds.size() > 0) {
        feedTable.setValue(feeds.getItemIds().iterator().next());
    }
}

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

License:BSD License

/**
 * Helper method to initialise this object.
 *///from  www . j a  v a2  s.com
@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.NewMappingConfigurationPanel.java

License:BSD License

/**
 * Helper method to initialise this object.
 *//*from   w w w  .j a  v a 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();

}