|
Lines 17-25
Link Here
|
| 17 |
import org.eclipse.jface.viewers.StructuredViewer; |
17 |
import org.eclipse.jface.viewers.StructuredViewer; |
| 18 |
import org.eclipse.ui.IActionBars; |
18 |
import org.eclipse.ui.IActionBars; |
| 19 |
import org.eclipse.ui.IMemento; |
19 |
import org.eclipse.ui.IMemento; |
|
|
20 |
import org.eclipse.ui.IWorkbenchPreferenceConstants; |
| 20 |
import org.eclipse.ui.IWorkingSet; |
21 |
import org.eclipse.ui.IWorkingSet; |
| 21 |
import org.eclipse.ui.IWorkingSetManager; |
22 |
import org.eclipse.ui.IWorkingSetManager; |
| 22 |
import org.eclipse.ui.PlatformUI; |
23 |
import org.eclipse.ui.PlatformUI; |
|
|
24 |
import org.eclipse.ui.ResourceWorkingSetFilter; |
| 23 |
import org.eclipse.ui.actions.WorkingSetFilterActionGroup; |
25 |
import org.eclipse.ui.actions.WorkingSetFilterActionGroup; |
| 24 |
import org.eclipse.ui.internal.navigator.workingsets.WorkingSetsContentProvider; |
26 |
import org.eclipse.ui.internal.navigator.workingsets.WorkingSetsContentProvider; |
| 25 |
import org.eclipse.ui.navigator.CommonActionProvider; |
27 |
import org.eclipse.ui.navigator.CommonActionProvider; |
|
Lines 30-42
Link Here
|
| 30 |
|
32 |
|
| 31 |
/** |
33 |
/** |
| 32 |
* @since 3.2 |
34 |
* @since 3.2 |
| 33 |
* |
35 |
* |
| 34 |
*/ |
36 |
*/ |
| 35 |
public class WorkingSetActionProvider extends CommonActionProvider { |
37 |
public class WorkingSetActionProvider extends CommonActionProvider { |
| 36 |
|
38 |
|
| 37 |
private static final String TAG_CURRENT_WORKING_SET_NAME = "currentWorkingSetName"; //$NON-NLS-1$ |
39 |
private static final String TAG_CURRENT_WORKING_SET_NAME = "currentWorkingSetName"; //$NON-NLS-1$ |
| 38 |
|
40 |
|
| 39 |
private boolean contributedToViewMenu = false; |
41 |
private boolean contributedToViewMenu = false; |
| 40 |
|
42 |
|
| 41 |
private StructuredViewer viewer; |
43 |
private StructuredViewer viewer; |
| 42 |
|
44 |
|
|
Lines 49-57
Link Here
|
| 49 |
|
51 |
|
| 50 |
private IExtensionStateModel extensionStateModel; |
52 |
private IExtensionStateModel extensionStateModel; |
| 51 |
|
53 |
|
|
|
54 |
private final ResourceWorkingSetFilter workingSetFilter = new ResourceWorkingSetFilter(); |
| 55 |
private boolean filterAdded; |
| 56 |
|
| 57 |
private boolean emptyWorkingSet; |
| 58 |
private IWorkingSet workingSet; |
| 59 |
|
| 60 |
private IPropertyChangeListener topLevelModeListener; |
| 61 |
|
| 62 |
|
| 52 |
/** |
63 |
/** |
| 53 |
* Provides a smart listener to monitor changes to the Working Set Manager. |
64 |
* Provides a smart listener to monitor changes to the Working Set Manager. |
| 54 |
* |
65 |
* |
| 55 |
*/ |
66 |
*/ |
| 56 |
public class WorkingSetManagerListener implements IPropertyChangeListener { |
67 |
public class WorkingSetManagerListener implements IPropertyChangeListener { |
| 57 |
|
68 |
|
|
Lines 59-104
Link Here
|
| 59 |
|
70 |
|
| 60 |
/* |
71 |
/* |
| 61 |
* (non-Javadoc) |
72 |
* (non-Javadoc) |
| 62 |
* |
73 |
* |
| 63 |
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) |
74 |
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) |
| 64 |
*/ |
75 |
*/ |
| 65 |
public void propertyChange(PropertyChangeEvent event) { |
76 |
public void propertyChange(PropertyChangeEvent event) { |
| 66 |
|
77 |
String property = event.getProperty(); |
| 67 |
Object input = viewer.getInput(); |
78 |
Object newValue = event.getNewValue(); |
| 68 |
if (input instanceof IWorkingSet) { |
79 |
Object oldValue = event.getOldValue(); |
| 69 |
IWorkingSet workingSet = (IWorkingSet) input; |
80 |
|
| 70 |
|
81 |
if (IWorkingSetManager.CHANGE_WORKING_SET_REMOVE.equals(property) && oldValue == workingSet) { |
| 71 |
String property = event.getProperty(); |
82 |
setWorkingSet(null); |
| 72 |
Object newValue = event.getNewValue(); |
83 |
} else if (IWorkingSetManager.CHANGE_WORKING_SET_NAME_CHANGE.equals(property) && newValue == workingSet) { |
| 73 |
Object oldValue = event.getOldValue(); |
84 |
} else if (IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE.equals(property) && newValue == workingSet) { |
| 74 |
|
85 |
if (workingSet.isAggregateWorkingSet() && workingSet.isEmpty()) { |
| 75 |
if (IWorkingSetManager.CHANGE_WORKING_SET_REMOVE.equals(property) && oldValue == workingSet) { |
86 |
// act as if the working set has been made null |
| 76 |
// setWorkingSet(null); |
87 |
if (!emptyWorkingSet) { |
| 77 |
if (viewer != null) { |
88 |
emptyWorkingSet = true; |
| 78 |
viewer.setInput(originalViewerInput); |
89 |
workingSetFilter.setWorkingSet(null); |
| 79 |
} |
90 |
} |
| 80 |
} else if (IWorkingSetManager.CHANGE_WORKING_SET_NAME_CHANGE.equals(property) && newValue == workingSet) { |
91 |
} else { |
| 81 |
} else if (IWorkingSetManager.CHANGE_WORKING_SET_CONTENT_CHANGE.equals(property) && newValue == workingSet) { |
92 |
// we've gone from empty to non-empty on our set. |
| 82 |
// if (workingSet.isAggregateWorkingSet() && workingSet.isEmpty()) { |
93 |
// Restore it. |
| 83 |
// // act as if the working set has been made null |
94 |
if (emptyWorkingSet) { |
| 84 |
// if (!emptyWorkingSet) { |
95 |
emptyWorkingSet = false; |
| 85 |
// emptyWorkingSet = true; |
96 |
workingSetFilter.setWorkingSet(workingSet); |
| 86 |
// workingSetFilter.setWorkingSet(null); |
|
|
| 87 |
// } |
| 88 |
// } else { |
| 89 |
// // we've gone from empty to non-empty on our set. |
| 90 |
// // Restore it. |
| 91 |
// if (emptyWorkingSet) { |
| 92 |
// emptyWorkingSet = false; |
| 93 |
// workingSetFilter.setWorkingSet(workingSet); |
| 94 |
// } |
| 95 |
// } |
| 96 |
if (viewer != null) { |
| 97 |
viewer.refresh(); |
| 98 |
} |
97 |
} |
| 99 |
} |
98 |
} |
|
|
99 |
if (viewer != null) { |
| 100 |
viewer.refresh(); |
| 101 |
} |
| 100 |
} |
102 |
} |
| 101 |
|
|
|
| 102 |
} |
103 |
} |
| 103 |
|
104 |
|
| 104 |
/** |
105 |
/** |
|
Lines 125-151
Link Here
|
| 125 |
private IPropertyChangeListener filterChangeListener = new IPropertyChangeListener() { |
126 |
private IPropertyChangeListener filterChangeListener = new IPropertyChangeListener() { |
| 126 |
/* |
127 |
/* |
| 127 |
* (non-Javadoc) |
128 |
* (non-Javadoc) |
| 128 |
* |
129 |
* |
| 129 |
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) |
130 |
* @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent) |
| 130 |
*/ |
131 |
*/ |
| 131 |
public void propertyChange(PropertyChangeEvent event) { |
132 |
public void propertyChange(PropertyChangeEvent event) { |
| 132 |
IWorkingSet oldWorkingSet = (IWorkingSet) event.getOldValue(); |
|
|
| 133 |
IWorkingSet newWorkingSet = (IWorkingSet) event.getNewValue(); |
133 |
IWorkingSet newWorkingSet = (IWorkingSet) event.getNewValue(); |
| 134 |
|
134 |
|
| 135 |
|
|
|
| 136 |
if (newWorkingSet != null && !contentService.isActive(WorkingSetsContentProvider.EXTENSION_ID)) { |
135 |
if (newWorkingSet != null && !contentService.isActive(WorkingSetsContentProvider.EXTENSION_ID)) { |
| 137 |
contentService.getActivationService().activateExtensions(new String[]{WorkingSetsContentProvider.EXTENSION_ID}, false); |
136 |
contentService.getActivationService().activateExtensions(new String[]{WorkingSetsContentProvider.EXTENSION_ID}, false); |
| 138 |
contentService.getActivationService().persistExtensionActivations(); |
137 |
contentService.getActivationService().persistExtensionActivations(); |
| 139 |
} |
138 |
} |
| 140 |
|
139 |
|
| 141 |
if (viewer != null) { |
140 |
setWorkingSet(newWorkingSet); |
| 142 |
if (newWorkingSet == null) { |
|
|
| 143 |
viewer.setInput(ResourcesPlugin.getWorkspace().getRoot()); |
| 144 |
} else if(oldWorkingSet != newWorkingSet) { |
| 145 |
viewer.setInput(newWorkingSet); |
| 146 |
} |
| 147 |
} |
| 148 |
|
| 149 |
} |
141 |
} |
| 150 |
}; |
142 |
}; |
| 151 |
|
143 |
|
|
Lines 153-159
Link Here
|
| 153 |
|
145 |
|
| 154 |
private IExtensionActivationListener activationListener = new IExtensionActivationListener() { |
146 |
private IExtensionActivationListener activationListener = new IExtensionActivationListener() { |
| 155 |
|
147 |
|
| 156 |
private IWorkingSet workingSet; |
148 |
private IWorkingSet savedWorkingSet; |
| 157 |
|
149 |
|
| 158 |
public void onExtensionActivation(String aViewerId, String[] theNavigatorExtensionIds, boolean isActive) { |
150 |
public void onExtensionActivation(String aViewerId, String[] theNavigatorExtensionIds, boolean isActive) { |
| 159 |
|
151 |
|
|
Lines 162-189
Link Here
|
| 162 |
if (isActive) { |
154 |
if (isActive) { |
| 163 |
extensionStateModel = contentService.findStateModel(WorkingSetsContentProvider.EXTENSION_ID); |
155 |
extensionStateModel = contentService.findStateModel(WorkingSetsContentProvider.EXTENSION_ID); |
| 164 |
workingSetRootModeActionGroup.setStateModel(extensionStateModel); |
156 |
workingSetRootModeActionGroup.setStateModel(extensionStateModel); |
| 165 |
|
157 |
if (extensionStateModel != null) { |
| 166 |
if (workingSet != null) { |
158 |
extensionStateModel.addPropertyChangeListener(topLevelModeListener); |
| 167 |
viewer.setInput(workingSet); |
|
|
| 168 |
workingSetActionGroup.setWorkingSet(workingSet); |
| 169 |
workingSetRootModeActionGroup.setShowTopLevelWorkingSets(true); |
| 170 |
} |
159 |
} |
| 171 |
managerChangeListener.listen(); |
|
|
| 172 |
|
160 |
|
|
|
161 |
if (savedWorkingSet != null) { |
| 162 |
setWorkingSet(savedWorkingSet); |
| 163 |
workingSetActionGroup.setWorkingSet(savedWorkingSet); |
| 164 |
} |
| 165 |
managerChangeListener.listen(); |
| 173 |
|
166 |
|
| 174 |
} else { |
167 |
} else { |
| 175 |
Object input = viewer.getInput(); |
168 |
savedWorkingSet= workingSet; |
| 176 |
if (input instanceof IWorkingSet) { |
169 |
setWorkingSet(null); |
| 177 |
workingSet = (IWorkingSet) input; |
|
|
| 178 |
if (viewer != null && input != originalViewerInput) { |
| 179 |
viewer.setInput(originalViewerInput); |
| 180 |
} |
| 181 |
} else { |
| 182 |
workingSet = null; |
| 183 |
} |
| 184 |
managerChangeListener.ignore(); |
170 |
managerChangeListener.ignore(); |
| 185 |
workingSetActionGroup.setWorkingSet(null); |
171 |
workingSetActionGroup.setWorkingSet(null); |
| 186 |
workingSetRootModeActionGroup.setShowTopLevelWorkingSets(false); |
172 |
workingSetRootModeActionGroup.setShowTopLevelWorkingSets(false); |
|
|
173 |
if (extensionStateModel != null) { |
| 174 |
extensionStateModel.removePropertyChangeListener(topLevelModeListener); |
| 175 |
} |
| 187 |
|
176 |
|
| 188 |
} |
177 |
} |
| 189 |
} |
178 |
} |
|
Lines 192-202
Link Here
|
| 192 |
|
181 |
|
| 193 |
}; |
182 |
}; |
| 194 |
|
183 |
|
| 195 |
|
|
|
| 196 |
|
184 |
|
| 197 |
/* |
185 |
/* |
| 198 |
* (non-Javadoc) |
186 |
* (non-Javadoc) |
| 199 |
* |
187 |
* |
| 200 |
* @see org.eclipse.ui.navigator.CommonActionProvider#init(org.eclipse.ui.navigator.ICommonActionExtensionSite) |
188 |
* @see org.eclipse.ui.navigator.CommonActionProvider#init(org.eclipse.ui.navigator.ICommonActionExtensionSite) |
| 201 |
*/ |
189 |
*/ |
| 202 |
public void init(ICommonActionExtensionSite aSite) { |
190 |
public void init(ICommonActionExtensionSite aSite) { |
|
Lines 211-279
Link Here
|
| 211 |
workingSetRootModeActionGroup = new WorkingSetRootModeActionGroup(viewer, extensionStateModel); |
199 |
workingSetRootModeActionGroup = new WorkingSetRootModeActionGroup(viewer, extensionStateModel); |
| 212 |
} |
200 |
} |
| 213 |
|
201 |
|
|
|
202 |
topLevelModeListener= new IPropertyChangeListener() { |
| 203 |
public void propertyChange(PropertyChangeEvent event) { |
| 204 |
setWorkingSet(workingSet); |
| 205 |
}}; |
| 214 |
|
206 |
|
| 215 |
if (contentService.isActive(WorkingSetsContentProvider.EXTENSION_ID)) { |
207 |
if (contentService.isActive(WorkingSetsContentProvider.EXTENSION_ID)) { |
| 216 |
managerChangeListener.listen(); |
208 |
managerChangeListener.listen(); |
|
|
209 |
if (extensionStateModel != null) { |
| 210 |
extensionStateModel.addPropertyChangeListener(topLevelModeListener); |
| 211 |
} |
| 217 |
} |
212 |
} |
| 218 |
|
213 |
|
| 219 |
contentService.getActivationService().addExtensionActivationListener(activationListener); |
214 |
contentService.getActivationService().addExtensionActivationListener(activationListener); |
|
|
215 |
|
| 220 |
} |
216 |
} |
| 221 |
|
217 |
|
|
|
218 |
/** |
| 219 |
* Restores the working set filter from the persistence store. |
| 220 |
*/ |
| 221 |
protected void initWorkingSetFilter(String workingSetName) { |
| 222 |
IWorkingSet workingSet = null; |
| 223 |
|
| 224 |
if (workingSetName != null && workingSetName.length() > 0) { |
| 225 |
IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); |
| 226 |
workingSet = workingSetManager.getWorkingSet(workingSetName); |
| 227 |
} else if (PlatformUI.getPreferenceStore().getBoolean( |
| 228 |
IWorkbenchPreferenceConstants.USE_WINDOW_WORKING_SET_BY_DEFAULT)) { |
| 229 |
// use the window set by default if the global preference is set |
| 230 |
workingSet = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getAggregateWorkingSet(); |
| 231 |
} |
| 232 |
|
| 233 |
if (workingSet != null) { |
| 234 |
workingSetFilter.setWorkingSet(workingSet); |
| 235 |
internalSetWorkingSet(workingSet); |
| 236 |
workingSetActionGroup.setWorkingSet(workingSet); |
| 237 |
} |
| 238 |
} |
| 239 |
|
| 240 |
/** |
| 241 |
* Set current active working set. |
| 242 |
* |
| 243 |
* @param workingSet working set to be activated, may be <code>null</code> |
| 244 |
*/ |
| 245 |
protected void setWorkingSet(IWorkingSet workingSet) { |
| 246 |
internalSetWorkingSet(workingSet); |
| 247 |
|
| 248 |
workingSetFilter.setWorkingSet(emptyWorkingSet ? null : workingSet); |
| 249 |
|
| 250 |
if (viewer != null) { |
| 251 |
if (workingSet == null || emptyWorkingSet || !isShowTopLevelWorkingSets()) { |
| 252 |
if (viewer.getInput() != originalViewerInput) { |
| 253 |
viewer.setInput(originalViewerInput); |
| 254 |
} |
| 255 |
if (!filterAdded) { |
| 256 |
viewer.addFilter(workingSetFilter); |
| 257 |
filterAdded = true; |
| 258 |
} else { |
| 259 |
viewer.refresh(); |
| 260 |
} |
| 261 |
} else { |
| 262 |
viewer.removeFilter(workingSetFilter); |
| 263 |
filterAdded = false; |
| 264 |
viewer.setInput(workingSet); |
| 265 |
} |
| 266 |
} |
| 267 |
} |
| 268 |
|
| 269 |
private void internalSetWorkingSet(IWorkingSet workingSet) { |
| 270 |
this.workingSet = workingSet; |
| 271 |
emptyWorkingSet = workingSet != null && workingSet.isAggregateWorkingSet() |
| 272 |
&& workingSet.isEmpty(); |
| 273 |
} |
| 274 |
|
| 222 |
/* (non-Javadoc) |
275 |
/* (non-Javadoc) |
| 223 |
* @see org.eclipse.ui.navigator.CommonActionProvider#restoreState(org.eclipse.ui.IMemento) |
276 |
* @see org.eclipse.ui.navigator.CommonActionProvider#restoreState(org.eclipse.ui.IMemento) |
| 224 |
*/ |
277 |
*/ |
| 225 |
public void restoreState(IMemento aMemento) { |
278 |
public void restoreState(IMemento aMemento) { |
| 226 |
super.restoreState(aMemento); |
279 |
super.restoreState(aMemento); |
| 227 |
|
280 |
|
| 228 |
boolean showWorkingSets = true; |
281 |
boolean showWorkingSets = true; |
| 229 |
if(aMemento != null) { |
282 |
if(aMemento != null) { |
| 230 |
Integer showWorkingSetsInt = aMemento.getInteger(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS); |
283 |
Integer showWorkingSetsInt = aMemento.getInteger(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS); |
| 231 |
showWorkingSets = showWorkingSetsInt == null || showWorkingSetsInt.intValue() == 1; |
284 |
showWorkingSets = showWorkingSetsInt == null || showWorkingSetsInt.intValue() == 1; |
| 232 |
extensionStateModel.setBooleanProperty(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS, showWorkingSets); |
285 |
extensionStateModel.setBooleanProperty(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS, showWorkingSets); |
| 233 |
workingSetRootModeActionGroup.setShowTopLevelWorkingSets(showWorkingSets); |
286 |
workingSetRootModeActionGroup.setShowTopLevelWorkingSets(showWorkingSets); |
| 234 |
|
287 |
|
| 235 |
if(viewer != null) { |
288 |
String lastWorkingSetName = aMemento.getString(TAG_CURRENT_WORKING_SET_NAME); |
| 236 |
String lastWorkingSetName = aMemento.getString(TAG_CURRENT_WORKING_SET_NAME); |
289 |
initWorkingSetFilter(lastWorkingSetName); |
| 237 |
IWorkingSetManager workingSetManager = PlatformUI.getWorkbench().getWorkingSetManager(); |
|
|
| 238 |
IWorkingSet lastWorkingSet = workingSetManager.getWorkingSet(lastWorkingSetName); |
| 239 |
viewer.setInput(lastWorkingSet); |
| 240 |
workingSetActionGroup.setWorkingSet(lastWorkingSet); |
| 241 |
} |
| 242 |
} else { |
290 |
} else { |
| 243 |
showWorkingSets = false; |
291 |
showWorkingSets = false; |
| 244 |
|
292 |
|
| 245 |
extensionStateModel.setBooleanProperty(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS, showWorkingSets); |
293 |
extensionStateModel.setBooleanProperty(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS, showWorkingSets); |
| 246 |
workingSetRootModeActionGroup.setShowTopLevelWorkingSets(showWorkingSets); |
294 |
workingSetRootModeActionGroup.setShowTopLevelWorkingSets(showWorkingSets); |
| 247 |
} |
295 |
} |
| 248 |
} |
296 |
} |
| 249 |
|
297 |
|
| 250 |
/* (non-Javadoc) |
298 |
/* (non-Javadoc) |
| 251 |
* @see org.eclipse.ui.navigator.CommonActionProvider#saveState(org.eclipse.ui.IMemento) |
299 |
* @see org.eclipse.ui.navigator.CommonActionProvider#saveState(org.eclipse.ui.IMemento) |
| 252 |
*/ |
300 |
*/ |
| 253 |
public void saveState(IMemento aMemento) { |
301 |
public void saveState(IMemento aMemento) { |
| 254 |
super.saveState(aMemento); |
302 |
super.saveState(aMemento); |
| 255 |
|
303 |
|
| 256 |
if(aMemento != null) { |
304 |
if(aMemento != null) { |
| 257 |
int showWorkingSets = extensionStateModel.getBooleanProperty(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS) ? 1 : 0; |
305 |
int showWorkingSets = extensionStateModel.getBooleanProperty(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS) ? 1 : 0; |
| 258 |
aMemento.putInteger(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS, showWorkingSets); |
306 |
aMemento.putInteger(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS, showWorkingSets); |
| 259 |
|
307 |
|
| 260 |
if(viewer != null) { |
308 |
if (workingSet != null) { |
| 261 |
Object input = viewer.getInput(); |
309 |
aMemento.putString(TAG_CURRENT_WORKING_SET_NAME, workingSet.getName()); |
| 262 |
if(input instanceof IWorkingSet) { |
|
|
| 263 |
IWorkingSet workingSet = (IWorkingSet) input; |
| 264 |
aMemento.putString(TAG_CURRENT_WORKING_SET_NAME, workingSet.getName()); |
| 265 |
} |
| 266 |
} |
310 |
} |
| 267 |
} |
311 |
} |
| 268 |
|
312 |
|
| 269 |
} |
313 |
} |
| 270 |
|
314 |
|
| 271 |
/* |
315 |
/* |
| 272 |
* (non-Javadoc) |
316 |
* (non-Javadoc) |
| 273 |
* |
317 |
* |
| 274 |
* @see org.eclipse.ui.actions.ActionGroup#fillActionBars(org.eclipse.ui.IActionBars) |
318 |
* @see org.eclipse.ui.actions.ActionGroup#fillActionBars(org.eclipse.ui.IActionBars) |
| 275 |
*/ |
319 |
*/ |
| 276 |
public void fillActionBars(IActionBars actionBars) { |
320 |
public void fillActionBars(IActionBars actionBars) { |
| 277 |
if (!contributedToViewMenu) { |
321 |
if (!contributedToViewMenu) { |
| 278 |
try { |
322 |
try { |
| 279 |
super.fillActionBars(actionBars); |
323 |
super.fillActionBars(actionBars); |
|
Lines 284-295
Link Here
|
| 284 |
} finally { |
328 |
} finally { |
| 285 |
contributedToViewMenu = true; |
329 |
contributedToViewMenu = true; |
| 286 |
} |
330 |
} |
| 287 |
} |
331 |
} |
| 288 |
} |
332 |
} |
| 289 |
|
333 |
|
| 290 |
/* |
334 |
/* |
| 291 |
* (non-Javadoc) |
335 |
* (non-Javadoc) |
| 292 |
* |
336 |
* |
| 293 |
* @see org.eclipse.ui.actions.ActionGroup#dispose() |
337 |
* @see org.eclipse.ui.actions.ActionGroup#dispose() |
| 294 |
*/ |
338 |
*/ |
| 295 |
public void dispose() { |
339 |
public void dispose() { |
|
Lines 301-306
Link Here
|
| 301 |
|
345 |
|
| 302 |
managerChangeListener.ignore(); |
346 |
managerChangeListener.ignore(); |
| 303 |
|
347 |
|
|
|
348 |
if (extensionStateModel != null) { |
| 349 |
extensionStateModel.removePropertyChangeListener(topLevelModeListener); |
| 350 |
} |
| 351 |
|
| 304 |
contentService.getActivationService().removeExtensionActivationListener(activationListener); |
352 |
contentService.getActivationService().removeExtensionActivationListener(activationListener); |
| 305 |
} |
353 |
} |
|
|
354 |
|
| 355 |
private boolean isShowTopLevelWorkingSets() { |
| 356 |
if (extensionStateModel == null) { |
| 357 |
return false; |
| 358 |
} |
| 359 |
return extensionStateModel.getBooleanProperty(WorkingSetsContentProvider.SHOW_TOP_LEVEL_WORKING_SETS); |
| 360 |
} |
| 306 |
} |
361 |
} |