|
Carbide.c++ | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nokia.carbide.templatewizard.process.AbstractProcess
public abstract class AbstractProcess
An abstract base class to enable implementing
com.nokia.carbide.templatewizard.process.IProcess
Includes methods for initialization, failure handling and accessing parameters.
Constructor Summary | |
---|---|
AbstractProcess()
|
Method Summary | |
---|---|
protected void |
fail(java.lang.String message)
Called by subclasses to encapsulate throwing a CoreException from IProcess.process(ITemplate, List, IProgressMonitor) |
protected void |
fail(java.lang.String message,
java.lang.Throwable t)
Called by subclasses to encapsulate throwing a CoreException from IProcess.process(ITemplate, List, IProgressMonitor) |
protected void |
failIfFalse(boolean condition,
java.lang.String message)
Called by subclasses to encapsulate throwing a CoreException from IProcess.process(ITemplate, List, IProgressMonitor) |
protected void |
failIfNull(java.lang.Object object,
java.lang.String message)
Called by subclasses to encapsulate throwing a CoreException from IProcess.process(ITemplate, List, IProgressMonitor) |
protected IParameter |
findParameterByName(java.lang.String parameterName,
java.util.List<IParameter> parameters)
Encapsulates getting a singleton IParameter that may or may not exist,returning null if none is found. |
protected abstract Plugin |
getPlugin()
Must be implemented by subclasses to provide the Plugin
needed to construct a CoreException . |
protected java.lang.String |
getProcessName()
The class attribute of the <process> element. |
protected java.lang.String |
getRequiredAttributeFromParameter(IParameter parameter,
java.lang.String attributeName)
Encapsulates getting a required attribute from an IParameter by name,or throwing a CoreException , if none is found. |
protected IParameter |
getRequiredParameterByName(java.lang.String parameterName,
java.util.List<IParameter> parameters)
Encapsulates getting a singleton IParameter that is required to exist,or throwing a CoreException , if none is found. |
protected abstract void |
init(ITemplate template,
java.util.List<IParameter> parameters)
Must be implemented by subclasses. |
boolean |
mustRunInUIThread()
This method is called before executing this process, to determine whether it should be executed in the UI thread. |
void |
process(ITemplate template,
java.util.List<IParameter> parameters,
IProgressMonitor monitor)
The main method called to execute this process. |
void |
setRunInUIThread(boolean runInUIThread)
Can be called in constructor to set the return value of IProcess.mustRunInUIThread() |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractProcess()
Method Detail |
---|
protected java.lang.String getProcessName()
java.lang.String
protected abstract Plugin getPlugin()
Plugin
needed to construct a CoreException
.
org.eclipse.core.runtime.Plugin
protected void fail(java.lang.String message, java.lang.Throwable t) throws CoreException
IProcess.process(ITemplate, List, IProgressMonitor)
message
- the String message of the exceptiont
- a Throwable
CoreException
protected void fail(java.lang.String message) throws CoreException
IProcess.process(ITemplate, List, IProgressMonitor)
message
- the String message of the exception
CoreException
protected void failIfFalse(boolean condition, java.lang.String message) throws CoreException
IProcess.process(ITemplate, List, IProgressMonitor)
condition
- throws CoreException if falsemessage
- the String message of the exception
CoreException
protected void failIfNull(java.lang.Object object, java.lang.String message) throws CoreException
IProcess.process(ITemplate, List, IProgressMonitor)
object
- throws CoreException if nullmessage
- the String message of the exception
CoreException
protected abstract void init(ITemplate template, java.util.List<IParameter> parameters) throws CoreException
IProcess.process(ITemplate, List, IProgressMonitor)
to separate initialization from processing code.
template
- the ITemplate argument to processparameters
- the parameter list argument to process
CoreException
com.nokia.carbide.templatewizard.process.IProcess#process(com.nokia.carbide.template.engine.ITemplate, java.util.List, org.eclipse.core.runtime.IProgressMonitor)
public void process(ITemplate template, java.util.List<IParameter> parameters, IProgressMonitor monitor) throws CoreException
IProcess
process
in interface IProcess
template
- the ITemplate
for this processparameters
- a list of IParameter
monitor
- the IProgressMonitor
CoreException
- if the process failspublic boolean mustRunInUIThread()
IProcess
mustRunInUIThread
in interface IProcess
true
to ensure this process is executed in the UI thread.org.eclipse.swt.widgets.Display#syncExec(Runnable)
public void setRunInUIThread(boolean runInUIThread)
IProcess.mustRunInUIThread()
runInUIThread
- the return value of IProcess.mustRunInUIThread()
protected IParameter findParameterByName(java.lang.String parameterName, java.util.List<IParameter> parameters) throws CoreException
IParameter
that may or may not exist,null
if none is found.IParameter
found by name.
Optional parameters can be accessed via the parameters list.
parameterName
- the name of the parameterparameters
- the list of parameters
null
CoreException
protected IParameter getRequiredParameterByName(java.lang.String parameterName, java.util.List<IParameter> parameters) throws CoreException
IParameter
that is required to exist,CoreException
, if none is found.IParameter
found by name.
Optional parameters can be accessed via the parameters list.
parameterName
- the name of the parameterparameters
- the list of parameters
CoreException
- if parameter is not foundprotected java.lang.String getRequiredAttributeFromParameter(IParameter parameter, java.lang.String attributeName) throws CoreException
IParameter
by name,CoreException
, if none is found.IParameter.getAttributeValue(String)
parameter
- the IParameterattributeName
- the attribute name
CoreException
- if attribute is not found
|
Carbide.c++ | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |