Example usage for com.vaadin.ui TabSheet setSizeFull

List of usage examples for com.vaadin.ui TabSheet setSizeFull

Introduction

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

Prototype

@Override
    public void setSizeFull() 

Source Link

Usage

From source file:org.activiti.administrator.ui.MainView.java

License:Apache License

public MainView(AdminApp application) {

    // Set application
    this.app = application;

    // Setup main layout
    setStyleName(Reindeer.LAYOUT_WHITE);
    setMargin(false);/* w  w  w . ja va  2  s .co m*/
    setSpacing(false);
    setSizeFull();

    // Create tab sheet
    TabSheet tabs = new TabSheet();
    tabs.setSizeFull();

    // Add tab styles
    tabs.addStyleName(Reindeer.TABSHEET_BORDERLESS);
    tabs.addStyleName(Reindeer.LAYOUT_WHITE);

    // Add task view tab
    tabs.addTab(new UserTab(app));
    tabs.addTab(new GroupTab(app));

    // Add tab sheet to layout
    addComponent(tabs);
    setExpandRatio(tabs, 1.0F);

    // Add footer text
    Label footerText = new Label(app.getMessage(Messages.Footer));
    footerText.setSizeUndefined();
    footerText.setStyleName(Reindeer.LABEL_SMALL);
    footerText.addStyleName("footer");
    addComponent(footerText);
    setComponentAlignment(footerText, Alignment.BOTTOM_CENTER);

}

From source file:org.ikasan.dashboard.ui.topology.window.CategorisedErrorOccurrenceViewWindow.java

License:BSD License

