org.eclipse.team.ui_3.6.101.R37x_v20111109-0800

ntProviderManager;
import org.eclipse.team.ui.history.IHistoryPageSource;
import org.eclipse.team.ui.history.IHistoryView;
import org.eclipse.team.ui.mapping.ITeamContentProviderManager;
import org.eclipse.team.ui.synchronize.ISynchronizeManager;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PartInitException;

public class TeamUI
{
  public static final String GLOBAL_IGNORES_CHANGED = "org.eclipse.team.uiglobal_ignores_changed";
  public static final String GLOBAL_FILE_TYPES_CHANGED = "org.eclipse.team.uiglobal_file_types_changed";
  
  public static ISynchronizeManager getSynchronizeManager()
  {
    return TeamUIPlugin.getPlugin().getSynchronizeManager();
  }
  
  public static void addPropertyChangeListener(IPropertyChangeListener listener)
  {
    TeamUIPlugin.addPropertyChangeListener(listener);
  }
  
  public static void removePropertyChangeListener(IPropertyChangeListener listener)
  {
    TeamUIPlugin.removePropertyChangeListener(listener);
  }
  
  public static IHistoryView getHistoryView()
  {
    try
    {
      TeamUIPlugin.getActivePage().showView("org.eclipse.team.ui.GenericHistoryView");
      return (IHistoryView)TeamUIPlugin.getActivePage().findView("org.eclipse.team.ui.GenericHistoryView");
    }
    catch (PartInitException localPartInitException) {}
    return null;
  }
  
  public static IHistoryView showHistoryFor(IWorkbenchPage page, Object input, IHistoryPageSource pageSource)
  {
    try
    {
      IHistoryView view = (IHistoryView)page.findView("org.eclipse.team.ui.GenericHistoryView");
      if (view == null)
      {
        page.showView("org.eclipse.team.ui.GenericHistoryView");
        view = (IHistoryView)TeamUIPlugin.getActivePage().findView("org.eclipse.team.ui.GenericHistoryView");
        return showInputInView(page, input, view, pageSource);
      }
      view = ((GenericHistoryView)view).findAppropriateHistoryViewFor(input, pageSource);
      if (view == null)
      {
        view = (IHistoryView)page.showView("org.eclipse.team.ui.GenericHistoryView", "org.eclipse.team.ui.GenericHistoryView" + System.currentTimeMillis(), 3);
        return showInputInView(page, input, view, pageSource);
      }
      return showInputInView(page, input, view, pageSource);
    }
    catch (PartInitException localPartInitException) {}
    return null;
  }
  
  private static IHistoryView showInputInView(IWorkbenchPage page, Object input, IHistoryView view, IHistoryPageSource pageSource)
  {
    page.activate((IWorkbenchPart)view);
    ((GenericHistoryView)view).showHistoryPageFor(input, true, false, pageSource);
    return view;
  }
  
  public static ITeamContentProviderManager getTeamContentProviderManager()
  {
    return TeamContentProviderManager.getInstance();
  }
  
  public static IScmUrlImportWizardPage[] getPages(ScmUrlImportDescription[] descriptions)
    throws CoreException
  {
    IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor("org.eclipse.team.ui", "scmUrlImportPages");
    if (elements.length > 0)
    {
      Set pages = new HashSet();
      for (int i = 0; i < elements.length; i++)
      {
        String repository = elements[i].getAttribute("repository");
        RepositoryProviderType providerType = RepositoryProviderType.getProviderType(repository);
        String providerScheme = providerType.getFileSystemScheme();
        Set schemeUris = new HashSet();
        for (int j = 0; j < descriptions.length; j++)
        {
          URI scmUri = descriptions[j].getUri();
          if ((scmUri != null) && 
            ("scm".equals(scmUri.getScheme())) && 
            (scmUri.getSchemeSpecificPart().startsWith(providerScheme))) {
            schemeUris.add(scmUri);
          }
        }
        if (schemeUris.size() > 0)
        {
          Object ext = TeamUIPlugin.createExtension(elements[i], "page");
          if ((ext instanceof IScmUrlImportWizardPage))
          {
            IScmUrlImportWizardPage page = (IScmUrlImportWizardPage)ext;
            page.setProvider(providerType);
            Set set = new HashSet();
            int j;
            for (Iterator iterator = schemeUris.iterator(); iterator.hasNext(); j < descriptions.length)
            {
              URI uri = (URI)iterator.next();
              j = 0; continue;
              if (descriptions[j].getUri().equals(uri)) {
                set.add(descriptions[j]);
              }
              j++;
            }
            page.setSelection((ScmUrlImportDescription[])set.toArray(new ScmUrlImportDescription[0]));
            pages.add(page);
          }
        }
      }
      return (IScmUrlImportWizardPage[])pages.toArray(new IScmUrlImportWizardPage[0]);
    }
    return null;
  }
}

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

