/** * Disposes of the resources associated with this BrowserFunction. * Applications must dispose of all BrowserFunctions that they create. * </p><p> * Note that disposing a Browser automatically disposes all * BrowserFunctions associated with it. * </p> */ public void dispose () { dispose (true); }
@Override public boolean isDisposed() { return( swt_bf.isDisposed()); }
void destroyFunction( BrowserFunction function ) { functions.remove( function ); updateBrowserFunctions( function.getName(), false ); }
void createFunction( BrowserFunction function ) { boolean removed = false; for( int i = 0; !removed && i < functions.size(); i++ ) { BrowserFunction current = functions.get( i ); if( current.name.equals( function.name ) ) { functions.remove( current ); removed = true; } } functions.add( function ); if( !removed ) { updateBrowserFunctions( function.getName(), true ); } }
/** * Disposes of the resources associated with this BrowserFunction. * Applications must dispose of all BrowserFunctions that they create. * </p><p> * Note that disposing a Browser automatically disposes all * BrowserFunctions associated with it. * </p> */ public void dispose () { dispose (true); }
private static void executeFunction( Browser browser, BrowserFunction function, Object[] arguments ) { try { JsonValue result = javaToJson( function.function( arguments ) ); setExecutedFunctionResult( browser, result ); } catch( Exception exception ) { setExecutedFunctionError( browser, exception.getMessage() ); } setExecutedFunctionName( browser, function.getName() ); }
private static BrowserFunction findBrowserFunction( Browser browser, String name ) { BrowserFunction[] functions = getAdapter( browser ).getBrowserFunctions(); for( BrowserFunction function : functions ) { if( function.getName().equals( name ) ) { return function; } } return null; }
/** * Disposes of the resources associated with this BrowserFunction. * Applications must dispose of all BrowserFunctions that they create. * </p><p> * Note that disposing a Browser automatically disposes all * BrowserFunctions associated with it. * </p> */ public void dispose () { dispose (true); }
private void executeFunction( final Browser browser ) { String function = WidgetLCAUtil.readPropertyValue( browser, PARAM_EXECUTE_FUNCTION ); String arguments = WidgetLCAUtil.readPropertyValue( browser, PARAM_EXECUTE_ARGUMENTS ); if( function != null ) { IBrowserAdapter adapter = getAdapter( browser ); BrowserFunction[] functions = adapter.getBrowserFunctions(); boolean found = false; for( int i = 0; i < functions.length && !found; i++ ) { final BrowserFunction current = functions[ i ]; if( current.getName().equals( function ) ) { final Object[] args = parseArguments( arguments ); ProcessActionRunner.add( new Runnable() { public void run() { try { Object executedFunctionResult = current.function( args ); setExecutedFunctionResult( browser, executedFunctionResult ); } catch( Exception e ) { setExecutedFunctionError( browser, e.getMessage() ); } setExecutedFunctionName( browser, current.getName() ); } } ); found = true; } } } }
@Override public void dispose() { swt_bf.dispose(); } }
/** * Disposes of the resources associated with this BrowserFunction. * Applications must dispose of all BrowserFunctions that they create. * </p><p> * Note that disposing a Browser automatically disposes all * BrowserFunctions associated with it. * </p> */ public void dispose() { dispose( true ); }
/** * Disposes of the resources associated with this BrowserFunction. * Applications must dispose of all BrowserFunctions that they create. * </p><p> * Note that disposing a Browser automatically disposes all * BrowserFunctions associated with it. * </p> */ public void dispose () { dispose (true); }