public UIToolBarManager getToolBarManager() {
   Object tb = SkinViewManager.getByClass(ToolBarView.class);
   if (tb instanceof UIToolBarManager) {
     return (UIToolBarManager) tb;
   }
   return null;
 }
  public void doSearch(String sSearchText, boolean toSubscribe) {
    if (sSearchText.length() == 0) {
      return;
    }

    if (checkForSpecialSearchTerm(sSearchText)) {

      return;
    }

    SearchResultsTabArea.SearchQuery sq =
        new SearchResultsTabArea.SearchQuery(sSearchText, toSubscribe);

    MultipleDocumentInterface mdi = UIFunctionsManager.getUIFunctions().getMDI();
    String id = MultipleDocumentInterface.SIDEBAR_SECTION_SEARCH;
    MdiEntry existingEntry = mdi.getEntry(id);
    if (existingEntry != null && existingEntry.isAdded()) {
      SearchResultsTabArea searchClass =
          (SearchResultsTabArea) SkinViewManager.getByClass(SearchResultsTabArea.class);
      if (searchClass != null) {
        searchClass.anotherSearch(sSearchText, toSubscribe);
      }
      mdi.showEntry(existingEntry);
      return;
    }

    final MdiEntry entry =
        mdi.createEntryFromSkinRef(
            MultipleDocumentInterface.SIDEBAR_HEADER_DISCOVERY,
            id,
            "main.area.searchresultstab",
            sSearchText,
            null,
            sq,
            true,
            MultipleDocumentInterface.SIDEBAR_POS_FIRST);
    if (entry != null) {
      entry.setImageLeftID("image.sidebar.search");
      entry.setDatasource(sq);
      entry.setViewTitleInfo(
          new ViewTitleInfo() {
            public Object getTitleInfoProperty(int propertyID) {
              if (propertyID == TITLE_TEXT) {
                SearchResultsTabArea searchClass =
                    (SearchResultsTabArea) SkinViewManager.getByClass(SearchResultsTabArea.class);
                if (searchClass != null && searchClass.sq != null) {
                  return searchClass.sq.term;
                }
              }
              return null;
            }
          });
    }
    mdi.showEntryByID(id);
  }
  // @see com.aelitis.azureus.ui.UIFunctions#refreshIconBar()
  public void refreshIconBar() {
    try {
      SkinView[] tbSkinViews = SkinViewManager.getMultiByClass(ToolBarView.class);
      if (tbSkinViews != null) {
        for (SkinView skinview : tbSkinViews) {
          if (skinview instanceof ToolBarView) {
            ToolBarView tb = (ToolBarView) skinview;
            if (tb.isVisible()) {
              tb.refreshCoreToolBarItems();
            }
          }
        }
      }

    } catch (Exception e) {
      Logger.log(new LogEvent(LOGID, "refreshIconBar", e));
    }
  }
 public MultipleDocumentInterfaceSWT getMDISWT() {
   return (MultipleDocumentInterfaceSWT) SkinViewManager.getByViewID(SkinConstants.VIEWID_MDI);
 }