當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。