Java Code Examples for com.vaadin.ui.Alignment

The following are top voted examples for showing how to use com.vaadin.ui.Alignment. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: obog-manager   File: MemberListView.java   View source code 6 votes vote down vote up
@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);
}
 
Example 2
Project: obog-manager   File: LogoutConfirmView.java   View source code 6 votes vote down vote up
@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);
}
 
Example 3
Project: obog-manager   File: ThanksView.java   View source code 6 votes vote down vote up
@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);
}
 
Example 4
Project: obog-manager   File: TokenSentView.java   View source code 6 votes vote down vote up
@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);
}
 
Example 5
Project: holon-vaadin7   File: QuestionDialog.java   View source code 6 votes vote down vote up
@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%");
	}
}
 
Example 6
Project: esup-ecandidat   File: CandidatCreerCompteView.java   View source code 6 votes vote down vote up
/**
 * 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);
}
 
Example 7
Project: esup-ecandidat   File: ScolMailWindow.java   View source code 6 votes vote down vote up
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);
}
 
Example 8
Project: esup-ecandidat   File: CandidatViewTemplate.java   View source code 6 votes vote down vote up
/** 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);
	}		
}
 
Example 9
Project: esup-ecandidat   File: CtrCandFormationView.java   View source code 6 votes vote down vote up
/**
 * @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;
}
 
Example 10
Project: esup-ecandidat   File: AccueilView.java   View source code 6 votes vote down vote up
/**
 * 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);
}
 
Example 11
Project: md-stepper   File: VerticalStepper.java   View source code 6 votes vote down vote up
/**
 * 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();
}
 
Example 12
Project: md-stepper   File: DemoUI.java   View source code 6 votes vote down vote up
@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();
}
 
Example 13
Project: holon-vaadin   File: QuestionDialog.java   View source code 6 votes vote down vote up
@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%");
	}
}
 
Example 14
Project: obog-manager   File: ErrorView.java   View source code 5 votes vote down vote up
@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);
}
 
Example 15
Project: holon-vaadin7   File: AbstractOrderedLayoutBuilder.java   View source code 5 votes vote down vote up
@Override
public B addAlignAndExpand(Component component, Alignment alignment, float expandRatio) {
	getInstance().addComponent(component);
	getInstance().setComponentAlignment(component, alignment);
	getInstance().setExpandRatio(component, expandRatio);
	return builder();
}
 
Example 16
Project: holon-vaadin7   File: DefaultOrderedLayoutConfigurator.java   View source code 5 votes vote down vote up
@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();
}
 
Example 17
Project: spring-boot-vaadin-rabbitmq-pipeline-demo   File: DemoView.java   View source code 5 votes vote down vote up
private void addDataGrid() {

		Grid<app.Event> grid = dataGrid.get();
		grid.setWidth("100%");

		HorizontalLayout bottomLayout = new HorizontalLayout();
		bottomLayout.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
		bottomLayout.addComponent(grid);
		bottomLayout.setWidth("100%");

		addComponent(bottomLayout);
	}
 
Example 18
Project: spring-boot-vaadin-rabbitmq-pipeline-demo   File: StreamView.java   View source code 5 votes vote down vote up
private void addDataGrid() {

		grid = streamDataGrid.get();
		grid.setWidth("100%");
		
		HorizontalLayout bottomLayout = new HorizontalLayout();
		bottomLayout.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
		bottomLayout.addComponent(grid);
		bottomLayout.setWidth("100%");

		addComponent(bottomLayout);
	}
 
Example 19
Project: esup-ecandidat   File: CandidatBacView.java   View source code 5 votes vote down vote up
/**
 * Initialise la vue
 */
@PostConstruct
public void init() {
	super.init();
	setNavigationButton(CandidatAdresseView.NAME, (parametreController.getIsGetCursusInterne()?CandidatCursusInterneView.NAME:CandidatCursusExterneView.NAME));
	
	/*Edition des donneés*/	
	OneClickButton btnEdit = new OneClickButton(applicationContext.getMessage("btnSaisir", null, UI.getCurrent().getLocale()), FontAwesome.PENCIL);
	btnEdit.addClickListener(e -> {
		candidatParcoursController.editBac(candidat, this);
	});
	addGenericButton(btnEdit, Alignment.MIDDLE_LEFT);
	
	noInfoLabel = new Label(applicationContext.getMessage("infobac.noinfo", null, UI.getCurrent().getLocale()));
	addGenericComponent(noInfoLabel);
	
	/*Table de présentation*/
	table.setSizeFull();
	table.setVisibleColumns((Object[]) FIELDS_ORDER_BAC);
	table.setColumnCollapsingAllowed(false);
	table.setColumnReorderingAllowed(false);
	table.setColumnHeaderMode(ColumnHeaderMode.HIDDEN);
	table.setSelectable(false);
	table.setImmediate(true);		
	table.setColumnWidth(SimpleTablePresentation.CHAMPS_TITLE, 250);
	table.setCellStyleGenerator((components, itemId, columnId)->{
		if (columnId!=null && columnId.equals(SimpleTablePresentation.CHAMPS_TITLE)){
			return (ValoTheme.LABEL_BOLD);
		}
		return null;
	});
	addGenericComponent(table);
	setGenericExpandRatio(table);
}
 
