It is possible to create/add mediniTags to objects via JavaScript? If yes how
Hi Justin,
Yes, it is possible to add mediniTags via JavaScript, but not by modifying the mediniTags list directly.
mediniTags
mediniTags is a derived property, so code such as:
element.mediniTags.add("myTag")
does not work.
Instead, create a new BasicEList, copy the existing tags, add the new tag, and then write the complete list back using mediniSetTags(...):
BasicEList
mediniSetTags(...)
// $EXPERIMENTAL$ var BasicEList = bind("org.eclipse.emf.common", "org.eclipse.emf.common.util.BasicEList", false); var element = selection[0]; var newTags = new BasicEList(); newTags.addAll(element.mediniTags); newTags.add("myTag"); element.mediniSetTags(newTags);
A few notes:
mediniSetTags()
helper.js
hasTag(...)
addTag(...)
removeTag(...)
These helper functions are easier to use when available, but internally they rely on the same tag API.
I hope that helps. Happy Scripting! Nils
The program is medini analyze