本文整理汇总了Java中com.vaadin.ui.Alignment类的典型用法代码示例。如果您正苦于以下问题:Java Alignment类的具体用法?Java Alignment怎么用?Java Alignment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Alignment类属于com.vaadin.ui包,在下文中一共展示了Alignment类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enter
import com.vaadin.ui.Alignment; //导入依赖的package包/类
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
if (!isLoggedIn()) {
getUI().getNavigator().navigateTo(LoginView.VIEW_NAME);
return;
}
addComponent(new HeadingLabel("会員名簿", VaadinIcons.BULLETS));
printAllMembers();
Button homeButton = new Button("会員メニュー", click -> getUI().getNavigator().navigateTo(MenuView.VIEW_NAME));
homeButton.setIcon(VaadinIcons.USER);
addComponent(homeButton);
setComponentAlignment(homeButton, Alignment.MIDDLE_CENTER);
}
示例2: enter
import com.vaadin.ui.Alignment; //导入依赖的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: enter
import com.vaadin.ui.Alignment; //导入依赖的package包/类
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
addComponent(new HeadingLabel("参加登録完了", VaadinIcons.CHECK));
addComponent(new Label("参加登録が完了し、確認メールを送信しました。"));
Label addressLabel = new Label("しばらく待ってもメールが来ない場合は、お手数ですが " + appReply + " までご連絡ください。");
addressLabel.setCaption("お願い");
addressLabel.setIcon(VaadinIcons.LIGHTBULB);
addComponent(addressLabel);
Button homeButton = new Button("ホーム", click -> getUI().getNavigator().navigateTo(FrontView.VIEW_NAME));
homeButton.setIcon(VaadinIcons.HOME);
addComponent(homeButton);
setComponentAlignment(homeButton, Alignment.MIDDLE_CENTER);
}
示例4: enter
import com.vaadin.ui.Alignment; //导入依赖的package包/类
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
addComponent(new HeadingLabel("パスワードリセット要求送信完了", VaadinIcons.INFO_CIRCLE));
addComponent(new Label("入力された E-mail アドレスへパスワードリセットの案内メールを送信しました。"));
Label addressLabel = new Label("しばらく待ってもメールが来ない場合は、お手数ですが " + appReply + " までご連絡ください。");
addressLabel.setCaption("お願い");
addressLabel.setIcon(VaadinIcons.LIGHTBULB);
addComponent(addressLabel);
Button homeButton = new Button("ホーム", click -> getUI().getNavigator().navigateTo(FrontView.VIEW_NAME));
homeButton.setIcon(VaadinIcons.HOME);
addComponent(homeButton);
setComponentAlignment(homeButton, Alignment.MIDDLE_CENTER);
}
示例5: buildActions
import com.vaadin.ui.Alignment; //导入依赖的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.Alignment; //导入依赖的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.Alignment; //导入依赖的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: setNavigationButton
import com.vaadin.ui.Alignment; //导入依赖的package包/类
/** Ajoute des boutons de navigation
* @param previousView
* @param nextView
*/
public void setNavigationButton(String previousView, String nextView){
if (previousView!=null){
OneClickButton btnPrevious = new OneClickButton(applicationContext.getMessage("btnPrevious", null, UI.getCurrent().getLocale()),FontAwesome.ARROW_CIRCLE_O_LEFT);
btnPrevious.addClickListener(e->uiController.navigateTo(previousView));
titleLayout.addComponent(btnPrevious);
titleLayout.setComponentAlignment(btnPrevious, Alignment.MIDDLE_LEFT);
}
if (nextView!=null){
OneClickButton btnNext = new OneClickButton(applicationContext.getMessage("btnNext", null, UI.getCurrent().getLocale()),FontAwesome.ARROW_CIRCLE_O_RIGHT);
btnNext.addStyleName(ValoTheme.BUTTON_ICON_ALIGN_RIGHT);
btnNext.addClickListener(e->uiController.navigateTo(nextView));
titleLayout.addComponent(btnNext);
titleLayout.setComponentAlignment(btnNext, Alignment.MIDDLE_RIGHT);
}
}
示例9: getLegendLineLayout
import com.vaadin.ui.Alignment; //导入依赖的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;
}
示例10: addMentionCnil
import com.vaadin.ui.Alignment; //导入依赖的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);
}
示例11: VerticalStepper
import com.vaadin.ui.Alignment; //导入依赖的package包/类
/**
* Create a new vertical stepper using the given iterator and label change handler.
*
* @param stepIterator
* The iterator that handles the iteration over the given steps
* @param labelProvider
* The handler that handles changes to labels
*/
private VerticalStepper(StepIterator stepIterator, LabelProvider labelProvider) {
super(stepIterator, labelProvider);
addStepperCompleteListener(this);
getStepIterator().addElementAddListener(this);
getStepIterator().addElementRemoveListener(this);
this.rowMap = new HashMap<>();
this.rootLayout = new VerticalLayout();
this.rootLayout.setDefaultComponentAlignment(Alignment.TOP_LEFT);
this.rootLayout.setSizeFull();
this.rootLayout.setMargin(false);
this.rootLayout.setSpacing(false);
setCompositionRoot(rootLayout);
addStyleName(STYLE_ROOT_LAYOUT);
setSizeFull();
refreshLayout();
}
示例12: init
import com.vaadin.ui.Alignment; //导入依赖的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();
}
示例13: enter
import com.vaadin.ui.Alignment; //导入依赖的package包/类
@Override
public void enter(ViewChangeListener.ViewChangeEvent event) {
Label errorLabel = new Label("エラーが発生しました。");
errorLabel.setStyleName(ValoTheme.LABEL_FAILURE);
VaadinSession session = VaadinSession.getCurrent();
String paramMessage = (String) session.getAttribute(PARAM_MESSAGE);
if (paramMessage != null) {
addComponent(new Label(paramMessage));
}
session.setAttribute(PARAM_MESSAGE, null);
Throwable paramThrowable = (Throwable) session.getAttribute(PARAM_THROWABLE);
if (paramThrowable != null) {
addComponent(new Label(throwable2html(paramThrowable), ContentMode.HTML));
}
session.setAttribute(PARAM_THROWABLE, null);
log.error(paramMessage, paramThrowable);
if (paramThrowable instanceof AuthenticationException) {
Button loginButton = new Button("ログイン", click -> getUI().getNavigator().navigateTo(LoginView.VIEW_NAME));
addComponent(loginButton);
setComponentAlignment(loginButton, Alignment.MIDDLE_CENTER);
}
Button homeButton = new Button("ホーム", click -> getUI().getNavigator().navigateTo(FrontView.VIEW_NAME));
addComponent(homeButton);
setComponentAlignment(homeButton, Alignment.MIDDLE_CENTER);
}
示例14: addAlignAndExpand
import com.vaadin.ui.Alignment; //导入依赖的package包/类
@Override
public B addAlignAndExpand(Component component, Alignment alignment, float expandRatio) {
getInstance().addComponent(component);
getInstance().setComponentAlignment(component, alignment);
getInstance().setExpandRatio(component, expandRatio);
return builder();
}
示例15: addAlignAndExpand
import com.vaadin.ui.Alignment; //导入依赖的package包/类
@Override
public com.holonplatform.vaadin.components.builders.OrderedLayoutConfigurator.BaseOrderedLayoutConfigurator addAlignAndExpand(
Component component, Alignment alignment, float expandRatio) {
getInstance().addComponent(component);
getInstance().setComponentAlignment(component, alignment);
getInstance().setExpandRatio(component, expandRatio);
return builder();
}