NetBeans Forums

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

custom javascript editor throws Exception

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



Joined: 04 Jan 2009
Posts: 55

PostPosted: Mon Aug 07, 2017 3:56 pm    Post subject: custom javascript editor throws Exception Reply with quote

I develop a web project plugin which has a javascript editor,and the editor is implemented as following:
Code:

    EditorKit kit = CloneableEditorSupport.getEditorKit("text/javascript");
    javascriptTextArea.setEditorKit(kit);

When installed in Netbeans 8.1,in the editor,when entering . ,the Netbeans throws exception´╝Ü
Code:

java.lang.NullPointerException: Passed null to FileOwnerQuery.getOwner(FileObject)
   at org.netbeans.api.project.FileOwnerQuery.getOwner(FileOwnerQuery.java:107)
   at org.netbeans.modules.javascript2.nodejs.editor.NodeJsDataProvider.getDefault(NodeJsDataProvider.java:181)
   at org.netbeans.modules.javascript2.nodejs.editor.model.NodeJsModelInterceptor.getGlobalObjects(NodeJsModelInterceptor.java:70)
   at org.netbeans.modules.javascript2.nodejs.editor.model.NodeJsModelInterceptor.interceptGlobal(NodeJsModelInterceptor.java:64)
   at org.netbeans.modules.javascript2.editor.model.impl.ModelExtender.getExtendingGlobalObjects(ModelExtender.java:137)
   at org.netbeans.modules.javascript2.editor.model.impl.ModelUtils.resolveTypeFromExpression(ModelUtils.java:847)
   at org.netbeans.modules.javascript2.editor.JsCodeCompletion.getCompletionFromExpressionChain(JsCodeCompletion.java:575)
   at org.netbeans.modules.javascript2.editor.JsCodeCompletion.completeObjectProperty(JsCodeCompletion.java:550)
   at org.netbeans.modules.javascript2.editor.JsCodeCompletion.complete(JsCodeCompletion.java:231)
   at org.netbeans.modules.csl.editor.completion.GsfCompletionProvider$JavaCompletionQuery.addCodeCompletionItems(GsfCompletionProvider.java:626)
   at org.netbeans.modules.csl.editor.completion.GsfCompletionProvider$JavaCompletionQuery.resolveCompletion(GsfCompletionProvider.java:613)
   at org.netbeans.modules.csl.editor.completion.GsfCompletionProvider$JavaCompletionQuery.access$400(GsfCompletionProvider.java:250)
   at org.netbeans.modules.csl.editor.completion.GsfCompletionProvider$JavaCompletionQuery$1.run(GsfCompletionProvider.java:336)
   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.completion.GsfCompletionProvider$JavaCompletionQuery.query(GsfCompletionProvider.java:345)
   at org.netbeans.spi.editor.completion.support.AsyncCompletionTask.run(AsyncCompletionTask.java:223)
   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)

while I change the editor implement as following,it looks ok but the prompt message doesn't include my javascript lib!
Code:

FileObject fob = FileUtil.createMemoryFileSystem().getRoot().createData("tmp", "js");
DialogBinding.bindComponentToFile(fob, 0, 0, javascriptTextArea);         

what is the right way to implement the javascipt editor base on Netbeans 8.1 ?
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