Skip to content
Empty file modified gradlew
100644 → 100755
Empty file.
20 changes: 19 additions & 1 deletion jme3-core/src/com/jme3/gde/core/assets/AssetDataNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
package com.jme3.gde.core.assets;

import com.jme3.asset.AssetKey;
import com.jme3.gde.core.dnd.AssetNameHolder;
import com.jme3.gde.core.util.PropertyUtils;
import java.beans.PropertyDescriptor;
import java.lang.reflect.Field;
Expand All @@ -48,7 +49,7 @@
* @author normenhansen
*/
@SuppressWarnings({"unchecked", "rawtypes"})
public class AssetDataNode extends DataNode {
public class AssetDataNode extends DataNode implements AssetNameHolder {

public AssetDataNode(DataObject obj, Children ch) {
super(obj, ch);
Expand Down Expand Up @@ -89,4 +90,21 @@ protected Sheet createSheet() {
sheet.put(set);
return sheet;
}

@Override
public String getAssetName() {
AssetData data = getLookup().lookup(AssetData.class);
if (data != null && data.getAssetKey() != null) {
return data.getAssetKey().getName();
}
return null;
}

@Override
public void setAssetName(String name) {
// AssetDataNode's asset name is derived from the underlying asset key
// and typically shouldn't be changed directly
// This method is required by the interface but doesn't need implementation
// for the drag-and-drop use case
}
}