Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.3 / 3....
  • LibreOffice 3.6.6 / 4.0.3
  • MPlayer 1.1.1
  • systemd 204
  • Arch Linux 2013.05.01
  • Blender 2.67
  • KDE Software Compilatio...
  • CrunchBang Linux Stable...
  • Elementary OS 0.1 / 0.2...
  • SystemRescueCd 3.6.0
  • Home > Linux > Internet > HTTP (WWW)

    Rhinohide 0.2.0 r2

    Download button

    No screenshots available
    Downloads: 398  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Michael Allan | More programs
    MIT/X Consortium Lic... / FREE
    June 16th, 2007, 00:35 GMT
    ROOT / Internet / HTTP (WWW)

     Read user reviews (0)  Refer to a friend  Subscribe

    Rhinohide description

    Rhinohide is a Java implementation of the W3C DOM, layered over a Web browser's native JavaScript.

    Rhinohide is a Java implementation of the W3C DOM, layered over a Web browser's native JavaScript.

    Rhinohide provides an interface for applets to manipulate their containing Web pages, using a standard Java binding of the DOM. The code is still in alpha, and coverage is incomplete, but at least partial support is provided for these DOM features:

    · Core level 3
    · XML
    · Events
    · Traversal
    · Range

    Requirements:

    · Java 1.5 or higher

    Use

    Details are in the API docs, and the demo code. What follows is a summary:

    In your Web page, there are two encoding requirements. One is to disable in-memory caching, by the browser. (Otherwise inconsistencies of state may occur between JavaScript and Java.)

    The second requirement is a mayscript attribute on the applet tag.

    The necessary JavaScript and HTML will look something like this, in your Web page:

    < script type='text/javascript' >
    if( window.addEventListener )
    {
    window.addEventListener ( 'unload', // to disable in-memory caching
    function( e ) {}, // do nothing
    /*capture phase*/false );
    }
    < /script >

    < applet alt='[applet: unsupported by this browser]'
    archive='rhinohideDemo.jar'
    code='textbender/a/b/rhinohideDemo/Test_12D_DOM2.class'
    MAYSCRIPT='true' width='550' height='90'>
    [applet: unsupported by this browser]
    < /applet >

    In your Java applet, your code is mostly ordinary DOM:
    private volatile RhiWindow window; // final after init

    private final AtomicBoolean isStartedA = new AtomicBoolean();

    public void start()
    {
    if( isStartedA.getAndSet( true )) return; // start once only

    try
    {
    window = RhiWindow.createWindow( /*applet*/this );
    final Document document = window.getDocument();

    // DOM level 2. see Test_12D_DOM2.java
    // ----------------------------------------------------------------------------
    assert document.getImplementation().hasFeature( "Core", "2.0" );

    Element element = getElementById( document, "parent-of-created" );
    Text text = document.createTextNode( "Hello world, from Java" );
    element.appendChild( text );

    // Events. see Test_22E_Events.java
    // ----------------------------------------------------------------------------
    assert document.isSupported( "Events", "2.0" );

    ((EventTarget)document).addEventListener( "mouseover", new RelaySIP()
    {
    public void handleEvent( Event e )
    {
    // do something
    }
    }, /*use capture*/false );

    // Traversal. see Test_32T_Traversal.java
    // ----------------------------------------------------------------------------
    assert document.isSupported( "Traversal", "2.0" );

    TreeWalker walker = ((DocumentTraversal)document).createTreeWalker
    (
    /*root*/document, NodeFilter.SHOW_ALL,
    /*filter*/null, /*expand entities*/false
    );

    // Range.
    // ----------------------------------------------------------------------------
    assert document.isSupported( "Range", "2.0" );

    Range myRange = ((DocumentRange)document).createRange();
    try // non-standard
    {
    Range userSelectedRange = window.getSelection().getRangeAt( 0 );
    }
    catch( RuntimeException x ) { assert false; }

    }
    catch( StupifiedRhinoException x ) // if the page exits in mid-initialization
    {
    Logger.getLogger( getClass().getPackage().getName() )
    .info( "page exit in progress? " + x );
    }
    }

    public void destroy()
    {
    if( window != null ) window.release();
    }

    Limitations:

    · Many methods are still marked ‘Not yet coded’, and will throw UnsupportedOperationException. (But they can often be implemented in-line, as described below.)
    · Testing is incomplete at this stage. And tests often fail, especially on slow machines and/or Windows platforms

    What's New in This Release:

    · Several bugs affecting Internet Explorer were fixed.
    · Remaining IE bugs were traced and documented.



    Product's homepage

      


    TAGS:

    Java implementation | W3C DOM | JavaScript library | Rhinohide | Java | implementation

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM