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


Java HorizontalLayout類代碼示例

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


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

示例1: I18nField

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

import com.vaadin.ui.HorizontalLayout; //導入依賴的package包/類
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
    addComponent(new HeadingLabel("ログアウト確認", VaadinIcons.INFO_CIRCLE));
    addComponent(new Label("ログアウトします。"));

    HorizontalLayout buttonArea = new HorizontalLayout();
    buttonArea.setSpacing(true);
    addComponent(buttonArea);
    setComponentAlignment(buttonArea, Alignment.MIDDLE_CENTER);

    Button cancelButton = new Button("キャンセル", click -> getUI().getNavigator().navigateTo(MenuView.VIEW_NAME));
    buttonArea.addComponent(cancelButton);

    Button logoutButton = new Button("ログアウト", click -> {
        membershipService.logout();
        getUI().getNavigator().navigateTo(FrontView.VIEW_NAME);
    });
    logoutButton.setIcon(VaadinIcons.SIGN_OUT);
    logoutButton.setStyleName(ValoTheme.BUTTON_PRIMARY);
    buttonArea.addComponent(logoutButton);
}
 
開發者ID:JavaTrainingCourse,項目名稱:obog-manager,代碼行數:22,代碼來源:LogoutConfirmView.java

示例3: BaseView

import com.vaadin.ui.HorizontalLayout; //導入依賴的package包/類
public BaseView(String title) {
    UI.getCurrent().getPage().setTitle(String.format("Analysis | %s", title));
    setWidth(100, PERCENTAGE);
    setSpacing(true);
    setMargin(true);

    HorizontalLayout actionBarLayout = new HorizontalLayout();
    actionBarLayout.setWidth(100, PERCENTAGE);

    MenuBar menu = new MenuBar();

    menu.addItem("Search", (item) -> UI.getCurrent().setContent(new SearchView()));
    menu.addItem("Context Cloud", (item) -> UI.getCurrent().setContent(new ContextCloudView()));

    actionBarLayout.addComponent(menu);

    addComponent(actionBarLayout);
}
 
開發者ID:tokenmill,項目名稱:crawling-framework,代碼行數:19,代碼來源:BaseView.java

示例4: BaseView

import com.vaadin.ui.HorizontalLayout; //導入依賴的package包/類
public BaseView(String title) {
    UI.getCurrent().getPage().setTitle(String.format("Crawler Admin | %s", title));
    setWidth(100, PERCENTAGE);
    setSpacing(true);
    setMargin(true);

    HorizontalLayout actionBarLayout = new HorizontalLayout();
    actionBarLayout.setWidth(100, PERCENTAGE);

    MenuBar menu = new MenuBar();

    MenuBar.MenuItem dataItem = menu.addItem("Configuration", null);
    dataItem.addItem("HTTP Sources", (item) -> UI.getCurrent().setContent(new HttpSourcesView()));
    dataItem.addItem("HTTP Source Tests", (item) -> UI.getCurrent().setContent(new HttpSourceTestsView()));
    dataItem.addItem("Named Queries", (item) -> UI.getCurrent().setContent(new NamedQueriesView()));
    dataItem.addItem("Import / Export", (item) -> UI.getCurrent().setContent(new ImportExportView()));

    menu.addItem("Page Analysis", (item) -> UI.getCurrent().setContent(new PageAnalysisView()));

    actionBarLayout.addComponent(menu);

    addComponent(actionBarLayout);
}
 
開發者ID:tokenmill,項目名稱:crawling-framework,代碼行數:24,代碼來源:BaseView.java

示例5: buildActions

