1 11 package org.eclipse.team.internal.ui.synchronize.actions; 12 13 import org.eclipse.core.runtime.IProgressMonitor; 14 import org.eclipse.swt.widgets.Shell; 15 import org.eclipse.team.core.ITeamStatus; 16 import org.eclipse.team.core.synchronize.*; 17 import org.eclipse.team.internal.ui.synchronize.SynchronizePageConfiguration; 18 import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration; 19 20 public class SyncInfoSetStatusLineContributionGroup extends 21 StatusLineContributionGroup implements ISyncInfoSetChangeListener { 22 23 public SyncInfoSetStatusLineContributionGroup(Shell shell, ISynchronizePageConfiguration configuration) { 24 super(shell, configuration); 25 SyncInfoSet set = getSyncInfoSet(); 27 set.addSyncSetChangedListener(this); 28 } 29 30 public void dispose() { 31 getSyncInfoSet().removeSyncSetChangedListener(this); 32 super.dispose(); 33 } 34 39 public void syncInfoChanged(ISyncInfoSetChangeEvent event, IProgressMonitor monitor) { 40 updateCounts(); 41 } 42 43 46 public void syncInfoSetReset(SyncInfoSet set, IProgressMonitor monitor) { 47 updateCounts(); 48 } 49 50 53 public void syncInfoSetErrors(SyncInfoSet set, ITeamStatus[] errors, IProgressMonitor monitor) { 54 } 56 57 private SyncInfoSet getSyncInfoSet() { 58 return (SyncInfoSet)getConfiguration().getProperty(SynchronizePageConfiguration.P_WORKING_SET_SYNC_INFO_SET); 59 } 60 61 protected int getChangeCount() { 62 return getSyncInfoSet().size(); 63 } 64 65 protected int countFor(int state) { 66 return (int)getSyncInfoSet().countFor(state, SyncInfo.DIRECTION_MASK); 67 } 68 69 } 70 | Popular Tags |