当前位置: 首页>>代码示例>>Java>>正文


Java VaadinRequest类代码示例

本文整理汇总了Java中com.vaadin.server.VaadinRequest的典型用法代码示例。如果您正苦于以下问题:Java VaadinRequest类的具体用法?Java VaadinRequest怎么用?Java VaadinRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


VaadinRequest类属于com.vaadin.server包,在下文中一共展示了VaadinRequest类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: init

import com.vaadin.server.VaadinRequest; //导入依赖的package包/类
@Override
protected void init(VaadinRequest request) {
    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    setContent(layout);

    Grid grid = new Grid();

    initializeGrid(grid);
    grid.setWidth("700px");
    grid.setHeight("500px");

    applyDemoHacks(grid);

    layout.addComponent(grid);
}
 
开发者ID:Legioth,项目名称:AllAboutGridWebinar,代码行数:17,代码来源:AllAboutGridUI.java

示例2: init

import com.vaadin.server.VaadinRequest; //导入依赖的package包/类
@Override
protected void init(VaadinRequest request) {
	final VerticalLayout root = new VerticalLayout();
	root.setSizeFull();
	root.setMargin(true);
	root.setSpacing(true);
	setContent(root);
	MHorizontalLayout horizontalLayout = new MHorizontalLayout();
	for (MenuEntry menuEntry : menuEntries) {
		horizontalLayout.addComponent(new MButton(menuEntry.getName(), event -> {
			navigator.navigateTo(menuEntry.getNavigationTarget());
		}));
	}
	root.addComponent(horizontalLayout);
	springViewDisplay = new Panel();
	springViewDisplay.setSizeFull();
	root.addComponent(springViewDisplay);
	root.setExpandRatio(springViewDisplay, 1.0f);

}
 
开发者ID:dve,项目名称:spring-boot-plugins-example,代码行数:21,代码来源:VaadinUI.java

示例3: init

import com.vaadin.server.VaadinRequest; //导入依赖的package包/类
@Override
protected void init(VaadinRequest vaadinRequest) {
    setNavigator(new Navigator(this, (View view) -> {
        tabs.setSelectedTab((Component) view);
    }));

    registerExample(SvgInVaadin.class);
    registerExample(SimplyAsAnImageOrIcon.class);
    registerExample(FileExample.class);
    registerExample(AnimationExample.class);
    registerExample(Java2DExample.class);
    registerExample(JungExample.class);

    getNavigator().setErrorView(SvgInVaadin.class);
    tabs.addSelectedTabChangeListener(e -> {
        if (e.isUserOriginated()) {
            getNavigator().navigateTo(e.getTabSheet().getSelectedTab().getClass().getSimpleName());
        }
    });
    String state = getNavigator().getState();
    getNavigator().navigateTo(state);

    tabs.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);
    setContent(tabs);
}
 
开发者ID:mstahv,项目名称:svgexamples,代码行数:26,代码来源:MyUI.java

示例4: init

import com.vaadin.server.VaadinRequest; //导入依赖的package包/类
@Override
protected void init(VaadinRequest request) {
    final VerticalLayout rootLayout = new VerticalLayout();
    rootLayout.setSizeFull();
    setContent(rootLayout);

    final CssLayout navigationBar = new CssLayout();
    navigationBar.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
    navigationBar.addComponent(createNavigationButton("Demo View (Default)",
            Constants.VIEW_DEFAULT));
    navigationBar.addComponent(createNavigationButton("Stream View",
            Constants.VIEW_STREAM));
    rootLayout.addComponent(navigationBar);

    springViewDisplay = new Panel();
    springViewDisplay.setSizeFull();
    
    rootLayout.addComponent(springViewDisplay);
    rootLayout.setExpandRatio(springViewDisplay, 1.0f);

}
 
开发者ID:MikeQin,项目名称:spring-boot-vaadin-rabbitmq-pipeline-demo,代码行数:22,代码来源:NavigatorUI.java

示例5: init