import org.eclipse.compare.ITypedElement;
import org.eclipse.core.resources.IFile;
import org.eclipse.team.core.TeamException;
import org.eclipse.team.internal.ui.history.EditionHistoryPage;
import org.eclipse.ui.part.Page;

public abstract class ElementLocalHistoryPageSource
  extends HistoryPageSource
{
  public static ITypedElement getPreviousEdition(IFile file, Object element)
    throws TeamException
  {
    return EditionHistoryPage.getPreviousState(file, element);
  }
  
  public final boolean canShowHistoryFor(Object object)
  {
    return getFile(object) != null;
  }
  
  public final Page createPage(Object object)
  {
    return new EditionHistoryPage(getFile(object), object);
  }
  
  protected abstract IFile getFile(Object paramObject);
}

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

import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.team.internal.ui.PropertyChangeHandler;
import org.eclipse.ui.part.Page;

public abstract class HistoryPage
  extends Page
  implements IHistoryPage, IAdaptable
{
  private IHistoryPageSite site;
  private Object input;
  private IHistoryView historyView;
  private PropertyChangeHandler fChangeHandler;
  
  public void setSite(IHistoryPageSite site)
  {
    this.site = site;
  }
  
  public IHistoryPageSite getHistoryPageSite()
  {
    return site;
  }
  
  public Object getInput()
  {
    return input;
  }
  
  public boolean setInput(Object object)
  {
    input = object;
    return inputSet();
  }
  
  public abstract boolean inputSet();
  
  public void setHistoryView(IHistoryView historyView)
  {
    this.historyView = historyView;
  }
  
  public IHistoryView getHistoryView()
  {
    if (historyView != null) {
      return historyView;
    }
    return null;
  }
  
  public synchronized void addPropertyChangeListener(IPropertyChangeListener listener)
  {
    if (fChangeHandler == null) {
      fChangeHandler = new PropertyChangeHandler();
    }
    fChangeHandler.addPropertyChangeListener(listener);
  }
  
  public void removePropertyChangeListener(IPropertyChangeListener listener)
  {
    if (fChangeHandler != null) {
      fChangeHandler.removePropertyChangeListener(listener);
    }
  }
  
  protected void firePropertyChange(Object source, String property, Object oldValue, Object newValue)
  {
    if (fChangeHandler == null) {
      return;
    }
    fChangeHandler.firePropertyChange(source, property, oldValue, newValue);
  }
}

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

import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;

