From 5ff3c0ef7de865ca46bd588f8b7a675271f69752 Mon Sep 17 00:00:00 2001 From: Normen Hansen Date: Thu, 22 Jan 2015 16:43:47 +0100 Subject: [PATCH] - Move Core j3o Model and j3f Filter layer registration to Annotations --- .../src/com/jme3/gde/core/Bundle.properties | 5 +- .../gde/core/FilterPostProcessorResolver.xml | 12 -- .../jme3/gde/core/JMEBinaryModelResolver.xml | 14 -- .../core/assets/BinaryModelFileLoader.java | 21 +++ .../jme3/gde/core/assets/Bundle.properties | 1 - .../gde/core/assets/FilterDataObject.java | 21 +++ sdk/jme3-core/src/com/jme3/gde/core/layer.xml | 149 ------------------ .../src/com/jme3/gde/core/package-info.java | 7 + 8 files changed, 50 insertions(+), 180 deletions(-) delete mode 100644 sdk/jme3-core/src/com/jme3/gde/core/FilterPostProcessorResolver.xml delete mode 100644 sdk/jme3-core/src/com/jme3/gde/core/JMEBinaryModelResolver.xml create mode 100644 sdk/jme3-core/src/com/jme3/gde/core/package-info.java diff --git a/sdk/jme3-core/src/com/jme3/gde/core/Bundle.properties b/sdk/jme3-core/src/com/jme3/gde/core/Bundle.properties index 839a3a1c2..afc3eeeb6 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/Bundle.properties +++ b/sdk/jme3-core/src/com/jme3/gde/core/Bundle.properties @@ -3,8 +3,5 @@ OpenIDE-Module-Long-Description=\ This plugin provides the core functions of jMonkeyEngine GDE. OpenIDE-Module-Name=SDK Core OpenIDE-Module-Short-Description=The jMonkeyEngine GDE Core Plugin -Services/MIMEResolver/FilterPostProcessorResolver.xml=FilterPostProcessor Files -Services/MIMEResolver/JMEBinaryModelResolver.xml=JMEBinaryModel Files Menu/Help/jmewiki.url=Browse Help online -Menu/Help/help-main.xml=Browse Help locally -Templates/Other/filter.j3f=Empty FilterPostProcessor file +Menu/Help/help-main.xml=Browse Help locally \ No newline at end of file diff --git a/sdk/jme3-core/src/com/jme3/gde/core/FilterPostProcessorResolver.xml b/sdk/jme3-core/src/com/jme3/gde/core/FilterPostProcessorResolver.xml deleted file mode 100644 index 4c2b931cb..000000000 --- a/sdk/jme3-core/src/com/jme3/gde/core/FilterPostProcessorResolver.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - - - diff --git a/sdk/jme3-core/src/com/jme3/gde/core/JMEBinaryModelResolver.xml b/sdk/jme3-core/src/com/jme3/gde/core/JMEBinaryModelResolver.xml deleted file mode 100644 index 7f3e33c7b..000000000 --- a/sdk/jme3-core/src/com/jme3/gde/core/JMEBinaryModelResolver.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - diff --git a/sdk/jme3-core/src/com/jme3/gde/core/assets/BinaryModelFileLoader.java b/sdk/jme3-core/src/com/jme3/gde/core/assets/BinaryModelFileLoader.java index 52da1ebbd..c9a84bf3f 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/assets/BinaryModelFileLoader.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/assets/BinaryModelFileLoader.java @@ -32,8 +32,13 @@ package com.jme3.gde.core.assets; import java.io.IOException; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionReferences; import org.openide.filesystems.FileObject; import org.openide.filesystems.FileUtil; +import org.openide.filesystems.MIMEResolver; +import org.openide.loaders.DataObject; import org.openide.loaders.DataObjectExistsException; import org.openide.loaders.ExtensionList; import org.openide.loaders.FileEntry; @@ -44,6 +49,22 @@ import org.openide.loaders.MultiFileLoader; * * @author normenhansen */ +@MIMEResolver.ExtensionRegistration( + displayName = "jME3 Model", + mimeType = "application/jme3model", + extension = {"j3o", "j3s", "j3odata"} +) +@DataObject.Registration(iconBase = "com/jme3/gde/core/icons/jme-logo.png", displayName = "jME3 Model", mimeType = "application/jme3model") +@ActionReferences({ + @ActionReference(id = @ActionID(category = "Edit", id = "org.openide.actions.CutAction"), path = "Loaders/application/jme3model/Actions", position = 200, separatorBefore = 100), + @ActionReference(id = @ActionID(category = "Edit", id = "org.openide.actions.CopyAction"), path = "Loaders/application/jme3model/Actions", position = 300, separatorAfter = 400), + @ActionReference(id = @ActionID(category = "Edit", id = "org.openide.actions.DeleteAction"), path = "Loaders/application/jme3model/Actions", position = 500), + @ActionReference(id = @ActionID(category = "System", id = "org.openide.actions.RenameAction"), path = "Loaders/application/jme3model/Actions", position = 600, separatorAfter = 700), + @ActionReference(id = @ActionID(category = "System", id = "org.openide.actions.SaveAsTemplateAction"), path = "Loaders/application/jme3model/Actions", position = 800, separatorAfter = 900), + @ActionReference(id = @ActionID(category = "System", id = "org.openide.actions.FileSystemAction"), path = "Loaders/application/jme3model/Actions", position = 1000, separatorAfter = 1100), + @ActionReference(id = @ActionID(category = "System", id = "org.openide.actions.ToolsAction"), path = "Loaders/application/jme3model/Actions", position = 1200), + @ActionReference(id = @ActionID(category = "System", id = "org.openide.actions.PropertiesAction"), path = "Loaders/application/jme3model/Actions", position = 1300), +}) public class BinaryModelFileLoader extends MultiFileLoader { public static final String PROP_EXTENSIONS = "extensions"; // NOI18N diff --git a/sdk/jme3-core/src/com/jme3/gde/core/assets/Bundle.properties b/sdk/jme3-core/src/com/jme3/gde/core/assets/Bundle.properties index 1ae61dc8c..2081ba986 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/assets/Bundle.properties +++ b/sdk/jme3-core/src/com/jme3/gde/core/assets/Bundle.properties @@ -1,2 +1 @@ -LBL_JMEBinaryModel_loader_name=JMEBinaryModel Files TextureBrowser.title=Texture Browser diff --git a/sdk/jme3-core/src/com/jme3/gde/core/assets/FilterDataObject.java b/sdk/jme3-core/src/com/jme3/gde/core/assets/FilterDataObject.java index 279490302..52ed8d432 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/assets/FilterDataObject.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/assets/FilterDataObject.java @@ -34,7 +34,12 @@ package com.jme3.gde.core.assets; import com.jme3.gde.core.filters.FilterPostProcessorNode; import com.jme3.post.FilterPostProcessor; import java.io.IOException; +import org.openide.awt.ActionID; +import org.openide.awt.ActionReference; +import org.openide.awt.ActionReferences; import org.openide.filesystems.FileObject; +import org.openide.filesystems.MIMEResolver; +import org.openide.loaders.DataObject; import org.openide.loaders.DataObjectExistsException; import org.openide.loaders.MultiFileLoader; @@ -42,6 +47,22 @@ import org.openide.loaders.MultiFileLoader; * * @author normenhansen */ +@MIMEResolver.ExtensionRegistration( + displayName = "FilterPostProcessor Files", + mimeType = "application/jme3filterpostprocessor", + extension = {"j3f"} +) +@DataObject.Registration(iconBase = "com/jme3/gde/core/icons/eye.gif", displayName = "jME3 FilterPostProcessor", mimeType = "application/jme3filterpostprocessor") +@ActionReferences({ + @ActionReference(id = @ActionID(category = "Edit", id = "org.openide.actions.CutAction"), path = "Loaders/application/jme3filterpostprocessor/Actions", position = 200, separatorBefore = 100), + @ActionReference(id = @ActionID(category = "Edit", id = "org.openide.actions.CopyAction"), path = "Loaders/application/jme3filterpostprocessor/Actions", position = 300, separatorAfter = 400), + @ActionReference(id = @ActionID(category = "Edit", id = "org.openide.actions.DeleteAction"), path = "Loaders/application/jme3filterpostprocessor/Actions", position = 500), + @ActionReference(id = @ActionID(category = "System", id = "org.openide.actions.RenameAction"), path = "Loaders/application/jme3filterpostprocessor/Actions", position = 600, separatorAfter = 700), + @ActionReference(id = @ActionID(category = "System", id = "org.openide.actions.SaveAsTemplateAction"), path = "Loaders/application/jme3filterpostprocessor/Actions", position = 800, separatorAfter = 900), + @ActionReference(id = @ActionID(category = "System", id = "org.openide.actions.FileSystemAction"), path = "Loaders/application/jme3filterpostprocessor/Actions", position = 1000, separatorAfter = 1100), + @ActionReference(id = @ActionID(category = "System", id = "org.openide.actions.ToolsAction"), path = "Loaders/application/jme3filterpostprocessor/Actions", position = 1200), + @ActionReference(id = @ActionID(category = "System", id = "org.openide.actions.PropertiesAction"), path = "Loaders/application/jme3filterpostprocessor/Actions", position = 1300) +}) public class FilterDataObject extends AssetDataObject { public FilterDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException { diff --git a/sdk/jme3-core/src/com/jme3/gde/core/layer.xml b/sdk/jme3-core/src/com/jme3/gde/core/layer.xml index 5dc6db6fe..fe6b6c8a2 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/layer.xml +++ b/sdk/jme3-core/src/com/jme3/gde/core/layer.xml @@ -143,141 +143,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -301,12 +166,6 @@ - - - - - - @@ -321,14 +180,6 @@ - - - - - - - - diff --git a/sdk/jme3-core/src/com/jme3/gde/core/package-info.java b/sdk/jme3-core/src/com/jme3/gde/core/package-info.java new file mode 100644 index 000000000..00aaf571b --- /dev/null +++ b/sdk/jme3-core/src/com/jme3/gde/core/package-info.java @@ -0,0 +1,7 @@ +@TemplateRegistrations({ + @TemplateRegistration(folder = "Filters", content = "filter.j3f", displayName = "jME3 Post Filter"), +}) +package com.jme3.gde.core; + +import org.netbeans.api.templates.TemplateRegistration; +import org.netbeans.api.templates.TemplateRegistrations;