protected Panel createErrorOccurrenceDetailsPanel() {
    Panel errorOccurrenceDetailsPanel = new Panel();

    GridLayout layout = new GridLayout(4, 7);
    layout.setWidth("100%");
    layout.setSpacing(true);//w ww . j  a va  2  s  . c o m
    layout.setColumnExpandRatio(0, .10f);
    layout.setColumnExpandRatio(1, .30f);
    layout.setColumnExpandRatio(2, .05f);
    layout.setColumnExpandRatio(3, .30f);

    Label errorOccurrenceDetailsLabel = new Label(" Categorised Error Occurence Details", ContentMode.HTML);
    Label errorCategoryLabel = new Label();

    if (categorisedErrorOccurrence.getErrorCategorisation().getErrorCategory()
            .equals(ErrorCategorisation.BLOCKER)) {
        errorOccurrenceDetailsLabel = new Label(
                VaadinIcons.BAN.getHtml() + " Categorised Error Occurence Details", ContentMode.HTML);
        errorCategoryLabel = new Label(VaadinIcons.BAN.getHtml() + " Blocker", ContentMode.HTML);
    } else if (categorisedErrorOccurrence.getErrorCategorisation().getErrorCategory()
            .equals(ErrorCategorisation.CRITICAL)) {
        errorOccurrenceDetailsLabel = new Label(
                VaadinIcons.EXCLAMATION.getHtml() + " Categorised Error Occurence Details", ContentMode.HTML);
        errorCategoryLabel = new Label(VaadinIcons.EXCLAMATION.getHtml() + " Critical", ContentMode.HTML);
    } else if (categorisedErrorOccurrence.getErrorCategorisation().getErrorCategory()
            .equals(ErrorCategorisation.MAJOR)) {
        errorOccurrenceDetailsLabel = new Label(
                VaadinIcons.ARROW_UP.getHtml() + " Categorised Error Occurence Details", ContentMode.HTML);
        errorCategoryLabel = new Label(VaadinIcons.ARROW_UP.getHtml() + " Major", ContentMode.HTML);
    } else if (categorisedErrorOccurrence.getErrorCategorisation().getErrorCategory()
            .equals(ErrorCategorisation.TRIVIAL)) {
        errorOccurrenceDetailsLabel = new Label(
                VaadinIcons.ARROW_DOWN.getHtml() + " Categorised Error Occurence Details", ContentMode.HTML);
        errorCategoryLabel = new Label(VaadinIcons.ARROW_DOWN.getHtml() + " Trivial", ContentMode.HTML);
    }

    errorOccurrenceDetailsLabel.setStyleName(ValoTheme.LABEL_HUGE);
    layout.addComponent(errorOccurrenceDetailsLabel, 0, 0, 3, 0);

    Label label = new Label("Module Name:");
    label.setSizeUndefined();
    layout.addComponent(label, 0, 1);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    TextField tf1 = new TextField();
    tf1.setValue(this.categorisedErrorOccurrence.getErrorOccurrence().getModuleName());
    tf1.setReadOnly(true);
    tf1.setWidth("80%");
    layout.addComponent(tf1, 1, 1);

    label = new Label("Flow Name:");
    label.setSizeUndefined();
    layout.addComponent(label, 0, 2);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    TextField tf2 = new TextField();
    tf2.setValue(this.categorisedErrorOccurrence.getErrorOccurrence().getFlowName());
    tf2.setReadOnly(true);
    tf2.setWidth("80%");
    layout.addComponent(tf2, 1, 2);

    label = new Label("Component Name:");
    label.setSizeUndefined();
    layout.addComponent(label, 0, 3);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    TextField tf3 = new TextField();
    tf3.setValue(this.categorisedErrorOccurrence.getErrorOccurrence().getFlowElementName());
    tf3.setReadOnly(true);
    tf3.setWidth("80%");
    layout.addComponent(tf3, 1, 3);

    label = new Label("Date/Time:");
    label.setSizeUndefined();
    layout.addComponent(label, 0, 4);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    TextField tf4 = new TextField();
    tf4.setValue(new Date(this.categorisedErrorOccurrence.getErrorOccurrence().getTimestamp()).toString());
    tf4.setReadOnly(true);
    tf4.setWidth("80%");
    layout.addComponent(tf4, 1, 4);

    GridLayout wrapperLayout = new GridLayout(1, 4);
    wrapperLayout.setMargin(true);
    wrapperLayout.setWidth("100%");

    Label errorMessageLabel = new Label("Error Message:");
    errorMessageLabel.setSizeUndefined();
    layout.addComponent(errorMessageLabel, 0, 5);
    layout.setComponentAlignment(errorMessageLabel, Alignment.TOP_RIGHT);

    final TextArea errorMessageTextArea = new TextArea();
    errorMessageTextArea.setWidth("650px");
    errorMessageTextArea.setRows(6);
    errorMessageTextArea
            .setValue(this.categorisedErrorOccurrence.getErrorCategorisation().getErrorDescription());

    layout.addComponent(errorMessageTextArea, 1, 5, 3, 5);

    AceEditor editor = new AceEditor();
    editor.setCaption("Error Details");
    editor.setValue(this.categorisedErrorOccurrence.getErrorOccurrence().getErrorDetail());
    editor.setReadOnly(true);
    editor.setMode(AceMode.xml);
    editor.setTheme(AceTheme.eclipse);
    editor.setHeight(470, Unit.PIXELS);
    editor.setWidth("100%");

    label = new Label("Error Category:");
    label.setSizeUndefined();
    layout.addComponent(label, 2, 1);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    layout.addComponent(errorCategoryLabel, 3, 1);
    layout.setComponentAlignment(errorCategoryLabel, Alignment.MIDDLE_LEFT);

    label = new Label("System Action:");
    label.setSizeUndefined();
    layout.addComponent(label, 2, 2);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    TextField systemAction = new TextField();
    systemAction.setValue(this.categorisedErrorOccurrence.getErrorOccurrence().getAction());
    systemAction.setReadOnly(true);
    systemAction.setWidth("80%");
    layout.addComponent(systemAction, 3, 2);

    label = new Label("User Action:");
    label.setSizeUndefined();
    layout.addComponent(label, 2, 3);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    TextField userAction = new TextField();
    userAction.setValue("");
    userAction.setReadOnly(true);
    userAction.setWidth("80%");
    layout.addComponent(userAction, 3, 3);

    label = new Label("User Action By:");
    label.setSizeUndefined();
    layout.addComponent(label, 2, 4);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    Label userActionBy = new Label();
    userActionBy.setValue("");
    userActionBy.setReadOnly(true);
    userActionBy.setWidth("80%");
    layout.addComponent(userActionBy, 3, 4);

    AceEditor eventEditor = new AceEditor();
    eventEditor.setCaption("Event Payload");

    if (this.categorisedErrorOccurrence.getErrorOccurrence().getEvent() != null) {
        eventEditor
                .setValue(new String((byte[]) this.categorisedErrorOccurrence.getErrorOccurrence().getEvent()));
    }

    eventEditor.setReadOnly(true);
    eventEditor.setMode(AceMode.java);
    eventEditor.setTheme(AceTheme.eclipse);
    eventEditor.setHeight(470, Unit.PIXELS);
    eventEditor.setWidth("100%");

    HorizontalLayout formLayout = new HorizontalLayout();
    formLayout.setWidth("100%");
    formLayout.setHeight(300, Unit.PIXELS);
    formLayout.addComponent(layout);
    wrapperLayout.addComponent(formLayout, 0, 0);

    //      VerticalSplitPanel vSplitPanel = new VerticalSplitPanel();
    //      vSplitPanel.setWidth("100%");
    //      vSplitPanel.setHeight(800, Unit.PIXELS);
    //      vSplitPanel.addStyleName(ValoTheme.SPLITPANEL_LARGE);

    TabSheet tabsheet = new TabSheet();
    tabsheet.setSizeFull();

    HorizontalLayout h1 = new HorizontalLayout();
    h1.setSizeFull();
    h1.setMargin(true);
    h1.addComponent(eventEditor);
    //      vSplitPanel.setFirstComponent(h1);

    HorizontalLayout h2 = new HorizontalLayout();
    h2.setSizeFull();
    h2.setMargin(true);
    h2.addComponent(editor);
    //      vSplitPanel.setSecondComponent(h2);

    tabsheet.addTab(h2, "Error Details");
    tabsheet.addTab(h1, "Event Payload");

    wrapperLayout.addComponent(tabsheet, 0, 1);

    //      wrapperLayout.addComponent(vSplitPanel, 0, 1);

    errorOccurrenceDetailsPanel.setContent(wrapperLayout);
    return errorOccurrenceDetailsPanel;
}

