KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > internal > LocalWorkingSetManager


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.ui.internal;
12
13 import org.eclipse.core.runtime.Assert;
14 import org.eclipse.ui.ILocalWorkingSetManager;
15 import org.eclipse.ui.IMemento;
16 import org.eclipse.ui.IWorkingSet;
17 import org.osgi.framework.BundleContext;
18
19
20 public class LocalWorkingSetManager extends AbstractWorkingSetManager implements ILocalWorkingSetManager {
21
22     public LocalWorkingSetManager(BundleContext context) {
23         super(context);
24     }
25
26     /**
27      * {@inheritDoc}
28      */

29     public void removeWorkingSet(IWorkingSet workingSet) {
30         internalRemoveWorkingSet(workingSet);
31     }
32
33     /**
34      * {@inheritDoc}
35      */

36     public void addRecentWorkingSet(IWorkingSet workingSet) {
37         internalAddRecentWorkingSet(workingSet);
38     }
39
40     /**
41      * {@inheritDoc}
42      */

43     public void saveState(IMemento memento) {
44         saveWorkingSetState(memento);
45         saveMruList(memento);
46     }
47     
48     /**
49      * {@inheritDoc}
50      */

51     public void restoreState(IMemento memento) {
52         Assert.isNotNull(memento);
53         Assert.isTrue(getWorkingSets().length == 0);
54         restoreWorkingSetState(memento);
55         restoreMruList(memento);
56     }
57 }
58
Popular Tags