01: /*******************************************************************************
02: * Copyright (c) 2000, 2006 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.internal;
11:
12: import org.eclipse.core.runtime.Assert;
13: import org.eclipse.ui.ILocalWorkingSetManager;
14: import org.eclipse.ui.IMemento;
15: import org.eclipse.ui.IWorkingSet;
16: import org.osgi.framework.BundleContext;
17:
18: public class LocalWorkingSetManager extends AbstractWorkingSetManager
19: implements ILocalWorkingSetManager {
20:
21: public LocalWorkingSetManager(BundleContext context) {
22: super (context);
23: }
24:
25: /**
26: * {@inheritDoc}
27: */
28: public void removeWorkingSet(IWorkingSet workingSet) {
29: internalRemoveWorkingSet(workingSet);
30: }
31:
32: /**
33: * {@inheritDoc}
34: */
35: public void addRecentWorkingSet(IWorkingSet workingSet) {
36: internalAddRecentWorkingSet(workingSet);
37: }
38:
39: /**
40: * {@inheritDoc}
41: */
42: public void saveState(IMemento memento) {
43: saveWorkingSetState(memento);
44: saveMruList(memento);
45: }
46:
47: /**
48: * {@inheritDoc}
49: */
50: public void restoreState(IMemento memento) {
51: Assert.isNotNull(memento);
52: Assert.isTrue(getWorkingSets().length == 0);
53: restoreWorkingSetState(memento);
54: restoreMruList(memento);
55: }
56: }
|