Exemplo n.º 1
0
 public void executeJavascript(String strJavascript) {
   // synchronized (Application.getEventLock())
   {
     BrowserField field = (BrowserField) m_oMainScreen.getField(0);
     field.executeScript("javascript:" + strJavascript);
   }
 }
Exemplo n.º 2
0
  private void createBrowserField() {
    LOG.INFO("Use BrowserField5");
    m_oBrowserField = new BrowserField(m_oConfig);
    m_oBrowserField
        .getRenderingOptions()
        .setProperty(RenderingOptions.CORE_OPTIONS_GUID, RenderingOptions.ALLOW_POPUPS, true);
    m_oController = new RhoProtocolController(m_oBrowserField);
    m_oConfig.setProperty(BrowserFieldConfig.CONTROLLER, m_oController);

    BrowserFieldListener _listener =
        new BrowserFieldListener() {
          public void documentLoaded(BrowserField browserField, org.w3c.dom.Document document)
              throws Exception {
            synchronized (Application.getEventLock()) {
              m_oMainScreen.deleteAll();
              m_oMainScreen.add(m_oBrowserField);
            }
          }
          /*
          public void downloadProgress(BrowserField browserField,
          	 net.rim.device.api.browser.field.ContentReadEvent event)throws Exception
          {
             //Add your code here.
          }*/
        };
    m_oBrowserField.addListener(_listener);
  }
Exemplo n.º 3
0
  public void processConnection(HttpConnection connection, Object e) {
    try {
      if (connection.getResponseCode() == HttpConnection.HTTP_NOT_MODIFIED) return;
    } catch (java.io.IOException exc) {
      LOG.ERROR("processConnection - getResponseCode failed.", exc);
    }

    synchronized (Application.getEventLock()) {
      createBrowserField();
      m_oBrowserField.displayContent(connection, (e != null ? (String) e : ""));
    }
  }