當前位置: 首頁>>代碼示例>>Java>>正文


Java VerticalLayout類代碼示例

本文整理匯總了Java中com.vaadin.ui.VerticalLayout的典型用法代碼示例。如果您正苦於以下問題:Java VerticalLayout類的具體用法?Java VerticalLayout怎麽用?Java VerticalLayout使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


VerticalLayout類屬於com.vaadin.ui包,在下文中一共展示了VerticalLayout類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: I18nField

import com.vaadin.ui.VerticalLayout; //導入依賴的package包/類
/**
 * Constructeur, initialisation du champs
 * @param listeLangueEnService 
 * @param langueParDefaut 
 * @param libelleBtnPlus 
 */
public I18nField(Langue langueParDefaut, List<Langue> listeLangueEnService, String libelleBtnPlus) {
	super();
	setRequired(false);			
	this.langueParDefaut = langueParDefaut;
	this.listeLangueEnService = listeLangueEnService;
	
	listLayoutTraductions = new ArrayList<HorizontalLayout>();
	listeTraduction = new ArrayList<I18nTraduction>();
	layoutComplet = new VerticalLayout();
	layoutComplet.setSpacing(true);
	layoutLangue = new VerticalLayout();
	layoutLangue.setSpacing(true);
	layoutComplet.addComponent(layoutLangue);
	
	btnAddLangue = new OneClickButton(libelleBtnPlus,FontAwesome.PLUS_SQUARE_O);
	btnAddLangue.setVisible(false);
	btnAddLangue.addStyleName(ValoTheme.BUTTON_TINY);
	layoutComplet.addComponent(btnAddLangue);
	btnAddLangue.addClickListener(e->{
		layoutLangue.addComponent(getLangueLayout(null));
		checkVisibleAddLangue();
		centerWindow();
	});		
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:31,代碼來源:I18nField.java

示例2: init

import com.vaadin.ui.VerticalLayout; //導入依賴的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: testHorizontalSplitPanel

import com.vaadin.ui.VerticalLayout; //導入依賴的package包/類
@Test
public void testHorizontalSplitPanel() {
    VerticalLayout c1 = new VerticalLayout();
    VerticalLayout c2 = new VerticalLayout();

    FHorizontalSplitPanel panel = new FHorizontalSplitPanel().withFirstComponent(c1)
                                                             .withSecondComponent(c2)
                                                             .withMinSplitPosition(10, Unit.PERCENTAGE)
                                                             .withMaxSplitPosition(90, Unit.PERCENTAGE)
                                                             .withSplitPosition(30)
                                                             .withLocked(true)
                                                             .withSplitPositionChangeListener(event -> System.out.println("pos changed"))
                                                             .withSplitterClickListener(event -> System.out.println("splitter clicked"));

    assertEquals(c1, panel.getFirstComponent());
    assertEquals(c2, panel.getSecondComponent());
    assertEquals(10, panel.getMinSplitPosition(), 0);
    assertEquals(90, panel.getMaxSplitPosition(), 0);
    assertEquals(Unit.PERCENTAGE, panel.getMinSplitPositionUnit());
    assertEquals(Unit.PERCENTAGE, panel.getMaxSplitPositionUnit());
    assertEquals(30, panel.getSplitPosition(), 0);
    assertEquals(Unit.PERCENTAGE, panel.getSplitPositionUnit());
    assertTrue(panel.isLocked());
}
 
開發者ID:viydaag,項目名稱:vaadin-fluent-api,代碼行數:25,代碼來源:FluentSplitPanelTest.java

示例4: init

import com.vaadin.ui.VerticalLayout; //導入依賴的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.ui.VerticalLayout; //導入依賴的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: getVarLayout

import com.vaadin.ui.VerticalLayout; //導入依賴的package包/類
private void getVarLayout(String title, List<String> liste, HorizontalLayout hlContent){
	if (liste==null || liste.size()==0){
		return;
	}
	
	VerticalLayout vl = new VerticalLayout();
	if (title!=null){
		Label labelTitle = new Label(title);
		vl.addComponent(labelTitle);
		vl.setComponentAlignment(labelTitle, Alignment.MIDDLE_CENTER);
	}
	
	StringBuilder txt = new StringBuilder("<ul>");
	liste.forEach(e->txt.append("<li><input type='text' value='${"+e+"}'></li>"));
	txt.append("</ul>");
	Label labelSearch = new Label(txt.toString(),ContentMode.HTML);
	
	vl.addComponent(labelSearch);
	hlContent.addComponent(vl);
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:21,代碼來源:ScolMailWindow.java

示例7: getLegendLayout

import com.vaadin.ui.VerticalLayout; //導入依賴的package包/類
/**
 * @return le layout de légende
 */
private VerticalLayout getLegendLayout() {
	VerticalLayout vlLegend = new VerticalLayout();
	// vlLegend.setWidth(300, Unit.PIXELS);
	vlLegend.setMargin(true);
	vlLegend.setSpacing(true);

	Label labelTitle = new Label(
			applicationContext.getMessage("formation.table.flagEtat.tooltip", null, UI.getCurrent().getLocale()));
	labelTitle.addStyleName(StyleConstants.VIEW_TITLE);

	vlLegend.addComponent(labelTitle);

	vlLegend.addComponent(getLegendLineLayout(ConstanteUtils.FLAG_GREEEN));
	vlLegend.addComponent(getLegendLineLayout(ConstanteUtils.FLAG_RED));
	vlLegend.addComponent(getLegendLineLayout(ConstanteUtils.FLAG_YELLOW));
	vlLegend.addComponent(getLegendLineLayout(ConstanteUtils.FLAG_BLUE));
	return vlLegend;
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:22,代碼來源:CtrCandFormationView.java

示例8: addMentionCnil

import com.vaadin.ui.VerticalLayout; //導入依賴的package包/類
/**
 * ajoute la mention CNIL
 */
private void addMentionCnil() {
	panelCnil.setWidth(100, Unit.PERCENTAGE);
	panelCnil.setHeight(100, Unit.PIXELS);
	addComponent(panelCnil);
	setComponentAlignment(panelCnil, Alignment.BOTTOM_LEFT);

	VerticalLayout vlContentLabelCnil = new VerticalLayout();
	vlContentLabelCnil.setSizeUndefined();
	vlContentLabelCnil.setWidth(100, Unit.PERCENTAGE);
	vlContentLabelCnil.setMargin(true);

	labelCnil.setContentMode(ContentMode.HTML);
	labelCnil.addStyleName(ValoTheme.LABEL_TINY);
	labelCnil.addStyleName(StyleConstants.LABEL_JUSTIFY);
	labelCnil.addStyleName(StyleConstants.LABEL_SAUT_LIGNE);
	vlContentLabelCnil.addComponent(labelCnil);

	panelCnil.setContent(vlContentLabelCnil);
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:23,代碼來源:AccueilView.java

示例9: init

import com.vaadin.ui.VerticalLayout; //導入依賴的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

示例10: makeSslUploadContainer

import com.vaadin.ui.VerticalLayout; //導入依賴的package包/類
private VerticalLayout makeSslUploadContainer(SslCertificateUploader certificateUploader, String title) {
    VerticalLayout sslUploadContainer = new VerticalLayout();
    try {
        certificateUploader.setSizeFull();
        certificateUploader.setUploadNotifier(uploadStatus -> {
            if (uploadStatus) {
                buildSslConfigurationTable();
            }
        });
        sslUploadContainer.addComponent(ViewUtil.createSubHeader(title, null));
        sslUploadContainer.addComponent(certificateUploader);
    } catch (Exception e) {
        log.error("Cannot add upload component. Trust manager factory failed to initialize", e);
        ViewUtil.iscNotification(getString(MAINTENANCE_SSLCONFIGURATION_UPLOAD_INIT_FAILED, new Date()),
                null, Notification.Type.TRAY_NOTIFICATION);
    }
    return sslUploadContainer;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:19,代碼來源:SslConfigurationLayout.java

示例11: EmailLayout

import com.vaadin.ui.VerticalLayout; //導入依賴的package包/類
public EmailLayout(GetEmailSettingsServiceApi getEmailSettingsService, SetEmailSettingsServiceApi setEmailSettingsService) {
    super();
    this.getEmailSettingsService = getEmailSettingsService;
    this.setEmailSettingsService = setEmailSettingsService;
    try {

        this.emailTable = createTable();

        // creating layout to hold edit button
        HorizontalLayout optionLayout = new HorizontalLayout();
        optionLayout.addComponent(createEditButton());

        // populating Email Settings in the Table
        populateEmailtable();

        // adding all components to Container
        this.container = new VerticalLayout();
        this.container.addComponent(optionLayout);
        this.container.addComponent(this.emailTable);

        // adding container to the root Layout
        addComponent(this.container);
    } catch (Exception ex) {
        log.error("Failed to get email settings", ex);
    }
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:27,代碼來源:EmailLayout.java

示例12: SummaryLayout

import com.vaadin.ui.VerticalLayout; //導入依賴的package包/類
public SummaryLayout(ServerApi server, BackupServiceApi backupService,
        ArchiveApi archiver) {
    super();
    this.server = server;
    this.backupService = backupService;
    this.archiver = archiver;
    this.summarytable = createTable();
    // creating Server table
    this.summarytable.addItem(new Object[] { "DNS Name: ", getHostName() }, new Integer(1));
    this.summarytable.addItem(new Object[] { "IP Address: ", getIpAddress() }, new Integer(2));
    this.summarytable.addItem(new Object[] { "Version: ", getVersion() }, new Integer(3));
    this.summarytable.addItem(new Object[] { "Uptime: ", server.uptimeToString() }, new Integer(4));
    this.summarytable.addItem(new Object[] { "Current Server Time: ", new Date().toString() }, new Integer(5));

    VerticalLayout tableContainer = new VerticalLayout();
    tableContainer.addComponent(this.summarytable);
    addComponent(tableContainer);
    addComponent(createCheckBox());

    HorizontalLayout actionContainer = new HorizontalLayout();
    actionContainer.addComponent(createDownloadButton());
    addComponent(actionContainer);
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:24,代碼來源:SummaryLayout.java

示例13: ManageLayout

import com.vaadin.ui.VerticalLayout; //導入依賴的package包/類
public ManageLayout(BackupServiceApi backupService, RestoreServiceApi restoreService,
        ServerApi server, ValidationApi validator) {
    super();
    this.backupService = backupService;
    this.validator = validator;

    VerticalLayout backupContainer = new VerticalLayout();
    VerticalLayout restoreContainer = new VerticalLayout();

    DbRestorer restorer = new DbRestorer(restoreService, server, validator);
    restorer.setSizeFull();

    // Component to Backup Database
    Panel bkpPanel = new Panel();
    bkpPanel.setContent(createBackup());

    backupContainer.addComponent(ViewUtil.createSubHeader("Backup Database", null));
    backupContainer.addComponent(bkpPanel);

    restoreContainer.addComponent(ViewUtil.createSubHeader("Restore Database", null));
    restoreContainer.addComponent(restorer);

    addComponent(backupContainer);
    addComponent(restoreContainer);
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:26,代碼來源:ManageLayout.java

示例14: createSubView

import com.vaadin.ui.VerticalLayout; //導入依賴的package包/類
private void createSubView(String title, ToolbarButtons[] buttons) {
    setSizeFull();
    final VerticalLayout layout = new VerticalLayout();
    layout.addStyleName(StyleConstants.BASE_CONTAINER);
    layout.setSizeFull();

    final VerticalLayout panel = new VerticalLayout();
    panel.addStyleName("panel");
    panel.setSizeFull();

    layout.addComponent(createHeader(title));
    layout.addComponent(panel);

    if (buttons != null) {
        panel.addComponent(createToolbar(buttons));
    }

    panel.addComponent(createTable());
    panel.setExpandRatio(this.table, 1L);
    layout.setExpandRatio(panel, 1L);
    addComponent(layout);
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:23,代碼來源:CRUDBaseSubView.java

示例15: addExitCloseTab

import com.vaadin.ui.VerticalLayout; //導入依賴的package包/類
private void addExitCloseTab() {
  VerticalLayout exitLayout = new VerticalLayout();
  exitLayout.addComponentsAndExpand(new Label("We hope you had fun using the TinyPounder, it is now shutdown, " +
      "as well as all the DatasetManagers, CacheManagers, and Terracotta servers you started with it"));
  TabSheet.Tab tab = mainLayout.addTab(exitLayout, "EXIT : Close TinyPounder " + VERSION);
  tab.setStyleName("tab-absolute-right");
  mainLayout.addSelectedTabChangeListener(tabEvent -> {
    if (tabEvent.getTabSheet().getSelectedTab().equals(tab.getComponent())) {
      new Thread(() -> {
        runningServers.values().forEach(RunningServer::stop);
        consoleRefresher.cancel(true);
        SpringApplication.exit(appContext);
      }).start();
    }
  });
}
 
開發者ID:Terracotta-OSS,項目名稱:tinypounder,代碼行數:17,代碼來源:TinyPounderMainUI.java


注:本文中的com.vaadin.ui.VerticalLayout類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。