本文整理汇总了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();
});
}
示例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);
}
示例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);
}
示例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);
}
示例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%");
}
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
});
}
示例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);
}
}
示例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);
}
示例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;
}
示例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;
}
示例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);
}