import com.vaadin.server.VaadinRequest; //导入依赖的package包/类
@Override
protected void init(VaadinRequest vaadinRequest) {
    // crate a binder for a form, specifying the data class that will be used in binding
    Binder<ImageData> binder = new Binder<>(ImageData.class);

    // specify explicit binding in order to add validation and converters
    binder.forMemberField(imageSize)
            // input should not be null or empty
            .withValidator(string -> string != null && !string.isEmpty(), "Input values should not be empty")
            // convert String to Integer, throw ValidationException if String is in incorrect format
            .withConverter(new StringToIntegerConverter("Input value should be an integer"))
            // validate converted integer: it should be positive
            .withValidator(integer -> integer > 0, "Input value should be a positive integer");

    // tell binder to bind use all fields from the current class, but considering already existing bindings
    binder.bindInstanceFields(this);

    // crate data object with predefined imageName and imageSize
    ImageData imageData = new ImageData("Lorem ipsum", 2);

    // fill form with predefined data from data object and
    // make binder to automatically update the object from the form, if no validation errors are present
    binder.setBean(imageData);

    binder.addStatusChangeListener(e -> {
        // the real image drawing will not be considered in this article

        if (e.hasValidationErrors() || !e.getBinder().isValid()) {
            Notification.show("Form contains validation errors, no image will be drawn");
        } else {
            Notification.show(String.format("I will draw image with \"%s\" text and width %d\n",
                    imageData.getText(), imageData.getSize()));
        }
    });

    // add a form to layout
    setContent(new VerticalLayout(text, imageSize));
}
 
开发者ID:SomeoneToIgnore,项目名称:vaadin-binders,代码行数:39,代码来源:BinderUI.java

示例6: handleConnectorRequest

