org.eclipse.mtj.core.project
Interface IMTJProject
-
All Known Subinterfaces:
-
IMidletSuiteProject
-
public interface IMTJProject
This interface provides the basic methods that must be available in all
projects provided by MTJ.
Features of MTJ projects include:
- Collects together a list of runtimes.
- Carry references to a java project.
- Controls the process of creating deployable applications based on its
resources.
- Carry properties related to the signing process.
- Notify listeners when it's state changes.
EXPERIMENTAL. This class or interface has been added as part
of a work in progress. There is no guarantee that this API will work or that
it will remain the same. Please do not use this API without consulting with
the MTJ team.
-
Since:
- 1.0
-
Restriction:
- This class is not intended to be implemented by clients.
addMTJProjectListener
void addMTJProjectListener(
IMTJProjectListener projectListener)
- Adds the listener to the collection of listeners who will be notified
when the project state changes. The listener is notified by invoking one
of methods defined in the
IMTJProjectListener
interface.
-
-
Parameters:
-
projectListener
- the listener that should be notified when the
project state changes.
createPackage
void createPackage(boolean obfuscate,
boolean packageInactiveConfigs,
IProgressMonitor monitor)
throws CoreException
- Create a deployable JAR file package based on the contents available in
the project.
The process of creating a deployable is described bellow:
- Clean the output of the specified project.
- Invoke the build method of the specified builders for this project.
- Create the package for the available configurations according the
given packageInactiveConfigs flag.
- Notify listeners.
This method notifies all listeners after the package creation through the
invocation of
IMTJProjectListener.packageCreated()
. Listeners
wont be notified in case the package creation fails.
-
-
Parameters:
-
obfuscate
- a boolean indicating whether to obfuscate the resulting
packaged code. -
packageInactiveConfigs
- a boolean indicating whether to create
packages for all configurations (including inactive
configurations) or just for the active one. -
monitor
- a progress monitor, or null
if progress
reporting is not desired.
-
Throws:
-
CoreException
getJavaProject
IJavaProject getJavaProject()
- Returns the
IJavaProject
on which this
IMTJProject
was created.
-
-
Returns:
- the non-
null
the IJavaProject
on which
this IMTJProject
was created.
getProject
IProject getProject()
- Returns the
IProject
on which this IMTJProject
was created.
-
-
Returns:
- the non-
null
the IProject
on which this
IMTJProject
was created.
getRuntimeList
MTJRuntimeList getRuntimeList()
- Return the list of runtimes that are associated to the project. From the
list it is possible to read each runtime and information such as the
device of each runtime
-
-
Returns:
- MTJRuntimeList list of MTJRuntime
getSignatureProperties
ISignatureProperties getSignatureProperties()
throws CoreException
- Get the ISignatureProperties associated with this project.
If the project has no specific signing settings, the signature properties
available in the workspace secure preferences will be used as default.
In case the project specific signing settings were not set correctly
(reading these settings from the project metadata is returning
null
) this method will return null
.
-
-
Returns:
- the currently associated ISignatureProperties for this project or
null
in case of invalid properties.
-
Throws:
-
CoreException
- an error occur while decrypting the information
available in the signature properties.
refreshClasspath
void refreshClasspath(IProgressMonitor monitor)
throws CoreException,
OperationCanceledException
- Refresh the classpath for this project.
This method removes all MTJ classpath specific markers previously set on
the project, refreshes the classpath based on the active configuration
and forces a full rebuild.
This method notifies all listeners after the package creation through the
invocation of
IMTJProjectListener.classpathRefreshed()
. Listeners
wont be notified in case the classpath couldn't be refreshed.
-
-
Parameters:
-
monitor
- a progress monitor, or null
if progress
reporting is not desired.
-
Throws:
-
CoreException
- if the classpath could not be set. Reasons include:
- The associated javaProject does not exist
(JavaModelException).
- Fails to clear all markers on the project before
refreshing the classpath.
- The classpath is being modified during resource change
event notification(JavaModelException).
- The classpath failed the validation check as defined by
JavaConventions#validateClasspath(IJavaProject, IClasspathEntry[], IPath)
(JavaModelException).
- The rebuild fails.
-
OperationCanceledException
- if the rebuild was canceled during
execution.
removeMTJProjectListener
void removeMTJProjectListener(
IMTJProjectListener projectListener)
- Removes the listener from the collection of listeners who will be
notified when the project state changes.
-
-
Parameters:
-
projectListener
- the listener that should no longer be notified
when the project state changes.
saveMetaData
void saveMetaData()
throws CoreException
- Save the project's metadata.
Should be called after
setSignatureProperties(ISignatureProperties)
to persist the
information set.
This method notifies all listeners after saving the metadata through the
invocation of
IMTJProjectListener.metaDataSaved()
. Listeners wont
be notified in case the metadata could not be saved.
-
-
Throws:
-
CoreException
- if fails to save the metadata.
setSignatureProperties
void setSignatureProperties(
ISignatureProperties props)
- Set the signature properties for using when signing deployable packages
generated for this MTJ project.
This method notifies all listeners after setting the signature properties
through the invocation of
IMTJProjectListener.signaturePropertiesChanged()
. Listeners wont
be notified in case the signature properties could not be set.
-
-
Parameters:
-
props
- the signature properties for use on signing the deployable
packages.