Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 169633 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/team/internal/ui/actions/actions.properties (+5 lines)
Lines 17-22 Link Here
17
action.collapseAll.description=Collapse All
17
action.collapseAll.description=Collapse All
18
action.collapseAll.image=collapseall.gif
18
action.collapseAll.image=collapseall.gif
19
19
20
action.expandTree.label=E&xpand All
21
action.expandTree.tooltip=Expand All
22
action.expandTree.description=Expand All
23
action.expandTree.image=expandall.gif
24
20
action.configureSchedulel.label=&Schedule...
25
action.configureSchedulel.label=&Schedule...
21
action.configureSchedulel.tooltip=Schedule a Background Synchronization
26
action.configureSchedulel.tooltip=Schedule a Background Synchronization
22
27
(-)src/org/eclipse/team/internal/ui/synchronize/actions/DirectionFilterActionGroup.java (+30 lines)
Lines 17-22 Link Here
17
import org.eclipse.jface.action.*;
17
import org.eclipse.jface.action.*;
18
import org.eclipse.jface.util.IPropertyChangeListener;
18
import org.eclipse.jface.util.IPropertyChangeListener;
19
import org.eclipse.jface.util.PropertyChangeEvent;
19
import org.eclipse.jface.util.PropertyChangeEvent;
20
import org.eclipse.jface.viewers.AbstractTreeViewer;
21
import org.eclipse.jface.viewers.Viewer;
20
import org.eclipse.team.internal.ui.Utils;
22
import org.eclipse.team.internal.ui.Utils;
21
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
23
import org.eclipse.team.ui.synchronize.ISynchronizePageConfiguration;
22
import org.eclipse.ui.IActionBars;
24
import org.eclipse.ui.IActionBars;
Lines 33-38 Link Here
33
	// The list of created actions	
35
	// The list of created actions	
34
	private List actions = new ArrayList(3);
36
	private List actions = new ArrayList(3);
35
	
37
	
38
	private Action collapseAll;
39
	private Action expandWholeTree;
40
	
36
	// The modes
41
	// The modes
37
	private DirectionFilterAction incomingMode;					
42
	private DirectionFilterAction incomingMode;					
38
	private DirectionFilterAction outgoingMode;
43
	private DirectionFilterAction outgoingMode;
Lines 80-85 Link Here
80
	 * Sets up the sync modes and the actions for switching between them.
85
	 * Sets up the sync modes and the actions for switching between them.
81
	 */
86
	 */
82
	private void createActions() {
87
	private void createActions() {
88
		final Viewer viewer = configuration.getPage().getViewer();
89
		if (viewer instanceof AbstractTreeViewer) {
90
			this.expandWholeTree =  new Action() {
91
				public void run() {
92
					if (viewer.getControl().isDisposed() || !(viewer instanceof AbstractTreeViewer)) return;
93
					viewer.getControl().setRedraw(false);		
94
					((AbstractTreeViewer)viewer).expandAll();
95
					viewer.getControl().setRedraw(true);
96
				}
97
			};
98
			Utils.initAction(this.expandWholeTree, "action.expandTree."); //$NON-NLS-1$
99
			
100
			collapseAll = new Action() {
101
				public void run() {
102
					if (viewer.getControl().isDisposed() || !(viewer instanceof AbstractTreeViewer)) return;
103
					viewer.getControl().setRedraw(false);		
104
					((AbstractTreeViewer)viewer).collapseToLevel(viewer.getInput(), AbstractTreeViewer.ALL_LEVELS);
105
					viewer.getControl().setRedraw(true);
106
				}
107
			};
108
			Utils.initAction(collapseAll, "action.collapseAll."); //$NON-NLS-1$
109
		}
83
		// Create the actions
110
		// Create the actions
84
		int supportedModes = configuration.getSupportedModes();
111
		int supportedModes = configuration.getSupportedModes();
85
		if (supportedModes == 0) return;
112
		if (supportedModes == 0) return;
Lines 151-156 Link Here
151
	}
178
	}
152
	
179
	
