本文整理汇总了Java中com.vaadin.shared.ui.MarginInfo类的典型用法代码示例。如果您正苦于以下问题:Java MarginInfo类的具体用法?Java MarginInfo怎么用?Java MarginInfo使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MarginInfo类属于com.vaadin.shared.ui包,在下文中一共展示了MarginInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: MultiColumnFormLayout
import com.vaadin.shared.ui.MarginInfo; //导入依赖的package包/类
public MultiColumnFormLayout(int columns, String caption) {
if (columns < 1) {
throw new IllegalArgumentException("column number must be greater than 1");
}
hLayout = new HorizontalLayout();
hLayout.setWidth(100, Unit.PERCENTAGE);
for (int i = 0; i < columns; i++) {
FormLayout form = new FormLayout();
hLayout.addComponent(form, i);
}
if (caption != null) {
hLayout.setMargin(new MarginInfo(false, true));
Panel panel = new Panel(caption, hLayout);
setCompositionRoot(panel);
} else {
setCompositionRoot(hLayout);
}
}
示例2: CubaRowsCount
import com.vaadin.shared.ui.MarginInfo; //导入依赖的package包/类
public CubaRowsCount() {
HorizontalLayout layout = new HorizontalLayout();
layout.setStyleName("c-paging");
layout.setSpacing(false);
layout.setMargin(new MarginInfo(false, false, false, true));
setCompositionRoot(layout);
CubaPlaceHolder expander = new CubaPlaceHolder();
expander.setWidth("100%");
layout.addComponent(expander);
layout.setExpandRatio(expander, 1);
AbstractOrderedLayout contentLayout = createContentLayout();
layout.addComponent(contentLayout);
layout.setWidth("100%");
setWidth("100%");
}
示例3: setHeight
import com.vaadin.shared.ui.MarginInfo; //导入依赖的package包/类
@Override
public void setHeight(String height) {
super.setHeight(height);
if (getHeight() > 0) {
composition.setExpandRatio(tokenContainer, 1);
tokenContainer.setMargin(false);
} else {
composition.setExpandRatio(tokenContainer, 0);
if (simple) {
tokenContainer.setMargin(false);
} else {
tokenContainer.setMargin(new MarginInfo(true, false, false, false));
}
}
}
示例4: CalendarLayout
import com.vaadin.shared.ui.MarginInfo; //导入依赖的package包/类
public CalendarLayout() {
super();
btnAdd.setCaption("Add task");
btnAdd.setVisible(false);
tools.addComponent(calendarOptionGroup, 1);
setMargin(new MarginInfo(true, false, false, false));
addComponent(calendar);
setExpandRatio(calendar, 1f);
calendarOptionGroup.addItem(TYPE.TODAY);
calendarOptionGroup.setItemCaption(TYPE.TODAY, "Today");
calendarOptionGroup.addItem(TYPE.WEEK);
calendarOptionGroup.setItemCaption(TYPE.WEEK, "Week");
calendarOptionGroup.addItem(TYPE.MONTH);
calendarOptionGroup.setItemCaption(TYPE.MONTH, "Month");
calendarOptionGroup.addValueChangeListener(this);
calendarOptionGroup.setValue(TYPE.WEEK);
calendarOptionGroup.setStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
calendarOptionGroup.addStyleName("small");
}
示例5: DashboardPanel
import com.vaadin.shared.ui.MarginInfo; //导入依赖的package包/类
public DashboardPanel(DashboardTab panelView, PanelDefinition pd) {
this.dashboardTab = panelView;
this.panelDefinition = pd;
toolbar = new HorizontalLayout();
toolbar.setMargin(new MarginInfo(false, false, false, true));
toolbar.setWidth(99, Unit.PERCENTAGE);
toolbar.setStyleName(HybridbpmStyle.LAYOUT_PADDING8);
caption.addStyleName(ValoTheme.LABEL_H4);
caption.addStyleName(ValoTheme.LABEL_COLORED);
caption.addStyleName(ValoTheme.LABEL_NO_MARGIN);
toolbar.removeAllComponents();
toolbar.addComponents(caption, new PanelMenuBar(this));
toolbar.setExpandRatio(caption, 1);
toolbar.setComponentAlignment(caption, Alignment.MIDDLE_LEFT);
setSizeFull();
setStyleName(ValoTheme.LAYOUT_CARD);
addStyleName("dashboard-panel");
configureModule();
}
示例6: AbstractEditor
import com.vaadin.shared.ui.MarginInfo; //导入依赖的package包/类
public AbstractEditor() {
setSizeFull();
setSpacing(true);
setMargin(new MarginInfo(true, false, false, false));
addComponent(buttonBar);
setComponentAlignment(buttonBar, Alignment.MIDDLE_RIGHT);
addComponent(horizontalSplitPanel);
setExpandRatio(horizontalSplitPanel, 1f);
horizontalSplitPanel.setSizeFull();
horizontalSplitPanel.setStyleName("transparent");
buttonBar.setSpacing(true);
buttonBar.setSpacing(true);
btnSave.setIcon(FontAwesome.SAVE);
btnSave.setStyleName(ValoTheme.BUTTON_BORDERLESS);
btnSave.addStyleName(ValoTheme.BUTTON_SMALL);
btnSave.addStyleName(ValoTheme.BUTTON_PRIMARY);
}
示例7: layout
import com.vaadin.shared.ui.MarginInfo; //导入依赖的package包/类
/**
* Do the application layout that is optimized for the screen size.
* <p>
* Like in Java world in general, Vaadin developers can modularize their
* helpers easily and re-use existing code. E.g. In this method we are using
* extended versions of Vaadins basic layout that has "fluent API" and this
* way we get bit more readable code. Check out vaadin.com/directory for a
* huge amount of helper libraries and custom components. They might be
* valuable for your productivity.
* </p>
*/
private void layout() {
removeAllComponents();
if (ScreenSize.getScreenSize() == ScreenSize.LARGE) {
addComponents(
new MHorizontalLayout(header, filter, addButton)
.expand(header)
.alignAll(Alignment.MIDDLE_LEFT),
mainContent
);
filter.setSizeUndefined();
} else {
addComponents(
header,
new MHorizontalLayout(filter, addButton)
.expand(filter)
.alignAll(Alignment.MIDDLE_LEFT),
mainContent
);
}
setMargin(new MarginInfo(false, true, true, true));
expand(mainContent);
}
示例8: init
import com.vaadin.shared.ui.MarginInfo; //导入依赖的package包/类
@PostConstruct
void init() {
add(new RichText().withMarkDownResource("/about.md"));
/*
int records = service.findAll().size();
add(new Label("There are " + records + " records in the DB."));
Button button = new Button("Fill test data into DB", new Button.ClickListener() {
@Override
public void buttonClick(Button.ClickEvent event) {
service.resetTestData();
ViewMenuUI.getMenu().navigateTo(CustomerListView.class);
}
});
button.setStyleName(ValoTheme.BUTTON_LARGE);
button.addStyleName(ValoTheme.BUTTON_PRIMARY);
add(button);
*/
setMargin(new MarginInfo(false, true, true, true));
setStyleName(ValoTheme.LAYOUT_CARD);
}
示例9: initContent1
import com.vaadin.shared.ui.MarginInfo; //导入依赖的package包/类
private void initContent1() {
VerticalLayout content = new VerticalLayout();
setContent(content);
Label envLbl = createEnvLabel();
HorizontalLayout top = new HorizontalLayout();
top.setSpacing(true);
top.setMargin(new MarginInfo(false, true, false, true));
top.addComponent(envLbl);
top.addComponent(processBtn);
top.addStyleName("backColor");
content.setSizeFull();
content.setSpacing(true);
content.setMargin(true);
content.addComponent(top);
content.setExpandRatio(top,1);
content.addComponent(screen0Grid);
// content.setExpandRatio(screen0Grid, 10);
// content.addComponent(controlGrid);
// content.setExpandRatio(controlGrid, 10);
}
示例10: makeLayout
import com.vaadin.shared.ui.MarginInfo; //导入依赖的package包/类
public Layout makeLayout(ZoomField<T> field) {
btnClose.setStyleName(ValoTheme.BUTTON_PRIMARY);
content.addStyleName(ValoTheme.PANEL_BORDERLESS);
Component dialogContents = field.getZoomDialog().getDialogContents();
content.setContent(dialogContents);
content.setSizeFull();
buttonBar.setStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
buttonBar.setWidth("100%");
buttonBar.setSpacing(true);
buttonBar.setExpandRatio(spacer, 1);
rootLayout.setSizeFull();
rootLayout.setExpandRatio(content, 1);
rootLayout.setMargin(new MarginInfo(true, false, true, false));
return rootLayout;
}
示例11: constructHeader
import com.vaadin.shared.ui.MarginInfo; //导入依赖的package包/类
protected ComponentContainer constructHeader() {
if (header == null) {
headerText = buildSearchTitle();
if (headerText != null) {
MHorizontalLayout rightComponent = new MHorizontalLayout();
header = new MHorizontalLayout().withFullWidth().withMargin(new MarginInfo(true, false, true, false));
header.with(headerText, rightComponent).withAlign(headerText, Alignment.MIDDLE_LEFT)
.withAlign(rightComponent, Alignment.MIDDLE_RIGHT).expand(headerText);
}
Component extraControls = buildExtraControls();
if (extraControls != null) {
addHeaderRight(extraControls);
}
return header;
} else {
return header;
}
}
示例12: createLegendBox
import com.vaadin.shared.ui.MarginInfo; //导入依赖的package包/类
@Override
protected final ComponentContainer createLegendBox() {
final CssLayout mainLayout = new CssLayout();
mainLayout.setWidth("100%");
mainLayout.addStyleName("legendBoxContent");
final List series = dataSet.getSeries();
for (int i = 0; i < series.size(); i++) {
final MHorizontalLayout layout = new MHorizontalLayout().withMargin(new MarginInfo(false, false, false, true));
layout.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
final TimeSeries key = (TimeSeries) series.get(i);
int colorIndex = i % CHART_COLOR_STR.size();
final String color = "<div style = \" width:13px;height:13px;background: #" + CHART_COLOR_STR.get(colorIndex) + "\" />";
final ELabel lblCircle = ELabel.html(color);
String captionBtn = UserUIContext.getMessage(StatusI18nEnum.class, (String) key.getKey());
final MButton btnLink = new MButton(StringUtils.trim(captionBtn, 30, true)).withDescription
(captionBtn).withStyleName(WebThemes.BUTTON_LINK);
layout.with(lblCircle, btnLink);
mainLayout.addComponent(layout);
}
return mainLayout;
}
示例13: feedBlocksPut
import com.vaadin.shared.ui.MarginInfo; //导入依赖的package包/类
private void feedBlocksPut(Date currentDate, Date nextDate, CssLayout currentBlock) {
MHorizontalLayout blockWrapper = new MHorizontalLayout().withSpacing(false).withFullWidth().withStyleName("feed-block-wrap");
blockWrapper.setDefaultComponentAlignment(Alignment.TOP_LEFT);
Calendar cal1 = Calendar.getInstance();
cal1.setTime(currentDate);
Calendar cal2 = Calendar.getInstance();
cal2.setTime(nextDate);
if (cal1.get(Calendar.YEAR) != cal2.get(Calendar.YEAR)) {
int currentYear = cal2.get(Calendar.YEAR);
Label yearLbl = ELabel.html("<div>" + String.valueOf(currentYear) + "</div>").withStyleName
("year-lbl").withWidthUndefined();
listContainer.addComponent(yearLbl);
} else {
blockWrapper.setMargin(new MarginInfo(true, false, false, false));
}
Label dateLbl = new Label(DateFormatUtils.format(nextDate, "dd/MM"));
dateLbl.setSizeUndefined();
dateLbl.setStyleName("date-lbl");
blockWrapper.with(dateLbl, currentBlock).expand(currentBlock);
listContainer.addComponent(blockWrapper);
}
示例14: BugsComp
import com.vaadin.shared.ui.MarginInfo; //导入依赖的package包/类
BugsComp(Version beanItem) {
withMargin(false).withFullWidth();
MHorizontalLayout header = new MHorizontalLayout();
final CheckBox openSelection = new BugStatusCheckbox(StatusI18nEnum.Open, true);
CheckBox reOpenSelection = new BugStatusCheckbox(StatusI18nEnum.ReOpen, true);
CheckBox verifiedSelection = new BugStatusCheckbox(StatusI18nEnum.Verified, true);
CheckBox resolvedSelection = new BugStatusCheckbox(StatusI18nEnum.Resolved, true);
Label spacingLbl1 = new Label("");
header.with(openSelection, reOpenSelection, verifiedSelection, resolvedSelection, spacingLbl1).alignAll(Alignment.MIDDLE_LEFT);
bugList = new DefaultBeanPagedList<>(AppContextUtil.getSpringBean(BugService.class), new BugRowRenderer());
bugList.setMargin(new MarginInfo(true, true, true, false));
bugList.setControlStyle("");
searchCriteria = new BugSearchCriteria();
searchCriteria.setProjectId(new NumberSearchField(CurrentProjectVariables.getProjectId()));
searchCriteria.setVersionids(new SetSearchField<>(beanItem.getId()));
searchCriteria.setStatuses(new SetSearchField<>(StatusI18nEnum.Open.name(), StatusI18nEnum.ReOpen.name(),
StatusI18nEnum.Verified.name(), StatusI18nEnum.Resolved.name()));
updateSearchStatus();
this.with(header, bugList);
}
示例15: displayEntryDateTime
import com.vaadin.shared.ui.MarginInfo; //导入依赖的package包/类
public void displayEntryDateTime(ValuedBean bean) {
this.removeAllComponents();
this.withMargin(false);
Label dateInfoHeader = new Label(FontAwesome.CALENDAR.getHtml() + " " +
UserUIContext.getMessage(CrmCommonI18nEnum.SUB_INFO_DATES), ContentMode.HTML);
dateInfoHeader.setStyleName("info-hdr");
this.addComponent(dateInfoHeader);
MVerticalLayout layout = new MVerticalLayout().withMargin(new MarginInfo(false, false, false, true)).withFullWidth();
try {
Date createdDate = (Date) PropertyUtils.getProperty(bean, "createdtime");
Label createdDateLbl = new Label(UserUIContext.getMessage(CrmCommonI18nEnum.ITEM_CREATED_DATE,
UserUIContext.formatPrettyTime(createdDate)));
createdDateLbl.setDescription(UserUIContext.formatDateTime(createdDate));
Date updatedDate = (Date) PropertyUtils.getProperty(bean, "lastupdatedtime");
Label updatedDateLbl = new Label(UserUIContext.getMessage(CrmCommonI18nEnum.ITEM_UPDATED_DATE,
UserUIContext.formatPrettyTime(updatedDate)));
updatedDateLbl.setDescription(UserUIContext.formatDateTime(updatedDate));
layout.with(createdDateLbl, updatedDateLbl);
this.addComponent(layout);
} catch (Exception e) {
LOG.error("Get date is failed {}", BeanUtility.printBeanObj(bean));
}
}