Package net.xoetrope.xui

Examples of net.xoetrope.xui.XMethodReference


        Class clazz = scriptEngine.getClass();

        // Find and invoke the method
        Method theMethod = clazz.getMethod( methodName, params );

        return new XMethodReference( clazz, scriptEngine, theMethod, args );
      }
    }
    catch ( Exception ex ) {
      if ( BuildProperties.DEBUG )
        DebugLogger.logWarning( "Unable to evaluate script: " + attributeValue );
View Full Code Here


    result = resultStr;
    try {
      int startPos = resultStr.indexOf( "${" );
      int len = resultStr.length();
      while ( startPos >= 0 ) {
        XMethodReference methodRef = getMethodReference( provider, resultStr );
        if ( methodRef == null ) {
          DebugLogger.logWarning( "Unable to evaluate attribute with the method call(?): " + result );
          return result;
        }
        int endPos = XuiUtilities.indexOfMatchingEnding( resultStr, '{', '}', startPos + 2 );
View Full Code Here

          classInstance = instance;
        }

        // Find and invoke the method
        Method theMethod = clazz.getMethod( methodName, params );
        return new XMethodReference ( clazz, classInstance, theMethod, args );
      }
    }
    catch ( Exception ex ) {
      if ( BuildProperties.DEBUG )
        DebugLogger.logWarning( "Unable to evaluate attribute with the method call(?): " + attributeValue );
View Full Code Here

    try {
      currentEvt = evt;
      if ( xValidationHandler.validationHandler( this ) > XValidator.LEVEL_WARNING )
        return;
      // Then call any other event handler
      XMethodReference reference = (XMethodReference)handlers.get( new Long( eventType * evt.getSource().hashCode() ) );
      Method m = reference.method;
      try {
        if ( ( m != null ) && ( m.getName().compareTo( "validationHandler" ) != 0 ) )
          m.invoke( container, (Object[])null );
      }
View Full Code Here

   * @param src
   *          the event source object
   */
  public Method findEvent( Object src, long eventType )
  {
    XMethodReference reference = (XMethodReference)handlers.get( new Long( eventType * src.hashCode() ) );
    return reference.method;
  }
View Full Code Here

   * @param methodStr
   *          the method to be invoked in response to the object
   */
  public XMethodReference addHandler( Object comp, long eventType, String methodStr ) throws ClassNotFoundException, NoSuchMethodException
  {
    XMethodReference reference;
    String className, methodName;
    int pos = methodStr.lastIndexOf( "." );
    if ( pos < 0 ) {
      methodName = methodStr;
      className = null;
View Full Code Here

   * @see org.eclipse.swt.events.ActionListener
   * @see org.eclipse.swt.events.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

      currentEvt = evt;
      if ( xValidationHandler.validationHandler( this ) > XValidator.LEVEL_WARNING )
        return;

      // Then call any other event handler
      XMethodReference reference = (XMethodReference)handlers.get( new Long( eventType * evt.getSource().hashCode() ) );
      if ( reference == null )
        return;

      Method m = reference.method;
      try {
View Full Code Here

   * @param evt
   *          the event object
   */
  public Method findEvent( Object src, long eventType )
  {
    XMethodReference reference = (XMethodReference)handlers.get( new Long( eventType * src.hashCode() ) );
    return reference.method;
  }
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.