From fd00230408a4c3780009e7d312a59eff4465036e Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Fri, 26 Aug 2011 08:32:52 +0000 Subject: [PATCH] - fix AssetPack preview git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8111 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../jme3/gde/assetpack/actions/PreviewAssetAction.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/actions/PreviewAssetAction.java b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/actions/PreviewAssetAction.java index c2da90272..81191aa14 100644 --- a/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/actions/PreviewAssetAction.java +++ b/sdk/jme3-assetpack-support/src/com/jme3/gde/assetpack/actions/PreviewAssetAction.java @@ -17,8 +17,11 @@ import java.beans.PropertyChangeListener; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.Action; +import org.netbeans.api.project.Project; import org.openide.loaders.DataObject; +import org.openide.loaders.DataObjectNotFoundException; import org.openide.nodes.Node; +import org.openide.util.Exceptions; import org.w3c.dom.Element; public final class PreviewAssetAction implements Action { @@ -43,7 +46,11 @@ public final class PreviewAssetAction implements Action { JmeNode jmeNode = NodeUtility.createNode(node); SceneApplication app = SceneApplication.getApplication(); SceneRequest request = new SceneRequest(app, jmeNode, pm); - request.setDataObject(context.getLookup().lookup(DataObject.class)); + try { + request.setDataObject(DataObject.find(context.getLookup().lookup(Project.class).getProjectDirectory())); + } catch (DataObjectNotFoundException ex) { + Exceptions.printStackTrace(ex); + } request.setWindowTitle("AssetPack - PreView Model"); app.requestScene(request);