Interface IUnoidlProject


public interface IUnoidlProject
Interface for a UNO project.
  • Field Details

  • Method Details

    • dispose

      void dispose()
      Cleans up the project before destroying it.
    • getLanguage

      AbstractLanguage getLanguage()
      Returns:
      the project implementation language.
    • getName

      String getName()
      Returns:
      the project name.
    • getOOo

      IOOo getOOo()
      Returns:
      the selected LibreOffice
    • getSdk

      ISdk getSdk()
      Returns:
      the selected SDK
    • setLanguage

      void setLanguage(AbstractLanguage language)
      Set the language of the project implementation. This method can be called only once on a project to avoid project nature problems.
      Parameters:
      language - the new language
    • setOOo

      void setOOo(IOOo ooo)
      Sets the selected LibreOffice.
      Parameters:
      ooo - the selected LibreOffice
    • setSdk

      void setSdk(ISdk sdk)
      Sets the selected SDK.
      Parameters:
      sdk - the selected SDK
    • setProperty

      void setProperty(String name, String value)
      Set a property to the project.

      This can be used by plugins to set their own properties on the project.

      Parameters:
      name - the property name
      value - the property value
    • getProperty

      String getProperty(String name)
      Get a project's property.

      This can be used by plugins to get their own properties from the project.

      Parameters:
      name - the property name
      Returns:
      the value of the property or null if it doesn't exists
    • getRootModule

      String getRootModule()
      Gets the root module of the project.

      It corresponds to the prefix transformed as an idl scoped name. For example, if the company prefix is set to foo.bar, the root module will be foo::bar.

      Returns:
      the root module of the project
    • getRootModulePath

      org.eclipse.core.runtime.IPath getRootModulePath()
      Gets the root module path of the project.

      It corresponds to the path to the root module definition. For example, if the company prefix is set to foo.bar, the root module path will be idl/foo/bar.

      Returns:
      the root module path of the project
    • setCompanyPrefix

      void setCompanyPrefix(String prefix)
      Sets the company prefix.
      Parameters:
      prefix - new company prefix
    • getCompanyPrefix

      String getCompanyPrefix()
      Returns the company prefix used in the idl modules and implementation trees. For example, it could be org.libreoffice for any code created by the LibreOffice community.
      Returns:
      the company prefix
    • setOutputExtension

      void setOutputExtension(String outputExt)
      Sets the output extension.
      Parameters:
      outputExt - new output extension to set
    • getOutputExtension

      String getOutputExtension()
      Returns the package or namespace name used for the implementation.

      If the company prefix is org.libreoffice and the output extension is comp, then the implementation namespace will be: org.libreoffice.comp.

      Returns:
      the implementation namespace
    • getBuildPath

      org.eclipse.core.runtime.IPath getBuildPath()
      Returns:
      the path to the project directory containing the temporary build files. This path is relative to the project folder.
    • getIdlDir

      String getIdlDir()
      Returns:
      the path to the project directory containing the idl files. This path is relative to the project folder.
    • getIdlPath

      org.eclipse.core.runtime.IPath getIdlPath()
      Returns:
      the path to the project directory containing the idl files. This path is relative to the project folder.
    • getImplementationPath

      org.eclipse.core.runtime.IPath getImplementationPath()
      Returns:
      the path to the project implementation directory. This path is relative to the project folder.
    • getProject

      org.eclipse.core.resources.IProject getProject()
      Returns:
      the IProject to the project
    • getProjectPath

      org.eclipse.core.runtime.IPath getProjectPath()
      Returns:
      the full path to the project
    • getSourcePath

      org.eclipse.core.runtime.IPath getSourcePath()
      Returns:
      the path to the sources directory: that is "source". This path is relative to the project folder.
    • getTypesPath

      org.eclipse.core.runtime.IPath getTypesPath()
      Returns:
      the path to the project types.rdb file. This path is relative to the project folder.
    • getServicesPath

      org.eclipse.core.runtime.IPath getServicesPath()
      Returns:
      the path to the project services.rdb file. This path is relative to the project folder.
    • getUrdPath

      org.eclipse.core.runtime.IPath getUrdPath()
      Returns:
      the path to the project directory containing the generated urd files. This path is relative to the project folder.
    • getDistPath

      org.eclipse.core.runtime.IPath getDistPath()
      Returns:
      the path to the project's folder containing the distribution .oxt file.
    • getDistFolder

      org.eclipse.core.resources.IFolder getDistFolder() throws org.eclipse.core.runtime.CoreException
      Returns:
      the folder containing the distribution .oxt file. If the folder does not exist then it is created.
      Throws:
      org.eclipse.core.runtime.CoreException - if we were unable to create the folder.
    • getOfficeUserProfilePath

      org.eclipse.core.runtime.IPath getOfficeUserProfilePath()
      Returns:
      the path to the project's folder used to store the user profile when running/debugging LibreOffice in a clean environment. This way we do not mangle with the system wide installed, LibreOffice settings.
    • getOfficeUserProfileFolder

      org.eclipse.core.resources.IFolder getOfficeUserProfileFolder() throws org.eclipse.core.runtime.CoreException
      Returns:
      the folder used to store the user profile when running/debugging LibreOffice in a clean environment. This way we do not mangle with the system wide installed, LibreOffice settings. If the folder does not exist then it is created.
      Throws:
      org.eclipse.core.runtime.CoreException - if we were unable to create the folder.
    • getFile

      org.eclipse.core.resources.IFile getFile(org.eclipse.core.runtime.IPath path)
      Returns the file handle for the given project relative path. If the file doesn't exists, the handle will be null.
      Parameters:
      path - the path to the folder to get
      Returns:
      the folder handle or null
      See Also:
      • IProject.getFile(java.lang.String)
    • getFile

      org.eclipse.core.resources.IFile getFile(String path)
      Returns the file handle for the given project relative path. If the file doesn't exists, the handle will be null.
      Parameters:
      path - the path to the folder to get
      Returns:
      the folder handle or null
      See Also:
      • IProject.getFile(java.lang.String)
    • getComponentsFile

      org.eclipse.core.resources.IFile getComponentsFile()
      Returns the file handle for project component XML file.
      Returns:
      the file handle or null
    • getTypesFile

      org.eclipse.core.resources.IFile getTypesFile()
      Returns the file handle for idl types file.
      Returns:
      the file handle or null
    • getComponentsDocument

      Document getComponentsDocument()
      Returns the XML document for project component XML file.
      Returns:
      the XML document or null
    • getComponentsDocument

      Document getComponentsDocument(boolean create)
      Returns the XML document for project component XML file.
      Parameters:
      create - create the XML document if not exist
      Returns:
      the XML document or null
    • getComponentsElement

      Element getComponentsElement(Document document)
      Returns the components XML element.
      Parameters:
      document - the XML document
      Returns:
      the components XML element.
    • removeImplementation

      boolean removeImplementation(Element components, Element component, String implementation)
      Remove the implementation XML element.
      Parameters:
      components - the XML document
      component - the XML document
      implementation - the XML document
      Returns:
      true if implementation has been removed or false
    • checkManifestTypes

      void checkManifestTypes()
      Check manifest types file entry.
      Throws:
      ParserConfigurationException
    • getImplementationElement

      Element getImplementationElement(Element element, String implementation)
      Get the implementation XML element.
      Parameters:
      element - the component XML element
      implementation - the implementation name
      Returns:
      the implementation XML element
    • createImplementation

      Element createImplementation(Document document, Element component, String implementation, String[] services)
      Create a new implementation.
      Parameters:
      document - the XML document
      component - the XML component
      implementation - the implementation name
      services - the service names array
      Returns:
      the created implementation element
    • addServiceElements

      boolean addServiceElements(Document document, Element element, String[] services)
      Check if service exist.
      Parameters:
      document - the XML document
      element - the implementation XML element
      services - the service names array
      Returns:
      true if service exist or false
    • removeImplementationElements

      void removeImplementationElements(Element element, Element implementation)
      Remove all implementation elements from component except the given implementation.
      Parameters:
      element - the component XML element
      implementation - the implementation element to keep
    • writeComponentsFile

      void writeComponentsFile(Document document)
      Write the components XML file.
      Parameters:
      document - the XML document
    • getFolder

      org.eclipse.core.resources.IFolder getFolder(org.eclipse.core.runtime.IPath path)
      Returns the folder handle for the given project relative path. If the folder doesn't exists, the handle will be null.
      Parameters:
      path - the path to the folder to get
      Returns:
      the folder handle or null
      See Also:
      • IProject.getFolder(java.lang.String)
    • getFolder

      org.eclipse.core.resources.IFolder getFolder(String path)
      Returns the folder handle for the given project relative path. If the folder doesn't exists, the handle will be null.
      Parameters:
      path - the path to the folder to get
      Returns:
      the folder handle or null
      See Also:
      • IProject.getFolder(java.lang.String)
    • setIdlDir

      void setIdlDir(String idlDir)
      Defines the directory containing the IDL files.
      Parameters:
      idlDir - the IDL directory
    • setSourcesDir

      void setSourcesDir(String sourcesDir)
      Defines the directory containing the sources.
      Parameters:
      sourcesDir - the sources directory
    • saveAllProperties

      void saveAllProperties()
      Saves the UNO project configuration in a hidden file.
    • createBuildProperties

      void createBuildProperties()
      Create the Ant build.properties configuration file.
    • getBinFolders

      org.eclipse.core.resources.IFolder[] getBinFolders()
      Returns:
      the language dependent binaries folders.
    • hasBuildFile

      boolean hasBuildFile()
      Returns:
      if the build.properties project file exist.
    • saveJavaBuildProperties

      void saveJavaBuildProperties(List<org.eclipse.core.resources.IResource> libs)
      Save in the Ant build.properties the Java class path.
      Parameters:
      libs - the files list composing the class path