|
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); |