import com.vaadin.ui.HorizontalLayout; //導入依賴的package包/類
@Override
protected void buildActions(HorizontalLayout actionsContainer) {
	actionsContainer.setSpacing(true);
	// yes
	final Button btnYes = Components.button().styleName(ValoTheme.BUTTON_PRIMARY)
			.caption(Localizable.builder().message(DEFAULT_YES_BUTTON_MESSAGE)
					.messageCode(DEFAULT_YES_BUTTON_MESSAGE_CODE).build())
			.onClick(e -> onDialogYesButtonClick(e.getButton())).build();
	getYesButtonConfigurator().ifPresent(c -> c.configureDialogButton(Components.configure(btnYes)));
	actionsContainer.addComponent(btnYes);
	actionsContainer.setComponentAlignment(btnYes, Alignment.MIDDLE_LEFT);
	if (getWidth() > -1) {
		btnYes.setWidth("100%");
	}
	// no
	final Button btnNo = Components.button()
			.caption(Localizable.builder().message(DEFAULT_NO_BUTTON_MESSAGE)
					.messageCode(DEFAULT_NO_BUTTON_MESSAGE_CODE).build())
			.onClick(e -> onDialogNoButtonClick(e.getButton())).build();
	getNoButtonConfigurator().ifPresent(c -> c.configureDialogButton(Components.configure(btnNo)));
	actionsContainer.addComponent(btnNo);
	actionsContainer.setComponentAlignment(btnNo, Alignment.MIDDLE_RIGHT);
	if (getWidth() > -1) {
		btnNo.setWidth("100%");
	}
}
 
開發者ID:holon-platform,項目名稱:holon-vaadin7,代碼行數:27,代碼來源:QuestionDialog.java

示例6: refreshConnexionPanelStudent

import com.vaadin.ui.HorizontalLayout; //導入依賴的package包/類
/**
 * Rafraichi le panel de connexion sans compte
 */