class HistoryPageCompareEditorInput$1
  implements IPropertyChangeListener
{
  final HistoryPageCompareEditorInput this$0;
  
  HistoryPageCompareEditorInput$1(HistoryPageCompareEditorInput paramHistoryPageCompareEditorInput)
  {
    this$0 = paramHistoryPageCompareEditorInput;
  }
  
  public void propertyChange(PropertyChangeEvent event)
  {
    this$0.handlePropertyChange(event);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.ui.history.HistoryPageCompareEditorInput.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.ui.history;

class HistoryPageCompareEditorInput$2
  implements Runnable
{
  final HistoryPageCompareEditorInput this$0;
  
  HistoryPageCompareEditorInput$2(HistoryPageCompareEditorInput paramHistoryPageCompareEditorInput)
  {
    this$0 = paramHistoryPageCompareEditorInput;
  }
  
  public void run()
  {
    this$0.setTitle(HistoryPageCompareEditorInput.access$0(this$0).getName());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.ui.history.HistoryPageCompareEditorInput.2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.ui.history;

class HistoryPageCompareEditorInput$3
  implements Runnable
{
  final HistoryPageCompareEditorInput this$0;
  
  HistoryPageCompareEditorInput$3(HistoryPageCompareEditorInput paramHistoryPageCompareEditorInput)
  {
    this$0 = paramHistoryPageCompareEditorInput;
  }
  
  public void run()
  {
    HistoryPageCompareEditorInput.access$1(this$0, HistoryPageCompareEditorInput.access$0(this$0).getDescription());
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.ui.history.HistoryPageCompareEditorInput.3
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.ui.history;

import java.lang.reflect.InvocationTargetException;
import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.CompareViewerPane;
import org.eclipse.compare.structuremergeviewer.ICompareInput;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Display;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.history.DialogHistoryPageSite;
import org.eclipse.team.ui.PageCompareEditorInput;
import org.eclipse.ui.part.IPage;
import org.eclipse.ui.part.Page;

public class HistoryPageCompareEditorInput
  extends PageCompareEditorInput
{
  private IHistoryPage historyPage;
  private DialogHistoryPageSite site;
  private final Object object;
  private final IHistoryPageSource pageSource;
  private final IPropertyChangeListener changeListener = new IPropertyChangeListener()
  {
    public void propertyChange(PropertyChangeEvent event)
    {
      handlePropertyChange(event);
    }
  };
  private boolean isReplace;
  
  public HistoryPageCompareEditorInput(CompareConfiguration configuration, IHistoryPageSource pageSource, Object object)
  {
    super(configuration);
    this.pageSource = pageSource;
    this.object = object;
  }
  
  protected Object prepareInput(IProgressMonitor monitor)
    throws InvocationTargetException, InterruptedException
  {
    return object;
  }
  
  protected void handleDispose()
  {
    super.handleDispose();
    if (historyPage != null)
    {
      historyPage.removePropertyChangeListener(changeListener);
      historyPage.dispose();
    }
  }
  
  protected IPage createPage(CompareViewerPane parent, IToolBarManager toolBarManager)
  {
    site = new DialogHistoryPageSite(parent.getShell());
    historyPage = ((IHistoryPage)pageSource.createPage(object));
    historyPage.setSite(site);
    site.setToolBarManager(toolBarManager);
    ((Page)historyPage).createControl(parent);
    historyPage.setInput(object);
    String description = historyPage.getDescription();
    if (description == null) {
      description = "";
    }
    setPageDescription(description);
    if (getTitle() == null) {
      setTitle(historyPage.getName());
    }
    historyPage.addPropertyChangeListener(changeListener);
    return (IPage)historyPage;
  }
  
  protected ICompareInput asCompareInput(ISelection selection)
  {
    ICompareInput compareInput = super.asCompareInput(selection);
    if (compareInput != null) {
      return compareInput;
    }
    IHistoryCompareAdapter compareAdapter = (IHistoryCompareAdapter)Utils.getAdapter(historyPage, IHistoryCompareAdapter.class);
    if ((compareAdapter != null) && 
      ((selection instanceof IStructuredSelection)))
    {
      IStructuredSelection ss = (IStructuredSelection)selection;
      if (ss.size() == 1)
      {
        Object o = ss.getFirstElement();
        return compareAdapter.getCompareInput(o);
      }
    }
    return null;
  }
  
  protected ISelectionProvider getSelectionProvider()
  {
    return site.getSelectionProvider();
  }
  
  protected void prepareInput(ICompareInput input, CompareConfiguration configuration, IProgressMonitor monitor)
    throws InvocationTargetException
  {
    IHistoryCompareAdapter compareAdapter = (IHistoryCompareAdapter)Utils.getAdapter(historyPage, IHistoryCompareAdapter.class);
    if (compareAdapter != null) {
      compareAdapter.prepareInput(input, configuration, monitor);
    }
  }
  
  public final IHistoryPage getHistoryPage()
  {
    return historyPage;
  }
  
  protected void handlePropertyChange(PropertyChangeEvent event)
  {
    if (event.getSource() == historyPage) {
      if (event.getProperty().equals("org.eclipse.team.ui.name")) {
        Display.getDefault().asyncExec(new Runnable()
        {
          public void run()
          {
            setTitle(historyPage.getName());
          }
        });
      } else if (event.getProperty().equals("org.eclipse.team.ui.description")) {
        Display.getDefault().asyncExec(new Runnable()
        {
          public void run()
          {
            setPageDescription(historyPage.getDescription());
          }
        });
      }
    }
  }
  
  public boolean isEditionSelectionDialog()
  {
    return isReplaceDialog();
  }
  
  protected boolean isReplaceDialog()
  {
    return isReplace;
  }
  
  public void setReplace(boolean isReplace)
  {
    this.isReplace = isReplace;
  }
  
  public String getOKButtonLabel()
  {
    if (isReplaceDialog()) {
      return TeamUIMessages.HistoryPageCompareEditorInput_0;
    }
    return super.getOKButtonLabel();
  }
  
  public boolean okPressed()
  {
    if (!isReplaceDialog()) {
      return super.okPressed();
    }
    try
    {
      Object o = getSelectedEdition();
      performReplace(((ICompareInput)o).getRight());
    }
    catch (CoreException e)
    {
      Utils.handle(e);
      return false;
    }
    return true;
  }
  
  protected void performReplace(Object selectedObject)
    throws CoreException
  {}
}

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

import java.lang.reflect.InvocationTargetException;
import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.IContentChangeNotifier;
import org.eclipse.compare.structuremergeviewer.ICompareInput;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.history.DialogHistoryPageSite;
import org.eclipse.team.ui.PageSaveablePart;
import org.eclipse.ui.part.Page;

/**
 * @deprecated
 */
public class HistoryPageSaveablePart
  extends PageSaveablePart
{
  private IHistoryPage historyPage;
  private DialogHistoryPageSite site;
  private final Object object;
  private final IHistoryPageSource pageSource;
  
  /* Error */
  public static boolean showHistoryInDialog(Shell shell, Object object)
  {
    // Byte code:
    //   0: aload_1
    //   1: invokestatic 212	org/eclipse/team/ui/history/HistoryPageSource:getHistoryPageSource	(Ljava/lang/Object;)Lorg/eclipse/team/ui/history/IHistoryPageSource;
    //   4: astore_2
    //   5: aload_2
    //   6: ifnull +91 -> 97
    //   9: aload_2
    //   10: aload_1
    //   11: invokeinterface 225 2 0
    //   16: ifeq +81 -> 97
    //   19: new 87	org/eclipse/compare/CompareConfiguration
    //   22: dup
    //   23: invokespecial 193	org/eclipse/compare/CompareConfiguration:<init>	()V
    //   26: astore_3
    //   27: aload_3
    //   28: aload_1
    //   29: invokestatic 208	org/eclipse/team/ui/history/HistoryPageSaveablePart:isFile	(Ljava/lang/Object;)Z
    //   32: invokevirtual 194	org/eclipse/compare/CompareConfiguration:setLeftEditable	(Z)V
    //   35: aload_3
    //   36: iconst_0
    //   37: invokevirtual 195	org/eclipse/compare/CompareConfiguration:setRightEditable	(Z)V
    //   40: new 94	org/eclipse/team/ui/history/HistoryPageSaveablePart
    //   43: dup
    //   44: aload_0
    //   45: aload_3
    //   46: aload_2
    //   47: aload_1
    //   48: invokespecial 211	org/eclipse/team/ui/history/HistoryPageSaveablePart:<init>	(Lorg/eclipse/swt/widgets/Shell;Lorg/eclipse/compare/CompareConfiguration;Lorg/eclipse/team/ui/history/IHistoryPageSource;Ljava/lang/Object;)V
    //   51: astore 4
    //   53: new 93	org/eclipse/team/ui/SaveablePartDialog
    //   56: dup
    //   57: aload_0
    //   58: aload 4
    //   60: invokespecial 206	org/eclipse/team/ui/SaveablePartDialog:<init>	(Lorg/eclipse/swt/widgets/Shell;Lorg/eclipse/team/ui/ISaveableWorkbenchPart;)V
    //   63: astore 5
    //   65: aload 5
    //   67: iconst_1
    //   68: invokevirtual 205	org/eclipse/team/ui/SaveablePartDialog:setBlockOnOpen	(Z)V
    //   71: aload 5
    //   73: invokevirtual 204	org/eclipse/team/ui/SaveablePartDialog:open	()I
    //   76: pop
    //   77: goto +13 -> 90
    //   80: astore 6
    //   82: aload 4
    //   84: invokevirtual 207	org/eclipse/team/ui/history/HistoryPageSaveablePart:dispose	()V
    //   87: aload 6
    //   89: athrow
    //   90: aload 4
    //   92: invokevirtual 207	org/eclipse/team/ui/history/HistoryPageSaveablePart:dispose	()V
    //   95: iconst_1
    //   96: ireturn
    //   97: iconst_0
    //   98: ireturn
    // Line number table:
    //   Java source line #52	-> byte code offset #0
    //   Java source line #53	-> byte code offset #5
    //   Java source line #54	-> byte code offset #19
    //   Java source line #55	-> byte code offset #27
    //   Java source line #56	-> byte code offset #35
    //   Java source line #57	-> byte code offset #40
    //   Java source line #59	-> byte code offset #53
    //   Java source line #60	-> byte code offset #65
    //   Java source line #61	-> byte code offset #71
    //   Java source line #62	-> byte code offset #80
    //   Java source line #63	-> byte code offset #82
    //   Java source line #64	-> byte code offset #87
    //   Java source line #63	-> byte code offset #90
    //   Java source line #65	-> byte code offset #95
    //   Java source line #67	-> byte code offset #97
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	99	0	shell	Shell
    //   0	99	1	object	Object
    //   4	43	2	pageSource	IHistoryPageSource
    //   26	20	3	cc	CompareConfiguration
    //   51	40	4	input	HistoryPageSaveablePart
    //   63	9	5	cd	org.eclipse.team.ui.SaveablePartDialog
    //   80	8	6	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   53	80	80	finally
  }
  
  private static boolean isFile(Object object)
  {
    IResource resource = Utils.getResource(object);
    return (resource != null) && (resource.getType() == 1);
  }
  
  public HistoryPageSaveablePart(Shell shell, CompareConfiguration configuration, IHistoryPageSource pageSource, Object object)
  {
    super(shell, configuration);
    this.pageSource = pageSource;
    this.object = object;
  }
  
  public String getTitle()
  {
    return historyPage.getName();
  }
  
  public Image getTitleImage()
  {
    return null;
  }
  
  public void contentChanged(IContentChangeNotifier source) {}
  
  protected Control createPage(Composite parent, ToolBarManager toolBarManager)
  {
    site = new DialogHistoryPageSite(getShell());
    historyPage = ((IHistoryPage)pageSource.createPage(object));
    historyPage.setSite(site);
    site.setToolBarManager(toolBarManager);
    ((Page)historyPage).createControl(parent);
    historyPage.setInput(object);
    String description = historyPage.getDescription();
    if (description == null) {
      description = "";
    }
    setPageDescription(description);
    return ((Page)historyPage).getControl();
  }
  
  protected final ISelectionProvider getSelectionProvider()
  {
    return site.getSelectionProvider();
  }
  
  protected ICompareInput getCompareInput(ISelection selection)
  {
    ICompareInput compareInput = super.getCompareInput(selection);
    if (compareInput != null) {
      return compareInput;
    }
    IHistoryCompareAdapter compareAdapter = (IHistoryCompareAdapter)Utils.getAdapter(historyPage, IHistoryCompareAdapter.class);
    if ((compareAdapter != null) && 
      ((selection instanceof IStructuredSelection)))
    {
      IStructuredSelection ss = (IStructuredSelection)selection;
      if (ss.size() == 1)
      {
        Object o = ss.getFirstElement();
        return compareAdapter.getCompareInput(o);
      }
    }
    return null;
  }
  
  protected void prepareInput(ICompareInput input, CompareConfiguration configuration, IProgressMonitor monitor)
    throws InvocationTargetException
  {
    IHistoryCompareAdapter compareAdapter = (IHistoryCompareAdapter)Utils.getAdapter(historyPage, IHistoryCompareAdapter.class);
    if (compareAdapter != null) {
      compareAdapter.prepareInput(input, configuration, monitor);
    }
  }
  
  public void dispose()
  {
    super.dispose();
    if (historyPage != null) {
      historyPage.dispose();
    }
  }
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.team.core.RepositoryProvider;
import org.eclipse.team.core.history.IFileHistoryProvider;
import org.eclipse.team.internal.ui.Utils;

public abstract class HistoryPageSource
  implements IHistoryPageSource
{
  public static IHistoryPageSource getHistoryPageSource(Object object)
  {
    IResource resource = Utils.getResource(object);
    if (resource != null)
    {
      RepositoryProvider provider = RepositoryProvider.getProvider(resource.getProject());
      if (provider != null)
      {
        IFileHistoryProvider fileHistoryProvider = provider.getFileHistoryProvider();
        if (fileHistoryProvider != null)
        {
          IHistoryPageSource pageSource = (IHistoryPageSource)Utils.getAdapter(fileHistoryProvider, IHistoryPageSource.class);
          if (pageSource != null) {
            return pageSource;
          }
        }
        IHistoryPageSource pageSource = (IHistoryPageSource)Utils.getAdapter(provider, IHistoryPageSource.class);
        if (pageSource != null) {
          return pageSource;
        }
      }
    }
    IHistoryPageSource pageSource = (IHistoryPageSource)Utils.getAdapter(object, IHistoryPageSource.class);
    return pageSource;
  }
}

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

import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.structuremergeviewer.ICompareInput;
import org.eclipse.core.runtime.IProgressMonitor;

public abstract interface IHistoryCompareAdapter
{
  public abstract ICompareInput getCompareInput(Object paramObject);
  
  public abstract void prepareInput(ICompareInput paramICompareInput, CompareConfiguration paramCompareConfiguration, IProgressMonitor paramIProgressMonitor);
}

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

import org.eclipse.jface.util.IPropertyChangeListener;

public abstract interface IHistoryPage
{
  public static final String P_NAME = "org.eclipse.team.ui.name";
  public static final String P_DESCRIPTION = "org.eclipse.team.ui.description";
  
  public abstract boolean setInput(Object paramObject);
  
  public abstract Object getInput();
  
  public abstract boolean isValidInput(Object paramObject);
  
  public abstract void refresh();
  
  public abstract String getName();
  
  public abstract String getDescription();
  
  public abstract void setSite(IHistoryPageSite paramIHistoryPageSite);
  
  public abstract IHistoryPageSite getHistoryPageSite();
  
  public abstract void dispose();
  
  public abstract IHistoryView getHistoryView();
  
  public abstract void addPropertyChangeListener(IPropertyChangeListener paramIPropertyChangeListener);
  
  public abstract void removePropertyChangeListener(IPropertyChangeListener paramIPropertyChangeListener);
}

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

import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.part.IPageSite;

public abstract interface IHistoryPageSite
{
  public abstract IPageSite getWorkbenchPageSite();
  
  public abstract IWorkbenchPart getPart();
  
  public abstract Shell getShell();
  
  public abstract ISelectionProvider getSelectionProvider();
  
  public abstract void setSelectionProvider(ISelectionProvider paramISelectionProvider);
  
  public abstract void setFocus();
  
  public abstract IToolBarManager getToolBarManager();
  
  public abstract boolean isModal();
}

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

import org.eclipse.ui.part.Page;

public abstract interface IHistoryPageSource
{
  public abstract boolean canShowHistoryFor(Object paramObject);
  
  public abstract Page createPage(Object paramObject);
}

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

public abstract interface IHistoryView
{
  public static final String VIEW_ID = "org.eclipse.team.ui.GenericHistoryView";
  
  public abstract IHistoryPage getHistoryPage();
  
  public abstract IHistoryPage showHistoryFor(Object paramObject);
  
  public abstract IHistoryPage showHistoryFor(Object paramObject, boolean paramBoolean);
}

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

import org.eclipse.jface.text.revisions.Revision;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;

class RevisionAnnotationController$1
  implements ISelectionChangedListener
{
  final RevisionAnnotationController this$0;
  
  RevisionAnnotationController$1(RevisionAnnotationController paramRevisionAnnotationController)
  {
    this$0 = paramRevisionAnnotationController;
  }
  
  public void selectionChanged(SelectionChangedEvent event)
  {
    ISelection selection = event.getSelection();
    Revision selected = null;
    if ((selection instanceof IStructuredSelection)) {
      selected = (Revision)((IStructuredSelection)selection).getFirstElement();
    }
    if (selected == null) {
      return;
    }
    this$0.revisionSelected(selected);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.ui.history.RevisionAnnotationController.1
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.ui.history;

import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;

class RevisionAnnotationController$2
  implements ISelectionChangedListener
{
  final RevisionAnnotationController this$0;
  
  RevisionAnnotationController$2(RevisionAnnotationController paramRevisionAnnotationController)
  {
    this$0 = paramRevisionAnnotationController;
  }
  
  public void selectionChanged(SelectionChangedEvent event)
  {
    ISelection selection = event.getSelection();
    if ((selection instanceof IStructuredSelection))
    {
      IStructuredSelection ss = (IStructuredSelection)selection;
      if (ss.size() == 1)
      {
        Object first = ss.getFirstElement();
        if (first != null) {
          this$0.historyEntrySelected(first);
        }
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.ui.history.RevisionAnnotationController.2
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.ui.history;

import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;

class RevisionAnnotationController$3
  implements DisposeListener
{
  final RevisionAnnotationController this$0;
  
  RevisionAnnotationController$3(RevisionAnnotationController paramRevisionAnnotationController)
  {
    this$0 = paramRevisionAnnotationController;
  }
  
  public void widgetDisposed(DisposeEvent e)
  {
    this$0.dispose();
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.ui.history.RevisionAnnotationController.3
 * Java Class Version: 1.2 (46.0)
 * JD-Core Version:    0.7.1
 */
package org.eclipse.team.ui.history;

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.text.revisions.IRevisionRulerColumn;
import org.eclipse.jface.text.revisions.IRevisionRulerColumnExtension;
import org.eclipse.jface.text.revisions.Revision;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.widgets.Control;
import org.eclipse.team.core.history.IFileRevision;
import org.eclipse.team.core.variants.IResourceVariant;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.history.FileRevisionEditorInput;
import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorReference;
import org.eclipse.ui.IEditorRegistry;
import org.eclipse.ui.IStorageEditorInput;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.part.MultiPageEditorPart;
import org.eclipse.ui.texteditor.AbstractDecoratedTextEditor;
import org.eclipse.ui.texteditor.ITextEditor;

public abstract class RevisionAnnotationController
{
  private ISelectionProvider fRulerSelectionProvider;
  private ISelectionProvider fHistoryListSelectionProvider;
  private ISelectionChangedListener rulerListener = new ISelectionChangedListener()
  {
    public void selectionChanged(SelectionChangedEvent event)
    {
      ISelection selection = event.getSelection();
      Revision selected = null;
      if ((selection instanceof IStructuredSelection)) {
        selected = (Revision)((IStructuredSelection)selection).getFirstElement();
      }
      if (selected == null) {
        return;
      }
      revisionSelected(selected);
    }
  };
  private ISelectionChangedListener historyListListener = new ISelectionChangedListener()
  {
    public void selectionChanged(SelectionChangedEvent event)
    {
      ISelection selection = event.getSelection();
      if ((selection instanceof IStructuredSelection))
      {
        IStructuredSelection ss = (IStructuredSelection)selection;
        if (ss.size() == 1)
        {
          Object first = ss.getFirstElement();
          if (first != null) {
            historyEntrySelected(first);
          }
        }
      }
    }
  };
  
  public static AbstractDecoratedTextEditor openEditor(IWorkbenchPage page, IFile file)
    throws PartInitException
  {
    if (file == null) {
      return null;
    }
    FileEditorInput input = new FileEditorInput(file);
    IEditorPart[] openEditors = findOpenEditorsForFile(page, input);
    if (openEditors.length > 0)
    {
      AbstractDecoratedTextEditor te = findTextEditor(page, openEditors, input);
      if (te != null) {
        return te;
      }
    }
    try
    {
      IEditorDescriptor descrptr = IDE.getEditorDescriptor(file);
      if ((descrptr.isInternal()) && (openEditors.length == 0))
      {
        IEditorPart part = page.openEditor(input, IDE.getEditorDescriptor(file).getId(), true, 1);
        AbstractDecoratedTextEditor te = findTextEditorPart(page, part, input);
        if (te != null) {
          return te;
        }
        page.closeEditor(part, false);
      }
      IEditorPart part = page.openEditor(input, "org.eclipse.ui.DefaultTextEditor", true, 3);
      AbstractDecoratedTextEditor te = findTextEditorPart(page, part, input);
      if (te != null) {
        return te;
      }
    }
    catch (PartInitException localPartInitException) {}
    return null;
  }
  
  public static AbstractDecoratedTextEditor openEditor(IWorkbenchPage page, Object fileRevision, IStorage storage)
    throws PartInitException
  {
    String id = getEditorId(storage);
    ITextEditor editor = getEditor(id, fileRevision, storage);
    if ((editor instanceof AbstractDecoratedTextEditor)) {
      return (AbstractDecoratedTextEditor)editor;
    }
    return null;
  }
  
  private static ITextEditor getEditor(String id, Object fileRevision, IStorage storage)
    throws PartInitException
  {
    IWorkbench workbench = PlatformUI.getWorkbench();
    IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
    IWorkbenchPage page = window.getActivePage();
    IEditorPart part = page.openEditor(new FileRevisionEditorInput(fileRevision, storage), id);
    if ((part instanceof ITextEditor)) {
      return (ITextEditor)part;
    }
    page.closeEditor(part, false);
    part = page.openEditor(new FileRevisionEditorInput(fileRevision, storage), "org.eclipse.ui.DefaultTextEditor");
    if ((part instanceof ITextEditor)) {
      return (ITextEditor)part;
    }
    throw new PartInitException(TeamUIMessages.RevisionAnnotationController_0);
  }
  
  private static String getEditorId(IStorage storage)
  {
    IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry();
    IEditorDescriptor descriptor = registry.getDefaultEditor(storage.getName());
    String id;
    String id;
    if ((descriptor == null) || (!descriptor.isInternal())) {
      id = "org.eclipse.ui.DefaultTextEditor";
    } else {
      try
      {
        String id;
        if (Utils.isTextEditor(descriptor)) {
          id = descriptor.getId();
        } else {
          id = "org.eclipse.ui.DefaultTextEditor";
        }
      }
      catch (CoreException localCoreException)
      {
        String id;
        id = "org.eclipse.ui.DefaultTextEditor";
      }
    }
    return id;
  }
  
  private static AbstractDecoratedTextEditor findOpenTextEditorForFile(IWorkbenchPage page, IFile file)
  {
    if (file == null) {
      return null;
    }
    FileEditorInput input = new FileEditorInput(file);
    IEditorPart[] editors = findOpenEditorsForFile(page, input);
    return findTextEditor(page, editors, input);
  }
  
  private static AbstractDecoratedTextEditor findTextEditor(IWorkbenchPage page, IEditorPart[] editors, IEditorInput input)
  {
    for (int i = 0; i < editors.length; i++)
    {
      IEditorPart editor = editors[i];
      AbstractDecoratedTextEditor te = findTextEditorPart(page, editor, input);
      if (te != null) {
        return te;
      }
    }
    return null;
  }
  
  private static AbstractDecoratedTextEditor findTextEditorPart(IWorkbenchPage page, IEditorPart editor, IEditorInput input)
  {
    if ((editor instanceof AbstractDecoratedTextEditor)) {
      return (AbstractDecoratedTextEditor)editor;
    }
    if ((editor instanceof MultiPageEditorPart))
    {
      MultiPageEditorPart mpep = (MultiPageEditorPart)editor;
      IEditorPart[] parts = mpep.findEditors(input);
      for (int i = 0; i < parts.length; i++)
      {
        IEditorPart editorPart = parts[i];
        if ((editorPart instanceof AbstractDecoratedTextEditor))
        {
          page.activate(mpep);
          mpep.setActiveEditor(editorPart);
          return (AbstractDecoratedTextEditor)editorPart;
        }
      }
    }
    return null;
  }
  
  private static IEditorPart[] findOpenEditorsForFile(IWorkbenchPage page, FileEditorInput input)
  {
    IEditorReference[] references = page.findEditors(input, null, 1);
    List editors = new ArrayList();
    for (int i = 0; i < references.length; i++)
    {
      IEditorReference reference = references[i];
      IEditorPart editor = reference.getEditor(false);
      editors.add(editor);
    }
    return (IEditorPart[])editors.toArray(new IEditorPart[editors.size()]);
  }
  
  private static AbstractDecoratedTextEditor findOpenTextEditorFor(IWorkbenchPage page, Object object)
  {
    if (object == null) {
      return null;
    }
    if ((object instanceof IFile))
    {
      IFile file = (IFile)object;
      return findOpenTextEditorForFile(page, file);
    }
    IWorkbench workbench = PlatformUI.getWorkbench();
    IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
    IEditorReference[] references = window.getActivePage().getEditorReferences();
    for (int i = 0; i < references.length; i++)
    {
      IEditorReference reference = references[i];
      try
      {
        if (object.equals(reference.getEditorInput()))
        {
          IEditorPart editor = reference.getEditor(false);
          if ((editor instanceof AbstractDecoratedTextEditor)) {
            return (AbstractDecoratedTextEditor)editor;
          }
        }
      }
      catch (PartInitException localPartInitException) {}
    }
    return null;
  }
  
  private static IRevisionRulerColumnExtension findEditorRevisonRulerColumn(IWorkbenchPage page, Object object)
  {
    ITextEditor editor = findOpenTextEditorFor(page, object);
    if (editor == null) {
      return null;
    }
    IRevisionRulerColumn column = (IRevisionRulerColumn)editor.getAdapter(IRevisionRulerColumn.class);
    if ((column instanc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69

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-2019. Infinite Loop Ltd