import com.vaadin.server.VaadinRequest; //导入依赖的package包/类
@Override
public boolean handleConnectorRequest(VaadinRequest request,
		VaadinResponse response, String path) throws IOException {		
	final BusyIndicatorWindow busyIndicatorWindow = new BusyIndicatorWindow();
	final UI ui = UI.getCurrent();
	ui.access(() -> ui.addWindow(busyIndicatorWindow));
	try {
		//on charge le fichier
		getStreamSource().loadOndemandFile();
		if (getStreamSource().getStream()==null){
			return true;
		}
		getResource().setFilename(getStreamSource().getFileName());
		return super.handleConnectorRequest(request, response, path);
	}catch(Exception e){
		return true;
	}
	finally {
		busyIndicatorWindow.close();
	}		
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:22,代码来源:OnDemandFileDownloader.java

示例7: handleConnectorRequest

import com.vaadin.server.VaadinRequest; //导入依赖的package包/类
@Override
public boolean handleConnectorRequest(VaadinRequest request,
		VaadinResponse response, String path) throws IOException {		
	final BusyIndicatorWindow busyIndicatorWindow = new BusyIndicatorWindow();
	final UI ui = UI.getCurrent();
	ui.access(() -> ui.addWindow(busyIndicatorWindow));
	try {
		getStreamSource().loadOndemandFile();
		if (getStreamSource().getStream()==null){
			return true;
		}
		getDownloadStreamSource().setMIMEType("application/pdf");
		getDownloadStreamSource().getStream().setParameter(
                "Content-Disposition",
                "attachment; filename="+getStreamSource().getFileName());
		return super.handleConnectorRequest(request, response, path);
	}catch(Exception e){
		return true;
	}finally {
		busyIndicatorWindow.close();
	}		
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:23,代码来源:OnDemandPdfBrowserOpener.java

示例8: init

import com.vaadin.server.VaadinRequest; //导入依赖的package包/类
@Override
protected void init(VaadinRequest vaadinRequest) {
  VaadinSession.getCurrent().getSession().setMaxInactiveInterval(-1);
  Page.getCurrent().setTitle("Tiny Pounder (" + VERSION + ")");

  setupLayout();
  addKitControls();
  updateKitControls();
  initVoltronConfigLayout();
  initVoltronControlLayout();
  initRuntimeLayout();
  addExitCloseTab();
  updateServerGrid();

  // refresh consoles if any
  consoleRefresher = scheduledExecutorService.scheduleWithFixedDelay(
      () -> access(() -> runningServers.values().forEach(RunningServer::refreshConsole)),
      2, 2, TimeUnit.SECONDS);
}
 
开发者ID:Terracotta-OSS,项目名称:tinypounder,代码行数:20,代码来源:TinyPounderMainUI.java

示例9: init

import com.vaadin.server.VaadinRequest; //导入依赖的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();
}
 
开发者ID:vaadin,项目名称:material-theme-fw8,代码行数:17,代码来源:DemoUI.java

示例10: init

import com.vaadin.server.VaadinRequest; //导入依赖的package包/类
@Override
protected void init(VaadinRequest request) {
  rootLayout = getRootLayout();
  setContent(rootLayout);

  Label title = getTitleLabel();

  StepperPropertiesLayout layout = new StepperPropertiesLayout();
  layout.addStepperCreateListener(this);
  layout.setWidth(300, Unit.PIXELS);

  Spacer spacer = new Spacer();
  spacer.setWidth(100, Unit.PIXELS);

  rootLayout.addComponent(title, 0, 0, 2, 0);
  rootLayout.addComponent(spacer, 1, 1);
  rootLayout.addComponent(layout, 0, 1);
  rootLayout.setComponentAlignment(title, Alignment.MIDDLE_CENTER);

  layout.start();
}
 
开发者ID:Juchar,项目名称:md-stepper,代码行数:22,代码来源:DemoUI.java

示例11: init

import com.vaadin.server.VaadinRequest; //导入依赖的package包/类
@Override
protected void init(VaadinRequest vaadinRequest) {
    final VerticalLayout contentArea = new VerticalLayout();
    contentArea.setMargin(false);
    setContent(contentArea);

    final Navigator navigator = new Navigator(this, contentArea);
    navigator.addProvider(viewProvider);
    navigator.setErrorView(InaccessibleErrorView.class);

    String defaultView = Page.getCurrent().getUriFragment();
    if (defaultView == null || defaultView.trim().isEmpty()) {
        defaultView = SecureView.VIEW_NAME;
    }

    if (isUserAuthenticated(vaadinRequest)) {
        navigator.navigateTo(defaultView);
    } else {
        navigator.navigateTo(LoginView.VIEW_NAME + "/" + defaultView);
    }
}
 
开发者ID:mrts,项目名称:vaadin-javaee-jaas-example,代码行数:22,代码来源:JaasExampleUI.java

示例12: init

import com.vaadin.server.VaadinRequest; //导入依赖的package包/类
@Override
protected void init(VaadinRequest request) {
	setSizeFull();

	VerticalLayout layout = new VerticalLayout();
	layout.setSizeFull();
	layout.setMargin(true);

	testGrid.setSizeFull();
	testGrid.getEditor().setEnabled(true);

	testGrid.setItems(getCustomers());

	layout.addComponent(testGrid);

	setContent(layout);
}
 
开发者ID:peterl1084,项目名称:bean-grid,代码行数:18,代码来源:TestUI.java

示例13: init

import com.vaadin.server.VaadinRequest; //导入依赖的package包/类
@Override
protected void init(VaadinRequest vaadinRequest) {
	final VerticalLayout layout = new VerticalLayout();

	final TextField name = new TextField();
	name.setCaption("Type your name here:");

	Button button = new Button("Click Me");
	button.addClickListener(e -> {
		layout.addComponent(new Label("Thanks " + name.getValue() + ", it works!"));
	});

	layout.addComponents(name, button);

	setContent(layout);
}
 
开发者ID:peterl1084,项目名称:vaadin-karaf,代码行数:17,代码来源:MyUI.java

示例14: init

import com.vaadin.server.VaadinRequest; //导入依赖的package包/类
@Override
protected void init(VaadinRequest request) {
    Label title = new Label("Live Image Editor add-on for Vaadin");
    title.addStyleName(ValoTheme.LABEL_H2);
    title.addStyleName(ValoTheme.LABEL_COLORED);

    instructions.setContentMode(ContentMode.HTML);
    instructions.setWidth(600, Unit.PIXELS);

    upload.addSucceededListener(this::uploadSucceeded);

    imageEditor.setWidth(100, Unit.PERCENTAGE);
    imageEditor.setBackgroundColor(0, 52, 220);

    VerticalLayout layout = new VerticalLayout(title, upload, instructions, imageEditor, send, result, editedImage);
    layout.setSizeUndefined();
    layout.setMargin(true);
    layout.setSpacing(true);
    setContent(layout);

    setupUploadStep();
}
 
开发者ID:alejandro-du,项目名称:live-image-editor,代码行数:23,代码来源:DemoUI.java

示例15: init

import com.vaadin.server.VaadinRequest; //导入依赖的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());
                }
            });
}
 
开发者ID:imotSpot,项目名称:imotSpot,代码行数:22,代码来源:DashboardUI.java


注:本文中的com.vaadin.server.VaadinRequest类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。