private void refreshConnexionPanelStudent() {
	vlConnexionIsStudent.removeAllComponents();

	OneClickButton logBtn = new OneClickButton(
			applicationContext.getMessage("btnConnect", null, UI.getCurrent().getLocale()), FontAwesome.SIGN_OUT);
	logBtn.addClickListener(e -> {
		userController.connectCAS();
	});

	HorizontalLayout hlConnect = new HorizontalLayout();
	hlConnect.setSpacing(true);
	Label labelConnect = new Label(
			applicationContext.getMessage("accueilView.connect.cas", null, UI.getCurrent().getLocale()));
	hlConnect.addComponent(labelConnect);
	hlConnect.setComponentAlignment(labelConnect, Alignment.MIDDLE_LEFT);
	hlConnect.addComponent(logBtn);
	hlConnect.setComponentAlignment(logBtn, Alignment.MIDDLE_CENTER);

	vlConnexionIsStudent.addComponent(hlConnect);
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:24,代碼來源:CandidatCreerCompteView.java

示例7: getVarLayout

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

示例8: getLegendLineLayout

import com.vaadin.ui.HorizontalLayout; //導入依賴的package包/類
/**
 * @param txtCode
 * @return une ligne de légende
 */
private HorizontalLayout getLegendLineLayout(String txtCode) {
	HorizontalLayout hlLineLegend = new HorizontalLayout();
	hlLineLegend.setWidth(100, Unit.PERCENTAGE);
	hlLineLegend.setSpacing(true);

	Image flagImg = new Image(null, new ThemeResource("images/icon/Flag-" + txtCode + "-icon.png"));
	Label label = new Label(applicationContext.getMessage("formation.table.flagEtat.tooltip." + txtCode, null,
			UI.getCurrent().getLocale()));
	hlLineLegend.addComponent(flagImg);
	hlLineLegend.setComponentAlignment(flagImg, Alignment.MIDDLE_LEFT);
	hlLineLegend.addComponent(label);
	hlLineLegend.setComponentAlignment(label, Alignment.MIDDLE_LEFT);
	hlLineLegend.setExpandRatio(label, 1);
	return hlLineLegend;
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:20,代碼來源:CtrCandFormationView.java

示例9: SearchAnneeUnivApoField

import com.vaadin.ui.HorizontalLayout; //導入依賴的package包/類
/**
 * Constructeur, initialisation du champs
 * @param libelleBtnFind 
 */
public SearchAnneeUnivApoField(String libelleBtnFind) {
	super();
	layout = new HorizontalLayout();
	layout.setSpacing(true);
	anneeField = new TextField();
	anneeField.addValueChangeListener(e->showOrHideError());
	anneeField.setNullRepresentation("");
	anneeField.setReadOnly(true);
	btnSearch = new OneClickButton(libelleBtnFind,FontAwesome.SEARCH);
	btnSearch.addClickListener(e->{
		SearchAnneeUnivApoWindow window = new SearchAnneeUnivApoWindow();
		window.addAnneeUniListener(a->changeFieldValue(a));
		UI.getCurrent().addWindow(window);
	});
	layout.addComponent(anneeField);
	layout.addComponent(btnSearch);
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:22,代碼來源:SearchAnneeUnivApoField.java

示例10: validateFields

import com.vaadin.ui.HorizontalLayout; //導入依賴的package包/類
/** Colore les champs en rouge si erreur
 * @param validate
 */
@SuppressWarnings("unchecked")
private void validateFields(Boolean validate){
	listLayoutTraductions.forEach(e -> {		
		AbstractField<String> tf;			
		if (e.getComponent(0) instanceof TextField || e.getComponent(0) instanceof RichTextArea){
			tf = (AbstractField<String>) e.getComponent(0);				
		}else if (e.getComponent(0) instanceof HorizontalLayout){				
			tf = (AbstractField<String>) e.getComponent(1);
		}else{
			tf = (AbstractField<String>) e.getComponent(1);
		}
		/* Ajout du style*/
		if (validate){
			tf.removeStyleName(StyleConstants.FIELD_ERROR_COMPLETE);
		}else{
			tf.addStyleName(StyleConstants.FIELD_ERROR_COMPLETE);
		}
	});
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:23,代碼來源:I18nField.java

示例11: EmailLayout

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

import com.vaadin.ui.HorizontalLayout; //導入依賴的package包/類
/**
 * @param toolbar
 *            HorizontalLayout which contains all the action Buttons
 * @param toolbarButton
 *            Which Tool bar button to create (Provided using ENUM constant)
 * @param listner
 *            Click listener called when this button is clicked
 * @return
 */

public static Button buildToolbarButton(HorizontalLayout toolbar, ToolbarButtons toolbarButton,
        ClickListener listner) {
    Button button = new Button(toolbarButton.getText());
    button.addStyleName(StyleConstants.BUTTON_TOOLBAR);
    button.setDescription(toolbarButton.getTooltip());
    button.setStyleName(ValoTheme.BUTTON_LINK);
    if (StringUtils.isNotEmpty(toolbarButton.getImageLocation())) {
        button.setIcon(new ThemeResource(toolbarButton.getImageLocation()), toolbarButton.toString());
    }
    button.setEnabled(false);
    button.setId(toolbarButton.getId());
    button.addClickListener(listner);
    toolbar.addComponent(button);
    return button;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:26,代碼來源:ViewUtil.java

示例14: createHeader

import com.vaadin.ui.HorizontalLayout; //導入依賴的package包/類
@SuppressWarnings("serial")
private HorizontalLayout createHeader(String title) {
    HorizontalLayout header = ViewUtil.createSubHeader(title, getSubViewHelpGuid());
    Button refresh = new Button();
    refresh.setStyleName(Reindeer.BUTTON_LINK);
    refresh.setDescription("Refresh");
    refresh.setIcon(new ThemeResource("img/Refresh.png"));
    refresh.addClickListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            populateTable();
        }
    });
    header.addComponent(refresh);
    return header;
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:17,代碼來源:CRUDBaseSubView.java

示例15: AbstractDialog

import com.vaadin.ui.HorizontalLayout; //導入依賴的package包/類
/**
 * Constructor
 */
public AbstractDialog() {
	super();

	// defaults
	setModal(true);
	setResizable(false);
	setDraggable(false);
	setClosable(false);

	// style name
	addStyleName("h-dialog");

	// build
	content = new Panel();
	content.setWidth("100%");
	content.addStyleName(ValoTheme.PANEL_BORDERLESS);
	content.addStyleName("h-dialog-content");

	actions = new HorizontalLayout();
	actions.setWidth("100%");
	actions.setSpacing(true);
	actions.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR);
	actions.addStyleName("h-dialog-actions");

	root = new VerticalLayout();
	root.addComponent(content);
	root.addComponent(actions);

	setContent(root);
}
 
開發者ID:holon-platform,項目名稱:holon-vaadin7,代碼行數:34,代碼來源:AbstractDialog.java


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