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

essMonitor pm, DiffNode node)
    throws CoreException
  {
    ITypedElement left = node.getLeft();
    if ((left instanceof LocalResourceTypedElement)) {
      ((LocalResourceTypedElement)left).commit(pm);
    }
    ITypedElement right = node.getRight();
    if ((right instanceof LocalResourceTypedElement)) {
      ((LocalResourceTypedElement)right).commit(pm);
    }
    IDiffElement[] children = node.getChildren();
    for (int i = 0; i < children.length; i++) {
      commit(pm, (DiffNode)children[i]);
    }
  }
  
  public void contentChanged(IContentChangeNotifier source)
  {
    super.contentChanged(source);
    try
    {
      if ((source instanceof DiffNode)) {
        commit(new NullProgressMonitor(), (DiffNode)source);
      } else if ((source instanceof LocalResourceTypedElement)) {
        ((LocalResourceTypedElement)source).commit(new NullProgressMonitor());
      }
    }
    catch (CoreException e)
    {
      Utils.handle(e);
    }
  }
  
  public ISynchronizePageConfiguration getPageConfiguration()
  {
    return pageConfiguration;
  }
  
  public ISynchronizeParticipant getParticipant()
  {
    return participant;
  }
  
  public Control createContents(Composite parent)
  {
    if (shouldCreateRememberButton())
    {
      Composite composite = new Composite(parent, 0);
      composite.setLayout(new GridLayout());
      Control control = super.createContents(composite);
      control.setLayoutData(new GridData(1808));
      rememberParticipantButton = new Button(composite, 32);
      rememberParticipantButton.setText(TeamUIMessages.ParticipantCompareDialog_1);
      rememberParticipantButton.setLayoutData(new GridData(768));
      return composite;
    }
    return super.createContents(parent);
  }
  
  protected boolean isOfferToRememberParticipant()
  {
    return true;
  }
  
  private boolean shouldCreateRememberButton()
  {
    return (isOfferToRememberParticipant()) && (participant != null) && (!particantRegisteredWithSynchronizeManager(participant));
  }
  
  private boolean isRememberParticipant()
  {
    return (getParticipant() != null) && (rememberParticipantButton != null) && (rememberParticipantButton.getSelection());
  }
  
  private boolean particantRegisteredWithSynchronizeManager(ISynchronizeParticipant participant)
  {
    return TeamUI.getSynchronizeManager().get(participant.getId(), participant.getSecondaryId()) != null;
  }
  
  private void rememberParticipant()
  {
    if (getParticipant() != null)
    {
      ISynchronizeManager mgr = TeamUI.getSynchronizeManager();
      ISynchronizeView view = mgr.showSynchronizeViewInActivePage();
      mgr.addSynchronizeParticipants(new ISynchronizeParticipant[] { getParticipant() });
      view.display(participant);
    }
  }
  
  public boolean okPressed()
  {
    if (isEditable())
    {
      super.okPressed();
      return false;
    }
    if (isRememberParticipant()) {
      rememberParticipant();
    }
    return super.okPressed();
  }
  
  public void cancelPressed()
  {
    if ((isEditable()) && (isRememberParticipant())) {
      rememberParticipant();
    }
    super.cancelPressed();
  }
  
  public String getOKButtonLabel()
  {
    if (isEditable()) {
      return TeamUIMessages.ParticipantPageCompareEditorInput_0;
    }
    return TeamUIMessages.ResourceMappingMergeOperation_2;
  }
  
  private boolean isEditable()
  {
    return (getCompareConfiguration().isLeftEditable()) || (getCompareConfiguration().isRightEditable());
  }
  
  public String getCancelButtonLabel()
  {
    return TeamUIMessages.ResourceMappingMergeOperation_2;
  }
}

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

import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.ui.SaveablePartAdapter;
import org.eclipse.team.ui.SaveablePartDialog;
import org.eclipse.team.ui.TeamUI;

/**
 * @deprecated
 */