From source file:org.ikasan.dashboard.ui.topology.window.ErrorOccurrenceViewWindow.java

License:BSD License

protected Panel createErrorOccurrenceDetailsPanel() {
    Panel errorOccurrenceDetailsPanel = new Panel();

    GridLayout layout = new GridLayout(2, 6);
    layout.setSizeFull();/*from  ww  w .  j  a v  a2 s  .  com*/
    layout.setSpacing(true);
    layout.setColumnExpandRatio(0, 0.25f);
    layout.setColumnExpandRatio(1, 0.75f);

    Label errorOccurrenceDetailsLabel = new Label("Error Occurence Details");
    errorOccurrenceDetailsLabel.setStyleName(ValoTheme.LABEL_HUGE);
    layout.addComponent(errorOccurrenceDetailsLabel);

    Label label = new Label("Module Name:");
    label.setSizeUndefined();
    layout.addComponent(label, 0, 1);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    TextField tf1 = new TextField();
    tf1.setValue(this.errorOccurrence.getModuleName());
    tf1.setReadOnly(true);
    tf1.setWidth("80%");
    layout.addComponent(tf1, 1, 1);

    label = new Label("Flow Name:");
    label.setSizeUndefined();
    layout.addComponent(label, 0, 2);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    TextField tf2 = new TextField();
    tf2.setValue(this.errorOccurrence.getFlowName());
    tf2.setReadOnly(true);
    tf2.setWidth("80%");
    layout.addComponent(tf2, 1, 2);

    label = new Label("Component Name:");
    label.setSizeUndefined();
    layout.addComponent(label, 0, 3);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    TextField tf3 = new TextField();
    tf3.setValue(this.errorOccurrence.getFlowElementName());
    tf3.setReadOnly(true);
    tf3.setWidth("80%");
    layout.addComponent(tf3, 1, 3);

    label = new Label("Date/Time:");
    label.setSizeUndefined();
    layout.addComponent(label, 0, 4);
    layout.setComponentAlignment(label, Alignment.MIDDLE_RIGHT);

    TextField tf4 = new TextField();
    tf4.setValue(new Date(this.errorOccurrence.getTimestamp()).toString());
    tf4.setReadOnly(true);
    tf4.setWidth("80%");
    layout.addComponent(tf4, 1, 4);

    label = new Label("Error Message:");
    label.setSizeUndefined();
    layout.addComponent(label, 0, 5);
    layout.setComponentAlignment(label, Alignment.TOP_RIGHT);

    TextArea tf5 = new TextArea();
    tf5.setValue(this.errorOccurrence.getErrorMessage());
    tf5.setReadOnly(true);
    tf5.setWidth("80%");
    tf5.setRows(3);
    layout.addComponent(tf5, 1, 5);

    GridLayout wrapperLayout = new GridLayout(1, 4);
    wrapperLayout.setMargin(true);
    wrapperLayout.setWidth("100%");

    TabSheet tabsheet = new TabSheet();
    tabsheet.setSizeFull();

    AceEditor editor = new AceEditor();
    //      editor.setCaption("Error Details");
    editor.setValue(this.errorOccurrence.getErrorDetail());
    editor.setReadOnly(true);
    editor.setMode(AceMode.xml);
    editor.setTheme(AceTheme.eclipse);
    editor.setHeight(470, Unit.PIXELS);
    editor.setWidth("100%");

    AceEditor eventEditor = new AceEditor();
    //      eventEditor.setCaption("Event Payload");

    if (this.errorOccurrence.getEvent() != null) {
        eventEditor.setValue(new String((byte[]) this.errorOccurrence.getEvent()));
    }

    eventEditor.setReadOnly(true);
    eventEditor.setMode(AceMode.java);
    eventEditor.setTheme(AceTheme.eclipse);
    eventEditor.setHeight(470, Unit.PIXELS);
    eventEditor.setWidth("100%");

    HorizontalLayout formLayout = new HorizontalLayout();
    formLayout.setWidth("100%");
    formLayout.setHeight(230, Unit.PIXELS);
    formLayout.addComponent(layout);
    wrapperLayout.addComponent(formLayout, 0, 0);

    //      VerticalSplitPanel vSplitPanel = new VerticalSplitPanel();
    //      vSplitPanel.setWidth("100%");
    //      vSplitPanel.setHeight(800, Unit.PIXELS);
    //      vSplitPanel.addStyleName(ValoTheme.SPLITPANEL_LARGE);

    HorizontalLayout h1 = new HorizontalLayout();
    h1.setSizeFull();
    h1.setMargin(true);
    h1.addComponent(eventEditor);
    //      vSplitPanel.setFirstComponent(h1);

    HorizontalLayout h2 = new HorizontalLayout();
    h2.setSizeFull();
    h2.setMargin(true);
    h2.addComponent(editor);
    //      vSplitPanel.setSecondComponent(h2);

    tabsheet.addTab(h2, "Error Details");
    tabsheet.addTab(h1, "Event Payload");

    wrapperLayout.addComponent(tabsheet, 0, 1);

    errorOccurrenceDetailsPanel.setContent(wrapperLayout);
    return errorOccurrenceDetailsPanel;
}

