| ||||||||||
| 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));
}
elements will rarely be used since SciContainer's derivatives
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:
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();
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.
| 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
RwiElement to check whether it can be pastedRwiElement before or after the element
true, then new element will be
anchor. If false - after. If anchor
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
anchor is null, then this container will paste
true, then new element will be
anchor. If false - after. If anchor
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 | |||||||||