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


Java Alignment類代碼示例

本文整理匯總了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);
}
 
開發者ID:JavaTrainingCourse,項目名稱:obog-manager,代碼行數:16,代碼來源:MemberListView.java

示例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);
}
 
開發者ID:JavaTrainingCourse,項目名稱:obog-manager,代碼行數:22,代碼來源:LogoutConfirmView.java

示例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);
}
 
開發者ID:JavaTrainingCourse,項目名稱:obog-manager,代碼行數:14,代碼來源:ThanksView.java

示例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);
}
 
開發者ID:JavaTrainingCourse,項目名稱:obog-manager,代碼行數:14,代碼來源:TokenSentView.java

示例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%");
	}
}
 
開發者ID:holon-platform,項目名稱:holon-vaadin7,代碼行數:27,代碼來源:QuestionDialog.java

示例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);
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:24,代碼來源:CandidatCreerCompteView.java

示例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);
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:21,代碼來源:ScolMailWindow.java

示例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);
	}		
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:21,代碼來源:CandidatViewTemplate.java

示例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;
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:20,代碼來源:CtrCandFormationView.java

示例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);
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:23,代碼來源:AccueilView.java

示例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();
}
 
開發者ID:Juchar,項目名稱:md-stepper,代碼行數:29,代碼來源:VerticalStepper.java

示例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();
}
 
開發者ID:Juchar,項目名稱:md-stepper,代碼行數:22,代碼來源:DemoUI.java

示例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);
}
 
開發者ID:JavaTrainingCourse,項目名稱:obog-manager,代碼行數:29,代碼來源:ErrorView.java

示例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();
}
 
開發者ID:holon-platform,項目名稱:holon-vaadin7,代碼行數:8,代碼來源:AbstractOrderedLayoutBuilder.java

示例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();
}
 
開發者ID:holon-platform,項目名稱:holon-vaadin7,代碼行數:9,代碼來源:DefaultOrderedLayoutConfigurator.java


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