From source file:org.jumpmind.vaadin.ui.common.CommonUiUtils.java

License:Open Source License

public static void styleTabSheet(TabSheet tabSheet) {
    tabSheet.setSizeFull();
    tabSheet.addStyleName(ValoTheme.TABSHEET_FRAMED);
    tabSheet.addStyleName(ValoTheme.TABSHEET_COMPACT_TABBAR);
    tabSheet.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);
}

From source file:org.lunifera.example.vaadin.databinding.DatabindingDemoUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {

    VaadinObservables.getRealm(getUI());

    CssLayout layout = new CssLayout();
    layout.setSizeFull();/*from  www.j  a  v  a 2s  . c o m*/
    setContent(layout);

    TabSheet tabsheet = new TabSheet();
    tabsheet.setSizeFull();
    tabsheet.addTab(new ValueBindings(), "Value bindings");
    tabsheet.addTab(new SelectionBindings(), "Selection bindings");
    tabsheet.addTab(new LocaleBindings(), "Locales combo");
    try {
        tabsheet.addTab(new ECViewVerticalLayout(), "ECView Vertical");
        tabsheet.addTab(new ECViewHorizontalLayout(), "ECView Horizontal");
        tabsheet.addTab(new ECViewGridLayout(), "ECView Gridlayout");
        tabsheet.addTab(new ECViewTabSheet(), "ECView Tabsheet");
        tabsheet.addTab(new ECViewDatabinding(), "ECView Bindings");
    } catch (ContextException e) {
        e.printStackTrace();
    }
    layout.addComponent(tabsheet);
}

