Search in sources :

Example 11 with MarginInfo

use of com.vaadin.shared.ui.MarginInfo in project cuba by cuba-platform.

the class WebGridLayout method setMargin.

@Override
public void setMargin(com.haulmont.cuba.gui.components.MarginInfo marginInfo) {
    MarginInfo vMargin = new MarginInfo(marginInfo.hasTop(), marginInfo.hasRight(), marginInfo.hasBottom(), marginInfo.hasLeft());
    component.setMargin(vMargin);
}
Also used : MarginInfo(com.vaadin.shared.ui.MarginInfo)

Example 12 with MarginInfo

use of com.vaadin.shared.ui.MarginInfo in project cuba by cuba-platform.

the class WebGroupBox method setOuterMargin.

@Override
public void setOuterMargin(com.haulmont.cuba.gui.components.MarginInfo marginInfo) {
    MarginInfo vMargin = new MarginInfo(marginInfo.hasTop(), marginInfo.hasRight(), marginInfo.hasBottom(), marginInfo.hasLeft());
    component.setOuterMargin(vMargin);
}
Also used : MarginInfo(com.vaadin.shared.ui.MarginInfo)

Example 13 with MarginInfo

use of com.vaadin.shared.ui.MarginInfo in project linkki by linkki-framework.

the class FormSection method createContent.

protected GridLayout createContent() {
    int columns = getNumberOfColumns();
    int gridColumns = columns * 3;
    GridLayout gridLayout = new GridLayout(gridColumns, 1);
    gridLayout.setWidth("100%");
    gridLayout.setMargin(new MarginInfo(true, true, true, true));
    gridLayout.setSpacing(true);
    for (int i = 0; i < columns; i++) {
        gridLayout.setColumnExpandRatio(i * 3, 0);
        gridLayout.setColumnExpandRatio(i * 3 + 1, 0);
        gridLayout.setColumnExpandRatio(i * 3 + 2, 1);
    }
    return gridLayout;
}
Also used : GridLayout(com.vaadin.ui.GridLayout) MarginInfo(com.vaadin.shared.ui.MarginInfo)

Example 14 with MarginInfo

use of com.vaadin.shared.ui.MarginInfo in project VaadinUtils by rlsutton1.

the class DashBoardView method enter.

@Override
public void enter(ViewChangeEvent event) {
    setMargin(new MarginInfo(false, false, false, false));
    setSizeFull();
    final Label preparing = new Label("Preparing your dashboard...");
    preparing.setStyleName(ValoTheme.LABEL_H1);
    addComponent(preparing);
    // defer the load of the dashboard to a separate request, otherwise on a
    // refresh(F5) it will be blank. I think this is due to the DashBoard
    // widget needing to be initialized (client side) first
    new JSCallWithReturnValue("true").callBoolean(new JavaScriptCallback<Boolean>() {

        @Override
        public void callback(Boolean value) {
            final UI ui = UI.getCurrent();
            new Thread(getLoadRunner(preparing, ui), "Dash Board Delayed Loader").start();
        }

        private Runnable getLoadRunner(final Label preparing, final UI ui) {
            return new Runnable() {

                @Override
                public void run() {
                    try {
                        Thread.sleep(500);
                    } catch (InterruptedException e1) {
                        logger.error(e1);
                    }
                    ui.access(new Runnable() {

                        @Override
                        public void run() {
                            try (AutoCloseable closer = EntityManagerProvider.setThreadLocalEntityManagerTryWithResources()) {
                                removeComponent(preparing);
                                postLoad();
                            } catch (Exception e) {
                                logger.error(e, e);
                            }
                        }
                    });
                }
            };
        }
    });
}
Also used : UI(com.vaadin.ui.UI) MarginInfo(com.vaadin.shared.ui.MarginInfo) Label(com.vaadin.ui.Label) JSCallWithReturnValue(au.com.vaadinutils.js.JSCallWithReturnValue)

Example 15 with MarginInfo

use of com.vaadin.shared.ui.MarginInfo in project VaadinUtils by rlsutton1.

the class JasperReportLayout method getOptionsPanel.

