KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > debug > ui > launcher > IClasspathViewer


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 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.jdt.internal.debug.ui.launcher;
13
14 import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
15 import org.eclipse.jface.viewers.ISelectionProvider;
16 import org.eclipse.jface.viewers.IStructuredSelection;
17 import org.eclipse.swt.widgets.Shell;
18
19 /**
20  * Defines a classpath viewer to abstract between classpath viewers that are tree or table viewers.
21  */

22 public interface IClasspathViewer extends ISelectionProvider {
23
24     /**
25      * Returns the entries in this viewer that are the children of the parent element
26      * associated with the selected item(s)
27      *
28      * @return the entries in this viewer
29      */

30     public IRuntimeClasspathEntry[] getEntries();
31
32     /**
33      * Sets the entries in this viewer to the given runtime classpath
34      * entries
35      *
36      * @param entries runtime classpath entries
37      */

38     public void setEntries(IRuntimeClasspathEntry[] entries);
39
40     /**
41      * Returns the shell associated with this viewer
42      * @return a shell
43      */

44     public Shell getShell();
45
46     /**
47      * Returns whether this viewer is enabled
48      * @return whether this viewer is enabled
49      */

50     public boolean isEnabled();
51
52     /**
53      * Adds the given entries to the list. If there is no selection
54      * in the list, the entries are added at the end of the list,
55      * otherwise the new entries are added before the (first) selected
56      * entry. The new entries are selected.
57      *
58      * @param entries additions
59      */

60     public void addEntries(IRuntimeClasspathEntry[] res);
61
62     /**
63      * Refreshes this entry in the viewer.
64      * @param entry the entry to be refreshed
65      */

66     public void refresh(Object JavaDoc entry);
67
68     /**
69      * The entries in a runtime classpath entry viewer have changed in some way.
70      * Calling this method allows the viewer to adapt to those changes if necessary.
71      */

72     public void notifyChanged();
73
74     /**
75      * Returns the index of an equivalent entry, or -1 if none.
76      *
77      * @return the index of an equivalent entry, or -1 if none
78      */

79     public int indexOf(IRuntimeClasspathEntry entry);
80
81     /**
82      * Returns whether an action of the supplied action type should be enabled based on the supplied selection.
83      *
84      * @param actionType One of RuntimeClasspathAction constants defining the action type
85      * @param selection The selection to use for the update
86      * @return Whether the action of this type should be enabled based on the selection
87      */

88     public boolean updateSelection(int actionType, IStructuredSelection selection);
89 }
90
Popular Tags