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

  308: aload_0
    //   309: getfield 572	org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler:additionsMap	Ljava/util/Map;
    //   312: ifnull +145 -> 457
    //   315: aload_0
    //   316: getfield 572	org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler:additionsMap	Ljava/util/Map;
    //   319: invokeinterface 672 1 0
    //   324: ifne +133 -> 457
    //   327: aload_3
    //   328: invokestatic 613	org/eclipse/team/internal/ui/Utils:canUpdateViewer	(Lorg/eclipse/jface/viewers/StructuredViewer;)Z
    //   331: ifeq +126 -> 457
    //   334: aload_0
    //   335: getfield 572	org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler:additionsMap	Ljava/util/Map;
    //   338: invokeinterface 673 1 0
    //   343: invokeinterface 681 1 0
    //   348: astore 7
    //   350: goto +92 -> 442
    //   353: aload 7
    //   355: invokeinterface 671 1 0
    //   360: checkcast 328	org/eclipse/team/ui/synchronize/ISynchronizeModelElement
    //   363: astore 8
    //   365: getstatic 569	org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler:DEBUG	Z
    //   368: ifeq +32 -> 400
    //   371: getstatic 565	java/lang/System:out	Ljava/io/PrintStream;
    //   374: new 280	java/lang/StringBuffer
    //   377: dup
    //   378: ldc_w 263
    //   381: invokespecial 582	java/lang/StringBuffer:<init>	(Ljava/lang/String;)V
    //   384: aload 8
    //   386: invokeinterface 692 1 0
    //   391: invokevirtual 584	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   394: invokevirtual 581	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   397: invokevirtual 579	java/io/PrintStream:println	(Ljava/lang/String;)V
    //   400: aload_0
    //   401: getfield 572	org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler:additionsMap	Ljava/util/Map;
    //   404: aload 8
    //   406: invokeinterface 674 2 0
    //   411: checkcast 289	java/util/Set
    //   414: astore 9
    //   416: aload_3
    //   417: checkcast 299	org/eclipse/jface/viewers/AbstractTreeViewer
    //   420: aload 8
    //   422: aload 9
    //   424: aload 9
    //   426: invokeinterface 676 1 0
    //   431: anewarray 277	java/lang/Object
    //   434: invokeinterface 682 2 0
    //   439: invokevirtual 594	org/eclipse/jface/viewers/AbstractTreeViewer:add	(Ljava/lang/Object;[Ljava/lang/Object;)V
    //   442: aload 7
    //   444: invokeinterface 670 1 0
    //   449: ifne -96 -> 353
    //   452: aload_0
    //   453: aconst_null
    //   454: putfield 572	org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler:additionsMap	Ljava/util/Map;
    //   457: aload 4
    //   459: ifnull +12 -> 471
    //   462: aload_0
    //   463: getfield 576	org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler:provider	Lorg/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider;
    //   466: aload 4
    //   468: invokevirtual 620	org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider:expandResources	([Lorg/eclipse/core/resources/IResource;)V
    //   471: aload 5
    //   473: ifnull +28 -> 501
    //   476: aload_0
    //   477: getfield 576	org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler:provider	Lorg/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider;
    //   480: aload 5
    //   482: invokevirtual 621	org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider:selectResources	([Lorg/eclipse/core/resources/IResource;)V
    //   485: goto +16 -> 501
    //   488: astore 10
    //   490: aload_3
    //   491: invokevirtual 595	org/eclipse/jface/viewers/StructuredViewer:getControl	()Lorg/eclipse/swt/widgets/Control;
    //   494: iconst_1
    //   495: invokevirtual 598	org/eclipse/swt/widgets/Control:setRedraw	(Z)V
    //   498: aload 10
    //   500: athrow
    //   501: aload_3
    //   502: invokevirtual 595	org/eclipse/jface/viewers/StructuredViewer:getControl	()Lorg/eclipse/swt/widgets/Control;
    //   505: iconst_1
    //   506: invokevirtual 598	org/eclipse/swt/widgets/Control:setRedraw	(Z)V
    //   509: aload_0
    //   510: getfield 576	org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler:provider	Lorg/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider;
    //   513: invokevirtual 624	org/eclipse/team/internal/ui/synchronize/AbstractSynchronizeModelProvider:getModelRoot	()Lorg/eclipse/team/ui/synchronize/ISynchronizeModelElement;
    //   516: astore 6
    //   518: aload 6
    //   520: instanceof 317
    //   523: ifeq +11 -> 534
    //   526: aload 6
    //   528: checkcast 317	org/eclipse/team/internal/ui/synchronize/SynchronizeModelElement
    //   531: invokevirtual 630	org/eclipse/team/internal/ui/synchronize/SynchronizeModelElement:fireChanges	()V
    //   534: return
    // Line number table:
    //   Java source line #562	-> byte code offset #0
    //   Java source line #563	-> byte code offset #5
    //   Java source line #564	-> byte code offset #11
    //   Java source line #566	-> byte code offset #17
    //   Java source line #567	-> byte code offset #24
    //   Java source line #568	-> byte code offset #32
    //   Java source line #569	-> byte code offset #36
    //   Java source line #570	-> byte code offset #45
    //   Java source line #572	-> byte code offset #54
    //   Java source line #573	-> byte code offset #68
    //   Java source line #575	-> byte code offset #79
    //   Java source line #576	-> byte code offset #88
    //   Java source line #577	-> byte code offset #90
    //   Java source line #579	-> byte code offset #97
    //   Java source line #580	-> byte code offset #123
    //   Java source line #581	-> byte code offset #142
    //   Java source line #582	-> byte code offset #154
    //   Java source line #583	-> byte code offset #160
    //   Java source line #585	-> byte code offset #189
    //   Java source line #586	-> byte code offset #205
    //   Java source line #580	-> byte code offset #231
    //   Java source line #588	-> byte code offset #241
    //   Java source line #590	-> byte code offset #246
    //   Java source line #591	-> byte code offset #251
    //   Java source line #593	-> byte code offset #260
    //   Java source line #594	-> byte code offset #265
    //   Java source line #596	-> byte code offset #277
    //   Java source line #597	-> byte code offset #279
    //   Java source line #598	-> byte code offset #287
    //   Java source line #597	-> byte code offset #290
    //   Java source line #600	-> byte code offset #298
    //   Java source line #577	-> byte code offset #301
    //   Java source line #579	-> byte code offset #308
    //   Java source line #580	-> byte code offset #334
    //   Java source line #581	-> byte code offset #353
    //   Java source line #582	-> byte code offset #365
    //   Java source line #583	-> byte code offset #371
    //   Java source line #585	-> byte code offset #400
    //   Java source line #586	-> byte code offset #416
    //   Java source line #580	-> byte code offset #442
    //   Java source line #588	-> byte code offset #452
    //   Java source line #590	-> byte code offset #457
    //   Java source line #591	-> byte code offset #462
    //   Java source line #593	-> byte code offset #471
    //   Java source line #594	-> byte code offset #476
    //   Java source line #596	-> byte code offset #488
    //   Java source line #597	-> byte code offset #490
    //   Java source line #598	-> byte code offset #498
    //   Java source line #597	-> byte code offset #501
    //   Java source line #602	-> byte code offset #509
    //   Java source line #603	-> byte code offset #518
    //   Java source line #604	-> byte code offset #526
    //   Java source line #605	-> byte code offset #534
    // Local variable table:
    //   start	length	slot	name	signature
    //   0	535	0	this	SynchronizeModelUpdateHandler
    //   0	535	1	runnable	Runnable
    //   0	535	2	preserveExpansion	boolean
    //   4	498	3	viewer	StructuredViewer
    //   9	458	4	expanded	IResource[]
    //   15	466	5	selected	IResource[]
    //   88	211	6	localObject1	Object
    //   516	11	6	root	ISynchronizeModelElement
    //   137	95	7	iter	java.util.Iterator
    //   348	95	7	iter	java.util.Iterator
    //   152	58	8	parent	ISynchronizeModelElement
    //   363	58	8	parent	ISynchronizeModelElement
    //   203	11	9	toAdd	Set
    //   414	11	9	toAdd	Set
    //   277	11	10	localObject2	Object
    //   488	11	10	localObject3	Object
    // Exception table:
    //   from	to	target	type
    //   17	88	88	finally
    //   97	277	277	finally
    //   308	488	488	finally
  }
  
  public void performUpdate(IWorkspaceRunnable runnable, boolean preserveExpansion, boolean updateInUIThread)
  {
    if (updateInUIThread) {
      queueEvent(new BackgroundEventHandler.RunnableEvent(getUIUpdateRunnable(runnable, preserveExpansion), true), true);
    } else {
      queueEvent(new BackgroundEventHandler.RunnableEvent(getBackgroundUpdateRunnable(runnable, preserveExpansion), true), true);
    }
  }
  
  private IWorkspaceRunnable getUIUpdateRunnable(IWorkspaceRunnable runnable, boolean preserveExpansion)
  {
    new IWorkspaceRunnable()
    {
      private final IWorkspaceRunnable val$runnable;
      
      public void run(IProgressMonitor monitor)
        throws CoreException
      {
        CoreException[] exception = new CoreException[1];
        runViewUpdate(new SynchronizeModelUpdateHandler.7(this, val$runnable, monitor, exception), 
        
          true);
        if (exception[0] != null) {
          throw exception[0];
        }
      }
    };
  }
  
  private IWorkspaceRunnable getBackgroundUpdateRunnable(IWorkspaceRunnable runnable, boolean preserveExpansion)
  {
    new IWorkspaceRunnable()
    {
      IResource[] expanded;
      IResource[] selected;
      private final boolean val$preserveExpansion;
      private final IWorkspaceRunnable val$runnable;
      
      /* Error */
      public void run(IProgressMonitor monitor)
        throws CoreException
      {
        // Byte code:
        //   0: aload_0
        //   1: getfield 80	org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler$8:val$preserveExpansion	Z
        //   4: ifeq +7 -> 11
        //   7: aload_0
        //   8: invokespecial 92	org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler$8:recordExpandedResources	()V
        //   11: aload_0
        //   12: getfield 82	org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler$8:this$0	Lorg/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler;
        //   15: iconst_1
        //   16: invokestatic 90	org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler:access$2	(Lorg/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler;Z)V
        //   19: aload_0
        //   20: getfield 81	org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler$8:val$runnable	Lorg/eclipse/core/resources/IWorkspaceRunnable;
        //   23: aload_1
        //   24: invokeinterface 95 2 0
        //   29: goto +14 -> 43
        //   32: astore_2
        //   33: aload_0
        //   34: getfield 82	org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler$8:this$0	Lorg/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler;
        //   37: iconst_0
        //   38: invokestatic 90	org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler:access$2	(Lorg/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler;Z)V
        //   41: aload_2
        //   42: athrow
        //   43: aload_0
        //   44: getfield 82	org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler$8:this$0	Lorg/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler;
        //   47: iconst_0
        //   48: invokestatic 90	org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler:access$2	(Lorg/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler;Z)V
        //   51: aload_0
        //   52: invokespecial 93	org/eclipse/team/internal/ui/synchronize/SynchronizeModelUpdateHandler$8:updateView	()V
        //   55: return
        // Line number table:
        //   Java source line #656	-> byte code offset #0
        //   Java source line #657	-> byte code offset #7
        //   Java source line #659	-> byte code offset #11
        //   Java source line #660	-> byte code offset #19
        //   Java source line #661	-> byte code offset #32
        //   Java source line #662	-> byte code offset #33
        //   Java source line #663	-> byte code offset #41
        //   Java source line #662	-> byte code offset #43
        //   Java source line #664	-> byte code offset #51
        //   Java source line #666	-> byte code offset #55
        // Local variable table:
        //   start	length	slot	name	signature
        //   0	56	0	this	8
        //   0	56	1	monitor	IProgressMonitor
        //   32	10	2	localObject	Object
        // Exception table:
        //   from	to	target	type
        //   11	32	32	finally
      }
      
      private void recordExpandedResources()
      {
        StructuredViewer viewer = getViewer();
        if ((viewer != null) && (!viewer.getControl().isDisposed()) && ((viewer instanceof AbstractTreeViewer))) {
          viewer.getControl().getDisplay().syncExec(new SynchronizeModelUpdateHandler.9(this, viewer));
        }
      }
      
      private void updateView()
      {
        runViewUpdate(new SynchronizeModelUpdateHandler.10(this), 
        
          false);
      }
    };
  }
  
  private void executeRunnable(BackgroundEventHandler.Event event, IProgressMonitor monitor)
  {
    try
    {
      dispatchEvents(Policy.subMonitorFor(monitor, 1));
    }
    catch (TeamException e)
    {
      handleException(e);
    }
    try
    {
      ((BackgroundEventHandler.RunnableEvent)event).run(Policy.subMonitorFor(monitor, 1));
    }
    catch (CoreException e)
    {
      handleException(e);
    }
  }
  
  protected void doAdd(ISynchronizeModelElement parent, ISynchronizeModelElement element)
  {
    if (additionsMap == null)
    {
      if (DEBUG) {
        System.out.println("Added view item " + element.getName());
      }
      AbstractTreeViewer viewer = (AbstractTreeViewer)getViewer();
      viewer.add(parent, element);
    }
    else
    {
      if (DEBUG) {
        System.out.println("Queueing view item for addition " + element.getName());
      }
      Set toAdd = (Set)additionsMap.get(parent);
      if (toAdd == null)
      {
        toAdd = new HashSet();
        additionsMap.put(parent, toAdd);
      }
      toAdd.add(element);
    }
  }
}

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

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;

class SynchronizePageConfiguration$1
  implements ISafeRunnable
{
  final SynchronizePageConfiguration this$0;
  private final IPropertyChangeListener val$listener;
  private final PropertyChangeEvent val$event;
  
  SynchronizePageConfiguration$1(SynchronizePageConfiguration paramSynchronizePageConfiguration, IPropertyChangeListener paramIPropertyChangeListener, PropertyChangeEvent paramPropertyChangeEvent)
  {
    this$0 = paramSynchronizePageConfiguration;val$listener = paramIPropertyChangeListener;val$event = paramPropertyChangeEvent;
  }
  
  public void handleException(Throwable exception) {}
  
  public void run()
    throws Exception
  {
    val$listener.propertyChange(val$event);
  }
}

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

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;

class SynchronizePageConfiguration$2
  implements ISafeRunnable
{
  final SynchronizePageConfiguration this$0;
  private final SynchronizePageActionGroup val$contribution;
  private final ISynchronizePageConfiguration val$configuration;
  
  SynchronizePageConfiguration$2(SynchronizePageConfiguration paramSynchronizePageConfiguration, SynchronizePageActionGroup paramSynchronizePageActionGroup, ISynchronizePageConfiguration paramISynchronizePageConfiguration)
  {
    this$0 = paramSynchronizePageConfiguration;val$contribution = paramSynchronizePageActionGroup;val$configuration = paramISynchronizePageConfiguration;
  }
  
  public void handleException(Throwable exception) {}
  
  public void run()
    throws Exception
  {
    val$contribution.initialize(val$configuration);
  }
}

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

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;
import org.eclipse.ui.actions.ActionContext;

