public UISWTInstance getUISWTInstance() {
   UISWTInstanceImpl impl = mainWindow.getUISWTInstanceImpl();
   if (impl == null) {
     Debug.out("No uiswtinstanceimpl");
   }
   return impl;
 }
  // @see com.aelitis.azureus.ui.UIFunctions#refreshLanguage()
  public void refreshLanguage() {
    try {
      mainWindow.setSelectedLanguageItem();

    } catch (Exception e) {
      Logger.log(new LogEvent(LOGID, "refreshLanguage", e));
    }
  }
 // @see com.aelitis.azureus.ui.UIFunctions#dispose(boolean, boolean)
 public boolean dispose(boolean for_restart, boolean close_already_in_progress) {
   try {
     return mainWindow.dispose(for_restart, close_already_in_progress);
   } catch (Exception e) {
     Logger.log(new LogEvent(LOGID, "Disposing MainWindow", e));
   }
   return false;
 }
  // @see com.aelitis.azureus.ui.swt.UIFunctionsSWT#getSWTPluginInstanceImpl()
  public UISWTInstanceImpl getSWTPluginInstanceImpl() {
    try {
      return mainWindow.getUISWTInstanceImpl();
    } catch (Exception e) {
      Logger.log(new LogEvent(LOGID, "getSWTPluginInstanceImpl", e));
    }

    return null;
  }
  public boolean viewURL(
      final String url,
      final String target,
      final double w,
      final double h,
      final boolean allowResize,
      final boolean isModal) {

    mainWindow
        .getShell()
        .getDisplay()
        .syncExec(
            new AERunnable() {
              public void runSupport() {
                String realURL = url;
                ContentNetwork cn = ContentNetworkUtils.getContentNetworkFromTarget(target);
                if (!realURL.startsWith("http")) {
                  if ("_blank".equals(target)) {
                    realURL = cn.getExternalSiteRelativeURL(realURL, false);
                  } else {
                    realURL = cn.getSiteRelativeURL(realURL, false);
                  }
                }
                if (target == null) {
                  if (UrlFilter.getInstance().urlCanRPC(realURL)) {
                    realURL = cn.appendURLSuffix(realURL, false, true);
                  }
                  BrowserWindow window =
                      new BrowserWindow(mainWindow.getShell(), realURL, w, h, allowResize, isModal);
                  window.waitUntilClosed();
                } else {
                  showURL(realURL, target);
                }
              }
            });
    return true;
  }
 // @see com.aelitis.azureus.ui.swt.UIFunctionsSWT#getMainStatusBar()
 public IMainStatusBar getMainStatusBar() {
   if (mainWindow == null) {
     return null;
   }
   return mainWindow.getMainStatusBar();
 }
 // @see com.aelitis.azureus.ui.swt.UIFunctionsSWT#getMainShell()
 public Shell getMainShell() {
   return mainWindow == null ? null : mainWindow.getShell();
 }
 public void setHideAll(boolean hidden) {
   mainWindow.setHideAll(hidden);
 }