153
	public void fillToolBar(String groupId, IToolBarManager toolBar) {
180
	public void fillToolBar(String groupId, IToolBarManager toolBar) {
181
		toolBar.appendToGroup(groupId, this.expandWholeTree);
182
		toolBar.appendToGroup(groupId, this.collapseAll);
183
		toolBar.appendToGroup(groupId, new Separator());
154
		for (Iterator it = actions.iterator(); it.hasNext();) {
184
		for (Iterator it = actions.iterator(); it.hasNext();) {
155
			DirectionFilterAction action = (DirectionFilterAction) it.next();
185
			DirectionFilterAction action = (DirectionFilterAction) it.next();
156
				toolBar.appendToGroup(groupId, action);
186
				toolBar.appendToGroup(groupId, action);
(-)src/org/eclipse/team/internal/ui/synchronize/actions/ExpandAllAction.java (-2 / +5 lines)
Lines 44-49 Link Here
44
				tree.getControl().setRedraw(true);
44
				tree.getControl().setRedraw(true);
45
			}
45
			}
46
		}
46
		}
47
		else {
48
			tree.getControl().setRedraw(false);		
49
			tree.expandAll();
50
			tree.getControl().setRedraw(true);
51
		}
47
	}
52
	}
48
	/* (non-Javadoc)
53
	/* (non-Javadoc)
49
	 * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
54
	 * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
Lines 51-58 Link Here
51
	public void selectionChanged(SelectionChangedEvent event) {
56
	public void selectionChanged(SelectionChangedEvent event) {
52
		ISelection selection = event.getSelection();
57
		ISelection selection = event.getSelection();
53
		if (selection instanceof IStructuredSelection) {
58
		if (selection instanceof IStructuredSelection) {
54
			IStructuredSelection ss = (IStructuredSelection)selection;
55
			setEnabled(!ss.isEmpty());
56
			return;
59
			return;
57
		}
60
		}
58
		setEnabled(false);
61
		setEnabled(false);
(-)src/org/eclipse/team/internal/ui/synchronize/NavigationActionGroup.java (-12 lines)
Lines 26-32 Link Here
26
public class NavigationActionGroup extends SynchronizePageActionGroup {
26
public class NavigationActionGroup extends SynchronizePageActionGroup {
27
27
28
	private ExpandAllAction expandAllAction;
28
	private ExpandAllAction expandAllAction;
29
	private Action collapseAll;
30
	private NavigateAction gotoNext;
29
	private NavigateAction gotoNext;
31
	private NavigateAction gotoPrevious;
30
	private NavigateAction gotoPrevious;
32
	
31
	
Lines 38-53 Link Here
38
			expandAllAction = new ExpandAllAction((AbstractTreeViewer) viewer);
37
			expandAllAction = new ExpandAllAction((AbstractTreeViewer) viewer);
39
			Utils.initAction(expandAllAction, "action.expandAll."); //$NON-NLS-1$
38
			Utils.initAction(expandAllAction, "action.expandAll."); //$NON-NLS-1$
40
			
39
			
41
			collapseAll = new Action() {
42
				public void run() {
43
					if (viewer == null || viewer.getControl().isDisposed() || !(viewer instanceof AbstractTreeViewer)) return;
44
					viewer.getControl().setRedraw(false);		
45
					((AbstractTreeViewer)viewer).collapseToLevel(viewer.getInput(), AbstractTreeViewer.ALL_LEVELS);
46
					viewer.getControl().setRedraw(true);
47
				}
48
			};
49
			Utils.initAction(collapseAll, "action.collapseAll."); //$NON-NLS-1$
50
			
51
			ICompareNavigator nav = (ICompareNavigator)configuration.getProperty(SynchronizePageConfiguration.P_NAVIGATOR);
40
			ICompareNavigator nav = (ICompareNavigator)configuration.getProperty(SynchronizePageConfiguration.P_NAVIGATOR);
52
			if (nav != null) {
41
			if (nav != null) {
53
				gotoNext = new NavigateAction(configuration, true /*next*/);		
42
				gotoNext = new NavigateAction(configuration, true /*next*/);		
Lines 64-69 Link Here
64
			appendToGroup(manager, ISynchronizePageConfiguration.NAVIGATE_GROUP, gotoNext);
53
			appendToGroup(manager, ISynchronizePageConfiguration.NAVIGATE_GROUP, gotoNext);
65
		if (gotoPrevious != null)
54
		if (gotoPrevious != null)
66
			appendToGroup(manager, ISynchronizePageConfiguration.NAVIGATE_GROUP, gotoPrevious);
55
			appendToGroup(manager, ISynchronizePageConfiguration.NAVIGATE_GROUP, gotoPrevious);
67
		appendToGroup(manager, ISynchronizePageConfiguration.NAVIGATE_GROUP, collapseAll);
68
	}
56
	}
69
}
57
}

Return to bug 169633