/** * Calls the overriden method and then sets the name of the created component. * The name of the created component is initialized to the name of this * template, if both components have a {@link NameController} interface * (otherwise this mixin does nothing). * * @return the instantiated component. * @throws InstantiationException if the component controller cannot be * instantiated. */ public Component newFcControllerInstance () throws InstantiationException { Component comp = _super_newFcControllerInstance(); if (_this_weaveableOptNC != null) { try { // copies the name of this template to the component, if applicable String name = _this_weaveableOptNC.getFcName(); ((NameController)comp.getFcInterface("name-controller")).setFcName(name); } catch (NoSuchInterfaceException ignored) { } } return comp; }
/** * Calls the overriden method and then sets the name of the created component. * The name of the created component is initialized to the name of this * template, if both components have a {@link NameController} interface * (otherwise this mixin does nothing). * * @return the instantiated component. * @throws InstantiationException if the component controller cannot be * instantiated. */ public Component newFcControllerInstance () throws InstantiationException { Component comp = _super_newFcControllerInstance(); if (_this_weaveableOptNC != null) { try { // copies the name of this template to the component, if applicable String name = _this_weaveableOptNC.getFcName(); ((NameController)comp.getFcInterface("name-controller")).setFcName(name); } catch (NoSuchInterfaceException ignored) { } } return comp; }