Example 20
Project: esup-ecandidat   File: DroitProfilIndividuWindow.java   View source code 5 votes vote down vote up
/** ajoute une option alignée au layout d'options
 * @param c le composant
 */
protected void addOption(Component c, Alignment align, Float expendRatio){
	infoSuppLayout.addComponent(c);
	infoSuppLayout.setComponentAlignment(c, align);
	if (!infoSuppLayout.isVisible()){
		infoSuppLayout.setVisible(true);
	}
	if (expendRatio!=null){
		infoSuppLayout.setExpandRatio(c, expendRatio);
	}
	center();
}
 
Example 21
Project: esup-ecandidat   File: CandidatureWindow.java   View source code 5 votes vote down vote up
/**
 * @param btn
 * @return le layout de bouton conditionnel
 */
private HorizontalLayout getLayoutBtnConditionnel(final OneClickButton btn) {
	btn.addStyleName(ValoTheme.BUTTON_TINY);
	HorizontalLayout layout = new HorizontalLayout();
	layout.setWidth(100, Unit.PERCENTAGE);
	layout.addComponent(btn);
	layout.setComponentAlignment(btn, Alignment.MIDDLE_CENTER);
	return layout;
}
 
Example 22
Project: esup-ecandidat   File: CandidatAdresseView.java   View source code 5 votes vote down vote up
/**
 * Initialise la vue
 */
@PostConstruct
public void init() {
	super.init();
	setNavigationButton(CandidatInfoPersoView.NAME, CandidatBacView.NAME);
		
	/*Edition des donneés d'adresse*/	
	OneClickButton btnEdit = new OneClickButton(FontAwesome.PENCIL);
	btnEdit.setCaption(applicationContext.getMessage("adresse.edit.btn", null, UI.getCurrent().getLocale()));
	btnEdit.addClickListener(e -> {
		candidatController.editAdresse(cptMin, this);
	});
	addGenericButton(btnEdit, Alignment.MIDDLE_LEFT);
	
	noInfoLabel.setValue(applicationContext.getMessage("adresse.noinfo", null, UI.getCurrent().getLocale()));
	addGenericComponent(noInfoLabel);
	
	/*L'adresse*/		
	table.setSizeFull();
	table.setVisibleColumns((Object[]) FIELDS_ORDER);
	table.setColumnCollapsingAllowed(false);
	table.setColumnReorderingAllowed(false);
	table.setColumnHeaderMode(ColumnHeaderMode.HIDDEN);
	table.setSelectable(false);
	table.setImmediate(true);		
	table.setColumnWidth(SimpleTablePresentation.CHAMPS_TITLE, 250);
	table.setCellStyleGenerator((components, itemId, columnId)->{
		if (columnId!=null && columnId.equals(SimpleTablePresentation.CHAMPS_TITLE)){
			return (ValoTheme.LABEL_BOLD);
		}
		return null;
	});
	addGenericComponent(table);		
	setGenericExpandRatio(table);
}
 
Example 23
Project: esup-ecandidat   File: LocalDateTimeField.java   View source code 5 votes vote down vote up
public LocalDateTimeField() {
	dateField = new DateField();
	dateField.addValueChangeListener(e->showOrHideErrorDateField());
	hourNs = new NativeSelect();
	hourNs.addValueChangeListener(e->fireValueChange(false));
	minuteNs = new NativeSelect();
	minuteNs.addValueChangeListener(e->fireValueChange(false));
	hlContent = new HorizontalLayout();
	//hlContent.setSizeFull();
	hlContent.setSpacing(true);
	
	dateField.setImmediate(true);
	hlContent.addComponent(dateField);
	
	for (Integer i = 0; i<24; i++){
		hourNs.addItem(i);
		hourNs.setItemCaption(i, MethodUtils.getLabelMinuteHeure(i));
	}
	hourNs.setNullSelectionAllowed(false);
	hourNs.setImmediate(true);
	hourNs.setValue(0);
	for (Integer i = 0; i<60; i++){
		minuteNs.addItem(i);
		minuteNs.setItemCaption(i, MethodUtils.getLabelMinuteHeure(i));
	}
	minuteNs.setNullSelectionAllowed(false);
	minuteNs.setImmediate(true);
	minuteNs.setValue(0);
	hlContent.addComponent(hourNs);
	hlContent.setComponentAlignment(hourNs, Alignment.MIDDLE_LEFT);
	Label label1 = new Label(":");
	hlContent.addComponent(label1);
	hlContent.setComponentAlignment(label1, Alignment.MIDDLE_LEFT);
	hlContent.addComponent(minuteNs);
	hlContent.setComponentAlignment(minuteNs, Alignment.MIDDLE_LEFT);
	Label label2 = new Label("(HH:MM)");
	hlContent.addComponent(label2);
	hlContent.setComponentAlignment(label2, Alignment.MIDDLE_LEFT);
}
 
Example 24
Project: esup-ecandidat   File: LocalTimeField.java   View source code 5 votes vote down vote up
public LocalTimeField() {
	hourNs = new NativeSelect();
	minuteNs = new NativeSelect();
	hlContent = new HorizontalLayout();
	//hlContent.setSizeFull();
	hlContent.setSpacing(true);
	for (Integer i = 0; i<24; i++){
		hourNs.addItem(i);
		hourNs.setItemCaption(i, MethodUtils.getLabelMinuteHeure(i));
	}
	hourNs.setNullSelectionAllowed(false);
	hourNs.setImmediate(true);
	for (Integer i = 0; i<60; i++){
		minuteNs.addItem(i);
		minuteNs.setItemCaption(i, MethodUtils.getLabelMinuteHeure(i));
	}
	minuteNs.setNullSelectionAllowed(false);
	minuteNs.setImmediate(true);
	hlContent.addComponent(hourNs);
	hlContent.setComponentAlignment(hourNs, Alignment.MIDDLE_LEFT);
	Label label1 = new Label(":");
	hlContent.addComponent(label1);
	hlContent.setComponentAlignment(label1, Alignment.MIDDLE_LEFT);
	hlContent.addComponent(minuteNs);
	hlContent.setComponentAlignment(minuteNs, Alignment.MIDDLE_LEFT);
	Label label2 = new Label("(HH:MM)");
	hlContent.addComponent(label2);
	hlContent.setComponentAlignment(label2, Alignment.MIDDLE_LEFT);
}
 
Example 25
Project: esup-ecandidat   File: OnDemandFileLayout.java   View source code 5 votes vote down vote up
public OnDemandFileLayout(String fileName){
	setSpacing(true);
	setWidth(100, Unit.PERCENTAGE);
	
	addStyleName(StyleConstants.ON_DEMAND_FILE_LAYOUT);
	
	btnDel.setDescription(applicationContext.getMessage("file.btnDel", null, UI.getCurrent().getLocale()));
	btnDel.setVisible(false);
	addComponent(btnDel);		
	setComponentAlignment(btnDel, Alignment.MIDDLE_CENTER);	
	
	btnViewer.setDescription(applicationContext.getMessage("img.viewer.btn", null, UI.getCurrent().getLocale()));
	btnViewer.setVisible(false);
	addComponent(btnViewer);
	setComponentAlignment(btnViewer, Alignment.MIDDLE_CENTER);
	
	btnDownload.setDescription(applicationContext.getMessage("file.btnDownload", null, UI.getCurrent().getLocale()));
	btnDownload.setVisible(false);
	addComponent(btnDownload);
	setComponentAlignment(btnDownload, Alignment.MIDDLE_CENTER);
	
	btnAdmin.setDescription(applicationContext.getMessage("pj.admin.btn", null, UI.getCurrent().getLocale()));
	btnAdmin.setVisible(false);
	addComponent(btnAdmin);
	setComponentAlignment(btnAdmin, Alignment.MIDDLE_CENTER);
	
	Label label = new Label(fileName);
	addComponent(label);
	setComponentAlignment(label, Alignment.MIDDLE_LEFT);
	setExpandRatio(label, 1.0f);
}
 
Example 26
Project: osc-core   File: ViewUtil.java   View source code 5 votes vote down vote up
/**
 * @param caption
 *            Caption Text Representing Header
 * @param guid
 *            Help GUID for caller view
 * @return
 *         Horizontal Layout containing Caption text and Help button
 */
public static HorizontalLayout createSubHeader(String caption, String guid) {

    HorizontalLayout subHeader = new HorizontalLayout();
    subHeader.setWidth("100%");
    subHeader.setHeight("35px");
    subHeader.setSpacing(true);
    subHeader.addStyleName("toolbar");
    final Label title = new Label(caption);
    title.setSizeUndefined();
    subHeader.addComponent(title);
    subHeader.setComponentAlignment(title, Alignment.MIDDLE_LEFT);
    subHeader.setExpandRatio(title, 1);

    // create help button if we have some GUID else do not add this button
    if (guid != null) {

        Button helpButton = new Button();
        helpButton.setImmediate(true);
        helpButton.setStyleName(Reindeer.BUTTON_LINK);
        helpButton.setDescription("Help");
        helpButton.setIcon(new ThemeResource("img/Help.png"));
        subHeader.addComponent(helpButton);
        helpButton.addClickListener(new HelpButtonListener(guid));
    }

    return subHeader;
}
 
Example 27
Project: osc-core   File: ProgressIndicatorWindow.java   View source code 5 votes vote down vote up
public ProgressIndicatorWindow() {
    center();
    setVisible(true);
    setResizable(false);
    setDraggable(false);
    setImmediate(true);
    setModal(true);
    setClosable(false);
    setCaption("Loading");

    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setWidth("100%");

    this.currentStatus = new Label();
    this.currentStatus.addStyleName(StyleConstants.TEXT_ALIGN_CENTER);
    this.currentStatus.setSizeFull();
    this.currentStatus.setImmediate(true);

    ProgressBar progressBar = new ProgressBar();
    progressBar.setSizeFull();
    progressBar.setIndeterminate(true);
    progressBar.setImmediate(true);
    progressBar.setVisible(true);

    layout.addComponent(progressBar);
    layout.addComponent(this.currentStatus);
    layout.setComponentAlignment(this.currentStatus, Alignment.MIDDLE_CENTER);
    layout.setComponentAlignment(progressBar, Alignment.MIDDLE_CENTER);
    setContent(layout);
}
 
Example 28
Project: md-stepper   File: VerticalStepper.java   View source code 5 votes vote down vote up
public void showTransitionMessage(String message) {
  if (rootLayout.getComponent(1, 0) != null) {
    rootLayout.removeComponent(1, 0);
  }

  if (rootLayout.getComponent(0, 0) != null) {
    rootLayout.removeComponent(0, 0);
  }

  label.setCaptionVisible(message == null);
  label.setDescriptionVisible(message == null);

  if (message != null) {
    Label feedbackLabel = new Label(message);
    feedbackLabel.addStyleName(STYLE_FEEDBACK_MESSAGE);
    feedbackLabel.setWidth(100, Unit.PERCENTAGE);

    rootLayout.addComponent(label, 0, 0);
    rootLayout.addComponent(feedbackLabel, 1, 0);
    rootLayout.setComponentAlignment(feedbackLabel, Alignment.MIDDLE_LEFT);
    contentContainer.setContent(new CenteredLayout(new Spinner()));
    buttonBar.forEach(c -> c.setVisible(false));
  } else {
    rootLayout.addComponent(label, 0, 0, 1, 0);
    contentContainer.setContent(step);
  }
}
 
Example 29
Project: md-stepper   File: DemoUI.java   View source code 5 votes vote down vote up
private GridLayout getRootLayout() {
  GridLayout layout = new GridLayout(3, 2);
  layout.setDefaultComponentAlignment(Alignment.TOP_LEFT);
  layout.setMargin(new MarginInfo(false, true, true, true));
  layout.setSpacing(true);
  layout.setSizeFull();
  layout.setRowExpandRatio(1, 1);
  layout.setColumnExpandRatio(2, 1);
  return layout;
}
 
Example 30
Project: spring-boot-security-vaadin   File: LoginUI.java   View source code 5 votes vote down vote up
@Override
protected void init(VaadinRequest request) {
    setSizeFull();

    user = new TextField("User:");
    user.setWidth("300px");
    user.setRequiredIndicatorVisible(true);

    password = new PasswordField("Password:");
    password.setWidth("300px");
    user.setRequiredIndicatorVisible(true);
    password.setValue("");

    VerticalLayout fields = new VerticalLayout(user, password, loginButton);
    fields.setCaption("Please login to access the application");
    fields.setSpacing(true);
    fields.setMargin(new MarginInfo(true, true, true, false));
    fields.setSizeUndefined();

    VerticalLayout uiLayout = new VerticalLayout(fields);
    uiLayout.setSizeFull();
    uiLayout.setComponentAlignment(fields, Alignment.MIDDLE_CENTER);

    setFocusedComponent(user);

    setContent(uiLayout);
}
 
