Search in sources :

Example 1 with DescriptorMatcher

use of org.springsource.ide.eclipse.commons.internal.content.core.DescriptorMatcher in project eclipse-integration-commons by spring-projects.

the class ContentManager method read.

private void read(File file) throws CoreException {
    DescriptorMatcher matcher = new DescriptorMatcher(this);
    DescriptorReader reader = new DescriptorReader();
    reader.read(file);
    List<Descriptor> descriptors = reader.getDescriptors();
    for (Descriptor descriptor : descriptors) {
        if (!matcher.match(descriptor)) {
            continue;
        }
        ContentItem item = itemById.get(descriptor.getId());
        if (item == null) {
            item = createItem(descriptor);
            if (item != null) {
                itemById.put(item.getId(), item);
            }
        }
        if (item != null) {
            if (descriptor.isLocal()) {
                item.setLocalDescriptor(descriptor);
            } else {
                item.setRemoteDescriptor(descriptor);
            }
        }
    }
}
Also used : DescriptorMatcher(org.springsource.ide.eclipse.commons.internal.content.core.DescriptorMatcher) Descriptor(org.springsource.ide.eclipse.commons.content.core.util.Descriptor) DescriptorReader(org.springsource.ide.eclipse.commons.content.core.util.DescriptorReader)

Aggregations

Descriptor (org.springsource.ide.eclipse.commons.content.core.util.Descriptor)1 DescriptorReader (org.springsource.ide.eclipse.commons.content.core.util.DescriptorReader)1 DescriptorMatcher (org.springsource.ide.eclipse.commons.internal.content.core.DescriptorMatcher)1