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