eclipse plugin: add auxiliar methods to remove code redundancy
This commit is contained in:
parent
97aaefd021
commit
9727ee7db4
1 changed files with 20 additions and 0 deletions
|
@ -58,6 +58,26 @@ public class WorkspaceUtils
|
|||
return (IStructuredSelection)window.getSelectionService().getSelection();
|
||||
}
|
||||
|
||||
public static IProject getSelectedProject()
|
||||
{
|
||||
return getSelectedProject(WorkspaceUtils.getWorkbenchWindow());
|
||||
}
|
||||
|
||||
public static IFolder getSelectedFolder()
|
||||
{
|
||||
return getSelectedFolder(WorkspaceUtils.getWorkbenchWindow());
|
||||
}
|
||||
|
||||
public static IFile getSelectedFile()
|
||||
{
|
||||
return getSelectedFile(WorkspaceUtils.getWorkbenchWindow());
|
||||
}
|
||||
|
||||
public static IStructuredSelection getSelectedStructuredSelection()
|
||||
{
|
||||
return getSelectedStructuredSelection(WorkspaceUtils.getWorkbenchWindow());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the first WorkbenchWindow available.
|
||||
* This is not always the same with ActiveWorkbecnWindow
|
||||
|
|
Loading…
Add table
Reference in a new issue