|
|
@ -36,6 +36,8 @@ import com.jme3.gde.materialdefinition.navigator.MatDefNavigatorPanel; |
|
|
|
import java.awt.event.KeyEvent; |
|
|
|
import java.awt.event.KeyEvent; |
|
|
|
import java.awt.event.KeyListener; |
|
|
|
import java.awt.event.KeyListener; |
|
|
|
import java.io.IOException; |
|
|
|
import java.io.IOException; |
|
|
|
|
|
|
|
import javax.swing.JEditorPane; |
|
|
|
|
|
|
|
import javax.swing.text.EditorKit; |
|
|
|
import org.netbeans.api.project.Project; |
|
|
|
import org.netbeans.api.project.Project; |
|
|
|
import org.netbeans.api.project.ProjectManager; |
|
|
|
import org.netbeans.api.project.ProjectManager; |
|
|
|
import org.netbeans.core.spi.multiview.MultiViewElement; |
|
|
|
import org.netbeans.core.spi.multiview.MultiViewElement; |
|
|
@ -52,6 +54,7 @@ import org.openide.loaders.DataObject; |
|
|
|
import org.openide.loaders.DataObjectExistsException; |
|
|
|
import org.openide.loaders.DataObjectExistsException; |
|
|
|
import org.openide.loaders.MultiDataObject; |
|
|
|
import org.openide.loaders.MultiDataObject; |
|
|
|
import org.openide.loaders.MultiFileLoader; |
|
|
|
import org.openide.loaders.MultiFileLoader; |
|
|
|
|
|
|
|
import org.openide.text.CloneableEditorSupport; |
|
|
|
import org.openide.util.Lookup; |
|
|
|
import org.openide.util.Lookup; |
|
|
|
import org.openide.util.NbBundle.Messages; |
|
|
|
import org.openide.util.NbBundle.Messages; |
|
|
|
import org.openide.util.lookup.AbstractLookup; |
|
|
|
import org.openide.util.lookup.AbstractLookup; |
|
|
@ -228,8 +231,11 @@ public class MatDefDataObject extends MultiDataObject { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void componentDeactivated() { |
|
|
|
public void componentDeactivated() { |
|
|
|
super.componentDeactivated(); |
|
|
|
super.componentDeactivated(); |
|
|
|
|
|
|
|
JEditorPane editorPane = getEditorPane(); |
|
|
|
|
|
|
|
if (editorPane != null) { |
|
|
|
getEditorPane().removeKeyListener(listener); |
|
|
|
getEditorPane().removeKeyListener(listener); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void componentClosed() { |
|
|
|
public void componentClosed() { |
|
|
@ -245,7 +251,9 @@ public class MatDefDataObject extends MultiDataObject { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected void handleDelete() throws IOException { |
|
|
|
protected void handleDelete() throws IOException { |
|
|
|
MatDefMetaData metaData = lookup.lookup(MatDefMetaData.class); |
|
|
|
MatDefMetaData metaData = lookup.lookup(MatDefMetaData.class); |
|
|
|
|
|
|
|
if(metaData != null){ |
|
|
|
metaData.cleanup(); |
|
|
|
metaData.cleanup(); |
|
|
|
|
|
|
|
} |
|
|
|
super.handleDelete(); |
|
|
|
super.handleDelete(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|