Greetings to all again!
I'm developing something similar to Eclipse Extension Points with Annotations
[ExtensionPoint] and [Extension] for dynamic
sparks and mx control injection at runtime. The whole thing is running inside
of an OSGi framework built with AS3 and the problem that I'm having is
concerning
the keep-all-type-selectors=true which is not working. Let me explain the
structure.
The UI is loading different Modules as the container for "Toolbar", "Timeline",
"PropertiesWindow", which are all independant <s:Module> handled by the OSGi
runtime.
The runtime creates for each bundle their own ApplicationDomain.
I created another bundle which is an Actionscript project which check at
runtime in each bundles in the OSGi framework if there is any class containing
the
[ExtensionPoint] and [Extension] metadata. If it finds something then they are
gathered and built in Parent/Children relationship.
This [ExtensionPointsManager] (in its own ApplicationDomain) is also scouting
the Stage.ADDED event to check when ever a UIComponent which has
[ExtensionPoint] is added.
[ExtensionPointManager class]
private function scoutAllExtensionUnitsByBundle(bundle:IBundle):void{
var applicationDomain:ApplicationDomain =
ApplicationDomain(Object(bundle).applicationDomain);
var domainClasses:Vector.<String> =
applicationDomain.getQualifiedDefinitionNames();
for each(var className:String in domainClasses){
try{
var infosExtensionUnit:ExtensionInfos =
infosExtensionUnitFromClassName(className);
var extensionPoint:ExtensionPoint =
getExtensionPointByName(infosExtensionUnit.name);
if (extensionPoint &&
infosExtensionUnit)
var parented:Boolean =
addExtensionUnitFromClass(infosExtensionUnit.type.clazz);
if (!parented)
unparentedExtensionUnits.push(new ExtensionUnit(null, infosExtensionUnit));
}catch(e:Error){
trace(e.message);
}
}
try{
extensionPoint.instanciateExtensionUnits();
}catch(e:Error){
}
}
[ExtensionPoint class]
public function instanciateExtensionUnits():void{
if (container){
for each(var extensionUnit:ExtensionUnit in
extensionUnits){
if (!extensionUnit.instance){
var uiElement:UIComponent =
extensionUnit.newInstance();
if (container is
IVisualElementContainer)
IVisualElementContainer(container).addElement(uiElement);
else
container.addChild(uiElement);
}
}
}
}
My problem is that I have a bundle which contains an <s:Button> (contains
[Extension(target="toolbar")] metadata)with an icons that I would like to be
automatically inserted in the "Toolbar" <s:Module> which has the
[ExtensionPoint(name="toolbar")] metadata. That button in its own code would
create a PopupManager.createPopup when it is clicked. Right now when that
button doesn't have the (skinClass="spark.skins.spark.ButtonSkin") property it
throws an error as follow:
Error: Skin for
instance1.instance2.instance18.instance19.instance20.rsls_loader0.ApplicationSkin2.containerGrp.contentGroup.SharedUIService6.instance167.UIServiceProxy8.MultiversesMainUI7.SkinnableContainerSkin9.contentGroup.toolbar.instance234.UIServiceProxy59.MultiversesMenuRoot58.SkinnableContainerSkin60.contentGroup.PluginsSettingsButton74
cannot be found.
So the "Toolbar" <s:Module> I've compiled with keep-all-type-selectors=true
seems to not recognize the (SkinClasses).
Right now I don't understand why
IVisualElementContainer(container).addElement(uiElement) always throws this big
line of exception...
When I add the (skinClass="spark.skins.spark.ButtonSkin") to that button and
recompile then its get added in the "toolbar" but another problem happens when
I click the button:
Error: Skin for
instance1.instance2.instance18.instance19.instance20.PluginsSettingsView92.ResizableTitleWindowSkin93._ResizableTitleWindowSkin_Group1.contents.contentGroup.parentDivider.pluginsCategories
cannot be found.
How do I fix this problem?
Best regards
Ergü