| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
A generic container for the SCI model objects.
The objects() method gives an enumeration of all SciObjects in this container:
SciObjectEnumeration objectsEnum=someContainer.objects();
For example, the objects method in SciClass(extends this interface) returns
an enumeration of SciMembers or inner classes.
This interface has method paste for pasting the SciObjects, inherited by all of
its derivatives. If you wish to paste a copy of existing SciObject, or SciObject
itself, you can obtian it using
SciObject's methods copy or
cut respectively:
If you wish to paste a new object, you should first create this object using SciFactory
or SciGenericFactory:
SciFunction copiedFunction = (SciFunction)someSciFunction.copy(); //getting a copy of a function
someSciClass.paste(copiedFunction, null, false); //pasting it into SciClass
import com.togethersoft.openapi.sci.SciModelAccess;
...
SciAttribute newAttribute = SciModelAccess.getModel().getFactory(SciLanguage.JAVA).newAttribute(); //creating a new attribute with default name and type
newAttribute.setName("myLastName"); //setting the name
newAttribute.getType().setText("String"); //setting the type
someSciClass.paste(newAttribute, null, false); //pasting it into someSciClass
| Method Summary | |
boolean | canPaste(SciObject object, SciObject anchor, boolean before)Returns true if the object can be pasted into this container in the specified place,
false otherwise. |
SciObjectEnumeration | objects()Returns an enumeration of all SciObjects in this container |
SciObject | paste(SciObject object, SciObject anchor, boolean before)Pastes the object into this containter. |
| Method Detail |
public boolean canPaste(SciObject object, SciObject anchor, boolean before)
true if the object can be pasted into this container in the specified place,
false otherwise. false can be returned either if
object can't be pasted at all, or if it just can't be pasted in the specified place.SciObject to check whether it can be pastedSciObject before or after the objecet
will be pasted. If anchor is null, then the object will be pasted
in the valid place choosen by this container.true, then new object will be
pasted befor the anchor. If false - after. If anchor
is null, then the value of this parameter does not matter.true if the object can be pasted, false otherwisepublic SciObjectEnumeration objects()
SciObjects in this containerSciObjects in this containerpublic SciObject paste(SciObject object, SciObject anchor, boolean before)
SciObject which needs be to pastedSciObject before or after the object
will be pasted. If anchor is null, then the object will be pasted
in the valid place choosen by this container.true, then new object 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 | ||||||||