From source file:org.lunifera.example.vaadin.ecview.ECViewDemoUI.java

License:Apache License

@Override
protected void init(VaadinRequest request) {
    setStyleName(Reindeer.LAYOUT_BLACK);

    VaadinObservables.getRealm(getUI());

    CssLayout layout = new CssLayout();
    layout.setSizeFull();//from w w  w .  j av a  2  s  .  co m
    setContent(layout);

    TabSheet tabsheet = new TabSheet();
    tabsheet.setSizeFull();
    try {
        // tabsheet.addTab(new ECViewVerticalLayout(), "ECView Vertical");
        // tabsheet.addTab(new ECViewHorizontalLayout(),
        // "ECView Horizontal");
        // tabsheet.addTab(new ECViewGridLayout(), "ECView Gridlayout");
        // tabsheet.addTab(new ECViewTabSheet(), "ECView Tabsheet");
        // tabsheet.addTab(new ECViewDatabinding(), "ECView Bindings");
        // tabsheet.addTab(new ECViewEntityGenerator(),
        // "ECView Entity Generator");
        // tabsheet.addTab(new ECViewDtoGenerator(),
        // "ECView Dto Generator");
        tabsheet.addTab(new ECViewMasterDetail(), "ECView Master Detail");
    } catch (ContextException e) {
        e.printStackTrace();
    }
    layout.addComponent(tabsheet);
}

From source file:org.lunifera.examples.runtime.web.ecp.uimodel.presentation.vaadin.UiModelDemoUI.java

License:Open Source License

@Override
public void init(VaadinRequest request) {
    VerticalLayout content = new VerticalLayout();
    content.setMargin(true);//from   ww w . j  a v a 2  s  .com
    content.setSizeFull();

    TabSheet sheet = new TabSheet();
    sheet.setSizeFull();
    content.addComponent(sheet);
    setContent(content);

    // add all examples
    //
    sheet.addTab(new GridLayoutFactory().createComponent(), "GridLayout");
    sheet.addTab(new HorizontalLayoutFactory().createComponent(), "HorizontalLayout");
    sheet.addTab(new VerticalLayoutFactory().createComponent(), "VerticalLayout");
}

From source file:org.opennms.features.topology.app.internal.TopologyWidgetTestApplication.java

License:Open Source License

/**
 * Gets a {@link TabSheet} view for all widgets in this manager.
 * // ww  w.  j ava 2  s . c o  m
 * @return TabSheet
 */
