Skip to main content
summaryrefslogtreecommitdiffstats
blob: d9b29d8a989e9479cb4da766c4e1ef7e66e2b294 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*******************************************************************************
 * Copyright (c) 2006 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.debug.internal.ui.viewers.model;

import org.eclipse.debug.internal.ui.commands.actions.AbstractRequestMonitor;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.ui.IMemento;

/**
 * @since 3.3
 */
abstract class MementoUpdate extends AbstractRequestMonitor implements IViewerUpdate {
	
	private IPresentationContext fContext;
	private Object fElement;
	private IMemento fMemento;
	protected ModelContentProvider fProvider;
	
	/**
	 * Constructs a viewer state request.
	 * 
	 * @param viewer viewer
	 * @param element element
	 * @param memento memento
	 */
	public MementoUpdate(ModelContentProvider provider, IPresentationContext context, Object element, IMemento memento) {
		fContext = context;
		fElement = element;
		fMemento = memento;
		fProvider = provider;
	}

	/* (non-Javadoc)
	 * @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getPresentationContext()
	 */
	public IPresentationContext getPresentationContext() {
		return fContext;
	}
	
	public Object getElement() {
		return fElement;
	}
	
	public IMemento getMemento() {
		return fMemento;
	}
	
	public ModelContentProvider getContentProvider() {
		return fProvider;
	}

	public Object getElement(TreePath path) {
		return fProvider.getElement(path);
	}
	
}

Back to the top