blob: e3b591c632416817b1f95ec479fd8d3f1ddbe233 (
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
/*******************************************************************************
* Copyright (c) 2006, 2011 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.core.commands.Request;
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 Request implements IViewerUpdate {
private IPresentationContext fContext;
private Object fElement;
private TreePath fElementPath;
private IMemento fMemento;
protected TreeModelContentProvider fProvider;
protected Object fViewerInput;
/**
* Constructs a viewer state request.
* @param provider the content provider to use for the update
* @param viewerInput the current input
* @param elementPath the path of the element to update
* @param element the element to update
* @param memento Memento to update
* @param context the presentation context
*
*/
public MementoUpdate(TreeModelContentProvider provider, Object viewerInput, IPresentationContext context, Object element, TreePath elementPath, IMemento memento) {
fContext = context;
fElement = element;
fElementPath = elementPath;
fMemento = memento;
fProvider = provider;
fViewerInput = viewerInput;
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getPresentationContext()
*/
@Override
public IPresentationContext getPresentationContext() {
return fContext;
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElement()
*/
@Override
public Object getElement() {
return fElement;
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getElementPath()
*/
@Override
public TreePath getElementPath() {
return fElementPath;
}
public IMemento getMemento() {
return fMemento;
}
public TreeModelContentProvider getContentProvider() {
return fProvider;
}
public Object getElement(TreePath path) {
return fProvider.getElement(path);
}
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate#getViewerInput()
*/
@Override
public Object getViewerInput() {
return fViewerInput;
}
}
|