Java 类org.eclipse.emf.edit.provider.DelegatingWrapperItemProvider 实例源码

项目:OpenSPIFe    文件:RecursiveItemProviderAdapter.java   
protected List<IItemPropertyDescriptor> getChildDescriptors(EObject parent, EObject child, EStructuralFeature feature, int index, final boolean readOnly) {
        List<IItemPropertyDescriptor> childDescriptors = new ArrayList<IItemPropertyDescriptor>();
        IItemPropertySource source = EMFUtils.adapt(child, IItemPropertySource.class);
        if (source != null) {
            List<IItemPropertyDescriptor> pds;
            {
                final DelegatingWrapperItemProvider ip = new DelegatingWrapperItemProvider(child, parent, feature, index, getAdapterFactory());
                pds = ip.getPropertyDescriptors(parent);
                ip.dispose();
            }
            for (IItemPropertyDescriptor pd : pds) {
                ((OverrideableCommandOwner)pd).setCommandOwner(child);
                childDescriptors.add(pd);
                Object realDescriptor = ReflectionUtils.get(pd, "itemPropertyDescriptor");
                if (realDescriptor.getClass().getName().equals(DELEGATING_WRAPPER_ITEM_PROPERTY_DESCRIPTOR_NAME))
                    realDescriptor = ReflectionUtils.get(realDescriptor, "itemPropertyDescriptor");
                ReflectionUtils.set(realDescriptor, "category", pd.getLabelProvider(child).getText(child));
                if (readOnly)
                    ReflectionUtils.set(realDescriptor, "isSettable", false);
            }
        }

//      // recurse?
//      if (child != null)
//          childDescriptors.addAll(getAllChildDescriptors(child));

        return childDescriptors;
    }
项目:OpenSPIFe    文件:EPlanElementItemProvider.java   
private void addWrappedDescriptors(EPlanElement element, Object reference, DelegatingWrapperItemProvider provider) {
 wrapperItemProviders.add(provider);
 for (IItemPropertyDescriptor pd : provider.getPropertyDescriptors(element)) {
    if (isVisible(element, reference, pd)) {
    itemPropertyDescriptors.add(pd);
    }
 }
}
项目:OpenSPIFe    文件:EPlanElementItemProvider.java   
@Override
public void dispose() {
    super.dispose();
    for (DelegatingWrapperItemProvider provider : wrapperItemProviders) {
        provider.dispose();
    }
    wrapperItemProviders.clear();
}