当前位置: 首页>>代码示例>>Java>>正文


Java ValoTheme类代码示例

本文整理汇总了Java中com.vaadin.ui.themes.ValoTheme的典型用法代码示例。如果您正苦于以下问题:Java ValoTheme类的具体用法?Java ValoTheme怎么用?Java ValoTheme使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ValoTheme类属于com.vaadin.ui.themes包,在下文中一共展示了ValoTheme类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: I18nField

import com.vaadin.ui.themes.ValoTheme; //导入依赖的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: SimplyAsAnImageOrIcon

import com.vaadin.ui.themes.ValoTheme; //导入依赖的package包/类
public SimplyAsAnImageOrIcon() {
    setCaption("Image and icon");
    addComponent(new MLabel("Following Image component (rendered as IMG element) contains SVG image. Note, that by using SVG in this way, it is treated as a static image. For eample the js changing the color on click is not executed. See the file example to see how to render an interactive SVG.").withFullWidth());
    Image image = new Image(null, new ClassResource("/pull.svg"));
    image.setWidth("300px");
    addComponent(image);
    
    addComponent(new MLabel("Following Button has SVG logo as an icon.").withFullWidth());
    
    Button button = new Button();
    button.setIcon(new ClassResource("/vaadin-logo.svg"));
    button.addStyleNames(ValoTheme.BUTTON_ICON_ONLY, ValoTheme.BUTTON_HUGE);
    addComponent(button);
}
 
开发者ID:mstahv,项目名称:svgexamples,代码行数:15,代码来源:SimplyAsAnImageOrIcon.java

示例3: init

import com.vaadin.ui.themes.ValoTheme; //导入依赖的package包/类
@Override
protected void init(VaadinRequest vaadinRequest) {
    setNavigator(new Navigator(this, (View view) -> {
        tabs.setSelectedTab((Component) view);
    }));

    registerExample(SvgInVaadin.class);
    registerExample(SimplyAsAnImageOrIcon.class);
    registerExample(FileExample.class);
    registerExample(AnimationExample.class);
    registerExample(Java2DExample.class);
    registerExample(JungExample.class);

    getNavigator().setErrorView(SvgInVaadin.class);
    tabs.addSelectedTabChangeListener(e -> {
        if (e.isUserOriginated()) {
            getNavigator().navigateTo(e.getTabSheet().getSelectedTab().getClass().getSimpleName());
        }
    });
    String state = getNavigator().getState();
    getNavigator().navigateTo(state);

    tabs.addStyleName(ValoTheme.TABSHEET_PADDED_TABBAR);
    setContent(tabs);
}
 
开发者ID:mstahv,项目名称:svgexamples,代码行数:26,代码来源:MyUI.java

示例4: NamedQueryResultsPanel

import com.vaadin.ui.themes.ValoTheme; //导入依赖的package包/类
public NamedQueryResultsPanel(PageableList<HttpArticle> results) {
    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);

    Label countLabel = new Label(String.format("%s documents matched", results.getTotalCount()));
    countLabel.addStyleName(ValoTheme.LABEL_LARGE);
    countLabel.setSizeFull();
    layout.addComponent(countLabel);

    for (HttpArticle article : results.getItems()) {
        String labelHtml = String.format("%s&nbsp;<a href=\"%s\" target=\"_blank\">%s</a> - <strong>%s</strong>",
                DataUtils.formatInUTC(article.getPublished()), article.getUrl(), article.getTitle(), article.getSource());
        Label articleLabel = new Label(labelHtml);
        articleLabel.setContentMode(ContentMode.HTML);
        articleLabel.setSizeFull();
        layout.addComponent(articleLabel);
    }
    setContent(layout);
}
 
开发者ID:tokenmill,项目名称:crawling-framework,代码行数:20,代码来源:NamedQueryResultsPanel.java

示例5: buildActions

import com.vaadin.ui.themes.ValoTheme; //导入依赖的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: init

import com.vaadin.ui.themes.ValoTheme; //导入依赖的package包/类
@PostConstruct
public void init() {
	Components.configure(this)
			// set full to view content
			.fullSize().spacing()
			.add(Components.button().caption("Add new").styleName(ValoTheme.BUTTON_PRIMARY)
					// navigate to "manage" view
					.onClick(e -> ViewNavigator.require().toView("manage").navigate()).build())
			// build and add listing
			.addAndExpandFull(listing = Components.listing.properties(PRODUCT)
					// setup data source using Datastore with 'products' table name target and product ID as pk
					.dataSource(datastore, TARGET, ID)
					// froze the ID column
					.frozenColumns(1)
					// set the ID column width and style
					.width(ID, 120).style(ID, "id-column")
					// when user clicks on a row, open the 'view' named View providing product id parameter
					.withItemClickListener((i, p, e) -> ViewNavigator.require().toView("view")
							.withParameter("id", i.getValue(ID)).navigate())
					// set full size and build
					.fullSize().build());
}
 
开发者ID:holon-platform,项目名称:holon-examples,代码行数:23,代码来源:Home.java

示例7: getTable

import com.vaadin.ui.themes.ValoTheme; //导入依赖的package包/类
/**
 * @param container
 * @param size
 * @return une table pour formatter les données
 */
private TableFormating getTable(BeanItemContainer<SimpleTablePresentation> container, Integer size){
	TableFormating table = new TableFormating(null, container);
	table.addBooleanColumn(SimpleTablePresentation.CHAMPS_VALUE,false);
	table.setVisibleColumns((Object[]) FIELDS_ORDER);
	table.setColumnCollapsingAllowed(false);
	table.setColumnReorderingAllowed(false);
	table.setColumnHeaderMode(ColumnHeaderMode.HIDDEN);
	table.setSelectable(false);
	table.setImmediate(true);
	table.setPageLength(size);
	table.setWidth(100, Unit.PERCENTAGE);
	table.setColumnWidth(SimpleTablePresentation.CHAMPS_TITLE, 300);
	table.setCellStyleGenerator((components, itemId, columnId)->{
		if (columnId!=null && columnId.equals(SimpleTablePresentation.CHAMPS_TITLE)){
			return (ValoTheme.LABEL_BOLD);
		}
		return null;
	});
	return table;
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:26,代码来源:CommissionParametreView.java

示例8: updateCandidaturePresentation

import com.vaadin.ui.themes.ValoTheme; //导入依赖的package包/类
/**
 * Met a jour le panel d'info
 * 
 * @param listePresentation
 */
private void updateCandidaturePresentation(final List<SimpleTablePresentation> listePresentation) {
	int i = 0;
	gridInfoLayout.removeAllComponents();
	gridInfoLayout.setRows(listePresentation.size());
	for (SimpleTablePresentation e : listePresentation) {
		Label title = new Label(e.getTitle());
		title.addStyleName(ValoTheme.LABEL_BOLD);
		title.setSizeUndefined();
		gridInfoLayout.addComponent(title, 0, i);
		Label value = new Label((String) e.getValue(), ContentMode.HTML);
		if ((e.getCode().equals("candidature." + ConstanteUtils.CANDIDATURE_LIB_LAST_DECISION)
				&& e.getShortValue() != null && !e.getShortValue().equals(NomenclatureUtils.TYP_AVIS_ATTENTE))
				|| (e.getCode().equals("candidature." + ConstanteUtils.CANDIDATURE_LIB_STATUT)
						&& e.getShortValue() != null
						&& !e.getShortValue().equals(NomenclatureUtils.TYPE_STATUT_ATT))) {
			title.addStyleName(ValoTheme.LABEL_COLORED);
			value.addStyleName(ValoTheme.LABEL_COLORED);
			value.addStyleName(ValoTheme.LABEL_BOLD);
		}
		value.setWidth(100, Unit.PERCENTAGE);
		gridInfoLayout.addComponent(value, 1, i);
		i++;
	}
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:30,代码来源:CandidatureWindow.java

示例9: updateCandidatureDatePresentation

import com.vaadin.ui.themes.ValoTheme; //导入依赖的package包/类
/**
 * Met à jour le panel de dates
 * 
 * @param listePresentation
 */
private void updateCandidatureDatePresentation(final List<SimpleTablePresentation> listePresentation) {
	int i = 0;
	gridDateLayout.removeAllComponents();
	if (listePresentation.size() > 0) {
		gridDateLayout.setRows(listePresentation.size());
		for (SimpleTablePresentation e : listePresentation) {
			Label title = new Label(e.getTitle());
			title.addStyleName(ValoTheme.LABEL_BOLD);
			title.setSizeUndefined();
			gridDateLayout.addComponent(title, 0, i);
			Label value = new Label((String) e.getValue());
			if (e.getCode().equals(
					"candidature." + Candidature_.formation.getName() + "." + Formation_.datRetourForm.getName())) {
				title.addStyleName(ValoTheme.LABEL_COLORED);
				value.addStyleName(ValoTheme.LABEL_COLORED);
				value.addStyleName(ValoTheme.LABEL_BOLD);
			}
			value.setWidth(100, Unit.PERCENTAGE);
			gridDateLayout.addComponent(value, 1, i);
			i++;
		}
	}
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:29,代码来源:CandidatureWindow.java

示例10: addMentionCnil

import com.vaadin.ui.themes.ValoTheme; //导入依赖的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: init

import com.vaadin.ui.themes.ValoTheme; //导入依赖的package包/类
@PostConstruct
public void init() {
	Components.configure(this)
			// set full to view content
			.fullSize().spacing()
			.add(Components.button().caption("Add new").styleName(ValoTheme.BUTTON_PRIMARY)
					// navigate to "manage" view
					.onClick(e -> ViewNavigator.require().toView("manage").navigate()).build())
			// build and add listing
			.addAndExpandFull(listing = Components.listing.properties(MProduct.PRODUCT)
					// setup data source using Datastore with 'products' table name target and product ID as pk
					.dataSource(datastore, DataTarget.named("products"), MProduct.ID)
					// disable auto refresh: will be triggered on view enter
					.autoRefresh(false)
					// when user clicks on a row, open the 'view' named View providing product id parameter
					.withItemClickListener((i, p, e) -> ViewNavigator.require().toView("view")
							.withParameter("id", i.getValue(MProduct.ID)).navigate())
					// set full size and build
					.fullSize().build());
}
 
开发者ID:holon-platform,项目名称:holon-examples,代码行数:21,代码来源:Home.java

示例12: buildMenu

import com.vaadin.ui.themes.ValoTheme; //导入依赖的package包/类
/**
 * Construit le menu
 */
private void buildMenu() {
	menu.addStyleName(ValoTheme.MENU_PART);

	final OneClickButton showMenu = new OneClickButton(applicationContext.getMessage("mainUi.menu", null, getLocale()), FontAwesome.LIST);
	showMenu.addStyleName(ValoTheme.BUTTON_PRIMARY);
	showMenu.addStyleName(ValoTheme.BUTTON_SMALL);
	showMenu.addStyleName(StyleConstants.VALO_MENU_TOGGLE);
	showMenu.addClickListener(e -> {
		if (menu.getStyleName().contains(StyleConstants.VALO_MENU_VISIBLE)) {
			menu.removeStyleName(StyleConstants.VALO_MENU_VISIBLE);
		} else {
			menu.addStyleName(StyleConstants.VALO_MENU_VISIBLE);
		}
		
	});
	menu.addComponent(showMenu);

	menuButtonLayout.setPrimaryStyleName(StyleConstants.VALO_MENUITEMS);
	menu.addComponent(menuButtonLayout);
	
	constructMainMenu();
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:26,代码来源:MainUI.java

示例13: constructCtrCandChangeBtn

import com.vaadin.ui.themes.ValoTheme; //导入依赖的package包/类
/** Construit le bouton de recherche de centre
 * @param libelle le libelle du bouton
 * @return	le bouton de recherche
 */
private OneClickButton constructCtrCandChangeBtn(String libelle){
	OneClickButton ctrCandBtn = new OneClickButton(libelle);
	ctrCandBtn.setPrimaryStyleName(ValoTheme.MENU_ITEM);
	ctrCandBtn.addClickListener(e->{
		SearchCtrCandWindow win = new SearchCtrCandWindow();
		win.addCentreCandidatureListener(centre->{
			userController.setCentreCandidature(centre);
			buildMenuCtrCand();
			navigateToView(AccueilView.NAME);
			idCtrCandEnCours = centre.getIdCtrCand();				
		});
		getCurrent().addWindow(win);
	});
	return ctrCandBtn;
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:20,代码来源:MainUI.java

示例14: constructCommissionChangeBtn

import com.vaadin.ui.themes.ValoTheme; //导入依赖的package包/类
/** Construit le bouton de recherche de commission
 * @param libelle le libellé du bouton
 * @return le bouton de recherche
 */
private OneClickButton constructCommissionChangeBtn(String libelle){
	OneClickButton commissionBtn = new OneClickButton(libelle);
	commissionBtn.setPrimaryStyleName(ValoTheme.MENU_ITEM);
	commissionBtn.addClickListener(e->{			
		SearchCommissionWindow win = new SearchCommissionWindow(null);
		win.addCommissionListener(comm->{
			userController.setCommission(comm);
			buildMenuCommission();
			navigateToView(AccueilView.NAME);
			idCommissionEnCours = comm.getIdComm();
		});
		getCurrent().addWindow(win);
	});
	return commissionBtn;
}
 
开发者ID:EsupPortail,项目名称:esup-ecandidat,代码行数:20,代码来源:MainUI.java

示例15: buildToolbarButton

import com.vaadin.ui.themes.ValoTheme; //导入依赖的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


注:本文中的com.vaadin.ui.themes.ValoTheme类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。