Search in sources :

Example 1 with NullResourceDescriptionsData

use of com.avaloq.tools.ddk.xtext.builder.layered.NullResourceDescriptionsData in project dsl-devkit by dsldevkit.

the class MonitoredClusteringBuilderState method platformChanged.

/**
 * {@inheritDoc} Schedules a full clean build if the target platform changes.
 */
@Override
public void platformChanged(final IResourceDescriptionsData newPlatform, final Collection<Delta> deltas, final boolean mustRebuild) {
    if (newPlatform == null) {
        // Hmmm... context deactivated. Events for removing the project from the index will be generated anyway, so no build necessary.
        // TODO: check!
        setResourceDescriptionsData(new NullResourceDescriptionsData());
        return;
    }
    // Deltas?
    if (isLoaded()) {
        // AbstractXtextTargetPlatformManager if it was the initial load?
        if (newPlatform instanceof AbstractResourceDescriptionsData) {
            ((AbstractResourceDescriptionsData) newPlatform).beginChanges();
        }
        setResourceDescriptionsData((ResourceDescriptionsData) newPlatform);
        ResourceDescriptionChangeEvent event = new ResourceDescriptionChangeEvent(deltas);
        notifyListeners(event);
    }
    if (mustRebuild) {
        buildTrigger.scheduleFullBuild();
    }
}
Also used : AbstractResourceDescriptionsData(com.avaloq.tools.ddk.xtext.extensions.AbstractResourceDescriptionsData) NullResourceDescriptionsData(com.avaloq.tools.ddk.xtext.builder.layered.NullResourceDescriptionsData) ResourceDescriptionChangeEvent(org.eclipse.xtext.resource.impl.ResourceDescriptionChangeEvent)

Aggregations

NullResourceDescriptionsData (com.avaloq.tools.ddk.xtext.builder.layered.NullResourceDescriptionsData)1 AbstractResourceDescriptionsData (com.avaloq.tools.ddk.xtext.extensions.AbstractResourceDescriptionsData)1 ResourceDescriptionChangeEvent (org.eclipse.xtext.resource.impl.ResourceDescriptionChangeEvent)1