| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
A top-level representative of a container of elements. RwiContainter's derivatives collect
elements into spesific
logical structures. These derivatives are RwiPackage, RwiDiagram and
RwiNode, which allow working with the model from different angles
of view and levels of detalization.
This interface defines the paste method which allows to paste RwiElement
into this container:
someRwiNode.paste(rwiElementToPaste, null, false);
The elements() method gives an enumeration of all elements this container has:
RwiElementEnumeration elementsEnum=someContainer.elements();
while (elementsEnum.hasMoreElements()){
RwiElement nextRwiElement=elements.nextRwiElement();
System.out.println("The name of the element is :"+nextRwiElement.getProperty(RwiProperty.NAME));
}
Normally the method elements will rarely be used since SciContainer's derivatives
contain more specific and useful methods for working with the elements in this container (see
RwiPackage.subpackages,
RwiPackage.nodes,
RwiPackage.diagrams,
RwiDiagram.nodeReferences,
RwiDiagram.diagramReferences,
RwiNode.members and
RwiNode.subnodes).
All new elements created by the methods in the derivatives of this intrface are not written instantly to the disk. That is they are created, but are written to the disk only when Together automatically flushes all the data to the disk (when it loses the focus etc).
For example, if you create a new subpackage
for certain RwiPackage using the method RwiPackage.createSubpackage,
the newly created package is fully functional for the script, it is already a part of the model etc,
but it is kept in some virtual space. The directory is physically created only when
you switch to another applications, close the project, close Together etc.
If your script needs to have the directory created instantly,
you must explicitly call the IdeManager.saveAll method:
Do not worry, if your script creates something it will certainly be written - when you close
the project, Together session, switch to another application or when the script is finished.
RwiPackage newPackage = someRwiPackage.createSubpackage();
//Once again: the newPackage is fully functional, it is a first-class part of the model,
//except that the directory physically is not created yet.
//Note that if you create new nodes/diagrams/packages in the newPackage, they also are
//kept in the virtual space, yet they are also fully functional - you can
//change their names, contents etc.
//
//the following line is needed only if you want the directory (and its contents) to be created "right now"
IdeAccess.getIdeManager().saveAll();
| Method Summary | |
boolean | canPaste(RwiElement element, RwiElement anchor, boolean before)Returns true if the element can be pasted in the specified place,
false otherwise. |
RwiElementEnumeration | elements()Returns an enumeration of all elements in this container |
RwiPackage | getContainingPackage()Returns the package this element belongs to. |
RwiElement | paste(RwiElement element, RwiElement anchor, boolean before)Pastes the element into this containter. |
| Methods inherited from interface com.togethersoft.openapi.rwi.RwiElement |
accept, canCreateIncomingLink, canCreateOutgoingLink, canCreateOutgoingLink, canCreateOutgoingLinkByPattern, canCut, canDelete, codeElements, copy, createOutgoingLink, createOutgoingLinkByPattern, cut, delete, getCodeElement, getTimeStamp, getUniqueName, isDeleted, outgoingLinks |
| Methods inherited from interface com.togethersoft.openapi.rwi.RwiPropertyMap |
addProperty, canAddProperty, canSetProperty, canSetProperty, getProperty, hasProperty, isPropertyReadable, isPropertyWritable, properties, properties, setProperty, setProperty |
| Method Detail |
public boolean canPaste(RwiElement element, RwiElement anchor, boolean before)
true if the element can be pasted in the specified place,
false otherwise. false can be returned either if
element can't be pasted at all, or if it can't be pasted in the specified place.RwiElement to check whether it can be pastedRwiElement before or after the element
will be pastedtrue, then new element will be
pasted before the anchor. If false - after. If anchor
is null, then the value of this parameter does not matter.true if the element can be pasted, false otherwisepublic RwiElementEnumeration elements()
public RwiPackage getContainingPackage()
null.public RwiElement paste(RwiElement element, RwiElement anchor, boolean before)
RwiElement which needs be to pastedRwiElement before or after the element
will be pasted. If anchor is null, then this container will paste
the element in the valid place choosen by this container.true, then new element will be
pasted before the anchor. If false - after. If anchor
is null, then the value of this parameter does not matter.
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||