public class ParticipantPageDialog
  extends SaveablePartDialog
{
  private ISynchronizeParticipant participant;
  private Button rememberParticipantButton;
  
  public ParticipantPageDialog(Shell shell, SaveablePartAdapter input, ISynchronizeParticipant participant)
  {
    super(shell, input);
    this.participant = participant;
  }
  
  protected Control createDialogArea(Composite parent2)
  {
    Composite parent = (Composite)super.createDialogArea(parent2);
    if ((isOfferToRememberParticipant()) && (participant != null) && (!particantRegisteredWithSynchronizeManager(participant)))
    {
      rememberParticipantButton = new Button(parent, 32);
      rememberParticipantButton.setText(TeamUIMessages.ParticipantCompareDialog_1);
    }
    Dialog.applyDialogFont(parent2);
    return parent;
  }
  
  protected void buttonPressed(int buttonId)
  {
    if ((buttonId == 0) && (isRememberParticipant())) {
      rememberParticipant();
    }
    super.buttonPressed(buttonId);
  }
  
  private boolean isRememberParticipant()
  {
    return (getParticipant() != null) && (rememberParticipantButton != null) && (rememberParticipantButton.getSelection());
  }
  
  private boolean particantRegisteredWithSynchronizeManager(ISynchronizeParticipant participant)
  {
    return TeamUI.getSynchronizeManager().get(participant.getId(), participant.getSecondaryId()) != null;
  }
  
  private void rememberParticipant()
  {
    if (getParticipant() != null)
    {
      ISynchronizeManager mgr = TeamUI.getSynchronizeManager();
      ISynchronizeView view = mgr.showSynchronizeViewInActivePage();
      mgr.addSynchronizeParticipants(new ISynchronizeParticipant[] { getParticipant() });
      view.display(participant);
    }
  }
  
  protected ISynchronizeParticipant getParticipant()
  {
    return participant;
  }
  
  protected boolean isOfferToRememberParticipant()
  {
    return true;
  }
}

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

import org.eclipse.compare.CompareViewerPane;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.team.internal.ui.SWTUtils;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.internal.ui.TeamUIPlugin;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.team.internal.ui.synchronize.DialogSynchronizePageSite;
import org.eclipse.team.internal.ui.synchronize.SynchronizePageConfiguration;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.IPageBookViewPage;

public final class ParticipantPagePane
{
  private ISynchronizeParticipant participant;
  private ISynchronizePageConfiguration pageConfiguration;
  private Image titleImage;
  private Shell shell;
  private boolean isModal;
  private CompareViewerPane fEditionPane;
  private IPageBookViewPage fPage;
  private DialogSynchronizePageSite site;
  
  public ParticipantPagePane(Shell shell, boolean isModal, ISynchronizePageConfiguration pageConfiguration, ISynchronizeParticipant participant)
  {
    this.isModal = isModal;
    this.shell = shell;
    this.participant = participant;
    this.pageConfiguration = pageConfiguration;
  }
  
  public void dispose()
  {
    if (titleImage != null) {
      titleImage.dispose();
    }
    if (fPage != null) {
      fPage.dispose();
    }
    if (site != null) {
      site.dispose();
    }
  }
  
  public Image getTitleImage()
  {
    if (titleImage == null) {
      titleImage = participant.getImageDescriptor().createImage();
    }
    return titleImage;
  }
  
  public String getTitle()
  {
    return Utils.shortenText(100, participant.getName());
  }
  
  public Control createPartControl(Composite parent)
  {
    Composite top = new Composite(parent, 0);
    GridLayout layout = new GridLayout();
    marginHeight = 0;
    marginWidth = 0;
    verticalSpacing = 0;
    top.setLayout(layout);
    
    shell = parent.getShell();
    
    fEditionPane = new CompareViewerPane(top, 8390656);
    fEditionPane.setText(TeamUIMessages.ParticipantPageSaveablePart_0);
    
    fEditionPane.setLayoutData(SWTUtils.createHVFillGridData());
    
    fPage = participant.createPage(pageConfiguration);
    site = new DialogSynchronizePageSite(shell, isModal);
    ((SynchronizePageConfiguration)pageConfiguration).setSite(site);
    ToolBarManager tbm = CompareViewerPane.getToolBarManager(fEditionPane);
    site.createActionBars(tbm);
    try
    {
      ((ISynchronizePage)fPage).init(pageConfiguration.getSite());
    }
    catch (PartInitException e1)
    {
      TeamUIPlugin.log(4, TeamUIMessages.ParticipantPagePane_0, e1);
    }
    fPage.createControl(fEditionPane);
    fPage.setActionBars(site.getActionBars());
    fEditionPane.setContent(fPage.getControl());
    tbm.update(true);
    
    return top;
  }
  
  public ISynchronizePageConfiguration getPageConfiguration()
  {
    return pageConfiguration;
  }
  
  public ISynchronizeParticipant getParticipant()
  {
    return participant;
  }
}

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

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