private TabSheet getTabSheet(WidgetManager manager, WidgetContext widgetContext) {
    TabSheet tabSheet = new TabSheet();
    tabSheet.setSizeFull();

    for (IViewContribution viewContrib : manager.getWidgets()) {
        // Create a new view instance
        Component view = viewContrib.getView(widgetContext);
        try {
            m_selectionManager.addSelectionListener((SelectionListener) view);
        } catch (ClassCastException e) {
        }
        try {
            ((SelectionNotifier) view).addSelectionListener(m_selectionManager);
        } catch (ClassCastException e) {
        }
        if (viewContrib.getIcon() != null) {
            tabSheet.addTab(view, viewContrib.getTitle(), viewContrib.getIcon());
        } else {
            tabSheet.addTab(view, viewContrib.getTitle());
        }
        view.setSizeFull();
    }

    return tabSheet;
}

From source file:org.opennms.features.vaadin.config.SnmpCollectionAdminApplication.java

License:Open Source License

@Override
public void init(VaadinRequest request) {
    if (dataCollectionDao == null)
        throw new RuntimeException("dataCollectionDao cannot be null.");

    TabSheet tabs = new TabSheet();
    tabs.addStyleName("light");
    tabs.setSizeFull();
    tabs.addTab(new SnmpCollectionPanel(dataCollectionDao, new SimpleLogger()));
    tabs.addTab(new DataCollectionGroupAdminPanel(dataCollectionDao));

    setContent(tabs);//from   w ww .ja  v a 2 s . c o  m
}

From source file:org.opennms.features.vaadin.datacollection.DataCollectionGroupPanel.java

License:Open Source License

/**
 * Instantiates a new data collection group panel.
 *
 * @param dataCollectionConfigDao the OpenNMS Data Collection Configuration DAO
 * @param group the data collection group object
 * @param logger the logger object/*w w w .  j  av  a  2  s.  c  o  m*/
 * @param existingFile the existing file
 */
public DataCollectionGroupPanel(final DataCollectionConfigDao dataCollectionConfigDao,
        final DatacollectionGroup group, final Logger logger, final File existingFile) {
    this.existingFile = existingFile;

    setCaption("Data Collection");
    addStyleName("light");

    // Data Collection Group - Main Fields

    groupName.setPropertyDataSource(new ObjectProperty<String>(group.getName()));
    groupName.setNullSettingAllowed(false);
    groupName.setImmediate(true);
    if (isExistingGroup()) { // If we allow to rename an existing group, we should modify the SNMP Collection as well
        groupName.setEnabled(false);
    }

    boolean mibGroupEditable = !(isExistingGroup() && ResourceTypeUtils.isStoreByGroup());
    resourceTypes = new ResourceTypePanel(dataCollectionConfigDao, group, logger);
    groups = new GroupPanel(dataCollectionConfigDao, group, logger, mibGroupEditable);
    systemDefs = new SystemDefPanel(dataCollectionConfigDao, group, logger);

    // Button Toolbar

    final HorizontalLayout toolbar = new HorizontalLayout();
    toolbar.addComponent(new Button("Save Data Collection File", new Button.ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            processDataCollection(dataCollectionConfigDao, logger);
        }
    }));
    toolbar.addComponent(new Button("Cancel", new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            cancel();
            logger.info("Data collection processing has been canceled");
        }
    }));

    // Tab Panel

    final TabSheet tabs = new TabSheet();
    tabs.addStyleName("light");
    tabs.setSizeFull();
    tabs.addTab(resourceTypes, "Resource Types");
    tabs.addTab(groups, "MIB Groups");
    tabs.addTab(systemDefs, "System Definitions");

    // Main Layout

    final VerticalLayout mainLayout = new VerticalLayout();
    mainLayout.setSpacing(true);
    mainLayout.setMargin(true);
    mainLayout.addComponent(toolbar);
    mainLayout.addComponent(groupName);
    mainLayout.addComponent(tabs);
    mainLayout.setComponentAlignment(toolbar, Alignment.MIDDLE_RIGHT);
    setContent(mainLayout);
}