Example 31
Project: Persephone   File: PropertiesPage.java   View source code 5 votes vote down vote up
private PopupView popupRowOnClick() {
	VerticalLayout popupContent = new VerticalLayout();
	popupContent.setSizeFull();

	PopupView popup = new PopupView(null, popupContent);

	grid.addItemClickListener(e -> {
		popup.setData(e.getItem());
		popup.setPopupVisible(true);
	});

	popup.addPopupVisibilityListener(event -> {
		if (event.isPopupVisible()) {
			popupContent.removeAllComponents();

			PropertyItem item = (PropertyItem) popup.getData();

			Label popupTitle = new Label("<h2>Property details</h2>", ContentMode.HTML);
			popupTitle.setSizeFull();

			Button popupClose = new Button(VaadinIcons.CLOSE);
			popupClose.addClickListener(e -> popup.setPopupVisible(false));

			HorizontalLayout title = new HorizontalLayout(popupTitle, popupClose);
			title.setSizeFull();
			title.setExpandRatio(popupTitle, 3);
			title.setExpandRatio(popupClose, 1);
			title.setComponentAlignment(popupClose, Alignment.TOP_RIGHT);

			Label propertyKey= new Label(String.format("Key: '%s'", item.getKey()), ContentMode.TEXT);
			Label propertyValue = new Label(String.format("Value: '%s'", item.getValue()), ContentMode.TEXT);
			propertyValue.setSizeFull();
			Label propertyOrigin = new Label(String.format("Origin: '%s'", item.getOrigin()), ContentMode.TEXT);

			popupContent.addComponents(title, propertyKey, propertyValue, propertyOrigin);
		}
	});

	popup.setHideOnMouseOut(false);
	popup.setSizeFull();

	return popup;
}
 
Example 32
Project: holon-vaadin   File: AbstractOrderedLayoutBuilder.java   View source code 5 votes vote down vote up
@Override
public B addAlignAndExpand(Component component, Alignment alignment, float expandRatio) {
	getInstance().addComponent(component);
	getInstance().setComponentAlignment(component, alignment);
	getInstance().setExpandRatio(component, expandRatio);
	return builder();
}
 
Example 33
Project: holon-vaadin   File: DefaultOrderedLayoutConfigurator.java   View source code 5 votes vote down vote up
@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();
}
 
Example 34
Project: holon-vaadin7   File: AbstractLayoutBuilder.java   View source code 4 votes vote down vote up
@Override
public B defaultAlignment(Alignment alignment) {
	getInstance().setDefaultComponentAlignment(alignment);
	return builder();
}
 
Example 35
Project: holon-vaadin7   File: AbstractLayoutBuilder.java   View source code 4 votes vote down vote up
@Override
public B align(Component component, Alignment alignment) {
	getInstance().setComponentAlignment(component, alignment);
	return builder();
}
 
Example 36
Project: holon-vaadin7   File: AbstractLayoutBuilder.java   View source code 4 votes vote down vote up
@Override
public B addAndAlign(Component component, Alignment alignment) {
	getInstance().addComponent(component);
	getInstance().setComponentAlignment(component, alignment);
	return builder();
}
 
Example 37
Project: holon-vaadin7   File: AbstractLayoutConfigurator.java   View source code 4 votes vote down vote up
@Override
public B defaultAlignment(Alignment alignment) {
	getInstance().setDefaultComponentAlignment(alignment);
	return builder();
}
 
Example 38
Project: holon-vaadin7   File: AbstractLayoutConfigurator.java   View source code 4 votes vote down vote up
@Override
public B align(Component component, Alignment alignment) {
	getInstance().setComponentAlignment(component, alignment);
	return builder();
}
 
Example 39
Project: holon-vaadin7   File: AbstractLayoutConfigurator.java   View source code 4 votes vote down vote up
@Override
public B addAndAlign(Component component, Alignment alignment) {
	getInstance().addComponent(component);
	getInstance().setComponentAlignment(component, alignment);
	return builder();
}
 
Example 40
Project: spring-boot-vaadin-rabbitmq-pipeline-demo   File: DemoView.java   View source code 4 votes vote down vote up
private void setupLayout() {
	setDefaultComponentAlignment(Alignment.MIDDLE_CENTER);
}