本文整理汇总了Java中javax.faces.component.UICommand类的典型用法代码示例。如果您正苦于以下问题:Java UICommand类的具体用法?Java UICommand怎么用?Java UICommand使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UICommand类属于javax.faces.component包,在下文中一共展示了UICommand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: _modifyBasicHTMLRenderKit
import javax.faces.component.UICommand; //导入依赖的package包/类
private void _modifyBasicHTMLRenderKit()
{
// We render UIForms with our own renderer
addRenderer(UIForm.COMPONENT_FAMILY,
"javax.faces.Form",
new HtmlFormRenderer());
// And we render UICommandLink with our own renderer
addRenderer(UICommand.COMPONENT_FAMILY,
"javax.faces.Link",
new HtmlCommandLinkRenderer());
// In jsf 1.1_02 the ri FormRenderer writes out script used by
// h:commandButton. Since we override the RI FormRenderer, we also
// need to override the commandButton renderer:
addRenderer(UICommand.COMPONENT_FAMILY,
"javax.faces.Button",
new HtmlCommandButtonRenderer());
}
示例2: visit
import javax.faces.component.UICommand; //导入依赖的package包/类
@Override
public VisitResult visit(final VisitContext context, final UIComponent target) {
// if (!target.isRendered()) {
// return VisitResult.REJECT;
// }
if (target instanceof UIInput) {
this.inputs.add((UIInput) target);
}
if (target instanceof UIForm) {
this.forms.add((UIForm) target);
}
if (target instanceof UICommand) {
this.commands.add((UICommand) target);
}
if (target instanceof UIOutput) {
this.outputs.add((UIOutput) target);
}
if (target instanceof UISubmenu) {
this.subMenus.add((UISubmenu) target);
}
if (target instanceof Column) {
this.columns.add((Column) target);
}
if (target instanceof DataTable) {
this.tables.add((DataTable) target);
}
if (target instanceof UISelectItems) {
this.selectItems.add((UISelectItems) target);
}
if (target instanceof PanelGrid) {
this.panelGrids.add((PanelGrid) target);
}
return VisitResult.ACCEPT;
}
示例3: encodeChildren
import javax.faces.component.UICommand; //导入依赖的package包/类
public void encodeChildren(FacesContext context, UIComponent component) throws IOException
{
if (!component.isRendered())
{
return;
}
if (!isDisabled(context, component) && !isCurrent( context, component ))
{
// use default rendering
super.encodeChildren(context, component);
}
else
{
// render the text of the disabled/current link ourselves
String label = "";
Object value = ((UICommand) component).getValue();
if (value != null)
{
label = value.toString();
}
ResponseWriter writer = context.getResponseWriter();
writer.write(label);
}
}
示例4: setProperties
import javax.faces.component.UICommand; //导入依赖的package包/类
/**
* @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
*/
protected void setProperties(UIComponent component)
{
super.setProperties(component);
setActionProperty((UICommand)component, this.action);
setActionListenerProperty((UICommand)component, this.actionListener);
setStringProperty(component, "image", this.image);
setBooleanProperty(component, "showLink", this.showLink);
setStringProperty(component, "verticalAlign", this.verticalAlign);
setIntProperty(component, "padding", this.padding);
setStringProperty(component, "href", this.href);
setStringProperty(component, "value", this.value);
setStringProperty(component, "target", this.target);
setStringProperty(component, "onclick", this.onclick);
setBooleanProperty(component, "immediate", this.immediate);
// TODO: Add image width/height properties
}
示例5: rowEditedTest
import javax.faces.component.UICommand; //导入依赖的package包/类
@Test
public void rowEditedTest(){
SlotConnectionBean slotConnection = saveASlotConnection();
Slot slot2 = rackService.findSlotByRack( RACK_1, 2 );
slotConnection.setSlot( slot2 );
Behavior behaviour = new Behavior()
{
@Override
public void broadcast( BehaviorEvent arg0 )
{
}
};
RowEditEvent event = new RowEditEvent( new UICommand(), behaviour, slotConnection );
settopController.rowEdited( event );
settopSlotService.refresh();
SlotConnectionBean slotConnection1 = settopSlotService.getSlotConnection( "1" );
assertEquals( slot2, slotConnection1.getSlot() );
}
示例6: dayDetailsClicked
import javax.faces.component.UICommand; //导入依赖的package包/类
/**
* Action to drill down into the details for a day. Clicking
* on the day fires this off
*/
public void dayDetailsClicked(ActionEvent actionEvent) throws Exception {
UIComponent comp = actionEvent.getComponent();
UICommand link = (UICommand)comp;
Object value = link.getAttributes().get("day");
String date = (String)value;
AccrualReportWrapper existingDailyReport = dailyReportMap.get(date);
if(existingDailyReport.isReportEmpty()) {
AccrualReportWrapper dailyAccrualReport = constructDailyAccrualReport(date,
existingDailyReport.getSubmissionCount());
dailyAccrualReport.setExpanded(true);
dailyReportMap.put(date, dailyAccrualReport);
}
else {
existingDailyReport.setExpanded(!existingDailyReport.isExpanded());
}
}
示例7: bindCommand
import javax.faces.component.UICommand; //导入依赖的package包/类
public void bindCommand(final EmptyEventHandler handler) {
if (handler == null)
return;
((UICommand) component).addActionListener(new ActionListener() {
@Override
public void processAction(ActionEvent event)
throws AbortProcessingException {
handler.handle();
}
});
}
示例8: setProperties
import javax.faces.component.UICommand; //导入依赖的package包/类
/**
* @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
*/
protected void setProperties(UIComponent component)
{
super.setProperties(component);
setBooleanProperty(component, "showEllipses", this.showEllipses);
setActionProperty((UICommand)component, this.action);
setActionListenerProperty((UICommand)component, this.actionListener);
setIntProperty(component, "maxChildren", this.maxChildren);
setStringProperty(component, "separator", this.separator);
setStringBindingProperty(component, "value", this.value);
}
示例9: setProperties
import javax.faces.component.UICommand; //导入依赖的package包/类
/**
* @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
*/
protected void setProperties(UIComponent component)
{
super.setProperties(component);
setStringProperty(component, "value", this.value);
setActionListenerProperty((UICommand)component, this.actionListener);
}
示例10: setProperties
import javax.faces.component.UICommand; //导入依赖的package包/类
/**
* @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
*/
protected void setProperties(UIComponent component)
{
super.setProperties(component);
setActionProperty((UICommand)component, this.action);
setActionListenerProperty((UICommand)component, this.actionListener);
setBooleanProperty(component, "breadcrumb", this.breadcrumb);
setBooleanProperty(component, "disabled", this.disabled);
setBooleanProperty(component, "showLeaf", this.showLeaf);
setStringBindingProperty(component, "value", this.value);
}
示例11: setProperties
import javax.faces.component.UICommand; //导入依赖的package包/类
/**
* @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
*/
protected void setProperties(UIComponent component)
{
super.setProperties(component);
setActionProperty((UICommand)component, this.action);
setActionListenerProperty((UICommand)component, this.actionListener);
}
示例12: setProperties
import javax.faces.component.UICommand; //导入依赖的package包/类
/**
* @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
*/
protected void setProperties(UIComponent component)
{
super.setProperties(component);
setBooleanProperty(component, "showFilter", this.showFilter);
setBooleanProperty(component, "showContains", this.showContains);
setBooleanProperty(component, "showAddButton", this.showAddButton);
setBooleanProperty(component, "filterRefresh", this.filterRefresh);
setBooleanProperty(component, "multiSelect", this.multiSelect);
setStringProperty(component, "addButtonLabel", this.addButtonLabel);
setStringProperty(component, "searchButtonLabel", this.searchButtonLabel);
setActionProperty((UICommand)component, this.action);
setActionListenerProperty((UICommand)component, this.actionListener);
setIntProperty(component, "width", this.width);
setIntProperty(component, "height", this.height);
setStringBindingProperty(component, "filters", this.filters);
if (queryCallback != null)
{
if (isValueReference(queryCallback))
{
MethodBinding b = getFacesContext().getApplication().createMethodBinding(queryCallback, QUERYCALLBACK_CLASS_ARGS);
((UIGenericPicker)component).setQueryCallback(b);
}
else
{
throw new FacesException("Query Callback method binding incorrectly specified: " + queryCallback);
}
}
}
示例13: setProperties
import javax.faces.component.UICommand; //导入依赖的package包/类
/**
* @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
*/
protected void setProperties(UIComponent component)
{
super.setProperties(component);
setActionProperty((UICommand)component, this.action);
setActionListenerProperty((UICommand)component, this.actionListener);
setStringProperty(component, "labelStyle", this.labelStyle);
setStringProperty(component, "labelStyleClass", this.labelStyleClass);
setStringProperty(component, "itemStyle", this.itemStyle);
setStringProperty(component, "itemStyleClass", this.itemStyleClass);
setStringProperty(component, "disabledStyle", this.disabledStyle);
setStringProperty(component, "disabledStyleClass", this.disabledStyleClass);
setStringProperty(component, "itemLinkStyle", this.itemLinkStyle);
setStringProperty(component, "itemLinkStyleClass", this.itemLinkStyleClass);
setStringProperty(component, "selectedStyle", this.selectedStyle);
setStringProperty(component, "selectedStyleClass", this.selectedStyleClass);
setStringProperty(component, "selectedLinkStyle", this.selectedLinkStyle);
setStringProperty(component, "selectedLinkStyleClass", this.selectedLinkStyleClass);
setStringProperty(component, "selectedImage", this.selectedImage);
setIntProperty(component, "itemSpacing", this.itemSpacing);
setIntProperty(component, "iconColumnWidth", this.iconColumnWidth);
setIntProperty(component, "width", this.width);
setStringProperty(component, "menuImage", this.menuImage);
setBooleanProperty(component, "menu", this.menu);
setBooleanProperty(component, "horizontal", this.horizontal);
setBooleanProperty(component, "disabled", this.disabled);
setStringProperty(component, "label", this.label);
setStringProperty(component, "value", this.value);
}
示例14: setProperties
import javax.faces.component.UICommand; //导入依赖的package包/类
/**
* @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
*/
protected void setProperties(UIComponent component)
{
super.setProperties(component);
setActionProperty((UICommand)component, this.action);
setActionListenerProperty((UICommand)component, this.actionListener);
setStringProperty(component, "separator", this.separator);
setBooleanProperty(component, "showRoot", this.showRoot);
setBooleanProperty(component, "immediate", this.immediate);
setStringProperty(component, "value", this.value);
}
示例15: decode
import javax.faces.component.UICommand; //导入依赖的package包/类
public void decode(FacesContext facesContext, UIComponent component)
{
super.decode(facesContext, component); //check for NP
if (component instanceof UICommand)
{
String clientId = component.getClientId(facesContext);
FormInfo formInfo = findNestingForm(component, facesContext);
if (formInfo != null)
{
String reqValue = (String) facesContext.getExternalContext().getRequestParameterMap().get(
HtmlRendererUtils.getHiddenCommandLinkFieldName(formInfo));
if (reqValue != null && reqValue.equals(clientId)
|| HtmlRendererUtils.isPartialOrBehaviorSubmit(facesContext, clientId)) {
component.queueEvent(new ActionEvent(component));
RendererUtils.initPartialValidationAndModelUpdate(component, facesContext);
}
}
if (component instanceof ClientBehaviorHolder &&
!HtmlRendererUtils.isDisabled(component))
{
HtmlRendererUtils.decodeClientBehaviors(facesContext, component);
}
}
else if (component instanceof UIOutput)
{
//do nothing
if (component instanceof ClientBehaviorHolder &&
!HtmlRendererUtils.isDisabled(component))
{
HtmlRendererUtils.decodeClientBehaviors(facesContext, component);
}
}
else
{
throw new IllegalArgumentException("Unsupported component class " + component.getClass().getName());
}
}