NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

How to bundle NetBeans Plugins with my App?

 
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users
View previous topic :: View next topic  
Author Message
Lusito



Joined: 06 Apr 2016
Posts: 12

PostPosted: Fri Mar 03, 2017 6:45 pm    Post subject: How to bundle NetBeans Plugins with my App? Reply with quote

I'd like to bundle some editors that NB provides with my app, but it seems like a very difficult process.

In this example I tried adding a json-editor. I thought it should be as simple as adding the "org-netbeans-modules-javascript2-kit" to my application module:
Code:
        <dependency>
            <groupId>org.netbeans.modules</groupId>
            <artifactId>org-netbeans-modules-javascript2-kit</artifactId>
            <version>${netbeans.version}</version>
        </dependency>

Compiling it showed a missing dependency for "javax.script.ScriptEngine.freemarker", so I'm adding this one:
Code:
        <dependency>
            <groupId>org.netbeans.modules</groupId>
            <artifactId>org-netbeans-libs-freemarker</artifactId>
            <version>${netbeans.version}</version>
        </dependency>

(why isn't this a dependency on the org-netbeans-modules-javascript2-kit module by default?)

Now it compiles, but I get a startup issue:
"java.lang.IllegalStateException: No ActiveDocumentProvider instance in global lookup."
Googling this, I found this:
https://netbeans.org/bugzilla/show_bug.cgi?id=254949
which linked to this:
http://hg.netbeans.org/core-main/rev/2666c7e4b839
So I found maven modules for the added lines (thinking: this can't be the correct way to do this?):
Code:
         <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-netbeans-modules-editor-document</artifactId>
            <version>${netbeans.version}</version>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-netbeans-modules-parsing-api</artifactId>
            <version>${netbeans.version}</version>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-netbeans-modules-parsing-indexing</artifactId>
            <version>${netbeans.version}</version>
        </dependency>
        <dependency>
            <groupId>org.netbeans.modules</groupId>
            <artifactId>org-netbeans-modules-parsing-nb</artifactId>
            <version>${netbeans.version}</version>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-netbeans-modules-editor-indent-support</artifactId>
            <version>${netbeans.version}</version>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-netbeans-modules-editor-settings-lib</artifactId>
            <version>${netbeans.version}</version>
        </dependency>
        <dependency>
            <groupId>org.netbeans.modules</groupId>
            <artifactId>org-netbeans-modules-project-spi-intern</artifactId>
            <version>${netbeans.version}</version>
        </dependency>
        <dependency>
            <groupId>org.netbeans.api</groupId>
            <artifactId>org-netbeans-modules-projectuiapi-base</artifactId>
            <version>${netbeans.version}</version>
        </dependency>


Finally, my app starts up without errors, but when I open a json file, I get:
"A org.netbeans.modules.parsing.spi.ParseException exception has occurred."

In Detail:
Quote:
java.lang.NullPointerException
at org.netbeans.modules.javascript2.editor.JsStructureScanner.foldsJson(JsStructureScanner.java:351)
at org.netbeans.modules.javascript2.editor.JsStructureScanner.folds(JsStructureScanner.java:296)
at org.netbeans.modules.csl.editor.fold.GsfFoldManager$JavaElementFoldTask.scan(GsfFoldManager.java:528)
at org.netbeans.modules.csl.editor.fold.GsfFoldManager$JavaElementFoldTask.access$100(GsfFoldManager.java:268)
at org.netbeans.modules.csl.editor.fold.GsfFoldManager$JavaElementFoldTask$1.run(GsfFoldManager.java:434)
at org.netbeans.modules.parsing.impl.TaskProcessor.callUserTask(TaskProcessor.java:609)
at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:153)
at org.netbeans.modules.parsing.api.ParserManager$UserTaskAction.run(ParserManager.java:137)
at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:204)
at org.netbeans.modules.parsing.impl.TaskProcessor$2.call(TaskProcessor.java:201)
at org.netbeans.modules.masterfs.filebasedfs.utils.FileChangedManager.priorityIO(FileChangedManager.java:176)
at org.netbeans.modules.masterfs.providers.ProvidedExtensions.priorityIO(ProvidedExtensions.java:360)
at org.netbeans.modules.parsing.nb.DataObjectEnvFactory.runPriorityIO(DataObjectEnvFactory.java:141)
at org.netbeans.modules.parsing.impl.Utilities.runPriorityIO(Utilities.java:88)
at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:201)
Caused: org.netbeans.modules.parsing.spi.ParseException
at org.netbeans.modules.parsing.impl.TaskProcessor.runUserTask(TaskProcessor.java:209)
at org.netbeans.modules.parsing.api.ParserManager.parse(ParserManager.java:104)
[catch] at org.netbeans.modules.csl.editor.fold.GsfFoldManager$JavaElementFoldTask.gsfFoldScan(GsfFoldManager.java:416)
at org.netbeans.modules.csl.editor.fold.GsfFoldManager$JavaElementFoldTask.run(GsfFoldManager.java:377)
at org.netbeans.modules.csl.editor.fold.GsfFoldManager$JavaElementFoldTask.run(GsfFoldManager.java:268)
at org.netbeans.modules.parsing.impl.TaskProcessor.callParserResultTask(TaskProcessor.java:584)
at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.run(TaskProcessor.java:809)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:304)
at org.netbeans.modules.parsing.impl.TaskProcessor$RequestPerformer.execute(TaskProcessor.java:725)
at org.netbeans.modules.parsing.impl.TaskProcessor$CompilationJob.run(TaskProcessor.java:686)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1443)
at org.netbeans.modules.openide.util.GlobalLookup.execute(GlobalLookup.java:68)
at org.openide.util.lookup.Lookups.executeWith(Lookups.java:303)
at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:2058)


Is it really necessary to go through this much trouble to get the json editor included?

The only (partially) working solution I found so far was to add the netbeans update centers to my app and then installing the javascript2-kit plugin from there.
Opening a json file worked with this, syntax errors where highlighted.. but for some weird reason, keyboard shortcuts like backspace for deleting the previous character have not been set.

Does anyone know of a better way of doing this? Is this maybe only so difficult when using maven projects instead of netbeans projects?
Back to top
avianrr



Joined: 10 Sep 2017
Posts: 0

PostPosted: Sun Sep 10, 2017 9:59 am    Post subject: Reply with quote

don bradman cricket 17
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> NetBeans Platform Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo