获取 TypeInstance 基准对象
对于对象创建或编辑向导中的面板,通常应返回 TypeInstance 基准对象,以便数据实用程序能够访问可能已为属性定义的约束。此代码可显示如何使用 CreateAndEditModelGetter.getItemAttributes() 方法来通过构建器的 buildComponentData() 方法获取 TypeInstance。此方法要求在带有 initializeItem 标记的向导的上下文中显示面板。
JcaComponentParams jcaParams = (JcaComponentParams) params;
ComponentDescriptor cdesc = jcaParams.getDescriptor();
NmCommandBean commandBean =
jcaParams.getHelperBean().getNmCommandBean();
NmContext nmContext =
jcaParams.getHelperBean().getNmContextBean().getContext();
ArrayList typeInstances =
CreateAndEditModelGetter.getItemAttributes
(cdesc, commandBean, nmContext);
这对您有帮助吗?