compatibility

16:34:55.898 INFO  jd.cli.Main - Decompiling compatibility.jar
package org.eclipse.ui.internal;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.IPluginDescriptor;
import org.eclipse.core.runtime.IPluginRegistry;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;

public class CompatibleWorkbenchPage
  implements ICompatibleWorkbenchPage
{
  public IEditorPart openEditor(IFile input)
    throws PartInitException
  {
    return openEditor(new Class[] { IWorkbenchPage.class, IFile.class, 
      Boolean.TYPE }, 
      new Object[] { this, input, new Boolean(true) });
  }
  
  public IEditorPart openEditor(IFile input, String editorID)
    throws PartInitException
  {
    return openEditor(input, editorID, true);
  }
  
  public IEditorPart openEditor(IFile input, String editorID, boolean activate)
    throws PartInitException
  {
    return ((IWorkbenchPage)this).openEditor(getFileEditorInput(input), 
      editorID);
  }
  
  public IEditorPart openEditor(IMarker marker)
    throws PartInitException
  {
    return openEditor(marker, true);
  }
  
  public IEditorPart openEditor(IMarker marker, boolean activate)
    throws PartInitException
  {
    return openEditor(new Class[] { IWorkbenchPage.class, IMarker.class, 
      Boolean.TYPE }, new Object[] { this, marker, 
      new Boolean(activate) });
  }
  
  public void openSystemEditor(IFile file)
    throws PartInitException
  {
    ((IWorkbenchPage)this).openEditor(getFileEditorInput(file), 
      "org.eclipse.ui.systemExternalEditor");
  }
  
  private IEditorInput getFileEditorInput(IFile file)
    throws PartInitException
  {
    IPluginDescriptor desc = Platform.getPluginRegistry()
      .getPluginDescriptor("org.eclipse.ui.ide");
    Exception problem;
    try
    {
      Class clazz = desc.getPluginClassLoader().loadClass(
        "org.eclipse.ui.part.FileEditorInput");
      Constructor constructor = clazz
        .getConstructor(new Class[] { IFile.class });
      return (IEditorInput)constructor
        .newInstance(new Object[] { file });
    }
    catch (NullPointerException e)
    {
      problem = e;
    }
    catch (ClassNotFoundException e)
    {
      Exception problem;
      problem = e;
    }
    catch (NoSuchMethodException e)
    {
      Exception problem;
      problem = e;
    }
    catch (IllegalArgumentException e)
    {
      Exception problem;
      problem = e;
    }
    catch (IllegalAccessException e)
    {
      Exception problem;
      problem = e;
    }
    catch (InvocationTargetException e)
    {
      Exception problem;
      problem = e;
    }
    catch (InstantiationException e)
    {
      Exception problem;
      problem = e;
    }
    IStatus status = new Status(
      4, 
      WorkbenchPlugin.PI_WORKBENCH, 
      0, 
      "openEditor() compatibility support failed - new FileEditorInput(file)", problem);
    WorkbenchPlugin.log(status.getMessage(), status);
    throw new PartInitException(status);
  }
  
  private IEditorPart openEditor(Class[] argTypes, Object[] args)
    throws PartInitException
  {
    IPluginDescriptor desc = Platform.getPluginRegistry()
      .getPluginDescriptor("org.eclipse.ui.ide");
    Throwable problem;
    try
    {
      Class clazz = desc.getPluginClassLoader().loadClass(
        "org.eclipse.ui.ide.IDE");
      Method method = clazz.getMethod("openEditor", argTypes);
      return (IEditorPart)method.invoke(null, args);
    }
    catch (NullPointerException e)
    {
      problem = e;
    }
    catch (ClassNotFoundException e)
    {
      Throwable problem;
      problem = e;
    }
    catch (NoSuchMethodException e)
    {
      Throwable problem;
      problem = e;
    }
    catch (IllegalArgumentException e)
    {
      Throwable problem;
      problem = e;
    }
    catch (IllegalAccessException e)
    {
      Throwable problem;
      problem = e;
    }
    catch (InvocationTargetException e)
    {
      Throwable problem;
      problem = e;
    }
    IStatus status = new Status(
      4, 
      WorkbenchPlugin.PI_WORKBENCH, 
      0, 
      "openEditor() compatibility support failed - IDE.openEditor()", problem);
    WorkbenchPlugin.log(status.getMessage(), status);
    throw new PartInitException(status);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.ui.internal.CompatibleWorkbenchPage
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.ui.internal;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IMarker;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PartInitException;

public abstract interface ICompatibleWorkbenchPage
{
  /**
   * @deprecated
   */
  public abstract IEditorPart openEditor(IFile paramIFile)
    throws PartInitException;
  
  /**
   * @deprecated
   */
  public abstract IEditorPart openEditor(IFile paramIFile, String paramString, boolean paramBoolean)
    throws PartInitException;
  
  /**
   * @deprecated
   */
  public abstract IEditorPart openEditor(IFile paramIFile, String paramString)
    throws PartInitException;
  
  /**
   * @deprecated
   */
  public abstract IEditorPart openEditor(IMarker paramIMarker)
    throws PartInitException;
  
  /**
   * @deprecated
   */
  public abstract IEditorPart openEditor(IMarker paramIMarker, boolean paramBoolean)
    throws PartInitException;
  
  /**
   * @deprecated
   */
  public abstract void openSystemEditor(IFile paramIFile)
    throws PartInitException;
}

/* Location:
 * Qualified Name:     org.eclipse.ui.internal.ICompatibleWorkbenchPage
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
1

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd