|
Mobile Tools for Java Release 1.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IMTJProject
This interface provides the basic methods that must be available in all projects provided by MTJ.
Features of MTJ projects include:
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.
Method Summary | |
---|---|
void |
addMTJProjectListener(IMTJProjectListener projectListener)
Adds the listener to the collection of listeners who will be notified when the project state changes. |
void |
createPackage(boolean obfuscate,
boolean packageInactiveConfigs,
IProgressMonitor monitor)
Create a deployable JAR file package based on the contents available in the project. |
IJavaProject |
getJavaProject()
Returns the IJavaProject on which this
IMTJProject was created. |
IProject |
getProject()
Returns the IProject on which this IMTJProject
was created. |
MTJRuntimeList |
getRuntimeList()
Return the list of runtimes that are associated to the project. |
Properties |
getSdkProviderMetaData(String sdkId)
Retrieve a Properties file of vendor-specific meta data associated with the IMTJProject. |
ISignatureProperties |
getSignatureProperties()
Get the ISignatureProperties associated with this project. |
void |
refreshClasspath(IProgressMonitor monitor)
Refresh the classpath for this project. |
void |
removeMTJProjectListener(IMTJProjectListener projectListener)
Removes the listener from the collection of listeners who will be notified when the project state changes. |
void |
saveMetaData()
Save the project's metadata. |
void |
setSdkProviderMetaData(String sdkId,
Properties metaData)
Set a Properties file of meta data to be associated with an IMTJProject. |
void |
setSignatureProperties(ISignatureProperties props)
Set the signature properties for using when signing deployable packages generated for this MTJ project. |
Method Detail |
---|
void addMTJProjectListener(IMTJProjectListener projectListener)
IMTJProjectListener
interface.
projectListener
- the listener that should be notified when the
project state changes.void createPackage(boolean obfuscate, boolean packageInactiveConfigs, IProgressMonitor monitor) throws CoreException
The process of creating a deployable is described bellow:
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.
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.
CoreException
IJavaProject getJavaProject()
IJavaProject
on which this
IMTJProject
was created.
null
the IJavaProject
on which
this IMTJProject
was created.IProject getProject()
IProject
on which this IMTJProject
was created.
null
the IProject
on which this
IMTJProject
was created.MTJRuntimeList getRuntimeList()
ISignatureProperties getSignatureProperties() throws CoreException
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
.
null
in case of invalid properties.
CoreException
- an error occur while decrypting the information
available in the signature properties.void refreshClasspath(IProgressMonitor monitor) throws CoreException, OperationCanceledException
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.
monitor
- a progress monitor, or null
if progress
reporting is not desired.
CoreException
- if the classpath could not be set. Reasons include:
JavaConventions#validateClasspath(IJavaProject, IClasspathEntry[], IPath)
(JavaModelException).OperationCanceledException
- if the rebuild was canceled during
execution.void removeMTJProjectListener(IMTJProjectListener projectListener)
projectListener
- the listener that should no longer be notified
when the project state changes.void saveMetaData() throws CoreException
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 won't
be notified in case the metadata could not be saved.
CoreException
- if fails to save the metadata.void setSdkProviderMetaData(String sdkId, Properties metaData) throws IllegalArgumentException
A example use case is to save project level user preferences associated with a vendor-supplied JAD editor page.
The Properties file is not cloned. The SDK provider may set the Properties files once and continue to make changes to it. Values will be persisted the next time saveMetaData() is called.
sdkId
- Unique identifier for the SDK. If meta data associated with
the ID is already set, the old meta data is replaced with the new.metaData
- A Properties file of arbitrary vendor-defined values.
Passing in null is allowed and will essentially 'erase' the meta data.
IllegalArgumentException
- if sdkId is null or empty.Properties getSdkProviderMetaData(String sdkId) throws IllegalArgumentException
sdkId
- Unique identifier for the SDK.
IllegalArgumentException
- if sdkId is null or empty.void setSignatureProperties(ISignatureProperties props)
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.
props
- the signature properties for use on signing the deployable
packages.
|
Mobile Tools for Java Release 1.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |