本文整理匯總了Java中com.vaadin.ui.Label.setWidth方法的典型用法代碼示例。如果您正苦於以下問題:Java Label.setWidth方法的具體用法?Java Label.setWidth怎麽用?Java Label.setWidth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.ui.Label
的用法示例。
在下文中一共展示了Label.setWidth方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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: createCaption
import com.vaadin.ui.Label; //導入方法依賴的package包/類
private Label createCaption(String text) {
Label lbl = new Label(text);
lbl.setPrimaryStyleName(Typography.Dark.Caption.SECONDARY);
lbl.addStyleName(FlexItem.FlexShrink.SHRINK_0);
lbl.setWidth(120, Unit.PIXELS);
return lbl;
}
示例4: showTransitionMessage
import com.vaadin.ui.Label; //導入方法依賴的package包/類
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);
}
}
示例5: createHintsLabel
import com.vaadin.ui.Label; //導入方法依賴的package包/類
private Label createHintsLabel() {
Label label
= new Label("* Changing the stepper type or the linearity will recreate the stepper.");
label.setWidth(100, Unit.PERCENTAGE);
label.addStyleName(ValoTheme.LABEL_LIGHT);
label.addStyleName(ValoTheme.LABEL_SMALL);
return label;
}
示例6: initializeLabel
import com.vaadin.ui.Label; //導入方法依賴的package包/類
private void initializeLabel(Label label) {
label.setImmediate(true);
label.setWidth("100%");
label.setHeight("-1px");
}
示例7: StepLabel
import com.vaadin.ui.Label; //導入方法依賴的package包/類
/**
* Construct a new label with the given caption, description and icon.
*
* @param caption
* The caption to show
* @param description
* The description to show
* @param icon
* The icon to show
*/
public StepLabel(String caption, String description, FontIcon icon) {
active = false;
nexted = false;
skipped = false;
editable = false;
clickable = false;
iconLabel = new Label();
iconLabel.setWidthUndefined();
iconLabel.setContentMode(ContentMode.HTML);
iconLabel.addStyleName(STYLE_STEP_ICON);
captionLabel = new Label();
captionLabel.setWidth(100, Unit.PERCENTAGE);
captionLabel.addStyleName(STYLE_STEP_CAPTION);
descriptionLabel = new Label();
descriptionLabel.setWidth(100, Unit.PERCENTAGE);
descriptionLabel.addStyleName(ValoTheme.LABEL_LIGHT);
descriptionLabel.addStyleName(ValoTheme.LABEL_SMALL);
descriptionLabel.addStyleName(STYLE_STEP_DESCRIPTION);
captionWrapper = new VerticalLayout();
captionWrapper.setSpacing(false);
captionWrapper.setMargin(false);
captionWrapper.setSizeFull();
captionWrapper.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
captionWrapper.addComponent(captionLabel);
captionWrapper.addComponent(descriptionLabel);
rootLayout = new HorizontalLayout();
rootLayout.setSpacing(false);
rootLayout.setMargin(false);
rootLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
rootLayout.setWidth(100, Unit.PERCENTAGE);
rootLayout.addComponent(iconLabel);
rootLayout.addComponent(captionWrapper);
rootLayout.setExpandRatio(captionWrapper, 1);
setCompositionRoot(rootLayout);
addStyleName(STYLE_ROOT_LAYOUT);
setIcon(icon);
setCaption(caption);
setDescription(description);
setIconNexted(DEFAULT_ICON_NEXTED);
setIconSkipped(DEFAULT_ICON_SKIPPED);
setIconEditable(DEFAULT_ICON_EDITABLE);
setIconError(DEFAULT_ICON_ERROR);
}