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);
}
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);
}
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;
}
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);
}
}
});
}
};
}
});
}
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;
}
Aggregations