class SynchronizePageConfiguration$3
  implements ISafeRunnable
{
  final SynchronizePageConfiguration this$0;
  private final SynchronizePageActionGroup val$contribution;
  private final ActionContext val$context;
  
  SynchronizePageConfiguration$3(SynchronizePageConfiguration paramSynchronizePageConfiguration, SynchronizePageActionGroup paramSynchronizePageActionGroup, ActionContext paramActionContext)
  {
    this$0 = paramSynchronizePageConfiguration;val$contribution = paramSynchronizePageActionGroup;val$context = paramActionContext;
  }
  
  public void handleException(Throwable exception) {}
  
  public void run()
    throws Exception
  {
    val$contribution.setContext(val$context);
  }
}

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

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;

class SynchronizePageConfiguration$4
  implements ISafeRunnable
{
  final SynchronizePageConfiguration this$0;
  private final SynchronizePageActionGroup val$contribution;
  private final IMenuManager val$manager;
  
  SynchronizePageConfiguration$4(SynchronizePageConfiguration paramSynchronizePageConfiguration, SynchronizePageActionGroup paramSynchronizePageActionGroup, IMenuManager paramIMenuManager)
  {
    this$0 = paramSynchronizePageConfiguration;val$contribution = paramSynchronizePageActionGroup;val$manager = paramIMenuManager;
  }
  
  public void handleException(Throwable exception) {}
  
  public void run()
    throws Exception
  {
    val$contribution.fillContextMenu(val$manager);
  }
}

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

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;
import org.eclipse.ui.IActionBars;

