Interface IUnoidlProject
public interface IUnoidlProject
Interface for a UNO project.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringorg.libreoffice.ide.eclipse.idlfolderis a persistent folder property that determines whether the folder can contain unoidl files or not.static final Stringstatic final Stringstatic final String -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddServiceElements(Document document, Element element, String[] services) Check if service exist.voidCheck manifest types file entry.voidCreate the Ant build.properties configuration file.createImplementation(Document document, Element component, String implementation, String[] services) Create a new implementation.voiddispose()Cleans up the project before destroying it.org.eclipse.core.resources.IFolder[]org.eclipse.core.runtime.IPathReturns the company prefix used in the idl modules and implementation trees.Returns the XML document for project component XML file.getComponentsDocument(boolean create) Returns the XML document for project component XML file.getComponentsElement(Document document) Returns the components XML element.org.eclipse.core.resources.IFileReturns the file handle for project component XML file.org.eclipse.core.resources.IFolderorg.eclipse.core.runtime.IPathorg.eclipse.core.resources.IFileReturns the file handle for the given project relative path.org.eclipse.core.resources.IFilegetFile(org.eclipse.core.runtime.IPath path) Returns the file handle for the given project relative path.org.eclipse.core.resources.IFolderReturns the folder handle for the given project relative path.org.eclipse.core.resources.IFoldergetFolder(org.eclipse.core.runtime.IPath path) Returns the folder handle for the given project relative path.org.eclipse.core.runtime.IPathgetImplementationElement(Element element, String implementation) Get the implementation XML element.org.eclipse.core.runtime.IPathgetName()org.eclipse.core.resources.IFolderorg.eclipse.core.runtime.IPathgetOOo()Returns the package or namespace name used for the implementation.org.eclipse.core.resources.IProjectorg.eclipse.core.runtime.IPathgetProperty(String name) Get a project's property.Gets the root module of the project.org.eclipse.core.runtime.IPathGets the root module path of the project.getSdk()org.eclipse.core.runtime.IPathorg.eclipse.core.runtime.IPathorg.eclipse.core.resources.IFileReturns the file handle for idl types file.org.eclipse.core.runtime.IPathorg.eclipse.core.runtime.IPathbooleanbooleanremoveImplementation(Element components, Element component, String implementation) Remove the implementation XML element.voidremoveImplementationElements(Element element, Element implementation) Remove all implementation elements from component except the given implementation.voidSaves the UNO project configuration in a hidden file.voidsaveJavaBuildProperties(List<org.eclipse.core.resources.IResource> libs) Save in the Ant build.properties the Java class path.voidsetCompanyPrefix(String prefix) Sets the company prefix.voidDefines the directory containing the IDL files.voidsetLanguage(AbstractLanguage language) Set the language of the project implementation.voidSets the selected LibreOffice.voidsetOutputExtension(String outputExt) Sets the output extension.voidsetProperty(String name, String value) Set a property to the project.voidSets the selected SDK.voidsetSourcesDir(String sourcesDir) Defines the directory containing the sources.voidwriteComponentsFile(Document document) Write the components XML file.
-
Field Details
-
DESCRIPTION_FILENAME
- See Also:
-
IDL_FOLDER
org.libreoffice.ide.eclipse.idlfolderis a persistent folder property that determines whether the folder can contain unoidl files or not.- See Also:
-
XCS_EXTENSION
- See Also:
-
XCU_EXTENSION
- See Also:
-
IDL_EXTENSION
- See Also:
-
IDLTYPES_FILE
- See Also:
-
COMPONENTS_FILE
- See Also:
-
-
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
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
Sets the selected LibreOffice.- Parameters:
ooo- the selected LibreOffice
-
setSdk
Sets the selected SDK.- Parameters:
sdk- the selected SDK
-
setProperty
Set a property to the project.This can be used by plugins to set their own properties on the project.
- Parameters:
name- the property namevalue- the property value
-
getProperty
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
nullif 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 befoo::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 beidl/foo/bar.- Returns:
- the root module path of the project
-
setCompanyPrefix
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 beorg.libreofficefor any code created by the LibreOffice community.- Returns:
- the company prefix
-
setOutputExtension
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.libreofficeand the output extension iscomp, 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.rdbfile. This path is relative to the project folder.
-
getServicesPath
org.eclipse.core.runtime.IPath getServicesPath()- Returns:
- the path to the project
services.rdbfile. 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 benull.- Parameters:
path- the path to the folder to get- Returns:
- the folder handle or
null - See Also:
-
IProject.getFile(java.lang.String)
-
getFile
Returns the file handle for the given project relative path. If the file doesn't exists, the handle will benull.- 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
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
Returns the components XML element.- Parameters:
document- the XML document- Returns:
- the components XML element.
-
removeImplementation
Remove the implementation XML element.- Parameters:
components- the XML documentcomponent- the XML documentimplementation- the XML document- Returns:
trueif implementation has been removed orfalse
-
checkManifestTypes
void checkManifestTypes()Check manifest types file entry.- Throws:
ParserConfigurationException
-
getImplementationElement
Get the implementation XML element.- Parameters:
element- the component XML elementimplementation- 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 documentcomponent- the XML componentimplementation- the implementation nameservices- the service names array- Returns:
- the created implementation element
-
addServiceElements
Check if service exist.- Parameters:
document- the XML documentelement- the implementation XML elementservices- the service names array- Returns:
trueif service exist orfalse
-
removeImplementationElements
Remove all implementation elements from component except the given implementation.- Parameters:
element- the component XML elementimplementation- the implementation element to keep
-
writeComponentsFile
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 benull.- Parameters:
path- the path to the folder to get- Returns:
- the folder handle or
null - See Also:
-
IProject.getFolder(java.lang.String)
-
getFolder
Returns the folder handle for the given project relative path. If the folder doesn't exists, the handle will benull.- Parameters:
path- the path to the folder to get- Returns:
- the folder handle or
null - See Also:
-
IProject.getFolder(java.lang.String)
-
setIdlDir
Defines the directory containing the IDL files.- Parameters:
idlDir- the IDL directory
-
setSourcesDir
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
Save in the Ant build.properties the Java class path.- Parameters:
libs- the files list composing the class path
-