private Component getOptionsPanel() {
    VerticalLayout layout = new VerticalLayout();
    layout.setId("OptionsPanel");
    // layout.setMargin(new MarginInfo(false, false, false, false));
    // layout.setSpacing(true);
    layout.setSizeFull();
    String buttonHeight = "" + 40;
    HorizontalLayout buttonBar = new HorizontalLayout();
    buttonBar.setSpacing(true);
    buttonBar.setStyleName(Reindeer.LAYOUT_BLUE);
    buttonBar.setWidth("100%");
    buttonBar.setHeight(buttonHeight);
    buttonBar.setMargin(new MarginInfo(false, false, false, false));
    HorizontalLayout buttonContainer = new HorizontalLayout();
    buttonContainer.setSizeFull();
    buttonContainer.setWidth("230");
    showButton = new NativeButton();
    showButton.setIcon(new ExternalResource("images/seanau/Print preview.png"));
    showButton.setDescription("Preview");
    showButton.setWidth("50");
    showButton.setHeight(buttonHeight);
    showButton.setDisableOnClick(true);
    addButtonListener(showButton, OutputFormat.HTML);
    buttonContainer.addComponent(showButton);
    printButton = new NativeButton();
    printButton.setIcon(new ExternalResource("images/seanau/Print_32.png"));
    printButton.setDescription("Print (PDF)");
    printButton.setWidth("50");
    printButton.setHeight(buttonHeight);
    printButton.setDisableOnClick(true);
    addButtonListener(printButton, OutputFormat.PDF);
    buttonContainer.addComponent(printButton);
    exportButton = new NativeButton();
    exportButton.setDescription("Export (Excel - CSV)");
    exportButton.setIcon(new ExternalResource("images/exporttoexcel.png"));
    exportButton.setWidth("50");
    exportButton.setDisableOnClick(true);
    exportButton.setHeight(buttonHeight);
    // exportButton.setStyleName(Reindeer.BUTTON_LINK);
    addButtonListener(exportButton, OutputFormat.CSV);
    buttonContainer.addComponent(exportButton);
    createEmailButton(buttonHeight, buttonContainer);
    createScheduleButton(buttonHeight, buttonContainer);
    if (reportProperties instanceof JasperReportPopUp) {
        // This is disabled because there are serious problems with
        // transient (JasperReportProperties is not aware of them)
        // parameters in drill
        // downs, these can not currently be save or represented in the
        // ReportEmailSchedule
        emailButton.setEnabled(false);
        scheduleButton.setEnabled(false);
    }
    buttonBar.addComponent(buttonContainer);
    layout.addComponent(buttonBar);
    components = builder.buildLayout(false);
    if (components.size() > 0) {
        VerticalLayout filterPanel = new VerticalLayout();
        filterPanel.setMargin(new MarginInfo(false, false, true, false));
        filterPanel.setSpacing(true);
        filterPanel.setSizeFull();
        Label filterLabel = new Label("<b>Filters</b>");
        filterLabel.setStyleName(Reindeer.LABEL_H2);
        filterLabel.setContentMode(ContentMode.HTML);
        filterPanel.addComponent(filterLabel);
        for (ExpanderComponent componet : components) {
            filterPanel.addComponent(componet.getComponent());
            if (componet.shouldExpand()) {
                filterPanel.setExpandRatio(componet.getComponent(), 1);
            }
        }
        layout.addComponent(filterPanel);
        layout.setExpandRatio(filterPanel, 1.0f);
    }
    // hidden frame for downloading csv
    csv = new BrowserFrame();
    csv.setVisible(true);
    csv.setHeight("1");
    csv.setWidth("1");
    csv.setImmediate(true);
    layout.addComponent(csv);
    return layout;
}
Also used : NativeButton(com.vaadin.ui.NativeButton) ExpanderComponent(au.com.vaadinutils.jasper.filter.ExpanderComponent) BrowserFrame(com.vaadin.ui.BrowserFrame) MarginInfo(com.vaadin.shared.ui.MarginInfo) Label(com.vaadin.ui.Label) VerticalLayout(com.vaadin.ui.VerticalLayout) ExternalResource(com.vaadin.server.ExternalResource) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Aggregations

MarginInfo (com.vaadin.shared.ui.MarginInfo)15 Label (com.vaadin.ui.Label)3 HorizontalLayout (com.vaadin.ui.HorizontalLayout)2 VerticalLayout (com.vaadin.ui.VerticalLayout)2 ExpanderComponent (au.com.vaadinutils.jasper.filter.ExpanderComponent)1 JSCallWithReturnValue (au.com.vaadinutils.js.JSCallWithReturnValue)1 ExternalResource (com.vaadin.server.ExternalResource)1 BrowserFrame (com.vaadin.ui.BrowserFrame)1 ComboBox (com.vaadin.ui.ComboBox)1 GridLayout (com.vaadin.ui.GridLayout)1 NativeButton (com.vaadin.ui.NativeButton)1 UI (com.vaadin.ui.UI)1