KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > debug > ui > actions > IAddMemoryRenderingsTarget


1 /*******************************************************************************
2  * Copyright (c) 2005, 2006 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
12 package org.eclipse.debug.ui.actions;
13
14 import org.eclipse.core.runtime.CoreException;
15 import org.eclipse.debug.ui.memory.IMemoryRenderingType;
16 import org.eclipse.jface.viewers.ISelection;
17 import org.eclipse.ui.IWorkbenchPart;
18
19 /**
20  * Adapter for the platform's retargettable "add memory rendering" action.
21  * Clients implementing this adapter are expected to add the necessary memory blocks
22  * and renderings when the adapter is invoked.
23  * <p>
24  * Typically, to add a memory rendering, client needs to do the following:
25  * <ol>
26  * <li>Create a new memory block</li>
27  * <li>Add the new memory block to the Memory Block Manager. (<code>IMemoryBlockManager</code>)</li>
28  * <li>Create the new rendering from <code>IMemoryRenderingTypeDelegate</code></li>
29  * <li>Bring the required memory view to the top. (<code>IMemoryRenderingSite</code>)</li>
30  * <li>Find the container from the memory view to host the new memory rendering.
31  * (<code>IMemoryRenderingContainer</code>)</li>
32  * <li>Initialize the new rendering with the appropriate memory block and container.</li>
33  * <li>Add the new rendering to the container.</li>
34  * </ol>
35  * </p>
36  * <p>
37  * Clients may implement this interface.
38  * </p>
39  * @since 3.2
40  * @see AddMemoryRenderingActionDelegate
41  */

42 public interface IAddMemoryRenderingsTarget {
43     /**
44      * Returns whether a memory rendering can be added from the specified
45      * part, based on the the given selection, which is the active debug context
46      * in the current workbench window.
47      *
48      * @param part the part on which the action has been invoked
49      * @param selection the active debug context in the active workbench window
50      * @throws CoreException if an error has occurred
51      */

52     public boolean canAddMemoryRenderings(IWorkbenchPart part, ISelection selection);
53     
54     /**
55      * Adds memory renderings. Based on the part and selection (active debug context), this
56      * adapter does the following:
57      * <ol>
58      * <li>creates and adds the required memory block to the memory block manager</li>
59      * <li>creates the specified renderings and add the them
60      * to the appropriate memory rendering containers</li>
61      * </ol>
62      * @param part the part on which the action has been invoked
63      * @param selection the active debug context
64      * @param renderingTypes renderings to add
65      * @throws CoreException if unable to perform the action
66      *
67      * @see org.eclipse.debug.core.model.IMemoryBlockRetrieval
68      * @see org.eclipse.debug.ui.memory.IMemoryRenderingManager
69      * @see org.eclipse.debug.core.IMemoryBlockManager
70      * @see org.eclipse.debug.ui.memory.IMemoryRenderingSite
71      * @see org.eclipse.debug.ui.memory.IMemoryRenderingContainer
72      */

73     public void addMemoryRenderings(IWorkbenchPart part, ISelection selection, IMemoryRenderingType[] renderingTypes) throws CoreException;
74     
75     /**
76      * Returns a list of rendering types that can be added from the given workbench part and active
77      * debug context, possibly empty.
78      *
79      * @param part the part on which the action has been invoked
80      * @param selection the active debug context
81      * @return a list of rendering types that can be added, possibly empty
82      */

83     public IMemoryRenderingType[] getMemoryRenderingTypes(IWorkbenchPart part, ISelection selection);
84 }
85
Popular Tags