本文整理匯總了Java中com.vaadin.ui.Label.setSizeUndefined方法的典型用法代碼示例。如果您正苦於以下問題:Java Label.setSizeUndefined方法的具體用法?Java Label.setSizeUndefined怎麽用?Java Label.setSizeUndefined使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.ui.Label
的用法示例。
在下文中一共展示了Label.setSizeUndefined方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: updateCandidaturePresentation
import com.vaadin.ui.Label; //導入方法依賴的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++;
}
}
示例2: updateCandidatureDatePresentation
import com.vaadin.ui.Label; //導入方法依賴的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++;
}
}
}
示例3: AccordionItemMenu
import com.vaadin.ui.Label; //導入方法依賴的package包/類
/**
* Constructeur
*
* @param title
* @param parent
*/
public AccordionItemMenu(String title, AccordionMenu parent,
Boolean isExpandable) {
super();
setWidth(100, Unit.PERCENTAGE);
/*
* Les labels n'etant pas cliquable, on passe par un layout
* intermediaire
*/
VerticalLayout layoutClickable = new VerticalLayout();
layoutClickable.setWidth(100, Unit.PERCENTAGE);
/* Label */
Label label = new Label(title);
label.setPrimaryStyleName(ValoTheme.MENU_SUBTITLE);
label.setSizeUndefined();
layoutClickable.addComponent(label);
layoutClickable.addStyleName(StyleConstants.VALO_MENUACCORDEON);
addComponent(layoutClickable);
if (isExpandable) {
layoutClickable.addStyleName(StyleConstants.CLICKABLE);
layoutClickable.addLayoutClickListener(e -> {
parent.changeItem((String) getData());
});
}
vlButton = new VerticalLayout();
vlButton.addStyleName(StyleConstants.VALO_MENUACCORDEON);
vlButton.setWidth(100, Unit.PERCENTAGE);
addComponent(vlButton);
}
示例4: createSubHeader
import com.vaadin.ui.Label; //導入方法依賴的package包/類
/**
* @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;
}
示例5: AppBar
import com.vaadin.ui.Label; //導入方法依賴的package包/類
public AppBar() {
super();
setPrimaryStyleName("md-appbar");
addStyleName(MaterialColor.BLUE_500.getBackgroundColorStyle());
naviIcon.setIcon(MaterialIcons.MENU);
naviIcon.setPrimaryStyleName(Styles.Buttons.NAV_ICON);
Label appBarTitle = new Label("Material Design");
appBarTitle.setPrimaryStyleName(Typography.Light.Title.PRIMARY);
appBarTitle.setSizeUndefined();
addComponents(naviIcon, appBarTitle);
}
示例6: buildHeader
import com.vaadin.ui.Label; //導入方法依賴的package包/類
private void buildHeader() {
this.header.addStyleName("branding");
this.header.addStyleName("header");
// product name and information
Label product = new Label(this.server.getProductName() + "<br> <span class='product-version'> Version: "
+ this.server.getVersionStr() + "</span>", ContentMode.HTML);
product.addStyleName("product-label");
product.setSizeUndefined();
HorizontalLayout brandingLayout = new HorizontalLayout();
brandingLayout.addStyleName("header-content");
brandingLayout.addComponent(new Image(null, new ThemeResource("img/logo.png")));
brandingLayout.addComponent(product);
// creating home help button
Button mainHelpButton = new Button();
mainHelpButton.setImmediate(true);
mainHelpButton.setStyleName(Reindeer.BUTTON_LINK);
mainHelpButton.setDescription("Help");
mainHelpButton.setIcon(new ThemeResource("img/headerHelp.png"));
mainHelpButton.addClickListener(new ClickListener() {
private String guid = "";
@Override
public void buttonClick(ClickEvent event) {
ViewUtil.showHelpBrowserWindow(this.guid);
}
});
HorizontalLayout helpLayout = new HorizontalLayout();
helpLayout.addComponent(mainHelpButton);
helpLayout.addStyleName("homeHelpButton");
// Adding current user to header
Label user = new Label("User: " + getCurrent().getSession().getAttribute("user").toString());
// header banner
HorizontalLayout userlayout = new HorizontalLayout();
userlayout.addStyleName("user");
userlayout.addComponent(user);
// create Logout button next to user
userlayout.addComponent(buildLogout());
// Adding help button to the user layout next to logout button
userlayout.addComponent(helpLayout);
this.header.setWidth("100%");
this.header.setHeight("65px");
this.header.addComponent(brandingLayout);
this.header.addComponent(userlayout);
this.header.setExpandRatio(brandingLayout, 1);
this.root.addComponent(this.header);
}