本文整理汇总了Java中javax.faces.component.html.HtmlOutputText.setValue方法的典型用法代码示例。如果您正苦于以下问题:Java HtmlOutputText.setValue方法的具体用法?Java HtmlOutputText.setValue怎么用?Java HtmlOutputText.setValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.faces.component.html.HtmlOutputText
的用法示例。
在下文中一共展示了HtmlOutputText.setValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testRIManyAttributes
import javax.faces.component.html.HtmlOutputText; //导入方法依赖的package包/类
public void testRIManyAttributes() throws IOException
{
HtmlOutputText out = _createHtmlOutputText();
out.setValue("Plain value");
out.setEscape(true);
out.setId("OutId");
out.setTitle("Short Desc");
out.setStyleClass("Style Class");
out.setStyle("The Style");
UIViewRoot root = createTestTree(out, "testRIManyAttributes()");
renderRoot(root);
root = createTestTree(out, "testRIManyAttributes() 2");
renderRoot(root);
}
示例2: testRISimplePerf
import javax.faces.component.html.HtmlOutputText; //导入方法依赖的package包/类
public void testRISimplePerf() throws IOException
{
HtmlOutputText out = _createHtmlOutputText();
out.setValue("Plain value");
UIViewRoot root = createTestTree(out, "testRISimplePerf()");
renderRoot(root);
root = createTestTree(out, "testRISimplePerf() 2");
renderRoot(root);
}
示例3: testComponentState
import javax.faces.component.html.HtmlOutputText; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public void testComponentState() throws Exception
{
RequestContext context = _createContext();
try
{
CorePanelGroupLayout cpgl = new CorePanelGroupLayout();
cpgl.setLayout("horizontal");
HtmlOutputText hot = new HtmlOutputText();
hot.setValue("foo");
CoreOutputText cot = new CoreOutputText();
cot.setValue("bar");
cpgl.getChildren().add(hot);
cpgl.getChildren().add(cot);
Object state = context.saveComponent(cpgl);
UIComponent restored = context.restoreComponent(state);
assertTrue(restored instanceof CorePanelGroupLayout);
assertEquals(restored.getChildCount(), 2);
assertEquals(restored.getAttributes().get("layout"), "horizontal");
UIComponent childOne = (UIComponent) restored.getChildren().get(0);
assertTrue(childOne instanceof HtmlOutputText);
assertEquals(childOne.getAttributes().get("value"), "foo");
UIComponent childTwo = (UIComponent) restored.getChildren().get(1);
assertTrue(childTwo instanceof CoreOutputText);
assertEquals(childTwo.getAttributes().get("value"), "bar");
}
finally
{
context.release();
}
}
示例4: addOneRowToTable
import javax.faces.component.html.HtmlOutputText; //导入方法依赖的package包/类
private void addOneRowToTable(List<FormFieldMetadata> row, List<UIComponent> tableChildrens, int maxFieldCounts,
Map<String, Object> formRecordValueMap) {
for (FormFieldMetadata field : row) {
// Skip the reference field and non-printable field
if ((field.getReferToFormMetadataId() != null && field.getReferToFormMetadataId() > 0)
|| !field.getIsPrintable()) {
continue;
}
HtmlOutputLabel label = new HtmlOutputLabel();
label.setValue(field.getFieldLabel());
HtmlOutputText text = new HtmlOutputText();
Object value = formRecordValueMap.get(field.getColumnName());
if (value instanceof Date) {
value = simpleDateFormat.format(value);
}
text.setValue(value == null ? EMPTY_STRING : value.toString());
tableChildrens.add(label);
tableChildrens.add(text);
}
for (int i = row.size(); i < maxFieldCounts; i++) {
HtmlOutputText emptyLabel = new HtmlOutputText();
emptyLabel.setValue(EMPTY_STRING);
HtmlOutputText emptyValue = new HtmlOutputText();
emptyValue.setValue(EMPTY_STRING);
tableChildrens.add(emptyLabel);
tableChildrens.add(emptyValue);
}
}
示例5: setRosterDataTable
import javax.faces.component.html.HtmlOutputText; //导入方法依赖的package包/类
public void setRosterDataTable(HtmlDataTable rosterDataTable) {
Set usedCategories = getUsedCategories();
if (rosterDataTable.findComponent(CAT_COLUMN_PREFIX + "0") == null) {
Application app = FacesContext.getCurrentInstance().getApplication();
// Add columns for each category. Be sure to create unique IDs
// for all child components.
int colpos = 0;
for (Iterator iter = usedCategories.iterator(); iter.hasNext(); colpos++) {
String category = (String)iter.next();
String categoryName = getCategoryName(category);
UIColumn col = new UIColumn();
col.setId(CAT_COLUMN_PREFIX + colpos);
HtmlCommandSortHeader sortHeader = new HtmlCommandSortHeader();
sortHeader.setId(CAT_COLUMN_PREFIX + "sorthdr_" + colpos);
sortHeader.setRendererType("org.apache.myfaces.SortHeader");
sortHeader.setArrow(true);
sortHeader.setColumnName(category);
//sortHeader.setActionListener(app.createMethodBinding("#{rosterBean.sort}", new Class[] {ActionEvent.class}));
HtmlOutputText headerText = new HtmlOutputText();
headerText.setId(CAT_COLUMN_PREFIX + "hdr_" + colpos);
headerText.setValue(categoryName);
sortHeader.getChildren().add(headerText);
col.setHeader(sortHeader);
HtmlOutputText contents = new HtmlOutputText();
contents.setId(CAT_COLUMN_PREFIX + "cell_" + colpos);
contents.setValueBinding("value",
app.createValueBinding("#{enrollment.categoryToSectionMap['" + category + "'].title}"));
col.getChildren().add(contents);
rosterDataTable.getChildren().add(col);
}
}
}
示例6: getAsPanel
import javax.faces.component.html.HtmlOutputText; //导入方法依赖的package包/类
@Override
public Panel getAsPanel() {
Panel p = (Panel) application.createComponent(FacesContext.getCurrentInstance(),
"org.primefaces.component.Panel", "org.primefaces.component.PanelRenderer");
p.setId(getPanelId());
p.setHeader("Lamp widget");
p.setClosable(true);
p.setToggleable(false);
AjaxBehavior ajaxBehavior = new AjaxBehavior();
ajaxBehavior.addAjaxBehaviorListener(new AjaxBehaviorListener() {
@Override
public void processAjaxBehavior(AjaxBehaviorEvent event) throws AbortProcessingException {
manager.closedWidget(event.getComponent().getId());
}
});
ajaxBehavior.setTransient(true);
p.addClientBehavior("close", ajaxBehavior);
HtmlOutputText title = (HtmlOutputText) application.createComponent(HtmlOutputText.COMPONENT_TYPE);
title.setValue(lampActor.getName());
title.setStyle("color: #666; font-size: 25px; margin: 10px 0; display: block; text-align: center;");
p.getChildren().add(title);
p.getChildren().add(button);
return p;
}
示例7: constructDatalinkPanelGrid
import javax.faces.component.html.HtmlOutputText; //导入方法依赖的package包/类
private void constructDatalinkPanelGrid() {
List<UIComponent> children = this.datalinkPanelGrid.getChildren();
children.clear();
for (Param p : parsedVotable.getDatalinkInputParams()) {
if (p.isIdParam()) {
continue;
}
HtmlOutputText label = new HtmlOutputText();
label.setValue(p.getName() + ": ");
children.add(label);
//check if there are some options available
if (p.getOptions().isEmpty()) {
//no options - just inputText
InputText text = new InputText();
text.setId("datalinkProperty" + p.getName());
children.add(text);
} else {
SelectOneMenu menu = new SelectOneMenu();
menu.setId("datalinkProperty" + p.getName());
List<SelectItem> items = new ArrayList<>();
SelectItem item = new SelectItem();//null value
item.setValue("");
item.setLabel("Nothing selected");
items.add(item);
for (Option o : p.getOptions()) {
item = new SelectItem();
item.setValue(o.getValue());
if (o.getValue().equals(o.getName())) {
item.setLabel(o.getName());
} else if (o.getName().trim().isEmpty()) {
item.setLabel(o.getValue());
} else {
item.setLabel(o.getName() + ": " + o.getValue());
}
items.add(item);
}
UISelectItems uiContainer = new UISelectItems();
uiContainer.setValue(items);
menu.getChildren().add(uiContainer);
children.add(menu);
}
}
}