class SynchronizePageConfiguration$5
  implements ISafeRunnable
{
  final SynchronizePageConfiguration this$0;
  private final SynchronizePageActionGroup val$contribution;
  private final IActionBars val$actionBars;
  
  SynchronizePageConfiguration$5(SynchronizePageConfiguration paramSynchronizePageConfiguration, SynchronizePageActionGroup paramSynchronizePageActionGroup, IActionBars paramIActionBars)
  {
    this$0 = paramSynchronizePageConfiguration;val$contribution = paramSynchronizePageActionGroup;val$actionBars = paramIActionBars;
  }
  
  public void handleException(Throwable exception) {}
  
  public void run()
    throws Exception
  {
    val$contribution.fillActionBars(val$actionBars);
  }
}

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

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;

class SynchronizePageConfiguration$6
  implements ISafeRunnable
{
  final SynchronizePageConfiguration this$0;
  private final SynchronizePageActionGroup val$contribution;
  
  SynchronizePageConfiguration$6(SynchronizePageConfiguration paramSynchronizePageConfiguration, SynchronizePageActionGroup paramSynchronizePageActionGroup)
  {
    this$0 = paramSynchronizePageConfiguration;val$contribution = paramSynchronizePageActionGroup;
  }
  
  public void handleException(Throwable exception) {}
  
  public void run()
    throws Exception
  {
    val$contribution.updateActionBars();
  }
}

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

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;

class SynchronizePageConfiguration$7
  implements ISafeRunnable
{
  final SynchronizePageConfiguration this$0;
  private final SynchronizePageActionGroup val$contribution;
  private final ISynchronizeModelElement val$root;
  
  SynchronizePageConfiguration$7(SynchronizePageConfiguration paramSynchronizePageConfiguration, SynchronizePageActionGroup paramSynchronizePageActionGroup, ISynchronizeModelElement paramISynchronizeModelElement)
  {
    this$0 = paramSynchronizePageConfiguration;val$contribution = paramSynchronizePageActionGroup;val$root = paramISynchronizeModelElement;
  }
  
  public void handleException(Throwable exception) {}
  
  public void run()
    throws Exception
  {
    val$contribution.modelChanged(val$root);
  }
}

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

import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;

class SynchronizePageConfiguration$8
  implements ISafeRunnable
{
  final SynchronizePageConfiguration this$0;
  private final SynchronizePageActionGroup val$contribution;
  
  SynchronizePageConfiguration$8(SynchronizePageConfiguration paramSynchronizePageConfiguration, SynchronizePageActionGroup paramSynchronizePageActionGroup)
  {
    this$0 = paramSynchronizePageConfiguration;val$contribution = paramSynchronizePageActionGroup;
  }
  
  public void handleException(Throwable exception) {}
  
  public void run()
    throws Exception
  {
    val$contribution.dispose();
  }
}

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

import java.util.HashMap;
import java.util.Map;
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.team.core.diff.IDiff;
import org.eclipse.team.core.diff.IThreeWayDiff;
import org.eclipse.team.core.mapping.IResourceDiff;
import org.eclipse.team.core.synchronize.SyncInfoSet;
import org.eclipse.team.ui.synchronize.ISynchronizeModelElement;
import org.eclipse.team.ui.synchronize.ISynchronizePage;
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
import org.eclipse.team.ui.synchronize.ISynchronizePageSite;
import org.eclipse.team.ui.synchronize.ISynchronizeParticipant;
import org.eclipse.team.ui.synchronize.SynchronizePageActionGroup;
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.actions.ActionContext;

