本文整理汇总了Java中com.vaadin.server.Responsive类的典型用法代码示例。如果您正苦于以下问题:Java Responsive类的具体用法?Java Responsive怎么用?Java Responsive使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Responsive类属于com.vaadin.server包,在下文中一共展示了Responsive类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.vaadin.server.Responsive; //导入依赖的package包/类
@Override
protected void init(VaadinRequest vaadinRequest) {
root = new CssLayout(appBar, navigationDrawer, content);
root.setPrimaryStyleName("root");
root.setSizeFull();
Responsive.makeResponsive(root);
setContent(root);
appBar.getNaviIcon().addClickListener(event -> navigationDrawer.toggle());
content.setPrimaryStyleName("content");
content.setSizeFull();
initNavigationItems();
initDummyContent();
}
示例2: buildToolbar
import com.vaadin.server.Responsive; //导入依赖的package包/类
private Component buildToolbar() {
HorizontalLayout header = new HorizontalLayout();
header.addStyleName("viewheader");
header.setSpacing(true);
Responsive.makeResponsive(header);
Label title = new Label("Imot list");
title.setSizeUndefined();
title.addStyleName(ValoTheme.LABEL_H1);
title.addStyleName(ValoTheme.LABEL_NO_MARGIN);
header.addComponent(title);
createReport = buildCreateReport();
HorizontalLayout tools = new HorizontalLayout(buildFilter(),
createReport);
tools.setSpacing(true);
tools.addStyleName("toolbar");
header.addComponent(tools);
return header;
}
示例3: init
import com.vaadin.server.Responsive; //导入依赖的package包/类
@Override
protected void init(final VaadinRequest request) {
setLocale(Locale.US);
DashboardEventBus.register(this);
Responsive.makeResponsive(this);
addStyleName(ValoTheme.UI_WITH_MENU);
updateContent();
// Some views need to be aware of browser resize events so a
// BrowserResizeEvent gets fired to the event bus on every occasion.
Page.getCurrent().addBrowserWindowResizeListener(
new BrowserWindowResizeListener() {
@Override
public void browserWindowResized(
final BrowserWindowResizeEvent event) {
DashboardEventBus.post(new BrowserResizeEvent());
}
});
}
示例4: MovieDetailsWindow
import com.vaadin.server.Responsive; //导入依赖的package包/类
private MovieDetailsWindow(final Movie movie, final Date startTime,
final Date endTime) {
addStyleName("moviedetailswindow");
Responsive.makeResponsive(this);
setCaption(movie.getTitle());
center();
setCloseShortcut(KeyCode.ESCAPE, null);
setResizable(false);
setClosable(false);
setHeight(90.0f, Unit.PERCENTAGE);
VerticalLayout content = new VerticalLayout();
content.setSizeFull();
setContent(content);
Panel detailsWrapper = new Panel(buildMovieDetails(movie, startTime,
endTime));
detailsWrapper.setSizeFull();
detailsWrapper.addStyleName(ValoTheme.PANEL_BORDERLESS);
detailsWrapper.addStyleName("scroll-divider");
content.addComponent(detailsWrapper);
content.setExpandRatio(detailsWrapper, 1f);
content.addComponent(buildFooter());
}
示例5: buildSparklines
import com.vaadin.server.Responsive; //导入依赖的package包/类
private Component buildSparklines() {
CssLayout sparks = new CssLayout();
sparks.addStyleName("sparks");
sparks.setWidth("100%");
Responsive.makeResponsive(sparks);
SparklineChart s = new SparklineChart("Traffic", "K", "",
DummyDataGenerator.chartColors[0], 22, 20, 80);
sparks.addComponent(s);
s = new SparklineChart("Revenue / Day", "M", "$",
DummyDataGenerator.chartColors[2], 8, 89, 150);
sparks.addComponent(s);
s = new SparklineChart("Checkout Time", "s", "",
DummyDataGenerator.chartColors[3], 10, 30, 120);
sparks.addComponent(s);
s = new SparklineChart("Theater Fill Rate", "%", "",
DummyDataGenerator.chartColors[5], 50, 34, 100);
sparks.addComponent(s);
return sparks;
}
示例6: buildToolbar
import com.vaadin.server.Responsive; //导入依赖的package包/类
private Component buildToolbar() {
HorizontalLayout header = new HorizontalLayout();
header.addStyleName("viewheader");
header.setSpacing(true);
Responsive.makeResponsive(header);
Label title = new Label("Latest Transactions");
title.setSizeUndefined();
title.addStyleName(ValoTheme.LABEL_H1);
title.addStyleName(ValoTheme.LABEL_NO_MARGIN);
header.addComponent(title);
createReport = buildCreateReport();
HorizontalLayout tools = new HorizontalLayout(buildFilter(),
createReport);
tools.setSpacing(true);
tools.addStyleName("toolbar");
header.addComponent(tools);
return header;
}
示例7: init
import com.vaadin.server.Responsive; //导入依赖的package包/类
@Override
protected void init(VaadinRequest vaadinRequest) {
Responsive.makeResponsive(this);
getPage().setTitle("DungeonStory");
if (Configuration.getInstance().isMock()) {
accessControl = new BasicAccessControl();
} else {
accessControl = new DsAccessControl();
}
setupEventBus();
if (!accessControl.isUserSignedIn()) {
setContent(new LoginScreen(accessControl, this::showMainView));
} else {
showMainView();
}
setLocale(vaadinRequest.getLocale());
ImageFactory.getInstance();
}
示例8: postInit
import com.vaadin.server.Responsive; //导入依赖的package包/类
@PostConstruct
private void postInit() {
setSpacing(false);
setMargin(false);
setSizeFull();
content = new CssLayout();
content.setPrimaryStyleName("valo-content");
content.addStyleName("v-scrollable");
content.setWidth(100, Unit.PERCENTAGE);
addComponents(appHeader,content);
expand(content);
addAttachListener(new AttachListener() {
@Override
public void attach(AttachEvent event) {
Responsive.makeResponsive(getUI());
}
});
}
示例9: DashboardView
import com.vaadin.server.Responsive; //导入依赖的package包/类
public DashboardView(ViewDefinition vd) {
this.viewDefinition = HybridbpmUI.getDashboardAPI().getViewDefinitionById(vd.getId().toString());
Design.read(this);
Responsive.makeResponsive(this);
btnAdd.addClickListener(this);
btnAdd.setIcon(FontAwesome.PLUS_CIRCLE);
btnAdd.setCaption("Add tab");
btnEdit.addClickListener(this);
btnEdit.setIcon(FontAwesome.EDIT);
btnEdit.setCaption("Edit view");
btnDelete.addClickListener(this);
btnDelete.setIcon(FontAwesome.TIMES_CIRCLE);
btnDelete.setCaption("Delete view");
createTabs();
checkDeveloperMode();
tabSheet.addSelectedTabChangeListener(this);
tabSheet.setCloseHandler(this);
}
示例10: createRowItem
import com.vaadin.server.Responsive; //导入依赖的package包/类
protected final void createRowItem(final ResponsiveRow row, final Button button, final String description) {
final CssLayout layout = new CssLayout();
layout.addStyleName("v-layout-content-overview-panel-level2");
Responsive.makeResponsive(layout);
layout.setSizeUndefined();
button.addStyleName("itembox");
button.addStyleName("title");
Responsive.makeResponsive(button);
button.setWidth(100, Unit.PERCENTAGE);
layout.addComponent(button);
final Label descriptionLabel = new Label(description);
descriptionLabel.addStyleName("itembox");
Responsive.makeResponsive(descriptionLabel);
descriptionLabel.setWidth(100, Unit.PERCENTAGE);
layout.addComponent(descriptionLabel);
row.addColumn().withDisplayRules(DISPLAY_SIZE_XS_DEVICE,DISPLAYS_SIZE_XM_DEVICE,DISPLAY_SIZE_MD_DEVICE,DISPLAY_SIZE_LG_DEVICE).withComponent(layout);
}
示例11: createRowComponent
import com.vaadin.server.Responsive; //导入依赖的package包/类
protected final void createRowComponent(final ResponsiveRow row, final Component component, final String description) {
final CssLayout layout = new CssLayout();
layout.addStyleName(".v-layout-content-pagemode-panel-level2");
Responsive.makeResponsive(layout);
layout.setSizeUndefined();
final Label descriptionLabel = new Label(description);
descriptionLabel.addStyleName("itembox");
Responsive.makeResponsive(descriptionLabel);
descriptionLabel.setWidth(100, Unit.PERCENTAGE);
layout.addComponent(descriptionLabel);
component.addStyleName("itembox");
component.addStyleName("title");
Responsive.makeResponsive(component);
component.setWidth(100, Unit.PERCENTAGE);
layout.addComponent(component);
row.addColumn().withDisplayRules(DISPLAY_SIZE_XS_DEVICE,DISPLAYS_SIZE_XM_DEVICE,DISPLAY_SIZE_MD_DEVICE,DISPLAY_SIZE_LG_DEVICE).withComponent(layout);
}
示例12: init
import com.vaadin.server.Responsive; //导入依赖的package包/类
@Override
protected void init(VaadinRequest vaadinRequest) {
Responsive.makeResponsive(this);
setLocale(vaadinRequest.getLocale());
getPage().setTitle("MockApp");
if (!accessControl.isUserSignedIn()) {
setContent(new LoginScreen(accessControl, new LoginListener() {
@Override
public void loginSuccessful() {
showMainView();
}
}));
} else {
showMainView();
}
}
示例13: buildLoginForm
import com.vaadin.server.Responsive; //导入依赖的package包/类
private Component buildLoginForm() {
final VerticalLayout loginPanel = new VerticalLayout();
loginPanel.setSizeUndefined();
loginPanel.setSpacing(true);
Responsive.makeResponsive(loginPanel);
loginPanel.addStyleName("login-panel");
loginPanel.addComponent(buildLabels());
loginPanel.addComponent(buildFields());
CheckBox rememberMe = new CheckBox("Remember me", true);
rememberMe.setTabIndex(3);
loginPanel.addComponent(rememberMe);
return loginPanel;
}
示例14: initLayout
import com.vaadin.server.Responsive; //导入依赖的package包/类
/**
* Initialise le layout principal
*/
private void initLayout() {
layout.setSizeFull();
setContent(layout);
menuLayout.setPrimaryStyleName(ValoTheme.MENU_ROOT);
layoutWithSheet.setPrimaryStyleName(StyleConstants.VALO_CONTENT);
layoutWithSheet.addStyleName(StyleConstants.SCROLLABLE);
layoutWithSheet.setSizeFull();
VerticalLayout vlAll = new VerticalLayout();
vlAll.addStyleName(StyleConstants.SCROLLABLE);
vlAll.setSizeFull();
subBarMenu.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);
subBarMenu.setVisible(false);
vlAll.addComponent(subBarMenu);
contentLayout.addStyleName(StyleConstants.SCROLLABLE);
contentLayout.setSizeFull();
vlAll.addComponent(contentLayout);
vlAll.setExpandRatio(contentLayout, 1);
layoutWithSheet.addComponent(vlAll);
menuButtonLayout.addStyleName(StyleConstants.VALO_MY_MENU_MAX_WIDTH);
layout.setExpandRatio(layoutWithSheet, 1);
Responsive.makeResponsive(this);
addStyleName(ValoTheme.UI_WITH_MENU);
}
示例15: DashboardView
import com.vaadin.server.Responsive; //导入依赖的package包/类
public DashboardView() {
addStyleName(ValoTheme.PANEL_BORDERLESS);
setSizeFull();
DashboardEventBus.register(this);
root = new VerticalLayout();
root.setSizeFull();
root.setMargin(true);
root.addStyleName("dashboard-view");
setContent(root);
Responsive.makeResponsive(root);
root.addComponent(buildHeader());
root.addComponent(buildSparklines());
Component content = buildContent();
root.addComponent(content);
root.setExpandRatio(content, 1);
// All the open sub-windows should be closed whenever the root layout
// gets clicked.
root.addLayoutClickListener(new LayoutClickListener() {
@Override
public void layoutClick(final LayoutClickEvent event) {
DashboardEventBus.post(new CloseOpenWindowsEvent());
}
});
}