org.eclipse.mtl.ide.ui.builders
Class MTLProject

java.lang.Object
  extended by org.eclipse.mtl.ide.ui.builders.MTLProject

public class MTLProject
extends java.lang.Object

A MTL project represents a view of a project resource in terms of MTL elements. Each MTL project has a classpath, defining which folders contain source code and where templates are located. Each MTL project also has an output location. The extension of a template is '.mtl' and the extension of an output file is '.emtl'.


Constructor Summary
MTLProject(org.eclipse.core.resources.IProject project)
          Constructor.
 
Method Summary
 java.util.List<org.eclipse.emf.common.util.URI> getAccessibleOutputFiles()
          Gets all the accessible output files (EMTL) of this project.
 org.eclipse.core.runtime.IPath getOutputFilePath(org.eclipse.core.resources.IFile fileMTL)
          Gets the output file path (EMTL) for the given MTL file.
 java.lang.String getPackageName(org.eclipse.core.resources.IFile fileMTL)
          Gets the full name of the package which contains the MTL file.
 java.util.List<org.eclipse.core.runtime.IPath> getResolvedClasspath()
          This is a helper method returning the resolved classpath for the project as a list of simple classpath entries.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MTLProject

public MTLProject(org.eclipse.core.resources.IProject project)
Constructor.

Parameters:
project - is the project
Method Detail

getOutputFilePath

public org.eclipse.core.runtime.IPath getOutputFilePath(org.eclipse.core.resources.IFile fileMTL)
Gets the output file path (EMTL) for the given MTL file. For example :
'/MyProject/src/org/eclipse/mtl/file.mtl' becomes '/MyProject/bin/org/eclipse/mtl/file.emtl'

Parameters:
fileMTL - is the MTL file
Returns:
the output file path

getResolvedClasspath

public java.util.List<org.eclipse.core.runtime.IPath> getResolvedClasspath()
This is a helper method returning the resolved classpath for the project as a list of simple classpath entries.

Returns:
the classpath entries

getPackageName

public java.lang.String getPackageName(org.eclipse.core.resources.IFile fileMTL)
Gets the full name of the package which contains the MTL file. For example :
'/MyProject/src/org/eclipse/mtl/file.mtl' becomes 'org.eclipse.mtl'

Parameters:
fileMTL - is the MTL file
Returns:
the full name of the package, or an empty string if the file is not valid

getAccessibleOutputFiles

public java.util.List<org.eclipse.emf.common.util.URI> getAccessibleOutputFiles()
Gets all the accessible output files (EMTL) of this project. It means the files of the project and the files of the required plugins.

Returns:
the URIs of the output files, there are 'plugin' URIs and 'workspace' URIs...

Copyright 2008 Obeo
All Rights Reserved.