本文整理汇总了Java中com.vaadin.v7.ui.Label.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java Label.setValue方法的具体用法?Java Label.setValue怎么用?Java Label.setValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.v7.ui.Label
的用法示例。
在下文中一共展示了Label.setValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createFoodIcon
import com.vaadin.v7.ui.Label; //导入方法依赖的package包/类
public static Component createFoodIcon(Customer cust) {
Label label = new Label(FontAwesome.HOURGLASS_2.getHtml(), ContentMode.HTML);
label.setHeight(24, Sizeable.Unit.PIXELS);
label.setWidth(30, Sizeable.Unit.PIXELS);
if (cust.getFood() == Customer.Food.HAMBURGER) {
label.setValue(FontAwesome.AMBULANCE.getHtml());
}
if (cust.getFood() == Customer.Food.FISH) {
label.setValue(FontAwesome.HEART.getHtml());
}
if (cust.getFood() == Customer.Food.VEGETABLES) {
label.setValue(FontAwesome.SUN_O.getHtml());
}
return label;
}
示例2: getTestComponent
import com.vaadin.v7.ui.Label; //导入方法依赖的package包/类
@Override
public Component getTestComponent() {
Label info = new Label();
info.setValue("Hide and/or sort columns."
+ " Grid will save your settings in the browser cookies."
+ " And load them next time you open the view");
MGrid<Person> table = new MGrid<>();
table.setRows(
new Person(1, "Some", "One", 13),
new Person(2, "Arni", "Red", 83),
new Person(3, "Sami", "Green", 42),
new Person(4, "Togy", "Tilly", 23),
new Person(5, "Billy", "Willy", 22),
new Person(6, "Anna", "Bunny", 23),
new Person(7, "Joe", "Black", 52)
);
makeGridColumnsHideable(table);
makeGridOrderable(table);
table.setColumnReorderingAllowed(true);
table.attachSaveSettings("personsGrid");
return new MVerticalLayout(info, table);
}
示例3: RootView
import com.vaadin.v7.ui.Label; //导入方法依赖的package包/类
public RootView() {
setCaption("Form test");
VerticalComponentGroup verticalComponentGroup = new VerticalComponentGroup();
myRoom = new MeetingRoom("Grand A", "Ballroom");
Label myLabel = new Label();
myLabel.setValue("Very important info.");
myLabel.setCaption("Title:");
verticalComponentGroup.addComponent(myLabel);
myForm = new MeetingRoomForm();
myForm.setItemDataSource(new BeanItem<MeetingRoom>(myRoom));
myForm.setBuffered(true);
// myForm.setWriteThrough(true);
myForm.setImmediate(true);
verticalComponentGroup.addComponent(myForm);
setContent(verticalComponentGroup);
}
示例4: ToolbarTest
import com.vaadin.v7.ui.Label; //导入方法依赖的package包/类
public ToolbarTest() {
setDescription("This is Toolbar test");
Toolbar tbar = new Toolbar();
final Label label = new Label();
label.setValue("Clicked: none");
for (int loop = 0; loop < 10; loop++) {
Button button = new Button();
if (loop % 2 == 0) {
button.setIcon(FontAwesome.HOME);
} else {
button.setIcon(new ThemeResource("../runo/icons/64/folder.png"));
}
if (loop % 3 == 0) {
button.setCaption("Diipa");
}
final int identifier = loop;
button.addClickListener(new Button.ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
label.setValue("Clicked: " + identifier);
}
});
tbar.addComponent(button);
}
addComponent(tbar);
addComponent(label);
}
示例5: TabBarInNavigationViewTest
import com.vaadin.v7.ui.Label; //导入方法依赖的package包/类
public TabBarInNavigationViewTest() {
TestUtils.injectCss(".green {background-color: green;}");
setDescription("This is TabBar test");
final TabBarView bar = new TabBarView();
for (int loop = 0; loop < 5; loop++) {
String content = String.format("Tab%d", loop);
Label label = new Label(content);
// label.setCaption(content);
Tab tab = bar.addTab(label);
if (loop % 3 == 0) {
tab.setIcon(new ThemeResource("../runo/icons/32/folder.png"));
tab.setCaption(content);
} else if (loop % 3 == 1) {
tab.setCaption(content);
} else {
tab.setIcon(new ThemeResource("../runo/icons/32/folder.png"));
}
if (loop == 0) {
label.setSizeFull();
label.addStyleName("green");
label.setValue(label.getValue()
+ ", green color should fill the whole content area");
} else if (loop == 1) {
StringBuilder sb = new StringBuilder();
sb.append(label.getValue());
sb.append("Content on this tab should be scrollable");
for (int i = 0; i < 200; i++) {
sb.append("Row " + i + "</br>");
}
label.setContentMode(ContentMode.HTML);
label.setValue(sb.toString());
}
}
NavigationView navigationView = new NavigationView();
navigationView.setCaption("NavView contains TabBarView");
navigationView.setContent(bar);
makeSmallTabletSize(navigationView);
addComponent(navigationView);
}