/* (non-Javadoc)
   * @see org.eclipse.ui.IViewPart#init(org.eclipse.ui.IViewSite, org.eclipse.ui.IMemento)
   */
  public void init(IViewSite site, IMemento memento) throws PartInitException {
    super.init(site);
    Workbench workbench = (Workbench) site.getWorkbenchWindow().getWorkbench();
    try {
      introPart = workbench.getWorkbenchIntroManager().createNewIntroPart();
      // reset the part name of this view to be that of the intro title
      setPartName(introPart.getTitle());
      introPart.addPropertyListener(
          new IPropertyListener() {
            public void propertyChanged(Object source, int propId) {
              firePropertyChange(propId);
            }
          });
      introSite = new ViewIntroAdapterSite(site, workbench.getIntroDescriptor());
      introPart.init(introSite, memento);

    } catch (CoreException e) {
      WorkbenchPlugin.log(
          IntroMessages.Intro_could_not_create_proxy,
          new Status(
              IStatus.ERROR,
              WorkbenchPlugin.PI_WORKBENCH,
              IStatus.ERROR,
              IntroMessages.Intro_could_not_create_proxy,
              e));
    }
  }
 public void a(int paramInt1, int paramInt2, int paramInt3) {
   // hMod: Check if we can open this. Will have to move a line from below to here.
   ig temp = new ig(this.an, this.l, paramInt1, paramInt2, paramInt3);
   Workbench bench = new Workbench(temp);
   if ((Boolean) etc.getLoader().callHook(PluginLoader.Hook.OPEN_INVENTORY, getPlayer(), bench)) {
     return;
   }
   this.lastOpenedInventory = bench;
   R();
   this.a.b(new ih(this.bH, 1, bench.getName(), 9));
   this.ap = temp;
   this.ap.f = this.bH;
   // hMod: Make sure this gets cast correctly, or mutant puppies will spawn and eat your items.
   this.ap.a((ec) this);
 }
 private void runCleanUp(Workbench realWorkbench) {
   if (!cleanupNeeded) {
     return;
   }
   cleanupNeeded = false;
   realWorkbench.removeShowingMenus(getMenuIds(), null, null);
   cleanUpContributionCache();
 }
  /** Notifies the listener that the menu is about to be shown. */
  public void menuAboutToShow(IMenuManager mgr) {
    registerE4Support();

    // Add this menu as a visible menu.
    final IWorkbenchPartSite site = part.getSite();
    if (site != null) {
      final IWorkbench workbench = site.getWorkbenchWindow().getWorkbench();
      if (workbench instanceof Workbench) {
        final Workbench realWorkbench = (Workbench) workbench;
        runCleanUp(realWorkbench);
        ISelection input = null;
        if ((bitSet & INCLUDE_EDITOR_INPUT) != 0) {
          if (part instanceof IEditorPart) {
            final IEditorPart editorPart = (IEditorPart) part;
            input = new StructuredSelection(new Object[] {editorPart.getEditorInput()});
          }
        }
        ISelection s = (selProvider == null ? null : selProvider.getSelection());
        realWorkbench.addShowingMenus(getMenuIds(), s, input);
      }
    }

    addMenuContributions(mgr);

    readStaticActions();
    // test for additions removed to comply with menu contributions
    if (menuWrapper != null) {
      mgr = menuWrapper;
      menuWrapper.removeAll();
    }
    if ((bitSet & INCLUDE_EDITOR_INPUT) != 0) {
      addEditorActions(mgr);
    }
    addObjectActions(mgr);
    addStaticActions(mgr);
  }