Package org.eclipse.swt.browser

Examples of org.eclipse.swt.browser.ProgressAdapter


        final Display display = getShell().getDisplay();
        fBrowser.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
        fBrowser.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));

        fBrowser.addProgressListener(new ProgressAdapter() {
            @Override
            public void completed(final ProgressEvent event) {
                fCompleted = true;
            }
        });
View Full Code Here


    GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
    toolbar.setLayoutData(gridData);

    browser = ApplicationFactory.createBrowser(browserComposite, PageMenu.class);
    if(ApplicationFactory.isMozillaBrowser()) {
      browser.addProgressListener (new ProgressAdapter () {
        @SuppressWarnings("unused")
        public void completed (ProgressEvent event) {
          nsIWebBrowser webBrowser = (nsIWebBrowser)browser.getWebBrowser ();
          if(webBrowser == null) return;
          nsIDOMWindow domWindow = webBrowser.getContentDOMWindow ();
          if(domWindow == null) return;
          nsIDOMEventTarget target = (nsIDOMEventTarget)domWindow.queryInterface (nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID);
          nsIDOMEventListener listener = new nsIDOMEventListener () {
            public nsISupports queryInterface (String uuid) {
              if (uuid.equals (nsIDOMEventListener.NS_IDOMEVENTLISTENER_IID) ||
                  uuid.equals (nsIDOMEventListener.NS_ISUPPORTS_IID)) {
                return this;
              }
              return null;
            }
            public void handleEvent (nsIDOMEvent devent) {
              nsIDOMElement element = (nsIDOMElement)devent.getTarget().queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
              String text =  element.getFirstChild().getNodeValue();
              if(text == null || text.trim().isEmpty() || "null".equalsIgnoreCase(text)) return;
              search(text.trim());
            }
          };
          target.addEventListener ("click", listener, false);
        }
      });
    }

    gridData = new GridData(GridData.FILL_BOTH);
    browser.setLayoutData(gridData);
    browser.addProgressListener(new ProgressAdapter(){   
      public void changed(ProgressEvent event){      
        if(event.total == 0) return;       
        int ratio = event.current * 100 / event.total;
        toolbar.getProgressBar().setSelection(ratio);
        browserBusy = event.current != event.total;
View Full Code Here

        File file = new File(xulPath);
        System.setProperty("org.eclipse.swt.browser.XULRunnerPath", file.getAbsolutePath());
        mozilla = true;
        final Browser browser = new Browser(parent, SWT.MOZILLA | SWT.BORDER);
        if(clazz == null) return browser;
        browser.addProgressListener (new ProgressAdapter () {
          @SuppressWarnings("unused")
          public void completed (ProgressEvent event) {
            nsIWebBrowser webBrowser = (nsIWebBrowser)browser.getWebBrowser ();
            nsIDOMWindow domWindow = webBrowser.getContentDOMWindow ();
            nsIDOMEventTarget target = (nsIDOMEventTarget)domWindow.queryInterface (nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID);
View Full Code Here

      }

      public void keyReleased(KeyEvent e) {}
    });

        fBrowser.addProgressListener(new ProgressAdapter() {
            public void completed(ProgressEvent event) {
              fCompleted= true;
            }
        });
       
View Full Code Here

    Display display= getShell().getDisplay();
    fBrowser.setForeground(display.getSystemColor(SWT.COLOR_INFO_FOREGROUND));
    fBrowser.setBackground(display.getSystemColor(SWT.COLOR_INFO_BACKGROUND));

    fBrowser.addProgressListener(new ProgressAdapter() {
      public void completed(ProgressEvent event) {
        fCompleted= true;
      }
    });
View Full Code Here

TOP

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

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.