本文整理汇总了Java中javax.faces.el.MethodBinding类的典型用法代码示例。如果您正苦于以下问题:Java MethodBinding类的具体用法?Java MethodBinding怎么用?Java MethodBinding使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MethodBinding类属于javax.faces.el包,在下文中一共展示了MethodBinding类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setAction
import javax.faces.el.MethodBinding; //导入依赖的package包/类
public void setAction(MethodBinding binding)
{
if (binding instanceof MethodExpressionMethodBinding)
setActionExpression(((MethodExpressionMethodBinding) binding).getMethodExpression());
else
setActionExpression(new MethodBindingMethodExpression(binding));
}
示例2: getPanel
import javax.faces.el.MethodBinding; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public CorePanelBox getPanel()
{
if (_panel == null)
{
FacesContext context = FacesContext.getCurrentInstance();
_panel = new CorePanelBox();
CoreCommandLink link = new CoreCommandLink();
link.setText("Dynamic Link");
MethodBinding actionListenerMethod = context.getApplication().
createMethodBinding("#{dynamic.doSomething}",
new Class[]{ActionEvent.class});
link.setActionListener(actionListenerMethod);
link.setId("TheLinkId");
_panel.getChildren().add(link);
}
return _panel;
}
示例3: broadcast
import javax.faces.el.MethodBinding; //导入依赖的package包/类
@Override
public void broadcast(FacesEvent event) throws AbortProcessingException
{
super.broadcast(event);
// Notify the specified action listener method (if any),
// and the default action listener
if (event instanceof ActionEvent)
{
FacesContext context = getFacesContext();
MethodBinding mb = getActionListener();
if (mb != null)
mb.invoke(context, new Object[] { event });
ActionListener defaultActionListener =
context.getApplication().getActionListener();
if (defaultActionListener != null)
{
defaultActionListener.processAction((ActionEvent) event);
}
}
}
示例4: setAction
import javax.faces.el.MethodBinding; //导入依赖的package包/类
public static void setAction(UIComponent component,
String attributeValue)
{
if (attributeValue == null)
{
return;
}
if (UIComponentTag.isValueReference(attributeValue))
{
setMethodBinding(component, "action", attributeValue,
new Class[]
{});
}
else
{
FacesContext context = FacesContext.getCurrentInstance();
Application app = context.getApplication();
MethodBinding mb = new ActionMethodBinding(attributeValue);
component.getAttributes().put("action", mb);
}
}
示例5: setMethodBinding
import javax.faces.el.MethodBinding; //导入依赖的package包/类
public static void setMethodBinding(UIComponent component,
String attributeName,
String attributeValue, Class[] paramTypes)
{
if (attributeValue == null)
{
return;
}
if (UIComponentTag.isValueReference(attributeValue))
{
FacesContext context = FacesContext.getCurrentInstance();
Application app = context.getApplication();
MethodBinding mb = app.createMethodBinding(attributeValue,
paramTypes);
component.getAttributes().put(attributeName, mb);
}
}
示例6: setAction
import javax.faces.el.MethodBinding; //导入依赖的package包/类
/**
* Set an action on a component - used by tags setProperties() method.
* Handles method bindings.
*/
public static void setAction(UIComponent component, String value)
{
if (value == null)
{
return;
}
if (UIComponentTag.isValueReference(value))
{
setMethodBinding(component, "action", value, new Class[] {});
} else
{
FacesContext context = FacesContext.getCurrentInstance();
Application app = context.getApplication();
MethodBinding mb = new ActionMethodBinding(value);
component.getAttributes().put("action", mb);
}
}
示例7: setMethodBinding
import javax.faces.el.MethodBinding; //导入依赖的package包/类
/**
* Set a MethodBinding on a component - used by tags setProperties() method.
*/
public static void setMethodBinding(UIComponent component, String name, String value,
Class[] paramTypes)
{
if (value == null)
{
return;
}
if (UIComponentTag.isValueReference(value))
{
FacesContext context = FacesContext.getCurrentInstance();
Application app = context.getApplication();
MethodBinding mb = app.createMethodBinding(value, paramTypes);
component.getAttributes().put(name, mb);
}
}
示例8: setAction
import javax.faces.el.MethodBinding; //导入依赖的package包/类
public static void setAction(UIComponent component,
String attributeValue)
{
if (attributeValue == null)
{
return;
}
if (UIComponentTag.isValueReference(attributeValue))
{
setMethodBinding(component, "action", attributeValue,
new Class[]
{});
}
else
{
//FacesContext context = FacesContext.getCurrentInstance();
//Application app = context.getApplication();
MethodBinding mb = new ActionMethodBinding(attributeValue);
component.getAttributes().put("action", mb);
}
}
示例9: setMethodBinding
import javax.faces.el.MethodBinding; //导入依赖的package包/类
public static void setMethodBinding(UIComponent component,
String attributeName, String attributeValue, Class[] paramTypes) {
if (attributeValue == null)
return;
if (UIComponentTag.isValueReference(attributeValue)) {
FacesContext context = FacesContext.getCurrentInstance();
Application app = context.getApplication();
MethodBinding mb = app.createMethodBinding(attributeValue, paramTypes);
component.getAttributes().put(attributeName, mb);
}
}
示例10: setAction
import javax.faces.el.MethodBinding; //导入依赖的package包/类
/**
* Set an action on a component - used by tags setProperties() method.
* Handles method bindings.
*/
public static void setAction(UIComponent component, String value)
{
if (value == null)
{
return;
}
if (UIComponentTag.isValueReference(value))
{
setMethodBinding(component, "action", value, new Class[] {});
} else
{
MethodBinding mb = new ActionMethodBinding(value);
component.getAttributes().put("action", mb);
}
}
示例11: openView
import javax.faces.el.MethodBinding; //导入依赖的package包/类
public Container openView(final FacesContext context) throws IOException {
MethodBinding queryOpenView = getQueryOpenView();
if (queryOpenView != null && FacesUtil.isCancelled(queryOpenView.invoke(context, null))) {
return null;
}
ModelManager<?> manager = ModelUtils.findModelManager(context, managerName_);
Object listObject = manager.getValue(key_);
if(listObject == null) {
throw new IOException("Received null value when retrieving list object from manager using key '" + key_ + "'");
}
if(!(listObject instanceof AbstractModelList)) {
throw new IOException("Retrieved non-model-list object from manager using key '" + key_ + "'");
}
Container container = new Container(getBeanId(), getUniqueId(), (AbstractModelList<?>)listObject);
MethodBinding postOpenView = getPostOpenView();
if(postOpenView != null) {
postOpenView.invoke(context, null);
}
return container;
}
示例12: setProperties
import javax.faces.el.MethodBinding; //导入依赖的package包/类
/**
* @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
*/
protected void setProperties(UIComponent component)
{
super.setProperties(component);
setStringBindingProperty(component, "collections", this.collections);
if (isValueReference(this.pasteActionListener))
{
MethodBinding vb = getFacesContext().getApplication().createMethodBinding(this.pasteActionListener, ACTION_CLASS_ARGS);
((UIClipboardShelfItem)component).setPasteActionListener(vb);
}
else
{
throw new FacesException("Paste Action listener method binding incorrectly specified: " + this.pasteActionListener);
}
}
示例13: setProperties
import javax.faces.el.MethodBinding; //导入依赖的package包/类
/**
* @see javax.faces.webapp.UIComponentTag#setProperties(javax.faces.component.UIComponent)
*/
protected void setProperties(UIComponent component)
{
super.setProperties(component);
setStringProperty(component, "groupPanel", this.groupPanel);
setStringProperty(component, "groupBgcolor", this.groupBgcolor);
setStringProperty(component, "selectedGroupPanel", this.selectedGroupPanel);
setStringProperty(component, "selectedGroupBgcolor", this.selectedGroupBgcolor);
setStringProperty(component, "innerGroupPanel", this.innerGroupPanel);
setStringProperty(component, "innerGroupBgcolor", this.innerGroupBgcolor);
if (this.groupExpandedActionListener != null)
{
if (isValueReference(this.groupExpandedActionListener))
{
MethodBinding vb = getFacesContext().getApplication().createMethodBinding(this.groupExpandedActionListener, ACTION_CLASS_ARGS);
((UIShelf)component).setGroupExpandedActionListener(vb);
}
else
{
throw new FacesException("Shelf Group Expanded Action listener method binding incorrectly specified: " + this.groupExpandedActionListener);
}
}
}
示例14: restoreState
import javax.faces.el.MethodBinding; //导入依赖的package包/类
/**
* @see javax.faces.component.StateHolder#restoreState(javax.faces.context.FacesContext, java.lang.Object)
*/
public void restoreState(FacesContext context, Object state)
{
Object values[] = (Object[])state;
// standard component attributes are restored by the super class
super.restoreState(context, values[0]);
setExpanded( ((Boolean)values[1]).booleanValue() );
this.progressive = (Boolean)values[2];
this.border = (String)values[3];
this.bgcolor = (String)values[4];
this.label = (String)values[5];
this.titleBgcolor = (String)values[6];
this.titleBorder = (String)values[7];
this.expandedTitleBorder = (String)values[8];
this.expandedActionListener = (MethodBinding)restoreAttachedState(context, values[9]);
this.facetsId = (String)values[10];
}
示例15: processActionMethod
import javax.faces.el.MethodBinding; //导入依赖的package包/类
/**
* Invoke the method encapsulated by the supplied MethodBinding
*
* @param context FacesContext
* @param method MethodBinding to invoke
* @param event ActionEvent to pass to the method of signature:
* public void myMethodName(ActionEvent event)
*/
public static void processActionMethod(FacesContext context, MethodBinding method, ActionEvent event)
{
try
{
method.invoke(context, new Object[] {event});
}
catch (EvaluationException e)
{
Throwable cause = e.getCause();
if (cause instanceof AbortProcessingException)
{
throw (AbortProcessingException)cause;
}
else
{
throw e;
}
}
}