From e3748e6ea22b907d590b53c61c6a9b704f99cd6c Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Sun, 3 Jul 2011 22:53:49 +0000 Subject: [PATCH] - show global assetpack license in single items properties if no license is specified for that item git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7815 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../gde/assetpack/browser/nodes/AssetPackBrowserItem.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserItem.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserItem.java index 19847dde7..7aa0a4e89 100644 --- a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserItem.java +++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/browser/nodes/AssetPackBrowserItem.java @@ -4,6 +4,7 @@ */ package com.jme3.gde.assetpack.browser.nodes; +import com.jme3.gde.assetpack.XmlHelper; import com.jme3.gde.assetpack.actions.AddAssetAction; import com.jme3.gde.assetpack.actions.AddToProjectAction; import com.jme3.gde.assetpack.actions.PreviewAssetAction; @@ -104,7 +105,12 @@ public class AssetPackBrowserItem extends AbstractNode { set.put(new ElementNodeTextProperty(project, item, "description")); set.put(new ElementAttributeProperty(project, item, "categories")); set.put(new ElementAttributeProperty(project, item, "tags")); - set.put(new ElementNodeTextProperty(project, item, "license")); + Element elem = XmlHelper.findChildElement(item, "license"); + if ((project.getLookup().lookup(AssetPackLibrary.class) != null) && (elem == null || elem.getTextContent().trim().length() <= 0)) { + set.put(new ElementNodeTextProperty(project, (Element) item.getParentNode().getParentNode(), "license")); + } else { + set.put(new ElementNodeTextProperty(project, item, "license")); + } set.put(new ElementAttributeProperty(project, item, "type", ASSET_TYPES)); // set.put(new ElementAttributeProperty(project, item, "format", ASSET_FORMATS)); sheet.put(set);