本文整理汇总了Java中javax.faces.component.html.HtmlOutputLink类的典型用法代码示例。如果您正苦于以下问题:Java HtmlOutputLink类的具体用法?Java HtmlOutputLink怎么用?Java HtmlOutputLink使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
HtmlOutputLink类属于javax.faces.component.html包,在下文中一共展示了HtmlOutputLink类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeContent
import javax.faces.component.html.HtmlOutputLink; //导入依赖的package包/类
private static void writeContent(List<String> row, StringListResponseWriter writer, FacesContext facesContext,
int columnCount, UIComponent child) throws IOException {
if (child instanceof HtmlCommandLink) {
final HtmlOutputLabel label = new HtmlOutputLabel();
label.setValue(((HtmlCommandLink) child).getValue());
label.setRendered(child.isRendered());
label.encodeBegin(facesContext);
label.encodeEnd(facesContext);
} else if (child instanceof HtmlGraphicImage) {
writer.writeText("", "");
//} else if (child instanceof UIInstructions) {
// child.encodeBegin(facesContext);
// child.encodeEnd(facesContext);
// postCleanUp(row, columnCount);
} else if (child instanceof HtmlPanelGroup || child instanceof HtmlOutputLink) {
final UIComponentBase uiComponent = (UIComponentBase) child;
if (uiComponent.isRendered()) {
for (UIComponent uiChildComponent : uiComponent.getChildren()) {
writeContent(row, writer, facesContext, columnCount, uiChildComponent);
}
}
postCleanUp(row, columnCount);
} else {
child.encodeBegin(facesContext);
child.encodeEnd(facesContext);
}
}
示例2: JsfLinkRenderer
import javax.faces.component.html.HtmlOutputLink; //导入依赖的package包/类
public JsfLinkRenderer(JsfLinkModel model) {
this(HtmlOutputLink.COMPONENT_TYPE, model);
}
示例3: getSingleMenu
import javax.faces.component.html.HtmlOutputLink; //导入依赖的package包/类
private UIComponent getSingleMenu(Menu menu) {
UIPanelMenuItem item = KarakuComponentFactory.getMenuItem();
// Con este código se consigue que solo el menu actualmente seleccionado
// tenga un ID legible, así se puede marcar como seleccionado.
if ((getCurrentMenuSelected() != null)
&& (menu.getId().equals(getCurrentMenuSelected().getId()))) {
item.setId(menu.getId());
item.setName(menu.getId());
}
item.setLabel(menu.getName());
UIComponent link;
if (menu.getUrl() != null) {
String menuUrl = menu.getUrl().trim();
String appPlaceHolder = properties
.get("application.appUrlPlaceHolder");
if (menuUrl.startsWith(appPlaceHolder)
|| menuUrl.startsWith("/view")) {
// link correspondiente a este sistema
menuUrl = menuUrl.replace(appPlaceHolder, "");
link = KarakuComponentFactory.getLink();
((HtmlOutcomeTargetLink) link).setOutcome(menuUrl);
} else {
// link a otro sistema
link = FacesContext
.getCurrentInstance()
.getApplication()
.createComponent(FacesContext.getCurrentInstance(),
HtmlOutputLink.COMPONENT_TYPE,
"javax.faces.Link");
((HtmlOutputLink) link).setValue(menuUrl);
}
} else {
link = KarakuComponentFactory.getLink();
}
link.getChildren().add(item);
return link;
}
示例4: setRenderComponents
import javax.faces.component.html.HtmlOutputLink; //导入依赖的package包/类
/**
* Decides which components should be rendered for the current view.
*
* @param context the context
*/
@SuppressWarnings("unchecked")
private void setRenderComponents() {
PageCursor pageCursor = this.getPageCursor();
UIComponent component = null;
// Next component
component = uiSupport.findComponent(this, this.getIdNextPage());
component.setRendered(pageCursor.getHasNextPage());
if(component.isRendered()) {
component.getAttributes().put
(PageEvents.goToPage.name(), pageCursor.getNextPage());
if(component instanceof HtmlOutputLink) {
((HtmlOutputLink)component).setOnclick(this.readJscriptOnclickPage(
pageCursor.getCurrentPage() + 1));
}
}
// Previous component
component = uiSupport.findComponent(this, this.getIdPreviousPage());
component.setRendered(pageCursor.getHasPreviousPage());
if(component.isRendered()) {
component.getAttributes().put
(PageEvents.goToPage.name(), pageCursor.getPreviousPage());
if(component instanceof HtmlOutputLink) {
((HtmlOutputLink)component).setOnclick(this.readJscriptOnclickPage(
pageCursor.getCurrentPage() - 1));
}
}
// First page component
component = uiSupport.findComponent(this, this.getIdFirstPage());
component.setRendered((pageCursor.getCurrentPage() > 1 )
&& this.getRenderFirstPageLink());
if(component instanceof HtmlOutputLink) {
((HtmlOutputLink)component).setOnclick(this.readJscriptOnclickPage(1));
}
// this.getRenderFirstPageLink();
// Last page component
component = uiSupport.findComponent(this, this.getIdLastPage());
component.setRendered(
(pageCursor.getCurrentPage() != pageCursor.getTotalPageCount())
&& (pageCursor.getTotalPageCount() > 0)
&& this.getRenderFirstPageLink());
if(component.isRendered()) {
component.getAttributes().put
(PageEvents.goToPage.name(), this.getPageCursor().getTotalPageCount());
if(component instanceof HtmlOutputLink) {
((HtmlOutputLink)component).setOnclick(this.readJscriptOnclickPage(
pageCursor.getTotalPageCount()));
}
}
// Label component
component = uiSupport.findComponent(this, this.getIdTxtStats());
((UIOutput) component).setValue(getLabel());
}