Package org.eclipse.swt.browser

Examples of org.eclipse.swt.browser.Browser


    }
  };

  @Override
  public void createPartControl(Composite parent) {
    _browser = new Browser(parent, SWT.NONE);
    Bundle plugin = WGADesignerPlugin.getDefault().getBundle();
    IPath relativePagePath = new Path("resources/html/gettingStarted/step1.1.html");
    URL fileInPlugin = FileLocator.find(plugin, relativePagePath, null);
    if (fileInPlugin != null) {
      try {
View Full Code Here


    this(parentShell, -1, -1);
  }

  @Override
  protected void createContent(Composite parent) {   
    _browser = new Browser(parent, SWT.BORDER)
    _browser.addKeyListener(this);
  }
View Full Code Here

    tp.run(runnable);
  }
 
  public static Browser createSafeBrowser(Composite parent, int style) {
    try {
      Browser browser = new Browser(parent, Utils.getInitialBrowserStyle(style));
      browser.addDisposeListener(new DisposeListener() {
        public void widgetDisposed(DisposeEvent e) {
          ((Browser)e.widget).setUrl("about:blank");
          ((Browser)e.widget).setVisible(false);
          while (!e.display.isDisposed() && e.display.readAndDispatch());
        }
View Full Code Here

  }

  public void _setWhatsNew() {

    if (sWhatsNew.indexOf("<html") >= 0 || sWhatsNew.indexOf("<HTML") >= 0) {
      Browser browser = Utils.createSafeBrowser(cWhatsNew, SWT.NONE);
      if (browser != null) { 
        browser.setText(sWhatsNew);
      } else {
        try {
          File tempFile = File.createTempFile("AZU", ".html");
          tempFile.deleteOnExit();
          FileUtil.writeBytesAsFile(tempFile.getAbsolutePath(),
View Full Code Here

        }

        SWTSkin skin = SWTSkinFactory.getInstance();
        SWTSkinObject skinObject = skin.getSkinObject(browserID);
        if (skinObject instanceof SWTSkinObjectBrowser) {
          final Browser browser = ((SWTSkinObjectBrowser) skinObject).getBrowser();
          if (null != browser && false == browser.isDisposed()) {
            browser.refresh();
          }
        }
      }
    });
  }
View Full Code Here

    if (browser != null && !browser.isDisposed()) {
      return;
    }

    try {
      browser = new Browser(cArea, Utils.getInitialBrowserStyle(SWT.NONE));

      browser.setLayoutData(Utils.getFilledFormData());
      browser.getParent().layout(true);
    } catch (SWTError e) {
      System.err.println("Browser: " + e.toString());
View Full Code Here

  public void addLinkHandler(String commandId, ILinkHandler handler) {
    fLinkHandler.put(commandId, handler);
  }

  private Browser createBrowser(Composite parent, int style) {
    Browser browser = null;

    /* Try Mozilla over IE on Windows */
    if (Application.IS_WINDOWS && fgMozillaAvailable) {
      try {
        browser = new Browser(parent, style | SWT.MOZILLA);
      } catch (SWTError e) {
        fgMozillaAvailable = false;
        Activator.getDefault().getLog().log(Activator.getDefault().createInfoStatus(e.getMessage(), null));
      }
    }

    /* Any other OS, or Mozilla unavailable, use default */
    if (browser == null)
      browser = new Browser(parent, style);

    /* Add Focusless Scroll Hook on Windows */
    if (Application.IS_WINDOWS)
      browser.setData(ApplicationWorkbenchWindowAdvisor.FOCUSLESS_SCROLL_HOOK, true);

    /* Clear all Link Handlers upon disposal */
    browser.addDisposeListener(new DisposeListener() {
      public void widgetDisposed(DisposeEvent e) {
        fLinkHandler.clear();
      }
    });

View Full Code Here

  public void addLinkHandler(String commandId, ILinkHandler handler) {
    fLinkHandler.put(commandId, handler);
  }

  private Browser createBrowser(Composite parent, int style) {
    Browser browser = null;

    /* Try Mozilla over IE on Windows */
    if (Application.IS_WINDOWS && fgMozillaAvailable) {
      try {
        browser = new Browser(parent, style | SWT.MOZILLA);
      } catch (SWTError e) {
        fgMozillaAvailable = false;
        Activator.getDefault().getLog().log(Activator.getDefault().createErrorStatus(e.getMessage(), null));
      }
    }

    /* Any other OS, or Mozilla unavailable, use default */
    if (browser == null)
      browser = new Browser(parent, style);

    /* Add Focusless Scroll Hook on Windows */
    if (Application.IS_WINDOWS)
      browser.setData(ApplicationWorkbenchWindowAdvisor.FOCUSLESS_SCROLL_HOOK, true);

    /* Clear all Link Handlers upon disposal */
    browser.addDisposeListener(new DisposeListener() {
      public void widgetDisposed(DisposeEvent e) {
        fLinkHandler.clear();
      }
    });

View Full Code Here

  public void addLinkHandler(String commandId, ILinkHandler handler) {
    fLinkHandler.put(commandId, handler);
  }

  private Browser createBrowser(Composite parent, int style) {
    Browser browser = null;

    /* Properly configure Proxy for Firefox/XULRunner if required */
    if (Application.IS_LINUX || (useMozilla())) {
      String proxyHost = fEclipsePreferences.getString(DefaultPreferences.ECLIPSE_PROXY_HOST);
      String proxyPort = fEclipsePreferences.getString(DefaultPreferences.ECLIPSE_PROXY_PORT);
      if (useProxy() && StringUtils.isSet(proxyHost) && StringUtils.isSet(proxyPort)) {
        System.setProperty(XULRUNNER_PROXY_HOST, proxyHost);
        System.setProperty(XULRUNNER_PROXY_PORT, proxyPort);
      } else {
        System.setProperty(XULRUNNER_PROXY_HOST, ""); //$NON-NLS-1$
        System.setProperty(XULRUNNER_PROXY_PORT, ""); //$NON-NLS-1$
      }
    }

    /* Try Mozilla over IE on Windows */
    if (useMozilla()) {
      try {
        browser = new Browser(parent, style | SWT.MOZILLA);
        fgMozillaRunningOnWindows = true;
      } catch (SWTError e) {
        fgMozillaAvailable = false;

        if (!"No more handles [Could not detect registered XULRunner to use]".equals(e.getMessage())) //This happens too often to log it //$NON-NLS-1$
          Activator.getDefault().getLog().log(Activator.getDefault().createInfoStatus(e.getMessage(), null));
      }
    }

    /* Any other OS, or Mozilla unavailable, use default */
    if (browser == null)
      browser = new Browser(parent, style);

    /* Add Focusless Scroll Hook on Windows */
    if (Application.IS_WINDOWS)
      browser.setData(ApplicationWorkbenchWindowAdvisor.FOCUSLESS_SCROLL_HOOK, true);

    /* Disable IE Navigation Sound (Windows Only) */
    Method method = null;
    if (!fgNavigationSoundsDisabled) {
      method = callCoInternetSetFeatureEnabled(method, FEATURE_DISABLE_NAVIGATION_SOUNDS, SET_FEATURE_ON_PROCESS, true);
      fgNavigationSoundsDisabled = true;
    }

    /* Set Popupblocker if necessary */
    if (Application.IS_WINDOWS) {
      boolean prefEnablePopupBlocker = fPreferences.getBoolean(DefaultPreferences.ENABLE_IE_POPUP_BLOCKER);
      if (prefEnablePopupBlocker != fgPopupBlockerEnabled) {
        method = callCoInternetSetFeatureEnabled(method, FEATURE_WEBOC_POPUPMANAGEMENT, SET_FEATURE_ON_PROCESS, prefEnablePopupBlocker);
        callCoInternetSetFeatureEnabled(method, FEATURE_SECURITYBAND, SET_FEATURE_ON_PROCESS, prefEnablePopupBlocker);
        fgPopupBlockerEnabled = prefEnablePopupBlocker;
      }
    }

    /* Clear all Link Handlers upon disposal */
    browser.addDisposeListener(new DisposeListener() {
      public void widgetDisposed(DisposeEvent e) {
        fLinkHandler.clear();
      }
    });

View Full Code Here

        /* Special handle external Browser */
        if (useExternalBrowser()) {

          /* Avoid IE being loaded from SWT on Windows */
          final Browser tempBrowser = new Browser(fBrowser.getShell(), useMozilla() ? SWT.MOZILLA : SWT.NONE);
          tempBrowser.setVisible(false);
          event.browser = tempBrowser;
          tempBrowser.getDisplay().timerExec(BROWSER_URL_DELAY, new Runnable() {
            public void run() {
              if (!tempBrowser.isDisposed() && PlatformUI.isWorkbenchRunning()) {
                String url = tempBrowser.getUrl();
                tempBrowser.dispose();
                if (StringUtils.isSet(url))
                  BrowserUtils.openLinkExternal(URIUtils.toUnManaged(url));
              }
            }
          });

          return;
        }

        /* Open internal Browser in a new Tab */
        if (fEclipsePreferences.getBoolean(DefaultPreferences.ECLIPSE_MULTIPLE_TABS)) {
          WebBrowserView browserView = BrowserUtils.openLinkInternal(null, WebBrowserContext.createFrom(Messages.CBrowser_LOADING));
          if (browserView != null)
            event.browser = browserView.getBrowser().getControl();
        }

        /* Open internal Browser in same Browser */
        else {
          final Browser tempBrowser = new Browser(fBrowser.getShell(), useMozilla() ? SWT.MOZILLA : SWT.NONE);
          tempBrowser.setVisible(false);
          event.browser = tempBrowser;
          tempBrowser.getDisplay().timerExec(BROWSER_URL_DELAY, new Runnable() {
            public void run() {
              if (!tempBrowser.isDisposed() && PlatformUI.isWorkbenchRunning()) {
                String url = tempBrowser.getUrl();
                tempBrowser.dispose();
                if (StringUtils.isSet(url))
                  setUrl(url);
              }
            }
          });
View Full Code Here

TOP

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

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.