KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > internal > ui > viewers > model > MementoUpdate


1 /*******************************************************************************
2  * Copyright (c) 2006, 2007 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.debug.internal.ui.viewers.model;
12
13 import org.eclipse.debug.internal.core.commands.Request;
14 import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
15 import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
16 import org.eclipse.jface.viewers.TreePath;
17 import org.eclipse.ui.IMemento;
18
19 /**
20  * @since 3.3
21  */

22 abstract class MementoUpdate extends Request implements IViewerUpdate {
23     
24     private IPresentationContext fContext;
25     private Object JavaDoc fElement;
26     private TreePath fElementPath;
27     private IMemento fMemento;
28     protected ModelContentProvider fProvider;
29     
30     /**
31      * Constructs a viewer state request.
32      *
33      * @param viewer viewer
34      * @param element element
35      * @param memento memento
36      */

37     public MementoUpdate(ModelContentProvider provider, IPresentationContext context, Object JavaDoc element, TreePath elementPath, IMemento memento) {
38         fContext = context;
39         fElement = element;
40         fElementPath = elementPath;
41         fMemento = memento;
42         fProvider = provider;
43     }
44
45     /* (non-Javadoc)
46      * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getPresentationContext()
47      */

48     public IPresentationContext getPresentationContext() {
49         return fContext;
50     }
51     
52     public Object JavaDoc getElement() {
53         return fElement;
54     }
55     
56     public TreePath getElementPath() {
57         return fElementPath;
58     }
59     
60     public IMemento getMemento() {
61         return fMemento;
62     }
63     
64     public ModelContentProvider getContentProvider() {
65         return fProvider;
66     }
67
68     public Object JavaDoc getElement(TreePath path) {
69         return fProvider.getElement(path);
70     }
71     
72 }
73
Popular Tags