org.eclipse.mtl.ide.ui.wizards.newfile.example
Interface IMTLExampleStrategy

All Known Implementing Classes:
MTLCopyExampleContentStrategy

public interface IMTLExampleStrategy

An internal extension point is defined to specify multiple example strategies. It is used to initialize automatically a template file from an example in the "New>MTL>MTL Templates" wizard. The extension point "org.eclipse.mtl.ide.ui.example" requires a fully qualified name of a Java class implementing this interface.

See Also:
MTLCopyExampleContentStrategy

Field Summary
static java.lang.String EXAMPLE_STRATEGY_EXTENSION_ID
          The identifier of the internal extension point specifying the implementation to use for example strategy.
 
Method Summary
 boolean forceMetamodelURI()
          Indicates if this strategy defines itself the meta-model URI of the template to create.
 java.lang.String getContent(org.eclipse.core.resources.IFile exampleFile, java.lang.String moduleName, boolean templateHasFileBlock, boolean templateIsMain, java.lang.String metamodelURI, java.lang.String metamodelFileType)
          Gets the new template content, using the example file and the wizard information.
 java.lang.String getDescription()
          Gets the description of the strategy (Displayed in the "New>MTL>MTL Templates" wizard).
 java.lang.String getInitialFileNameFilter()
          Gets the initial file name filter for this strategy.
 

Field Detail

EXAMPLE_STRATEGY_EXTENSION_ID

static final java.lang.String EXAMPLE_STRATEGY_EXTENSION_ID
The identifier of the internal extension point specifying the implementation to use for example strategy. It is used to initialize automatically a template file in the MTL project.

See Also:
Constant Field Values
Method Detail

getDescription

java.lang.String getDescription()
Gets the description of the strategy (Displayed in the "New>MTL>MTL Templates" wizard).

Returns:
the description of the strategy

getInitialFileNameFilter

java.lang.String getInitialFileNameFilter()
Gets the initial file name filter for this strategy.

Returns:
the initial file name filter

forceMetamodelURI

boolean forceMetamodelURI()
Indicates if this strategy defines itself the meta-model URI of the template to create.

Returns:
true if this strategy defines itself the meta-model URI

getContent

java.lang.String getContent(org.eclipse.core.resources.IFile exampleFile,
                            java.lang.String moduleName,
                            boolean templateHasFileBlock,
                            boolean templateIsMain,
                            java.lang.String metamodelURI,
                            java.lang.String metamodelFileType)
Gets the new template content, using the example file and the wizard information.

Parameters:
exampleFile - is the selected example
moduleName - is the module name
templateHasFileBlock - indicates if a file block must be generated
templateIsMain - indicates if a main tag (@main) must be generated
metamodelURI - is the metamodel URI
metamodelFileType - is the main metamodel type
Returns:
the new template content

Copyright 2008 Obeo
All Rights Reserved.