Package net.xoetrope.xui

Examples of net.xoetrope.xui.XMethodReference


   * @throws java.lang.NoSuchMethodException
   *           The specified method does not exist in the class
   */
  public XMethodReference addHandler( Object comp, long eventType, String methodStr ) throws ClassNotFoundException, NoSuchMethodException
  {
    XMethodReference reference;
    String className, methodName;
    if ( methodStr == null )
      return null;

    if ( methodStr.startsWith( "${script." ) ) {
View Full Code Here


   * @see java.awt.event.ActionListener
   * @see java.awt.event.ActionEvent
   */
  public XMethodReference addHandler( Object srcObj, String methodName, String adderMethod, String listenerInterface, long eventMask, Object listener )
  {
    XMethodReference reference = null;
    addListener( srcObj, adderMethod, listenerInterface, listener );
    try {
      reference = addHandler( srcObj, eventMask, methodName );
    }
    catch ( Error error ) {
View Full Code Here

      if ( attEval == null ) {
        attEval = new XDefaultAttributeEvaluator( currentProject );
        attEval.setCurrentProject( currentProject );
        currentProject.setObject( "DefaultAttributeEvaluator", attEval );
      }
      XMethodReference methodRef = attEval.getMethodReference( (PageSupport)container, className + "." + methodName );
      return methodRef;
    }
    else if ( className.startsWith( "Script" ) ) {
      XMethodReference methodRef = null;
      try {
        XAttributeEvaluator attEval = (XAttributeEvaluator)currentProject.getObject( "ScriptAttributeEvaluator" );
        if ( attEval == null ) {
          attEval = (XAttributeEvaluator)XEventHandler.class.forName( "incubator.net.xoetrope.scripts.ScriptAttributeEvaluator" ).newInstance();
          attEval.setCurrentProject( currentProject );
          currentProject.setObject( "ScriptAttributeEvaluator", attEval );
        }
        methodRef = attEval.getMethodReference( methodName );
      }
      catch ( Throwable t ) {
      }
      return methodRef;
    }
    else {
      Method method = null;
      if ( clazz == null )
        clazz = Class.forName( className.trim());
     
      if ( methodName.endsWith( "}" ) )
        methodName = methodName.substring( 0, methodName.length() - 1 );
     
      if ( methodName.endsWith( "()" ) )
        methodName = methodName.substring( 0, methodName.length() - 2 );

      int pos;
      if ( ( pos = methodName.indexOf( "(" ) ) > 0 ) {
        String argValues = methodName.substring( pos + 1, methodName.indexOf( ')' ) );
        int numArgs = 1 + XuiUtilities.count( argValues, ',' );
        Object[] args = new Object[numArgs];
        Class[] params = new Class[numArgs];
        XuiUtilities.getArguments( argValues, params, args, ',' );

        methodName = methodName.substring( 0, pos );
        method = clazz.getMethod( methodName, params );
        return new XMethodReference( clazz, container, method, args );
      }
      else
        method = clazz.getMethod( methodName, (Class[])null );
      return new XMethodReference( clazz, container, method, null );
    }
  }
View Full Code Here

TOP

Related Classes of net.xoetrope.xui.XMethodReference

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.