|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jmlspecs.eclipse.jdt.ui.UIUtils
public class UIUtils
This class contains a number of (static) utility methods for use in plugins.
Field Summary | |
---|---|
static java.lang.String |
eol
A convenience holder for the end-of-line String for the current platform. |
Constructor Summary | |
---|---|
UIUtils()
|
Method Summary | |
---|---|
static IJavaProject[] |
getJavaProjects()
A convenience method for getting all of the Java projects in the workspace. |
static java.lang.String |
getProjectClassPath(IJavaProject project)
Computes the classpath (in terms of full absolute file-system paths to directories) from the information available in the Eclipse project. |
static java.util.List |
getProjectClassPathEntries(IJavaProject project)
Gets the classpath entries for the given project and adds them to the List as file-system absolute paths (String); required projects are added recursively; libraries are added once; source folders are converted to file system absolute paths (remember that source folders may be linked). |
static IWorkspaceRoot |
getRoot()
|
static java.util.List |
getSelectedElements(org.eclipse.jface.viewers.ISelection selection,
org.eclipse.ui.IWorkbenchWindow window)
This method interprets the selection returning a List of IJavaElement and IResource objects that the plugin knows how to handle. |
static void |
showMessage(org.eclipse.swt.widgets.Shell shell,
java.lang.String title,
java.lang.String msg)
Displays a message in a information dialog; must be called from the UI thread. |
static void |
showMessageInUI(org.eclipse.swt.widgets.Shell sh,
java.lang.String title,
java.lang.String msg)
Displays a message in a dialog in the UI thread - this may be called from other threads. |
static java.util.Map |
sortByPackageFragmentRoot(java.util.Collection elements)
Creates a map indexed by IPackageFragmentRoot, with the value for each IPackageFragmentRoot being a Collection consisting of the subset of the argument that belongs to the IPackageFragmentRoot. |
static java.util.Map |
sortByProject(java.util.Collection elements)
Creates a map indexed by IJavaProject, with the value for each IJavaProject being a Collection consisting of the subset of the argument that belongs to the Java project. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String eol
Constructor Detail |
---|
public UIUtils()
Method Detail |
---|
public static IWorkspaceRoot getRoot()
public static void showMessageInUI(org.eclipse.swt.widgets.Shell sh, java.lang.String title, java.lang.String msg)
sh
- The shell to use to display the dialog, or
a top-level shell if the parameter is nulltitle
- The title of the dialog windowmsg
- The message to display in the dialogpublic static void showMessage(org.eclipse.swt.widgets.Shell shell, java.lang.String title, java.lang.String msg)
shell
- Either the parent shell, or null for a top-level shelltitle
- A title for the dialog windowmsg
- The message to display in the dialog windowpublic static java.util.List getSelectedElements(org.eclipse.jface.viewers.ISelection selection, org.eclipse.ui.IWorkbenchWindow window)
selection
- The selection to inspectwindow
- The window in which a selected editor exists
public static IJavaProject[] getJavaProjects()
public static java.lang.String getProjectClassPath(IJavaProject project)
project
- The project whose classpath is to be determined.
public static java.util.List getProjectClassPathEntries(IJavaProject project)
project
-
public static java.util.Map sortByProject(java.util.Collection elements)
elements
- The set of elements to sort
public static java.util.Map sortByPackageFragmentRoot(java.util.Collection elements) throws org.eclipse.core.runtime.CoreException
elements
- The set of elements to sort
org.eclipse.core.runtime.CoreException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |