public class Item extends java.lang.Object implements IComponentVisitor, Identifiable, IUpdateableListener
State |
Item behavior |
FormStatus.InfoError |
The Item returns and accepts Forms as usual, but cannot be processed. |
FormStatus.InReview |
The Item is reviewing the contents of the Form and will not accept any other requests. |
FormStatus.NeedsInfo |
The Item returns and accepts a second Form created during the process of executing an action based on the original Form that was submitted to the Item. |
FormStatus.Processed |
The Item has been completely processed and will retrieve and accept Forms as usual (although that may trigger a state change). ICEResources have been added to the output component, etc. |
FormStatus.Processing |
The Item is currently processing the Form and perform an Action. It will only accept a request to cancel the Action. |
FormStatus.ReadyToProcess |
The Item has finished reviewing its Form and can be processed. It will accept all requests. |
FormStatus.Unacceptable |
The Item has been disabled and will not process the Form or accept another Form in place of the current Form. |
component
Constructor and Description |
---|
Item()
A nullary constructor.
|
Item(org.eclipse.core.resources.IProject projectSpace)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(ItemListener listener)
This operation adds a listeners to the Item's set of listeners.
|
FormStatus |
cancelProcess()
This operation cancels the last process request sent to the Item.
|
FormStatus |
cancelProcess(java.lang.String actionName)
This operation cancels all processes with the specified name.
|
java.lang.Object |
clone()
This operation provides a deep copy of the Item.
|
void |
copy(Item otherItem)
This operation performs a deep copy of the attributes of another Item
into the current Item.
|
void |
disable(boolean state)
This operation disables the Item.
|
boolean |
equals(java.lang.Object otherObject)
(non-Javadoc)
|
java.util.ArrayList<java.lang.String> |
getAvailableActions()
This operation returns the list of available actions for an Item.
|
java.lang.String |
getDescription()
(non-Javadoc)
|
Form |
getForm()
This operation returns a Form for the Item.
|
int |
getId()
(non-Javadoc)
|
java.lang.String |
getItemBuilderName()
This operation sets the Item's builderName.
|
ItemType |
getItemType()
This operation returns the type of the Item.
|
java.lang.String |
getName()
(non-Javadoc)
|
java.io.File |
getOutputFile()
This operation returns a file handle to the output file for the Item.
|
ICEResource |
getResource(Entry file)
This method is similar to
getResource(String) , except that
it takes in an Entry instead. |
ICEResource |
getResource(java.lang.String filePath)
This method is intended to discover and create
ICEResource
objects (and the VizResource subclass) that are associated to
the Item in some way. |
FormStatus |
getStatus()
This operation returns the status of the Item.
|
int |
hashCode()
This operation returns the hashcode value of the Item.
|
boolean |
hasProject()
This operation returns true if the Item is already associated with a
project space that it can use for storing and retrieving files.
|
boolean |
isEnabled()
True if the Item is enabled, false if it is disabled.
|
void |
loadFromPSF(java.io.InputStream inputStream)
This operation loads the SerializedItem from a Painfully Simple Form file
format.
|
void |
loadInput(java.lang.String input)
This operation loads data into the Item from an input file.
|
FormStatus |
process(java.lang.String actionName)
The process operation processes the data in the Form to perform a certain
action.
|
void |
reloadProjectData()
This operation directs the Item to reload data that it has read from its
project.
|
void |
setActionFactory(IActionFactory factory)
This operation sets the service reference for the IActionFactory that
should be used by Items to find and execute Items during their process
phase.
|
void |
setDescription(java.lang.String description)
(non-Javadoc)
|
void |
setId(int id)
(non-Javadoc)
|
void |
setIOService(IOService service)
This operation is used by the underlying OSGi framework to set the
IOService that has been exposed as a Declarative Service.
|
void |
setItemBuilderName(java.lang.String builderName)
This operation sets the Item's builderName.
|
void |
setName(java.lang.String name)
(non-Javadoc)
|
void |
setProject(org.eclipse.core.resources.IProject projectSpace)
This operation sets the project for the Item.
|
void |
setupFormWithServices()
This operation directs the Item to setup its Form using the services that
were registered with it after construction.
|
FormStatus |
submitForm(Form preparedForm)
This operation submits a Form to the Item for processing.
|
void |
update(IUpdateable component)
This operation notifies the listener that an update has occurred in the
Component.
|
boolean |
update(Message msg)
This operation updates the Item to let it know that a particular event
has occurred in an ICE subsystem, remote ICE subsystem or external
third-party process.
|
void |
visit(AdaptiveTreeComposite component)
This operation informs the visitor that it is actually working with an
AdaptiveTreeComposite and should operate accordingly.
|
void |
visit(DataComponent component)
(non-Javadoc)
|
void |
visit(EMFComponent component)
This operation informs the visitor that it is actually working with an
EMFComponent and should operate accordingly.
|
void |
visit(GeometryComponent component)
(non-Javadoc)
|
void |
visit(IReactorComponent component)
(non-Javadoc)
|
void |
visit(IShape component)
(non-Javadoc)
|
void |
visit(ListComponent component)
This operation informs the visitor that it is actually working with a
ListComponent.
|
void |
visit(MasterDetailsComponent component)
(non-Javadoc)
|
void |
visit(MatrixComponent component)
(non-Javadoc)
|
void |
visit(MeshComponent component)
(non-Javadoc)
|
void |
visit(ResourceComponent component)
(non-Javadoc)
|
void |
visit(TableComponent component)
(non-Javadoc)
|
void |
visit(TimeDataComponent component)
This operation informs the visitor that it is actually working with a
TimeDataComponent and should operate accordingly.
|
void |
visit(TreeComposite component)
(non-Javadoc)
|
public Item(org.eclipse.core.resources.IProject projectSpace)
projectSpace
- The Eclipse project where files should be stored for this
Item.public Item()
public void setIOService(IOService service)
service
- public void setActionFactory(IActionFactory factory)
factory
- The IActionFactory, which should never be null when this is
called.public void setId(int id)
setId
in interface Identifiable
id
- The unique identification number that should be assigned to the Identifiable entity.
Identifiable.setId(int id)
public java.lang.String getDescription()
getDescription
in interface Identifiable
The description of the Identifiable entity.
Identifiable.getDescription()
public int getId()
getId
in interface Identifiable
The unique identification number of the Identifiable entity.
Identifiable.getId()
public void setName(java.lang.String name)
setName
in interface Identifiable
name
- The name that should be given to the Identifiable entity.
Identifiable.setName(String name)
public java.lang.String getName()
getName
in interface Identifiable
The name of the Identifiable entity.
Identifiable.getName()
public void setDescription(java.lang.String description)
setDescription
in interface Identifiable
description
- The description that should be stored for the Identifiable entity.
Identifiable.setDescription(String description)
public boolean equals(java.lang.Object otherObject)
equals
in interface Identifiable
equals
in class java.lang.Object
otherObject
- The other Identifiable entity that should be compared with this one.
True if the Identifiable entitys are equal, false otherwise.
Identifiable.equals(Object otherObject)
public ItemType getItemType()
public Form getForm()
public FormStatus submitForm(Form preparedForm)
preparedForm
- A Form that has been prepared by the Eclipse User with
information that is required by the Item.public FormStatus process(java.lang.String actionName)
actionName
- The name of action that should be performed using the
processed Form data.public FormStatus cancelProcess(java.lang.String actionName)
actionName
- The name of action that should be canceled.public FormStatus cancelProcess()
public java.util.ArrayList<java.lang.String> getAvailableActions()
public FormStatus getStatus()
public void setupFormWithServices()
public int hashCode()
hashCode
in interface Identifiable
hashCode
in class java.lang.Object
public void copy(Item otherItem)
otherItem
- The Item from which information should be copied.public java.lang.Object clone()
clone
in interface Identifiable
clone
in class java.lang.Object
public void loadFromPSF(java.io.InputStream inputStream) throws java.io.IOException
inputStream
- The InputStream that contains a PSF file.java.io.IOException
- This exception is thrown if there is a problem with the
Inputstream.public boolean hasProject()
public void setProject(org.eclipse.core.resources.IProject projectSpace)
projectSpace
- The Eclipse Platform IProject that should be referenced for
project space information by this Item.public void reloadProjectData()
public void addListener(ItemListener listener)
listener
- The new listener that is subscribing to the Item for updates.public ICEResource getResource(java.lang.String filePath) throws java.io.IOException
This method is intended to discover and create ICEResource
objects (and the VizResource
subclass) that are associated to
the Item in some way. For example, a CSV post-processing file that can
be plotted.
This method takes in a file path, and then delegates its work to the
Item's ResourceHandler
.
filePath
- The file path of the Item's resource.ICEResource
or
VizResource
depending on the file extension
of the file path. If the file path was invalid,
returns null.java.io.IOException
public ICEResource getResource(Entry file) throws java.io.IOException
This method is similar to getResource(String)
, except that
it takes in an Entry
instead. This is a special case where
a resource might be stored on the Item's Form (for example, a FileEntry
for a mesh file).
This method simply calls getResource(String)
. If the Entry's
associated file (obtained by Entry.getValue()
) is found in the
default ICE workspace, then it will pass the fully-qualified path name
into getResource(String)
. Otherwise, it will pass just the file
name (without a path), which will result in a null resource.
file
- The file path of the Item's resource.ICEResource
or
VizResource
depending on the file extension
of the file path. If the file path was invalid,
returns null.java.io.IOException
public void loadInput(java.lang.String input)
input
- The file containing the input that should be loaded. It should
be a file in the project space.public boolean update(Message msg)
msg
- The incoming Message.public void setItemBuilderName(java.lang.String builderName)
builderName
- The builderName to be set. Can not be null or the empty
string.public java.lang.String getItemBuilderName()
public void disable(boolean state)
state
- True if the Item is disabled, false if not.public boolean isEnabled()
public java.io.File getOutputFile()
public void visit(DataComponent component)
visit
in interface IComponentVisitor
component
- DataComponent which was originally called by the accept()
operationIComponentVisitor.visit(DataComponent component)
public void visit(ResourceComponent component)
visit
in interface IComponentVisitor
component
- OutputComponent which was originally called by the accept()
operationIComponentVisitor.visit(ResourceComponent component)
public void visit(TableComponent component)
visit
in interface IComponentVisitor
component
- TableComponent which was originally called by the accept()
operationIComponentVisitor.visit(TableComponent component)
public void visit(MatrixComponent component)
visit
in interface IComponentVisitor
component
- MatrixComponent which was originally called by the accept()
operationIComponentVisitor.visit(MatrixComponent component)
public void visit(IShape component)
visit
in interface IComponentVisitor
component
- IShape which was originally called by the accept() operationIComponentVisitor.visit(IShape component)
public void visit(GeometryComponent component)
visit
in interface IComponentVisitor
component
- GeometryComponent which was originally called by the accept()
operationIComponentVisitor.visit(GeometryComponent component)
public void visit(MasterDetailsComponent component)
visit
in interface IComponentVisitor
component
- MasterDetailsComponent which was originally called by the
accept() operation.IComponentVisitor.visit(MasterDetailsComponent component)
public void visit(TreeComposite component)
visit
in interface IComponentVisitor
component
- The TreeCompositeIComponentVisitor.visit(TreeComposite component)
public void visit(IReactorComponent component)
visit
in interface IComponentVisitor
component
- The IReactorComponentIComponentVisitor.visit(IReactorComponent component)
public void visit(TimeDataComponent component)
IComponentVisitor
visit
in interface IComponentVisitor
component
- The TimeDataComponent.public void visit(MeshComponent component)
visit
in interface IComponentVisitor
component
- The MeshComponent.IComponentVisitor.visit(MeshComponent component)
public void visit(AdaptiveTreeComposite component)
IComponentVisitor
visit
in interface IComponentVisitor
component
- The AdaptiveTreeCompositepublic void visit(EMFComponent component)
IComponentVisitor
visit
in interface IComponentVisitor
component
- The EMFComponent.public void update(IUpdateable component)
IUpdateableListener
This operation notifies the listener that an update has occurred in the Component.
update
in interface IUpdateableListener
component
- The component that was updated in some way.public void visit(ListComponent component)
IComponentVisitor
visit
in interface IComponentVisitor
component
- The ListComponent