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


Java Label.setValue方法代碼示例

本文整理匯總了Java中com.vaadin.ui.Label.setValue方法的典型用法代碼示例。如果您正苦於以下問題:Java Label.setValue方法的具體用法?Java Label.setValue怎麽用?Java Label.setValue使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.vaadin.ui.Label的用法示例。


在下文中一共展示了Label.setValue方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: init

import com.vaadin.ui.Label; //導入方法依賴的package包/類
/**
 * Initialise la vue
 */
@PostConstruct
public void init() {
	/* Style */
	setMargin(true);
	setSpacing(true);

	/* Titre */
	Label title = new Label(applicationContext.getMessage(NAME + ".title", null, UI.getCurrent().getLocale()));
	title.addStyleName(StyleConstants.VIEW_TITLE);
	addComponent(title);

	/* Texte */
	Label label = new Label("", ContentMode.HTML);
	String msg = messageController.getMessage(NomenclatureUtils.COD_MSG_MAINTENANCE);
	if (msg != null){
		label.setValue(msg);
	}else{
		label.setValue(applicationContext.getMessage(NAME + ".text", null, UI.getCurrent().getLocale()));
	}
	addComponent(label);
}
 
開發者ID:EsupPortail,項目名稱:esup-ecandidat,代碼行數:25,代碼來源:MaintenanceView.java

示例2: localize

import com.vaadin.ui.Label; //導入方法依賴的package包/類
@Override
protected void localize(Label instance) {
	super.localize(instance);
	if (content != null) {
		instance.setValue(LocalizationContext.translate(content, true));
	}
}
 
開發者ID:holon-platform,項目名稱:holon-vaadin7,代碼行數:8,代碼來源:DefaultLabelBuilder.java

示例3: startServer

import com.vaadin.ui.Label; //導入方法依賴的package包/類
private void startServer(String stripeName, String serverName, Button startBT, Button stopBT, Label stateLBL, Label pidLBL) {
  File stripeconfig = tcConfigLocationPerStripe.get(stripeName);
  if (stripeconfig == null) {
    generateXML(false);
    stripeconfig = tcConfigLocationPerStripe.get(stripeName);
  }

  File workDir = new File(settings.getKitPath());
  String key = stripeName + "-" + serverName;
  TextArea console = getConsole(key);

  RunningServer runningServer = new RunningServer(
      workDir, stripeconfig, serverName, console, 500,
      () -> {
        runningServers.remove(key);
        access(() -> {
          stopBT.setEnabled(false);
          startBT.setEnabled(true);
          pidLBL.setValue("");
          stateLBL.setValue("STOPPED");
        });
      },
      newState -> access(() -> stateLBL.setValue("STATE: " + newState)),
      newPID -> access(() -> pidLBL.setValue("PID: " + newPID))
  );

  if (runningServers.put(key, runningServer) != null) {
    Notification.show("ERROR", "Server is running: " + serverName, Notification.Type.ERROR_MESSAGE);
    return;
  }

  consoles.setSelectedTab(console);
  stateLBL.setValue("STARTING");
  runningServer.start();
  startBT.setEnabled(false);
  stopBT.setEnabled(true);
  runningServer.refreshConsole();
}
 
開發者ID:Terracotta-OSS,項目名稱:tinypounder,代碼行數:39,代碼來源:TinyPounderMainUI.java

示例4: createLabel

import com.vaadin.ui.Label; //導入方法依賴的package包/類
private Label createLabel(String style) {
    Label lbl = new Label();
    lbl.setPrimaryStyleName(style);
    style = style.substring(3).replace("-", " ");
    style = style.substring(0, 1).toUpperCase() + style.substring(1);
    lbl.setValue(style);
    return lbl;
}
 
開發者ID:vaadin,項目名稱:material-theme-fw8,代碼行數:9,代碼來源:TypographyView.java

示例5: addKitControls

import com.vaadin.ui.Label; //導入方法依賴的package包/類
private void addKitControls() {

    kitControlsLayout = new VerticalLayout();
    kitPathLayout = new GridLayout(1, 1);
    kitPathLayout.setWidth(100, Unit.PERCENTAGE);
    kitPathLayout.setColumnExpandRatio(0, 2);

    Label info = new Label();
    if (settings.getKitPath() != null) {
      info.setValue("Using " + (kitAwareClassLoaderDelegator.isEEKit() ? "Enterprise Kit" : "Open source Kit"));
    } else {
      info.setValue("Enter Kit location:");
    }
    TextField kitPath = new TextField();
    kitPath.setPlaceholder("Kit location");
    kitPath.setWidth("100%");
    kitPath.setValue(settings.getKitPath() != null ? settings.getKitPath() : "");
    kitPath.addValueChangeListener(event -> {
      try {
        kitAwareClassLoaderDelegator.setKitPath(kitPath.getValue());
        info.setValue("Using " + (kitAwareClassLoaderDelegator.isEEKit() ? "Enterprise" : "Open source") + " Kit");
        if (voltronConfigLayout != null) {
          voltronConfigLayout.removeAllComponents();
        }
        if (voltronControlLayout != null) {
          voltronControlLayout.removeAllComponents();
        }
        updateKitControls();
        initVoltronConfigLayout();
        initVoltronControlLayout();
        initRuntimeLayout();
        updateServerGrid();
        displayWarningNotification("Kit location updated with success !");
      } catch (Exception e) {
        if (e.getCause() instanceof NoSuchFileException) {
          displayErrorNotification("Kit path could not update !", "Make sure the path points to a kit !");
        } else {
          displayErrorNotification("Kit path could not update !", e);
        }
      }
    });
    kitPathLayout.addComponent(kitPath);
    kitControlsLayout.addComponent(info);
    kitControlsLayout.addComponent(kitPathLayout);
    mainLayout.addTab(kitControlsLayout, "STEP 1: KIT");
  }
 
開發者ID:Terracotta-OSS,項目名稱:tinypounder,代碼行數:47,代碼來源:TinyPounderMainUI.java


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