class ParticipantPageSaveablePart$1
  implements IPropertyChangeListener
{
  final ParticipantPageSaveablePart this$0;
  
  ParticipantPageSaveablePart$1(ParticipantPageSaveablePart paramParticipantPageSaveablePart)
  {
    this$0 = paramParticipantPageSaveablePart;
  }
  
  public void propertyChange(PropertyChangeEvent event)
  {
    if (event.getProperty().equals("org.eclipse.team.ui.P_PAGE_DESCRIPTION")) {
      ParticipantPageSaveablePart.access$0(this$0);
    }
  }
}

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

import org.eclipse.compare.structuremergeviewer.ICompareInput;
import org.eclipse.jface.viewers.IOpenListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.OpenEvent;
import org.eclipse.team.internal.ui.synchronize.SyncInfoModelElement;

class ParticipantPageSaveablePart$2
  implements IOpenListener
{
  final ParticipantPageSaveablePart this$0;
  
  ParticipantPageSaveablePart$2(ParticipantPageSaveablePart paramParticipantPageSaveablePart)
  {
    this$0 = paramParticipantPageSaveablePart;
  }
  
  public void open(OpenEvent event)
  {
    ISelection s = event.getSelection();
    SyncInfoModelElement node = ParticipantPageSaveablePart.access$1(this$0, s);
    if (node == null)
    {
      ICompareInput input = this$0.getCompareInput(s);
      if (input != null) {
        ParticipantPageSaveablePart.access$2(this$0, input);
      }
    }
    else
    {
      ParticipantPageSaveablePart.access$2(this$0, node);
    }
  }
}

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

import org.eclipse.compare.CompareConfiguration;
import org.eclipse.compare.IContentChangeListener;
import org.eclipse.compare.IContentChangeNotifier;
import org.eclipse.compare.ITypedElement;
import org.eclipse.compare.structuremergeviewer.DiffNode;
import org.eclipse.compare.structuremergeviewer.ICompareInput;
import org.eclipse.compare.structuremergeviewer.IDiffElement;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.IOpenListener;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.OpenEvent;
import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.jface.viewers.Viewer;
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.synchronize.DialogSynchronizePageSite;
import org.eclipse.team.internal.ui.synchronize.LocalResourceTypedElement;
import org.eclipse.team.internal.ui.synchronize.SyncInfoModelElement;
import org.eclipse.team.internal.ui.synchronize.SynchronizePageConfiguration;
import org.eclipse.team.ui.PageSaveablePart;
import org.eclipse.team.ui.mapping.ISynchronizationCompareInput;
import org.eclipse.team.ui.mapping.SaveableComparison;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.IPageBookViewPage;

/**
 * @deprecated
 */
