- warn user when asset cannot be loaded because it is not part of a project with ProjectAssetManager

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8384 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
nor..67 13 years ago
parent 82de99ca94
commit 86e5ffd7a4
  1. 3
      sdk/jme3-core/src/com/jme3/gde/core/assets/AssetDataObject.java
  2. 4
      sdk/jme3-core/src/com/jme3/gde/core/assets/SpatialAssetDataObject.java
  3. 3
      sdk/jme3-ogretools/src/com/jme3/gde/ogretools/OgreBinaryMeshDataObject.java
  4. 1
      sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreSceneDataObject.java
  5. 1
      sdk/jme3-ogrexml/src/com/jme3/gde/ogrexml/OgreXMLDataObject.java

@ -46,6 +46,8 @@ import org.netbeans.api.progress.ProgressHandle;
import org.netbeans.api.progress.ProgressHandleFactory;
import org.netbeans.api.project.Project;
import org.netbeans.api.project.ProjectManager;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.awt.StatusDisplayer;
import org.openide.cookies.SaveCookie;
import org.openide.filesystems.FileLock;
@ -160,6 +162,7 @@ public class AssetDataObject extends MultiDataObject {
}
ProjectAssetManager mgr = getLookup().lookup(ProjectAssetManager.class);
if (mgr == null) {
DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message("File is not part of a project!\nCannot load without ProjectAssetManager."));
return null;
}
FileLock lock = null;

@ -37,6 +37,8 @@ import com.jme3.scene.Spatial;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.filesystems.FileLock;
import org.openide.filesystems.FileObject;
import org.openide.loaders.DataObject;
@ -77,6 +79,7 @@ public class SpatialAssetDataObject extends AssetDataObject {
}
ProjectAssetManager mgr = getLookup().lookup(ProjectAssetManager.class);
if (mgr == null) {
DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message("File is not part of a project!\nCannot load without ProjectAssetManager."));
return null;
}
FileLock lock = null;
@ -101,6 +104,7 @@ public class SpatialAssetDataObject extends AssetDataObject {
super.saveAsset();
ProjectAssetManager mgr = getLookup().lookup(ProjectAssetManager.class);
if (mgr == null) {
DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message("File is not part of a project!\nCannot load without ProjectAssetManager."));
return;
}
FileObject outFile = null;

@ -13,6 +13,8 @@ import java.io.File;
import java.io.IOException;
import org.netbeans.api.progress.ProgressHandle;
import org.netbeans.api.progress.ProgressHandleFactory;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.filesystems.FileLock;
import org.openide.filesystems.FileObject;
import org.openide.loaders.DataObjectExistsException;
@ -44,6 +46,7 @@ public class OgreBinaryMeshDataObject extends SpatialAssetDataObject {
handle.progress("Convert Model");
ProjectAssetManager mgr = getLookup().lookup(ProjectAssetManager.class);
if (mgr == null) {
DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message("File is not part of a project!\nCannot load without ProjectAssetManager."));
return null;
}
String assetKey = mgr.getRelativeAssetPath(options.getDestFile());

@ -57,6 +57,7 @@ public class OgreSceneDataObject extends SpatialAssetDataObject {
}
ProjectAssetManager mgr = getLookup().lookup(ProjectAssetManager.class);
if (mgr == null) {
DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message("File is not part of a project!\nCannot load without ProjectAssetManager."));
return null;
}
String name = getPrimaryFile().getName();

@ -77,6 +77,7 @@ public class OgreXMLDataObject extends SpatialAssetDataObject {
}
ProjectAssetManager mgr = getLookup().lookup(ProjectAssetManager.class);
if (mgr == null) {
DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Message("File is not part of a project!\nCannot load without ProjectAssetManager."));
return null;
}
String name = getPrimaryFile().getName();

Loading…
Cancel
Save