Merge "Omaha #3861 Fix vb resources initializing too early." into omaha_16.2.1

Former-commit-id: 08f39d722d48a5a17159cfae4eac55770110de35
This commit is contained in:
Nate Jensen 2015-10-19 17:33:02 -05:00 committed by Gerrit Code Review
commit 2b899b52bc

View file

@ -35,6 +35,8 @@ import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay;
import com.raytheon.uf.viz.core.drawables.ResourcePair;
import com.raytheon.uf.viz.core.procedures.Bundle;
import com.raytheon.uf.viz.core.rsc.DisplayType;
import com.raytheon.uf.viz.core.rsc.ResourceList;
import com.raytheon.uf.viz.core.rsc.ResourceProperties;
import com.raytheon.uf.viz.core.rsc.ResourceType;
import com.raytheon.viz.core.rsc.ICombinedResourceData;
import com.raytheon.viz.core.rsc.ICombinedResourceData.CombineOperation;
@ -73,8 +75,6 @@ public class ProductLoader {
private List<AbstractRenderableDisplay> displaysToLoad = new ArrayList<>();
public void addProduct(IDataCatalogEntry catalogEntry,
DisplayType displayType) {
IDataCatalog catalog = DataCatalogManager.getDataCatalogManager()
@ -157,8 +157,22 @@ public class ProductLoader {
.getClass().getName());
IEditorPart activeEditor = EditorUtil.getActiveEditor();
AbstractRenderableDisplay clonedDisplay = display.cloneDisplay();
/*
* Must clear non-system resources so that the editor that is opened
* does not initialize the resources, they need to be initialized by the
* bundle product loader instead.
*/
ResourceList resources = clonedDisplay.getDescriptor()
.getResourceList();
for (ResourcePair resourcePair : resources) {
ResourceProperties resourceProps = resourcePair.getProperties();
if (resourceProps.isSystemResource() == false) {
resources.remove(resourcePair);
}
}
AbstractEditor editor = UiUtil.createOrOpenEditor(editorId,
display.cloneDisplay());
clonedDisplay);
if (editor != null) {
if (activeEditor != null && editor != activeEditor