public class ParticipantPageSaveablePart
  extends PageSaveablePart
  implements IContentChangeListener
{
  private ISynchronizeParticipant participant;
  private ISynchronizePageConfiguration pageConfiguration;
  private Image titleImage;
  private IPageBookViewPage page;
  private DialogSynchronizePageSite site;
  private IPropertyChangeListener listener;
  private Viewer viewer;
  
  public ParticipantPageSaveablePart(Shell shell, CompareConfiguration cc, ISynchronizePageConfiguration pageConfiguration, ISynchronizeParticipant participant)
  {
    super(shell, cc);
    this.participant = participant;
    this.pageConfiguration = pageConfiguration;
  }
  
  public void dispose()
  {
    if (titleImage != null) {
      titleImage.dispose();
    }
    if (page != null) {
      page.dispose();
    }
    if (site != null) {
      site.dispose();
    }
    pageConfiguration.removePropertyChangeListener(listener);
    super.dispose();
  }
  
  public Image getTitleImage()
  {
    if (titleImage == null) {
      titleImage = participant.getImageDescriptor().createImage();
    }
    return titleImage;
  }
  
  public String getTitle()
  {
    return Utils.shortenText(100, participant.getName());
  }
  
  public boolean isDirty()
  {
    if ((participant instanceof ModelSynchronizeParticipant))
    {
      ModelSynchronizeParticipant msp = (ModelSynchronizeParticipant)participant;
      SaveableComparison currentBuffer = msp.getActiveSaveable();
      if (currentBuffer != null) {
        return currentBuffer.isDirty();
      }
    }
    return super.isDirty();
  }
  
  public void contentChanged(IContentChangeNotifier source)
  {
    try
    {
      if ((source instanceof DiffNode)) {
        commit(new NullProgressMonitor(), (DiffNode)source);
      } else if ((source instanceof LocalResourceTypedElement)) {
        ((LocalResourceTypedElement)source).commit(new NullProgressMonitor());
      }
    }
    catch (CoreException e)
    {
      Utils.handle(e);
    }
  }
  
  /* Error */
  public void doSave(IProgressMonitor pm)
  {
    // Byte code:
    //   0: aload_0
    //   1: aload_1
    //   2: invokespecial 380	org/eclipse/team/ui/PageSaveablePart:doSave	(Lorg/eclipse/core/runtime/IProgressMonitor;)V
    //   5: aload_0
    //   6: getfield 348	org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart:viewer	Lorg/eclipse/jface/viewers/Viewer;
    //   9: invokevirtual 365	org/eclipse/jface/viewers/Viewer:getInput	()Ljava/lang/Object;
    //   12: astore_2
    //   13: aload_2
    //   14: instanceof 180
    //   17: ifeq +60 -> 77
    //   20: aload_2
    //   21: checkcast 180	org/eclipse/team/ui/synchronize/ISynchronizeModelElement
    //   24: astore_3
    //   25: aload_3
    //   26: ifnull +51 -> 77
    //   29: aload_3
    //   30: instanceof 159
    //   33: ifeq +44 -> 77
    //   36: aload_1
    //   37: aload_3
    //   38: checkcast 159	org/eclipse/compare/structuremergeviewer/DiffNode
    //   41: invokestatic 394	org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart:commit	(Lorg/eclipse/core/runtime/IProgressMonitor;Lorg/eclipse/compare/structuremergeviewer/DiffNode;)V
    //   44: goto +28 -> 72
    //   47: astore 4
    //   49: aload 4
    //   51: invokestatic 368	org/eclipse/team/internal/ui/Utils:handle	(Ljava/lang/Throwable;)V
    //   54: aload_0
    //   55: iconst_0
    //   56: invokevirtual 388	org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart:setDirty	(Z)V
    //   59: goto +18 -> 77
    //   62: astore 5
    //   64: aload_0
    //   65: iconst_0
    //   66: invokevirtual 388	org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart:setDirty	(Z)V
    //   69: aload 5
    //   71: athrow
    //   72: aload_0
    //   73: iconst_0
    //   74: invokevirtual 388	org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart:setDirty	(Z)V
    //   77: return
    // Line number table:
    //   Java source line #139	-> byte code offset #0
    //   Java source line #140	-> byte code offset #5
    //   Java source line #141	-> byte code offset #13
    //   Java source line #142	-> byte code offset #20
    //   Java source line #143	-> byte code offset #25
    //   Java source line #145	-> byte code offset #36
    //   Java source line #146	-> byte code offset #47
    //   Java source line #147	-> byte code offset #49
    //   Java source line #149	-> byte code offset #54
    //   Java source line #148	-> byte code offset #62
    //   Java source line #149	-> byte code offset #64
    //   Java source line #150	-> byte code offset #69
    //   Java source line #149	-> byte code offset #72
    //   Java source line #153	-> byte code offset #77
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	78	0	this	ParticipantPageSaveablePart
    //   0	78	1	pm	IProgressMonitor
    //   12	9	2	input	Object
    //   24	14	3	root	ISynchronizeModelElement
    //   47	3	4	e	CoreException
    //   62	8	5	localObject1	Object
    // Exception table:
    //   from	to	target	type
    //   36	44	47	org/eclipse/core/runtime/CoreException
    //   36	54	62	finally
  }
  
  protected Control createPage(Composite parent, ToolBarManager toolBarManager)
  {
    listener = new IPropertyChangeListener()
    {
      public void propertyChange(PropertyChangeEvent event)
      {
        if (event.getProperty().equals("org.eclipse.team.ui.P_PAGE_DESCRIPTION")) {
          ParticipantPageSaveablePart.this.updateDescription();
        }
      }
    };
    pageConfiguration.addPropertyChangeListener(listener);
    updateDescription();
    
    page = participant.createPage(pageConfiguration);
    site = new DialogSynchronizePageSite(getShell(), true);
    ((SynchronizePageConfiguration)pageConfiguration).setSite(site);
    site.createActionBars(toolBarManager);
    try
    {
      ((ISynchronizePage)page).init(pageConfiguration.getSite());
    }
    catch (PartInitException localPartInitException) {}
    page.createControl(parent);
    
    initializeDiffViewer(((ISynchronizePage)page).getViewer());
    
    page.setActionBars(site.getActionBars());
    toolBarManager.update(true);
    viewer = ((ISynchronizePage)page).getViewer();
    
    setNavigator(pageConfiguration);
    return page.getControl();
  }
  
  protected final ISelectionProvider getSelectionProvider()
  {
    return ((ISynchronizePage)page).getViewer();
  }
  
  private void updateDescription()
  {
    String description = (String)pageConfiguration.getProperty("org.eclipse.team.ui.P_PAGE_DESCRIPTION");
    if (description != null) {
      setPageDescription(description);
    }
  }
  
  private void initializeDiffViewer(Viewer viewer)
  {
    if ((viewer instanceof StructuredViewer)) {
      ((StructuredViewer)viewer).addOpenListener(new IOpenListener()
      {
        public void open(OpenEvent event)
        {
          ISelection s = event.getSelection();
          SyncInfoModelElement node = ParticipantPageSaveablePart.this.getElement(s);
          if (node == null)
          {
            ICompareInput input = getCompareInput(s);
            if (input != null) {
              prepareCompareInput(input);
            }
          }
          else
          {
            prepareCompareInput(node);
          }
        }
      });
    }
  }
  
  /* Error */
  protected void prepareInput(ICompareInput input, CompareConfiguration configuration, IProgressMonitor monitor)
    throws java.lang.reflect.InvocationTargetException
  {
    // Byte code:
    //   0: aload_3
    //   1: getstatic 345	org/eclipse/team/internal/ui/TeamUIMessages:SyncInfoCompareInput_3	Ljava/lang/String;
    //   4: bipush 100
    //   6: invokeinterface 404 3 0
    //   11: aload_3
    //   12: getstatic 345	org/eclipse/team/internal/ui/TeamUIMessages:SyncInfoCompareInput_3	Ljava/lang/String;
    //   15: invokeinterface 403 2 0
    //   20: aload_0
    //   21: aload_0
    //   22: getfield 351	org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart:pageConfiguration	Lorg/eclipse/team/ui/synchronize/ISynchronizePageConfiguration;
    //   25: invokeinterface 412 1 0
    //   30: invokeinterface 415 1 0
    //   35: aload_1
    //   36: iconst_0
    //   37: aload_3
    //   38: invokespecial 398	org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart:checkForBufferChange	(Lorg/eclipse/swt/widgets/Shell;Lorg/eclipse/compare/structuremergeviewer/ICompareInput;ZLorg/eclipse/core/runtime/IProgressMonitor;)V
    //   41: aload_1
    //   42: instanceof 175
    //   45: ifeq +48 -> 93
    //   48: aload_1
    //   49: checkcast 175	org/eclipse/team/internal/ui/synchronize/SyncInfoModelElement
    //   52: astore 4
    //   54: aload 4
    //   56: invokevirtual 376	org/eclipse/team/internal/ui/synchronize/SyncInfoModelElement:getResource	()Lorg/eclipse/core/resources/IResource;
    //   59: astore 5
    //   61: aload 5
    //   63: ifnull +82 -> 145
    //   66: aload 5
    //   68: invokeinterface 401 1 0
    //   73: iconst_1
    //   74: if_icmpne +71 -> 145
    //   77: aload_0
    //   78: getfield 352	org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart:participant	Lorg/eclipse/team/ui/synchronize/ISynchronizeParticipant;
    //   81: aload 4
    //   83: aload_2
    //   84: aload_3
    //   85: invokeinterface 419 4 0
    //   90: goto +55 -> 145
    //   93: aload_0
    //   94: aload_1
    //   95: invokespecial 397	org/eclipse/team/ui/synchronize/ParticipantPageSaveablePart:asModelCompareInput	(Lorg/eclipse/compare/structuremergeviewer/ICompareInput;)Lorg/eclipse/team/ui/mapping/ISynchronizationCompareInput;
    //   98: astore 4
    //   100: aload 4
    //   102: ifnull +43 -> 145
    //   105: aload 4
    //   107: aload_2
    //   108: aload_3
    //   109: bipush 90
    //   111: invokestatic 367	org/eclipse/team/internal/ui/Policy:subMonitorFor	(Lorg/eclipse/core/runtime/IProgressMonitor;I)Lorg/eclipse/core/runtime/IProgressMonitor;
    //   114: invokeinterface 407 3 0
    //   119: goto +26 -> 145
    //   122: astore 4
    //   124: new 157	java/lang/reflect/InvocationTargetException
    //   127: dup
    //   128: aload 4
    //   130: invokespecial 357	java/lang/reflect/InvocationTargetException:<init>	(Ljava/lang/Throwable;)V
    //   133: athrow
    //   134: astore 6
    //   136: aload_3
    //   137: invokeinterface 402 1 0
    //   142: aload 6
    //   144: athrow
    //   145: aload_3
    //   146: invokeinterface 402 1 0
    //   151: return
    // Line number table:
    //   Java source line #235	-> byte code offset #0
    //   Java source line #236	-> byte code offset #11
    //   Java source line #239	-> byte code offset #20
    //   Java source line #240	-> byte code offset #41
    //   Java source line #241	-> byte code offset #48
    //   Java source line #242	-> byte code offset #54
    //   Java source line #243	-> byte code offset #61
    //   Java source line #244	-> byte code offset #77
    //   Java source line #247	-> byte code offset #93
    //   Java source line #248	-> byte code offset #100
    //   Java source line #249	-> byte code offset #105
    //   Java source line #252	-> byte code offset #122
    //   Java source line #253	-> byte code offset #124
    //   Java source line #254	-> byte code offset #134
    //   Java source line #255	-> byte code offset #136
    //   Java source line #256	-> byte code offset #142
    //   Java source line #255	-> byte code offset #145
    //   Java source line #257	-> byte code offset #151
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	152	0	this	ParticipantPageSaveablePart
    //   0	152	1	input	ICompareInput
    //   0	152	2	configuration	CompareConfiguration
    //   0	152	3	monitor	IProgressMonitor
    //   52	30	4	node	SyncInfoModelElement
    //   98	8	4	adapter	ISynchronizationCompareInput
    //   122	7	4	e	CoreException
    //   59	8	5	resource	org.eclipse.core.resources.IResource
    //   134	9	6	localObject	Object
    // Exception table:
    //   from	to	target	type
    //   20	119	122	org/eclipse/core/runtime/CoreException
    //   20	134	134	finally
  }
  
  private void checkForBufferChange(Shell shell, ICompareInput input, boolean cancelAllowed, IProgressMonitor monitor)
    throws CoreException
  {
    ISynchronizeParticipant participant = pageConfiguration.getParticipant();
    if ((participant instanceof ModelSynchronizeParticipant))
    {
      ModelSynchronizeParticipant msp = (ModelSynchronizeParticipant)participant;
      if ((input instanceof ISynchronizationCompareInput))
      {
        ISynchronizationCompareInput mci = (ISynchronizationCompareInput)input;
        msp.checkForBufferChange(shell, mci, cancelAllowed, monitor);
      }
    }
  }
  
  private ISynchronizationCompareInput asModelCompareInput(ICompareInput input)
  {
    return (ISynchronizationCompareInput)Utils.getAdapter(input, ISynchronizationCompareInput.class);
  }
  
  private SyncInfoModelElement getElement(ISelection selection)
  {
    ICompareInput input = getCompareInput(selection);
    if ((input instanceof SyncInfoModelElement)) {
      return (SyncInfoModelElement)input;
    }
    return null;
  }
  
  private static void commit(IProgressMonitor pm, DiffNode node)
    throws CoreException
  {
    ITypedElement left = node.getLeft();
    if ((left instanceof LocalResourceTypedElement)) {
      ((LocalResourceTypedElement)left).commit(pm);
    }
    ITypedElement right = node.getRight();
    if ((right instanceof LocalResourceTypedElement)) {
      ((LocalResourceTypedElement)right).commit(pm);
    }
    IDiffElement[] children = node.getChildren();
    for (int i = 0; i < children.length; i++) {
      commit(pm, (DiffNode)children[i]);
    }
  }
  
  public ISynchronizePageConfiguration getPageConfiguration()
  {
    return pageConfiguration;
  }
  
  public ISynchronizeParticipant getParticipant()
  {
    return participant;
  }
  
  protected ICompareInput getCompareInput(ISelection selection)
  {
    ICompareInput compareInput = super.getCompareInput(selection);
    if (compareInput != null) {
      return compareInput;
    }
    if ((selection != null) && ((selection instanceof IStructuredSelection)))
    {
      IStructuredSelection ss = (IStructuredSelection)selection;
      if (ss.size() == 1)
      {
        Object o = ss.getFirstElement();
        if ((participant instanceof ModelSynchronizeParticipant))
        {
          ModelSynchronizeParticipant msp = (ModelSynchronizeParticipant)participant;
          return msp.asCompareInput(o);
        }
      }
    }
    return null;
  }
}

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

