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