當前位置: 首頁>>代碼示例>>Java>>正文


Java Label.setWidth方法代碼示例

本文整理匯總了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++;
	}
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:30,代碼來源:CandidatureWindow.java

示例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++;
		}
	}
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:29,代碼來源:CandidatureWindow.java

示例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;
}
 
開發者ID:vaadin,項目名稱:material-theme-fw8,代碼行數:8,代碼來源:ButtonsView.java

示例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);
  }
}
 
開發者ID:Juchar,項目名稱:md-stepper,代碼行數:28,代碼來源:VerticalStepper.java

示例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;
}
 
開發者ID:Juchar,項目名稱:md-stepper,代碼行數:9,代碼來源:StepperPropertiesLayout.java

示例6: initializeLabel

import com.vaadin.ui.Label; //導入方法依賴的package包/類
private void initializeLabel(Label label) {
    label.setImmediate(true);
    label.setWidth("100%");
    label.setHeight("-1px");
}
 
開發者ID:opensecuritycontroller,項目名稱:osc-core,代碼行數:6,代碼來源:PageInformationComponent.java

示例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);
}
 
開發者ID:Juchar,項目名稱:md-stepper,代碼行數:61,代碼來源:StepLabel.java


注:本文中的com.vaadin.ui.Label.setWidth方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。