1
/*******************************************************************************
2
* Copyright (c) 2006, 2008 Wind River Systems 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
9
* Wind River Systems - initial API and implementation
10
*******************************************************************************/
11
package org.eclipse.cdt.dsf.ui.viewmodel;
13
import org.eclipse.cdt.dsf.concurrent.ConfinedToDsfExecutor;
14
import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
15
import org.eclipse.cdt.dsf.concurrent.RequestMonitor;
16
import org.eclipse.cdt.dsf.service.IDsfService;
17
import org.eclipse.cdt.dsf.ui.viewmodel.datamodel.AbstractDMVMProvider;
18
import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenCountUpdate;
19
import org.eclipse.debug.internal.ui.viewers.model.provisional.IChildrenUpdate;
20
import org.eclipse.debug.internal.ui.viewers.model.provisional.IElementContentProvider;
21
import org.eclipse.debug.internal.ui.viewers.model.provisional.IHasChildrenUpdate;
22
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
25
* View model nodes are configured with a view model provider to collectively
26
* define the layout of a view. Each layout node generates elements of type
27
* {@link IVMContext} which are then stored in the viewer.
30
* NOTE: This interface extends <code>IElementContentProvider</code> but it has
31
* slightly different parameter requirements. For the
32
* {@link IElementContentProvider#update(IChildrenUpdate[])} method, this class
33
* can accept an update where {@link IChildrenUpdate#getOffset()} and
34
* {@link IChildrenUpdate#getLength()} may return -1. In this case the
35
* implementation should return all available elements for the given parent.<br>
36
* Also the for the {@link IElementContentProvider#update(IHasChildrenUpdate[])} and
37
* {@link IElementContentProvider#update(IChildrenCountUpdate[])} methods, the
38
* implementation may return an error with an error code of {@link IDsfService#NOT_SUPPORTED}.
39
* In this case the caller of this update should call
40
* {@link IElementContentProvider#update(IChildrenUpdate[])}
43
* @see AbstractDMVMProvider
44
* @see IElementContentProvider
48
@ConfinedToDsfExecutor("")
49
public interface IVMNode extends IElementContentProvider
52
* Retrieves the view model provider that this node is configured with.
54
public IVMProvider getVMProvider();
57
* Returns the potential delta flags that would be generated by this node
58
* for the given event.
59
* @param event Event to process.
60
* @return IModelDelta flags
61
* @see #buildDelta(Object, VMDelta, int, RequestMonitor)
64
public int getDeltaFlags(Object event);
67
* Builds model delta information based on the given event.
69
* Model deltas, which are used to control the state of elements in the viewer, are
70
* generated by the layout nodes by recursively calling this method on all the nodes
71
* in the layout tree. Each node implements two methods: {@link #getDeltaFlags(Object)},
72
* and <code>buildDelta()</code>. A parent node which is processing a
73
* <code>buildDelta</code> operation needs to determine which of its elements are
74
* affected by a given event, set appropriate flags on these elements, and then
75
* it needs to call its child nodes with those elements to give the child nodes a
76
* chance to add onto the delta.
79
* The <code>getDeltaFlags()</code> is a synchronous
80
* call which tells the parent node whether on not to call the child node's
81
* <code>buildDelta</code> with the given event. If a child node return
82
* <code>true</code>, it only indicates that the node may add delta flags, but it
83
* does not require it to do so.
86
* @param event Event to process.
87
* @param parent Parent model delta node that this object should add delta
89
* @param nodeOffset The offset of the first element in this node. This offset
90
* depends on the elements returned by the siblings of this layout node.
91
* @param requestMonitor Return token, which notifies the caller that the calculation is
94
public void buildDelta(Object event, VMDelta parent, int nodeOffset, RequestMonitor requestMonitor);
97
* Retireves the view model elements for the given data model event. This method
98
* is optional and it allows the view model provider to optimize event processing
99
* by avoiding the need to retrieve all possible elements for the given node.
101
* For example: If a threads node implementation is given a thread stopped event in
102
* this method, and the stopped event included a reference to the thread. Then
103
* the implementation should create a view model context for that thread and return it
106
* @param parentDelta The parent delta in the processing of this event.
107
* @param event The event to check for the data model object.
108
* @param Request monitor for the array of elements corresponding to the
111
public void getContextsForEvent(VMDelta parentDelta, Object event, DataRequestMonitor<IVMContext[]> rm);
114
* Releases the resources held by this node.
116
public void dispose();
b'\\ No newline at end of file'