Package org.eclipse.swt.browser

Examples of org.eclipse.swt.browser.BrowserFunction


        final String refreshURL = plugin.getFullURL(entryPageUri);

        /*
         * Register custom callback functions.
         */
        new BrowserFunction(browser, "swt_onGroupSelectionChanged")
        {
            public Object function(Object [] arguments)
            {
                if (!browserInitialized) return null;

                Object [] ids = (Object[]) arguments[0];
                int [] groupIds = new int [ids.length];
               
                for (int i = 0; i < groupIds.length; i++) {
                  groupIds[i] = (int) Double.parseDouble(ids[i].toString());
                }
                doGroupSelection(groupIds);
                return null;
            }
        };

        new BrowserFunction(browser, "swt_onModelChanged")
        {
            public Object function(Object [] arguments)
            {
                if (!browserInitialized) return null;
                selectionJob.reschedule(BROWSER_SELECTION_DELAY);
                return null;
            }
        };
       
        new BrowserFunction(browser, "swt_onVisualizationLoaded")
        {
            public Object function(Object [] arguments)
            {
                browserInitialized = true;
                onBrowserReady();

                ReloadXMLJob reloadXMLJob = new ReloadXMLJob("Browser loaded");
                reloadXMLJob.reschedule(500);
                return null;
            }
        };

        new BrowserFunction(browser, "swt_log")
        {
            public Object function(Object [] arguments)
            {
                logger.info("JS->SWT log: " + Arrays.toString(arguments));
                return null;
View Full Code Here


  private static class CMN_registerFunction extends ControlCommandMessage {
    @Override
    public Object run(Object[] args) {
      Browser browser = (Browser)getControl();
      String functionName = (String)args[0];
      BrowserFunction browserFunction = new BrowserFunction(browser, functionName) {
        @Override
        public Object function(Object[] arguments) {
          return new CMJ_invokeFunction().syncExec(getBrowser(), getName(), arguments);
        }
      };
View Full Code Here

  private static class CMN_unregisterFunction extends ControlCommandMessage {
    @Override
    public Object run(Object[] args) {
      Browser browser = (Browser)getControl();
      String key = "nsFunction_" + (String)args[0];
      BrowserFunction browserFunction = (BrowserFunction)browser.getData(key);
      browser.setData(key, null);
      browserFunction.dispose();
      return null;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.swt.browser.BrowserFunction

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.