SDK:
- fix custom controls and classpath updating git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9835 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
627f9b616a
commit
1ee8375d82
@ -112,11 +112,11 @@ public class ProjectAssetManager extends DesktopAssetManager {
|
|||||||
this(null);
|
this(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void updateClassLoader() {
|
private void clearClassLoader() {
|
||||||
for (FileObject fileObject : jarItems) {
|
for (FileObject fileObject : jarItems) {
|
||||||
try {
|
try {
|
||||||
Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Remove locator:{0}", fileObject.getURL());
|
Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Remove locator:{0}", fileObject.getURL());
|
||||||
unregisterLocator(fileObject.getURL().toExternalForm(),
|
unregisterLocator(fileObject.toURL().toExternalForm(),
|
||||||
com.jme3.asset.plugins.UrlLocator.class);
|
com.jme3.asset.plugins.UrlLocator.class);
|
||||||
} catch (FileStateInvalidException ex) {
|
} catch (FileStateInvalidException ex) {
|
||||||
Exceptions.printStackTrace(ex);
|
Exceptions.printStackTrace(ex);
|
||||||
@ -128,6 +128,9 @@ public class ProjectAssetManager extends DesktopAssetManager {
|
|||||||
fileObject.object.removeRecursiveListener(fileObject.listener);
|
fileObject.object.removeRecursiveListener(fileObject.listener);
|
||||||
}
|
}
|
||||||
classPathItems.clear();
|
classPathItems.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
private synchronized void loadClassLoader() {
|
||||||
Sources sources = project.getLookup().lookup(Sources.class);
|
Sources sources = project.getLookup().lookup(Sources.class);
|
||||||
if (sources != null) {
|
if (sources != null) {
|
||||||
if (loader != null) {
|
if (loader != null) {
|
||||||
@ -148,7 +151,9 @@ public class ProjectAssetManager extends DesktopAssetManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void fileDataCreated(FileEvent fe) {
|
public void fileDataCreated(FileEvent fe) {
|
||||||
// notifyClassPathListeners();
|
if (!fe.isExpected()) {
|
||||||
|
notifyClassPathListeners();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void fileChanged(FileEvent fe) {
|
public void fileChanged(FileEvent fe) {
|
||||||
@ -172,12 +177,12 @@ public class ProjectAssetManager extends DesktopAssetManager {
|
|||||||
fileObject.addRecursiveListener(listener);
|
fileObject.addRecursiveListener(listener);
|
||||||
Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Add classpath:{0}", fileObject);
|
Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Add classpath:{0}", fileObject);
|
||||||
classPathItems.add(new ClassPathItem(fileObject, listener));
|
classPathItems.add(new ClassPathItem(fileObject, listener));
|
||||||
urls.add(fileObject.getURL());
|
urls.add(fileObject.toURL());
|
||||||
}
|
}
|
||||||
if (fileObject.getURL().toExternalForm().startsWith("jar")) {
|
if (fileObject.toURL().toExternalForm().startsWith("jar")) {
|
||||||
Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Add locator:{0}", fileObject.getURL());
|
Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Add locator:{0}", fileObject.getURL());
|
||||||
jarItems.add(fileObject);
|
jarItems.add(fileObject);
|
||||||
registerLocator(fileObject.getURL().toExternalForm(),
|
registerLocator(fileObject.toURL().toExternalForm(),
|
||||||
"com.jme3.asset.plugins.UrlLocator");
|
"com.jme3.asset.plugins.UrlLocator");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -191,6 +196,11 @@ public class ProjectAssetManager extends DesktopAssetManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private synchronized void updateClassLoader() {
|
||||||
|
clearClassLoader();
|
||||||
|
loadClassLoader();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setAssetEventListener(AssetEventListener listener) {
|
public void setAssetEventListener(AssetEventListener listener) {
|
||||||
throw new UnsupportedOperationException("Setting the asset event listener is not allowed for ProjectAssetManager, use addAssetEventListener instead");
|
throw new UnsupportedOperationException("Setting the asset event listener is not allowed for ProjectAssetManager, use addAssetEventListener instead");
|
||||||
|
@ -59,7 +59,9 @@ public final class NewCustomControlVisualPanel1 extends JPanel {
|
|||||||
|
|
||||||
Project proj;
|
Project proj;
|
||||||
|
|
||||||
/** Creates new form NewCustomControlVisualPanel1 */
|
/**
|
||||||
|
* Creates new form NewCustomControlVisualPanel1
|
||||||
|
*/
|
||||||
public NewCustomControlVisualPanel1() {
|
public NewCustomControlVisualPanel1() {
|
||||||
this.proj = proj;
|
this.proj = proj;
|
||||||
initComponents();
|
initComponents();
|
||||||
@ -98,7 +100,6 @@ public final class NewCustomControlVisualPanel1 extends JPanel {
|
|||||||
JavaSource js = JavaSource.create(cpInfo);
|
JavaSource js = JavaSource.create(cpInfo);
|
||||||
try {
|
try {
|
||||||
js.runUserActionTask(new Task<CompilationController>() {
|
js.runUserActionTask(new Task<CompilationController>() {
|
||||||
|
|
||||||
public void run(CompilationController control)
|
public void run(CompilationController control)
|
||||||
throws Exception {
|
throws Exception {
|
||||||
control.toPhase(Phase.RESOLVED);
|
control.toPhase(Phase.RESOLVED);
|
||||||
@ -106,6 +107,7 @@ public final class NewCustomControlVisualPanel1 extends JPanel {
|
|||||||
// TypeUtilities util = control.getTypeUtilities();//.isCastable(Types., null)
|
// TypeUtilities util = control.getTypeUtilities();//.isCastable(Types., null)
|
||||||
// util.isCastable(null, null);
|
// util.isCastable(null, null);
|
||||||
TypeElement elem = elementHandle.resolve(control);
|
TypeElement elem = elementHandle.resolve(control);
|
||||||
|
if (elem != null) {
|
||||||
List<? extends TypeMirror> interfaces = elem.getInterfaces();
|
List<? extends TypeMirror> interfaces = elem.getInterfaces();
|
||||||
for (TypeMirror typeMirror : interfaces) {
|
for (TypeMirror typeMirror : interfaces) {
|
||||||
String interfaceName = typeMirror.toString();
|
String interfaceName = typeMirror.toString();
|
||||||
@ -119,6 +121,7 @@ public final class NewCustomControlVisualPanel1 extends JPanel {
|
|||||||
list.add(elem.getQualifiedName().toString());
|
list.add(elem.getQualifiedName().toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}, false);
|
}, false);
|
||||||
} catch (Exception ioe) {
|
} catch (Exception ioe) {
|
||||||
Exceptions.printStackTrace(ioe);
|
Exceptions.printStackTrace(ioe);
|
||||||
@ -136,10 +139,10 @@ public final class NewCustomControlVisualPanel1 extends JPanel {
|
|||||||
scanControls();
|
scanControls();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method is called from within the constructor to
|
/**
|
||||||
* initialize the form.
|
* This method is called from within the constructor to initialize the form.
|
||||||
* WARNING: Do NOT modify this code. The content of this method is
|
* WARNING: Do NOT modify this code. The content of this method is always
|
||||||
* always regenerated by the Form Editor.
|
* regenerated by the Form Editor.
|
||||||
*/
|
*/
|
||||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user