本文整理汇总了Java中javax.faces.component.html.HtmlOutputText类的典型用法代码示例。如果您正苦于以下问题:Java HtmlOutputText类的具体用法?Java HtmlOutputText怎么用?Java HtmlOutputText使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HtmlOutputText类属于javax.faces.component.html包,在下文中一共展示了HtmlOutputText类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: _createHtmlOutputText
import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
private HtmlOutputText _createHtmlOutputText()
{
return new HtmlOutputText();
}
示例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);
}
}
}
示例8: encodeBegin
import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
public void encodeBegin(FacesContext context, UIComponent component)
throws IOException {
if (!component.isRendered()) {
return;
}
ResponseWriter writer = context.getResponseWriter();
String jsfId = (String) RendererUtil.getAttribute(context, component, "id");
String id = jsfId;
if (component.getId() != null &&
!component.getId().startsWith(UIViewRoot.UNIQUE_ID_PREFIX))
{
id = component.getClientId(context);
}
String title = (String) RendererUtil.getAttribute(context, component, "title");
Object tmpFoldStr = RendererUtil.getAttribute(context, component, "hideByDefault");
boolean foldDiv = tmpFoldStr != null && "true".equals(tmpFoldStr);
String foldImage = foldDiv ? FOLD_IMG_HIDE : FOLD_IMG_SHOW;
writer.write("<" + BARTAG + " class=\"" + BARSTYLE + "\">");
writer.write("<table style=\"width: 100%;\" class=\"discTria\" cellpadding=\"0\" cellspacing=\"0\" >");
writer.write("<tr><td class=\"discTria\" onclick=\"javascript:showHideDivBlock('" + id +
"', '" + RESOURCE_PATH + "');\">" );
writer.write(" <img id=\"" + id + "__img_hide_division_" + "\" alt=\"" +
title + "\"");
writer.write(" src=\"" + foldImage + "\" style=\"" + CURSOR + "\" />");
writer.write("<h4>" + title + "</h4>");
writer.write("</td><td class=\"discTria\"> </td>");
writer.write("<td class=\"itemAction\" style=\"text-align: right;\">");
List childrenList = component.getChildren();
for(int i=0; i<childrenList.size(); i++)
{
UIComponent thisComponent = (UIComponent)childrenList.get(i);
if(thisComponent instanceof org.sakaiproject.tool.messageforums.jsf.BarLinkComponent
||thisComponent instanceof HtmlOutputText)
{
thisComponent.encodeBegin(context);
thisComponent.encodeChildren(context);
thisComponent.encodeEnd(context);
}
}
writer.write("</td></tr></table>");
writer.write("</"+ BARTAG + ">");
if(foldDiv) {
writer.write("<div style=\"display:none\" " +
" id=\"" + id + "__hide_division_" + "\">");
} else {
writer.write("<div style=\"display:block\" " +
" id=\"" + id + "__hide_division_" + "\">");
}
}
示例9: getColResourceTimeRows
import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
public HtmlOutputText getColResourceTimeRows() { return colResourceTimeRows; }
示例10: getColEngineTimeRows
import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
public HtmlOutputText getColEngineTimeRows() { return colEngineTimeRows; }
示例11: getColNameRows
import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
public HtmlOutputText getColNameRows() { return colNameRows; }
示例12: setColNameRows
import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
public void setColNameRows(HtmlOutputText hot) { colNameRows = hot; }
示例13: getColNameHeader
import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
public HtmlOutputText getColNameHeader() { return colNameHeader; }
示例14: setColNameHeader
import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
public void setColNameHeader(HtmlOutputText hot) { colNameHeader = hot; }
示例15: getColStartTimeRows
import javax.faces.component.html.HtmlOutputText; //导入依赖的package包/类
public HtmlOutputText getColStartTimeRows() { return colStartTimeRows; }