Class ContributionUtil


  • public final class ContributionUtil
    extends java.lang.Object
    Util class used during the creation and deletion of view models to update other project files accordingly.
    Author:
    Eugen Neufeld
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean isFragmentProject​(org.eclipse.core.resources.IProject project)
      Checks whether the project is a fragment project.
      static boolean isPluginProject​(org.eclipse.core.resources.IProject project)
      Checks whether the project is a plugin project.
      static java.util.Optional<java.lang.String> parseIFile​(org.eclipse.core.resources.IFile file)
      Util method which allows to parse an IFile.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • isPluginProject

        public static boolean isPluginProject​(org.eclipse.core.resources.IProject project)
        Checks whether the project is a plugin project.
        Parameters:
        project - the project to checks
        Returns:
        true if the project has the plugin nature
      • isFragmentProject

        public static boolean isFragmentProject​(org.eclipse.core.resources.IProject project)
        Checks whether the project is a fragment project.
        Parameters:
        project - the project to checks
        Returns:
        true if the Manifest has a fragment host
      • parseIFile

        public static java.util.Optional<java.lang.String> parseIFile​(org.eclipse.core.resources.IFile file)
                                                               throws java.io.IOException,
                                                                      org.eclipse.core.runtime.CoreException
        Util method which allows to parse an IFile.
        Parameters:
        file - the IFile to parse
        Returns:
        The content of the IFile
        Throws:
        java.io.UnsupportedEncodingException
        java.io.IOException - Thrown if file is not readable
        org.eclipse.core.runtime.CoreException - Thrown if eclipse cannot read the file