import org.eclipse.core.resources.IResource;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.osgi.util.NLS;
import org.eclipse.team.internal.ui.TeamUIMessages;
import org.eclipse.team.ui.TeamImages;

public abstract class ParticipantSynchronizeWizard
  extends Wizard
{
  private WizardPage selectionPage;
  private IWizard importWizard;
  
  protected ParticipantSynchronizeWizard()
  {
    setDefaultPageImageDescriptor(TeamImages.getImageDescriptor("wizban/share_wizban.png"));
    setNeedsProgressMonitor(false);
  }
  
  public String getWindowTitle()
  {
    return TeamUIMessages.GlobalRefreshSubscriberPage_0;
  }
  
  public void addPages()
  {
    if (getRootResources().length == 0)
    {
      importWizard = getImportWizard();
      if (importWizard != null)
      {
        importWizard.setContainer(getContainer());
        importWizard.addPages();
        IWizardPage startingPage = importWizard.getStartingPage();
        if (startingPage != null)
        {
          startingPage.setTitle(NLS.bind(TeamUIMessages.SubscriberParticipantWizard_0, new String[] { getPageTitle() }));
          startingPage.setDescription(NLS.bind(TeamUIMessages.SubscriberParticipantWizard_1, new String[] { importWizard.getWindowTitle() }));
        }
      }
    }
    else
    {
      selectionPage = createScopeSelectionPage();
      selectionPage.setTitle(NLS.bind(TeamUIMessages.GlobalRefreshSubscriberPage_1, new String[] { getPageTitle() }));
      selectionPage.setMessage(TeamUIMessages.GlobalRefreshSubscriberPage_2);
      addPage(selectionPage);
    }
  }
  
  public boolean performFinish()
  {
    if (importWizard != null) {
      return importWizard.performFinish();
    }
    createParticipant();
    return true;
  }
  
  public IWizardPage getNextPage(IWizardPage page)
  {
    if (importWizard != null) {
      return importWizard.getNextPage(page);
    }
    return super.getNextPage(page);
  }
  
  public boolean performCancel()
  {
    if (importWizard != null) {
      return importWizard.performCancel();
    }
    return super.performCancel();
  }
  
  public boolean canFinish()
  {
    if (importWizard != null) {
      return importWizard.canFinish();
    }
    return super.canFinish();
  }
  
  public IWizardPage getStartingPage()
  {
    if (importWizard != null) {
      return importWizard.getStartingPage();
    }
    return super.getStartingPage();
  }
  
  protected abstract String getPageTitle();
  
  protected abstract IWizard getImportWizard();
  
  protected abstract IResource[] getRootResources();
  
  protected abstract WizardPage createScopeSelectionPage();
  
  protected abstract void createParticipant();
}

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

import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.team.internal.ui.Utils;
import org.eclipse.ui.IMemento;

public class ResourceScope
  extends AbstractSynchronizeScope
{
  private static final String CTX_ROOT = "resource_scope_roots";
  private static final String CTX_ROOT_PATH = "resource_scope_root_resource";
  private IResource[] resources;
  
  public ResourceScope(IResource[] resources)
  {
    this.resources = resources;
  }
  
  protected ResourceScope(IMemento memento)
  {
    super(memento);
  }
  
  public void setResources(IResource[] resources)
  {
    this.resources = resources;
    fireRootsChanges();
  }
  
  public String getName()
  {
    return Utils.convertSelection(resources);
  }
  
  public IResource[] getRoots()
  {
    return resources;
  }
  
  public void dispose() {}
  
  public void saveState(IMemento memento)
  {
    if (resources != null) {
      for (int i = 0; i < resources.length; i++)
      {
        IResource resource = resources[i];
        IMemento rootNode = memento.createChild("resource_scope_roots");
        rootNode.putString("resource_scope_root_resource", resource.getFullPath().toString());
      }
    }
  }
  
  protected void init(IMemento memento)
  {
    IMemento[] rootNodes = memento.getChildren("resource_scope_roots");
    if (rootNodes != null)
    {
      List resources = new ArrayList();
      for (int i = 0; i < rootNodes.length; i++)
      {
        IMemento rootNode = rootNodes[i];
        IPath path = new Path(rootNode.getString("resource_scope_root_resource"));
        IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(path, true);
        if (resource != null) {
          resources.add(resource);
        }
      }
      this.resources = ((IResource[])resources.toArray(new IResource[resources.size()]));
    }
  }
}

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