public class SynchronizePageConfiguration
  extends SynchronizePageActionGroup
  implements ISynchronizePageConfiguration
{
  public static final String P_MODEL = "org.eclipse.team.ui.P_MODEL";
  public static final String P_ADVISOR = "org.eclipse.team.ui.P_ADVISOR";
  public static final String P_NAVIGATOR = "org.eclipse.team.ui.P_NAVIGATOR";
  public static final String P_INPUT_NAVIGATOR = "org.eclipse.team.ui.P_INPUT_NAVIGATOR";
  public static final String P_MODEL_MANAGER = "org.eclipse.team.ui.P_MODEL_MANAGER";
  public static final String P_WORKING_SET_SYNC_INFO_SET = "org.eclipse.team.ui.P_WORKING_SET_SYNC_INFO_SET";
  public static final String P_PARTICIPANT_SYNC_INFO_SET = "org.eclipse.team.ui.P_PARTICIPANT_SYNC_INFO_SET";
  public static final String P_OPEN_ACTION = "org.eclipse.team.ui.P_OPEN_ACTION";
  public static final String P_VIEWER_STYLE = "org.eclipse.team.ui.P_VIEWER_STYLE";
  public static final int CHECKBOX = 1;
  private static final int UNINITIALIZED = 0;
  private static final int INITIALIZED = 1;
  private static final int DISPOSED = 2;
  private ISynchronizeParticipant participant;
  private ISynchronizePageSite site;
  private ListenerList propertyChangeListeners = new ListenerList(1);
  private ListenerList actionContributions = new ListenerList(1);
  private Map properties = new HashMap();
  private int actionState = 0;
  private ISynchronizePage page;
  private IRunnableContext context;
  
  public SynchronizePageConfiguration(ISynchronizeParticipant participant)
  {
    this.participant = participant;
    setProperty("org.eclipse.team.ui.P_CONTEXT_MENU", DEFAULT_CONTEXT_MENU);
    setProperty("org.eclipse.team.ui.P_TOOLBAR_MENU", DEFAULT_TOOLBAR_MENU);
    setProperty("org.eclipse.team.ui.P_VIEW_MENU", DEFAULT_VIEW_MENU);
    setProperty("org.eclipse.team.ui.P_COMPARISON_TYPE", "three-way");
  }
  
  public ISynchronizeParticipant getParticipant()
  {
    return participant;
  }
  
  public ISynchronizePageSite getSite()
  {
    return site;
  }
  
  public void setSite(ISynchronizePageSite site)
  {
    this.site = site;
  }
  
  public void addPropertyChangeListener(IPropertyChangeListener listener)
  {
    synchronized (propertyChangeListeners)
    {
      propertyChangeListeners.add(listener);
    }
  }
  
  public void removePropertyChangeListener(IPropertyChangeListener listener)
  {
    synchronized (propertyChangeListeners)
    {
      propertyChangeListeners.remove(listener);
    }
  }
  
  public void setProperty(String key, Object newValue)
  {
    Object oldValue = properties.get(key);
    if ((page == null) || (page.aboutToChangeProperty(this, key, newValue)))
    {
      properties.put(key, newValue);
      if ((oldValue == null) || (!oldValue.equals(newValue))) {
        firePropertyChange(key, oldValue, newValue);
      }
    }
  }
  
  public Object getProperty(String key)
  {
    return properties.get(key);
  }
  
  public void addActionContribution(SynchronizePageActionGroup contribution)
  {
    synchronized (actionContributions)
    {
      int currentActionState = actionState;
      if (currentActionState != 2) {
        actionContributions.add(contribution);
      }
    }
    int currentActionState;
    if (currentActionState == 1)
    {
      contribution.initialize(this);
      if (actionState == 2) {
        contribution.dispose();
      }
    }
    else if (currentActionState == 2)
    {
      contribution.dispose();
    }
  }
  
  public void removeActionContribution(SynchronizePageActionGroup contribution)
  {
    synchronized (actionContributions)
    {
      actionContributions.remove(contribution);
    }
  }
  
  private void firePropertyChange(String key, Object oldValue, Object newValue)
  {
    Object[] listeners;
    synchronized (propertyChangeListeners)
    {
      listeners = propertyChangeListeners.getListeners();
    }
    Object[] listeners;
    PropertyChangeEvent event = new PropertyChangeEvent(this, key, oldValue, newValue);
    for (int i = 0; i < listeners.length; i++)
    {
      IPropertyChangeListener listener = (IPropertyChangeListener)listeners[i];
      SafeRunner.run(new ISafeRunnable()
      {
        private final IPropertyChangeListener val$listener;
        private final PropertyChangeEvent val$event;
        
        public void handleException(Throwable exception) {}
        
        public void run()
          throws Exception
        {
          val$listener.propertyChange(val$event);
        }
      });
    }
  }
  
  public void initialize(ISynchronizePageConfiguration configuration)
  {
    super.initialize(configuration);
    Object[] listeners;
    synchronized (actionContributions)
    {
      if (actionState != 0) {
        return;
      }
      actionState = 1;
      listeners = actionContributions.getListeners();
    }
    Object[] listeners;
    for (int i = 0; i < listeners.length; i++)
    {
      SynchronizePageActionGroup contribution = (SynchronizePageActionGroup)listeners[i];
      SafeRunner.run(new ISafeRunnable()
      {
        private final SynchronizePageActionGroup val$contribution;
        private final ISynchronizePageConfiguration val$configuration;
        
        public void handleException(Throwable exception) {}
        
        public void run()
          throws Exception
        {
          val$contribution.initialize(val$configuration);
        }
      });
    }
  }
  
  public void setContext(ActionContext context)
  {
    super.setContext(context);
    Object[] listeners;
    synchronized (actionContributions)
    {
      listeners = actionContributions.getListeners();
    }
    Object[] listeners;
    for (int i = 0; i < listeners.length; i++)
    {
      SynchronizePageActionGroup contribution = (SynchronizePageActionGroup)listeners[i];
      SafeRunner.run(new ISafeRunnable()
      {
        private final SynchronizePageActionGroup val$contribution;
        private final ActionContext val$context;
        
        public void handleException(Throwable exception) {}
        
        public void run()
          throws Exception
        {
          val$contribution.setContext(val$context);
        }
      });
    }
  }
  
  public void fillContextMenu(IMenuManager manager)
  {
    Object[] listeners;
    synchronized (actionContributions)
    {
      listeners = actionContributions.getListeners();
    }
    Object[] listeners;
    for (int i = 0; i < listeners.length; i++)
    {
      SynchronizePageActionGroup contribution = (SynchronizePageActionGroup)listeners[i];
      SafeRunner.run(new ISafeRunnable()
      {
        private final SynchronizePageActionGroup val$contribution;
        private final IMenuManager val$manager;
        
        public void handleException(Throwable exception) {}
        
        public void run()
          throws Exception
        {
          val$contribution.fillContextMenu(val$manager);
        }
      });
    }
  }
  
  public void fillActionBars(IActionBars actionBars)
  {
    if (actionState == 0) {
      initialize(this);
    }
    Object[] listeners;
    synchronized (actionContributions)
    {
      listeners = actionContributions.getListeners();
    }
    Object[] listeners;
    for (int i = 0; i < listeners.length; i++)
    {
      SynchronizePageActionGroup contribution = (SynchronizePageActionGroup)listeners[i];
      SafeRunner.run(new ISafeRunnable()
      {
        private final SynchronizePageActionGroup val$contribution;
        private final IActionBars val$actionBars;
        
        public void handleException(Throwable exception) {}
        
        public void run()
          throws Exception
        {
          val$contribution.fillActionBars(val$actionBars);
        }
      });
    }
  }
  
  public void updateActionBars()
  {
    Object[] listeners;
    synchronized (actionContributions)
    {
      listeners = actionContributions.getListeners();
    }
    Object[] listeners;
    for (int i = 0; i < listeners.length; i++)
    {
      SynchronizePageActionGroup contribution = (SynchronizePageActionGroup)listeners[i];
      SafeRunner.run(new ISafeRunnable()
      {
        private final SynchronizePageActionGroup val$contribution;
        
        public void handleException(Throwable exception) {}
        
        public void run()
          throws Exception
        {
          val$contribution.updateActionBars();
        }
      });
    }
  }
  
  public void modelChanged(ISynchronizeModelElement root)
  {
    Object[] listeners;
    synchronized (actionContributions)
    {
      listeners = actionContributions.getListeners();
    }
    Object[] listeners;
    for (int i = 0; i < listeners.length; i++)
    {
      SynchronizePageActionGroup contribution = (SynchronizePageActionGroup)listeners[i];
      SafeRunner.run(new ISafeRunnable()
      {
        private final SynchronizePageActionGroup val$contribution;
        private final ISynchronizeModelElement val$root;
        
        public void handleException(Throwable exception) {}
        
        public void run()
          throws Exception
        {
          val$contribution.modelChanged(val$root);
        }
      });
    }
  }
  
  public void dispose()
  {
    super.dispose();
    synchronized (actionContributions)
    {
      Object[] listeners = actionContributions.getListeners();
      actionState = 2;
    }
    Object[] listeners;
    for (int i = 0; i < listeners.length; i++)
    {
      SynchronizePageActionGroup contribution = (SynchronizePageActionGroup)listeners[i];
      SafeRunner.run(new ISafeRunnable()
      {
        private final SynchronizePageActionGroup val$contribution;
        
        public void handleException(Throwable exception) {}
        
        public void run()
          throws Exception
        {
          val$contribution.dispose();
        }
      });
    }
  }
  
  public void setMenuGroups(String menuPropertyId, String[] groups)
  {
    setProperty(menuPropertyId, groups);
  }
  
  public void addMenuGroup(String menuPropertyId, String groupId)
  {
    String[] menuGroups = (String[])getProperty(menuPropertyId);
    if (menuGroups == null) {
      menuGroups = getDefault(menuPropertyId);
    }
    String[] newGroups = new String[menuGroups.length + 1];
    System.arraycopy(menuGroups, 0, newGroups, 0, menuGroups.length);
    newGroups[menuGroups.length] = groupId;
    setProperty(menuPropertyId, newGroups);
  }
  
  public boolean hasMenuGroup(String menuPropertyId, String groupId)
  {
    String[] groups = (String[])getProperty(menuPropertyId);
    if (groups == null) {
      groups = getDefault(menuPropertyId);
    }
    for (int i = 0; i < groups.length; i++)
    {
      String string = groups[i];
      if (string.equals(groupId)) {
        return true;
      }
    }
    return false;
  }
  
  protected String[] getDefault(String menuPropertyId)
  {
    if (menuPropertyId.equals("org.eclipse.team.ui.P_CONTEXT_MENU")) {
      return DEFAULT_CONTEXT_MENU;
    }
    if (menuPropertyId.equals("org.eclipse.team.ui.P_VIEW_MENU")) {
      return DEFAULT_VIEW_MENU;
    }
    if (menuPropertyId.equals("org.eclipse.team.ui.P_TOOLBAR_MENU")) {
      return DEFAULT_TOOLBAR_MENU;
    }
    return new String[0];
  }
  
  public void addLabelDecorator(ILabelDecorator decorator)
  {
    ILabelDecorator[] decorators = (ILabelDecorator[])getProperty("org.eclipse.team.ui.P_LABEL_DECORATORS");
    if (decorators == null) {
      decorators = new ILabelDecorator[0];
    }
    for (int i = 0; i < decorators.length; i++)
    {
      ILabelDecorator d = decorators[i];
      if (d == decorator) {
        return;
      }
    }
    ILabelDecorator[] newDecorators = new ILabelDecorator[decorators.length + 1];
    System.arraycopy(decorators, 0, newDecorators, 0, decorators.length);
    newDecorators[decorators.length] = decorator;
    setProperty("org.eclipse.team.ui.P_LABEL_DECORATORS", newDecorators);
  }
  
  public String getGroupId(String group)
  {
    String id = getParticipant().getId();
    if (getParticipant().getSecondaryId() != null)
    {
      id = id + ".";
      id = id + getParticipant().getSecondaryId();
    }
    return id + "." + group;
  }
  
  public int getMode()
  {
    Object o = getProperty("org.eclipse.team.ui.P_SYNCVIEWPAGE_MODE");
    if ((o instanceof Integer)) {
      return ((Integer)o).intValue();
    }
    return 0;
  }
  
  public void setMode(int mode)
  {
    if (isModeSupported(mode)) {
      setProperty("org.eclipse.team.ui.P_SYNCVIEWPAGE_MODE", new Integer(mode));
    }
  }
  
  public boolean isModeSupported(int mode)
  {
    return (getSupportedModes() & mode) > 0;
  }
  
  public int getSupportedModes()
  {
    Object o = getProperty("org.eclipse.team.ui.P_SUPPORTED_MODES");
    if ((o instanceof Integer)) {
      return ((Integer)o).intValue();
    }
    return 0;
  }
  
  public void setSupportedModes(int modes)
  {
    setProperty("org.eclipse.team.ui.P_SUPPORTED_MODES", new Integer(modes));
  }
  
  public ISynchronizePage getPage()
  {
    return page;
  }
  
  public void setPage(ISynchronizePage page)
  {
    this.page = page;
  }
  
  public int getViewerStyle()
  {
    Object o = getProperty("org.eclipse.team.ui.P_VIEWER_STYLE");
    if ((o instanceof Integer)) {
      return ((Integer)o).intValue();
    }
    return 0;
  }
  
  public void setViewerStyle(int style)
  {
    setProperty("org.eclipse.team.ui.P_VIEWER_STYLE", new Integer(style));
  }
  
  public SyncInfoSet getSyncInfoSet()
  {
    Object o = getProperty("org.eclipse.team.ui.P_SYNC_INFO_SET");
    if ((o instanceof SyncInfoSet)) {
      return (SyncInfoSet)o;
    }
    return null;
  }
  
  public String getComparisonType()
  {
    return (String)getProperty("org.eclipse.team.ui.P_COMPARISON_TYPE");
  }
  
  public void setComparisonType(String type)
  {
    setProperty("org.eclipse.team.ui.P_COMPARISON_TYPE", type);
  }
  
  public void setRunnableContext(IRunnableContext context)
  {
    this.context = context;
  }
  
  public IRunnableContext getRunnableContext()
  {
    return context;
  }
  
  public String getViewerId()
  {
    String viewerId = (String)getProperty("org.eclipse.team.ui.P_VIEWER_ID");
    if (viewerId != null) {
      return viewerId;
    }
    return "org.eclipse.team.ui.navigatorViewer";
  }
  
  public boolean isVisible(IDiff node)
  {
    if ((getComparisonType() == "three-way") && 
      ((node instanceof IThreeWayDiff)))
    {
      IThreeWayDiff twd = (IThreeWayDiff)node;
      return includeDirection(twd.getDirection());
    }
    return (getComparisonType() == "two-way") && ((node instanceof IResourceDiff));
  }
  
  public boolean includeDirection(int direction)
  {
    int mode = getMode();
    switch (mode)
    {
    case 4: 
      return true;
    case 8: 
      return direction == 768;
    case 1: 
      return (direction == 768) || (direction == 512);
    case 2: 
      return (direction == 768) || (direction == 256);
    }
    return true;
  }
  
  public ILabelDecorator getLabelDecorator()
  {
    ILabelDecorator[] decorators = (ILabelDecorator[])getProperty("org.eclipse.team.ui.P_LABEL_DECORATORS");
    if (decorators == null) {
      return null;
    }
    return new MultiLabelDecorator(decorators);
  }
}

/* Location:
 * Qualified Name:     org.eclipse.team.internal.ui.synchroniz
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