Skip to main content
summaryrefslogtreecommitdiffstats
blob: b00c8bab5c86e376b5d7191c88576885643f6b5e (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
/*******************************************************************************
 * Copyright (c) 2007, 2010 Wind River Systems 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:
 *     Wind River Systems - initial API and implementation
 *******************************************************************************/
package org.eclipse.cdt.dsf.ui.viewmodel;

import org.eclipse.cdt.dsf.concurrent.DataRequestMonitor;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.Viewer;

/**
 * View Model extension to the platform IModelProxy interface.  This extension
 * allows the IVMProvider implementation to delegate the model proxy implementation
 * into a separate object. 
 * <br/> 
 * Note: The IVMModelProxy.init() may be called twice when installed, as a 
 * workaround for bug 241024. 
 * 
 * @since 1.0
 */
public interface IVMModelProxy extends IModelProxy {

    /**
     * Returns the root element that this model proxy was created for.  
     */
    public Object getRootElement();
    
    /**
     * Returns whether the given event applies to the root element and the 
     * nodes in this model proxy. 
     * <p>
     * This method is the equivalent of calling 
     * <code> getEventDeltaFlags(event) != IModelDelta.NO_CHANGE </code>.
     * </p>
     */
    public boolean isDeltaEvent(Object event);

    /**
     * Creates a model delta for the given event.
     */
    public void createDelta(final Object event, final DataRequestMonitor<IModelDelta> rm);

    /**
     * Sends the given delta to this model proxy's listeners.
     */
    public void fireModelChanged(IModelDelta delta);

    /**
     * Returns the viewer.
     * 
     * @since 2.0
     */
    public Viewer getViewer();

    /**
     * Returns the viewer input that was set to the viewer when this proxy 
     * was created.  
     * 
     * @since 2.0
     */
    public Object getViewerInput();

    /**
     * Returns the full path for the root element.  If the path is empty, it
     * means that the root element is the viewer input.
     * 
     * @since 2.0
     */
    public TreePath getRootPath();

    /**
     * Returns the delta flags associated with this event.  This method is   
     * 
     * @param event 
     * @return
     * 
     * @since 2.1
     */
    public int getEventDeltaFlags(Object event);

}

Back to the top