Class SelectionContextProject


  • public final class SelectionContextProject
    extends Object
    Utility method to retrieve context project from the given selection.
    Restriction:
    This class is not intended to be sub-classed by clients.
    • Method Detail

      • getContextProject

        public static org.eclipse.core.resources.IProject getContextProject​(org.eclipse.ui.IWorkbenchPage page)
        Retrieve current workbench page context project. Can return null, if cannot retrieve.
        Parameters:
        page - the workbench page to retrieve project from, cannot be null
        Returns:
        current workbench page context project or null if cannot retrieve
      • getContextProject

        public static org.eclipse.core.resources.IProject getContextProject​(ISelection selection)
        Retrieve current selection context project. Can return null, if cannot retrieve.
        Parameters:
        selection - the selection to retrieve project from, if given selection is null, method will return null
        Returns:
        current selection context project or null if cannot retrieve
      • getContextProject

        public static org.eclipse.core.resources.IProject getContextProject​(org.eclipse.ui.IEditorPart editorpart)
        Retrieve current editor part context project. Can return null if cannot retrieve.
        Parameters:
        editorpart - the editor part to retrieve project from, cannot be null
        Returns:
        current editor context project or null if cannot retrieve