import org.eclipse.compare.structuremergeviewer.ICompareInput;
import org.eclipse.compare.structuremergeviewer.ICompareInputChangeListener;

class SaveableCompareEditorInput$1
  implements ICompareInputChangeListener
{
  final SaveableCompareEditorInput this$0;
  
  SaveableCompareEditorInput$1(SaveableCompareEditorInput paramSaveableCompareEditorInput)
  {
    this$0 = paramSaveableCompareEditorInput;
  }
  
  public void compareInputChanged(ICompareInput source)
  {
    if (source == this$0.getCompareResult())
    {
      boolean closed = false;
      if (source.getKind() == 0) {
        closed = this$0.closeEditor(true);
      }
      if (!closed) {
        this$0.propogateInputChange();
      }
    }
  }
}

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

import org.eclipse.ui.IPropertyListener;
import org.eclipse.ui.Saveable;

class SaveableCompareEditorInput$2
  implements IPropertyListener
{
  final SaveableCompareEditorInput this$0;
  
  SaveableCompareEditorInput$2(SaveableCompareEditorInput paramSaveableCompareEditorInput)
  {
    this$0 = paramSaveableCompareEditorInput;
  }
  
  public void propertyChanged(Object source, int propId)
  {
    if (propId == 257) {
      this$0.setDirty(SaveableCompareEditorInput.access$2(this$0).isDirty());
    }
  }
}

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

import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;

class SaveableCompareEditorInput$3
  implements Runnable
{
  final SaveableCompareEditorInput this$0;
  private final IWorkbenchPage val$page;
  
  SaveableCompareEditorInput$3(SaveableCompareEditorInput paramSaveableCompareEditorInput, IWorkbenchPage paramIWorkbenchPage)
  {
    this$0 = paramSaveableCompareEditorInput;val$page = paramIWorkbenchPage;
  }
  
  public void run()
  {
    Shell shell = val$page.getWorkbenchWindow().getShell();
    if (shell == null) {
      return;
    }
    IEditorPart part = val$page.findEditor(this$0);
    SaveableCompareEditorInput.access$3(this$0).closeEditor(part, false);
  }
}

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

import org.eclipse.compare.structuremergeviewer.ICompareInput;
import org.eclipse.compare.structuremergeviewer.ICompareInputChangeListener;
import org.eclipse.core.runtime.ISafeRunnable;

class SaveableCompareEditorInput$4
  implements ISafeRunnable
{
  final SaveableCompareEditorInput this$0;
  private final ICompareInputChangeListener val$listener;
  
  SaveableCompareEditorInput$4(SaveableCompareEditorInput paramSaveableCompareEditorInput, ICompareInputChangeListener paramICompareInputChangeListener)
  {
    this$0 = paramSaveableCompareEditorInput;val$listener = paramICompareInputChangeListener;
  }
  
  public void run()
    throws Exception
  {
    val$listener.compareInputChanged((ICompareInput)this$0.getCompareResult());
  }
  
  public void handleException(Throwable exception) {}
}

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

import org.eclipse.compare.IPropertyChangeNotifier;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;

class SaveableCompareEditorInput$5
  implements DisposeListener
{
  final SaveableCompareEditorInput this$0;
  private final IPropertyChangeNotifier val$dsp;
  private final IPropertyChangeListener val$pcl;
  
  SaveableCompareEditorInput$5(SaveableCompareEditorInput paramSaveableCompareEditorInput, IPropertyChangeNotifier paramIPropertyChangeNotifier, IPropertyChangeListener paramIPropertyChangeListener)
  {
    this$0 = paramSaveableCompareEditorInput;val$dsp = paramIPropertyChangeNotifier;val$pcl = paramIPropertyChangeListener;
  }
  
  public void widgetDisposed(DisposeEvent e)
  {
    val$dsp.removePropertyChangeListener(val$pcl);
  }
}

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

import org.eclipse.compare.ITypedElement;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.team.internal.ui.synchronize.SaveablesCompareEditorInput;
import org.eclipse.ui.Saveable;

class SaveableCompareEditorInput$6
  implements IMenuListener
{
  final SaveableCompareEditorInput this$0;
  private final Saveable val$saveable;
  private final ITypedElement val$element;
  private final ISelectionProvider val$selectionProvider;
  
  SaveableCompareEditorInput$6(SaveableCompareEditorInput paramSaveableCompareEditorInput, Saveable paramSaveable, ITypedElement paramITypedElement, ISelectionProvider paramISelectionProvider)
  {
    this$0 = paramSaveableCompareEditorInput;val$saveable = paramSaveable;val$element = paramITypedElement;val$selectionProvider = paramISelectionProvider;
  }
  
  public void menuAboutToShow(IMenuManager manager)
  {
    SaveablesCompareEditorInput.handleMenuAboutToShow(manager, this$0.getContainer(), val$saveable, val$element, val$selectionProvider);
  }
}

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

import org.eclipse.compare.CompareEditorInput;
import org.eclipse.compare.ICompareContainer;
import org.eclipse.compare.ITypedElement;
import org.eclipse.compare.structuremergeviewer.ICompareInput;
import org.eclipse.team.internal.ui.synchronize.EditableSharedDocumentAdapter.ISharedDocumentAdapterListener;
import org.eclipse.team.internal.ui.sync
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