You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@netbeans.apache.org by ma...@apache.org on 2021/09/20 18:13:20 UTC
[netbeans] branch master updated: Switch typescript and cpplite
editors to multiviews
This is an automated email from the ASF dual-hosted git repository.
matthiasblaesing pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git
The following commit(s) were added to refs/heads/master by this push:
new 46208bb Switch typescript and cpplite editors to multiviews
new fe0d54a Merge pull request #3155 from matthiasblaesing/typescript_multiview
46208bb is described below
commit 46208bb9ea48bf8e1e0ae413be01fe056defc20c
Author: Matthias Bläsing <mb...@doppel-helix.eu>
AuthorDate: Sat Sep 4 18:38:22 2021 +0200
Switch typescript and cpplite editors to multiviews
---
cpplite/cpplite.editor/nbproject/project.xml | 18 ++++++++++++++
.../modules/cpplite/editor/file/Bundle.properties | 18 ++++++++++++++
.../modules/cpplite/editor/file/CDataObject.java | 23 +++++++++++++++--
.../modules/cpplite/editor/file/CPPDataObject.java | 23 +++++++++++++++--
.../modules/cpplite/editor/file/HDataObject.java | 23 +++++++++++++++--
.../modules/cpplite/editor/file/HPPDataObject.java | 23 +++++++++++++++--
.../modules/cpplite/editor/file/package-info.java | 8 +++---
webcommon/typescript.editor/nbproject/project.xml | 18 ++++++++++++++
.../editor/TypeScriptDataObjectDataObject.java | 29 ++++++++++++++++++----
.../typescript/editor/TypeScriptEditorKit.java | 3 +++
.../modules/typescript/editor/TypeScriptLSP.java | 11 +++++---
11 files changed, 176 insertions(+), 21 deletions(-)
diff --git a/cpplite/cpplite.editor/nbproject/project.xml b/cpplite/cpplite.editor/nbproject/project.xml
index 58f824f..658ae5d 100644
--- a/cpplite/cpplite.editor/nbproject/project.xml
+++ b/cpplite/cpplite.editor/nbproject/project.xml
@@ -26,6 +26,15 @@
<code-name-base>org.netbeans.modules.cpplite.editor</code-name-base>
<module-dependencies>
<dependency>
+ <code-name-base>org.netbeans.api.annotations.common</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>1</release-version>
+ <specification-version>1.41</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
<code-name-base>org.netbeans.api.java.classpath</code-name-base>
<build-prerequisite/>
<compile-dependency/>
@@ -43,6 +52,15 @@
</run-dependency>
</dependency>
<dependency>
+ <code-name-base>org.netbeans.core.multiview</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>1</release-version>
+ <specification-version>1.57</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
<code-name-base>org.netbeans.modules.editor</code-name-base>
<build-prerequisite/>
<compile-dependency/>
diff --git a/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/Bundle.properties b/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/Bundle.properties
new file mode 100644
index 0000000..a327b58
--- /dev/null
+++ b/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/Bundle.properties
@@ -0,0 +1,18 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+Source=&Source
diff --git a/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/CDataObject.java b/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/CDataObject.java
index eb6c211..654d223 100644
--- a/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/CDataObject.java
+++ b/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/CDataObject.java
@@ -19,6 +19,9 @@
package org.netbeans.modules.cpplite.editor.file;
import java.io.IOException;
+import org.netbeans.api.annotations.common.StaticResource;
+import org.netbeans.core.spi.multiview.MultiViewElement;
+import org.netbeans.core.spi.multiview.text.MultiViewEditorElement;
import org.netbeans.modules.textmate.lexer.api.GrammarRegistration;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
@@ -29,7 +32,9 @@ import org.openide.loaders.DataObject;
import org.openide.loaders.DataObjectExistsException;
import org.openide.loaders.MultiDataObject;
import org.openide.loaders.MultiFileLoader;
+import org.openide.util.Lookup;
import org.openide.util.NbBundle.Messages;
+import org.openide.windows.TopComponent;
@Messages({
"LBL_C_LOADER=Files of C"
@@ -42,7 +47,7 @@ import org.openide.util.NbBundle.Messages;
)
@DataObject.Registration(
mimeType = MIMETypes.C,
- iconBase = "org/netbeans/modules/cpplite/editor/file/resources/CSrcIcon.gif",
+ iconBase = CDataObject.ICON,
displayName = "#LBL_C_LOADER",
position = 300
)
@@ -112,9 +117,12 @@ import org.openide.util.NbBundle.Messages;
@GrammarRegistration(grammar="resources/c.tmLanguage.json", mimeType=MIMETypes.C)
public class CDataObject extends MultiDataObject {
+ @StaticResource
+ static final String ICON = "org/netbeans/modules/cpplite/editor/file/resources/CSrcIcon.gif";
+
public CDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
super(pf, loader);
- registerEditor(MIMETypes.C, false);
+ registerEditor(MIMETypes.C, true);
}
@Override
@@ -122,4 +130,15 @@ public class CDataObject extends MultiDataObject {
return 1;
}
+ @MultiViewElement.Registration(
+ displayName = "#Source",
+ iconBase = CDataObject.ICON,
+ persistenceType = TopComponent.PERSISTENCE_ONLY_OPENED,
+ mimeType = MIMETypes.C,
+ preferredID = "c.source",
+ position = 100
+ )
+ public static MultiViewEditorElement createEditor(Lookup lkp) {
+ return new MultiViewEditorElement(lkp);
+ }
}
diff --git a/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/CPPDataObject.java b/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/CPPDataObject.java
index 294ab0a..e8421bf 100644
--- a/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/CPPDataObject.java
+++ b/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/CPPDataObject.java
@@ -19,6 +19,9 @@
package org.netbeans.modules.cpplite.editor.file;
import java.io.IOException;
+import org.netbeans.api.annotations.common.StaticResource;
+import org.netbeans.core.spi.multiview.MultiViewElement;
+import org.netbeans.core.spi.multiview.text.MultiViewEditorElement;
import org.netbeans.modules.textmate.lexer.api.GrammarRegistration;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
@@ -29,7 +32,9 @@ import org.openide.loaders.DataObject;
import org.openide.loaders.DataObjectExistsException;
import org.openide.loaders.MultiDataObject;
import org.openide.loaders.MultiFileLoader;
+import org.openide.util.Lookup;
import org.openide.util.NbBundle.Messages;
+import org.openide.windows.TopComponent;
@Messages({
"LBL_CPP_LOADER=Files of CPP"
@@ -42,7 +47,7 @@ import org.openide.util.NbBundle.Messages;
)
@DataObject.Registration(
mimeType = MIMETypes.CPP,
- iconBase = "org/netbeans/modules/cpplite/editor/file/resources/CCSrcIcon.gif",
+ iconBase = CPPDataObject.ICON,
displayName = "#LBL_CPP_LOADER",
position = 300
)
@@ -112,9 +117,12 @@ import org.openide.util.NbBundle.Messages;
@GrammarRegistration(grammar="resources/cpp.tmLanguage.json", mimeType=MIMETypes.CPP)
public class CPPDataObject extends MultiDataObject {
+ @StaticResource
+ static final String ICON = "org/netbeans/modules/cpplite/editor/file/resources/CCSrcIcon.gif";
+
public CPPDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
super(pf, loader);
- registerEditor(MIMETypes.CPP, false);
+ registerEditor(MIMETypes.CPP, true);
}
@Override
@@ -122,4 +130,15 @@ public class CPPDataObject extends MultiDataObject {
return 1;
}
+ @MultiViewElement.Registration(
+ displayName = "#Source",
+ iconBase = CPPDataObject.ICON,
+ persistenceType = TopComponent.PERSISTENCE_ONLY_OPENED,
+ mimeType = MIMETypes.CPP,
+ preferredID = "cpp.source",
+ position = 100
+ )
+ public static MultiViewEditorElement createEditor(Lookup lkp) {
+ return new MultiViewEditorElement(lkp);
+ }
}
diff --git a/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/HDataObject.java b/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/HDataObject.java
index be8d498..c4cc4cf 100644
--- a/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/HDataObject.java
+++ b/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/HDataObject.java
@@ -19,6 +19,9 @@
package org.netbeans.modules.cpplite.editor.file;
import java.io.IOException;
+import org.netbeans.api.annotations.common.StaticResource;
+import org.netbeans.core.spi.multiview.MultiViewElement;
+import org.netbeans.core.spi.multiview.text.MultiViewEditorElement;
import org.netbeans.modules.textmate.lexer.api.GrammarRegistration;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
@@ -29,7 +32,9 @@ import org.openide.loaders.DataObject;
import org.openide.loaders.DataObjectExistsException;
import org.openide.loaders.MultiDataObject;
import org.openide.loaders.MultiFileLoader;
+import org.openide.util.Lookup;
import org.openide.util.NbBundle.Messages;
+import org.openide.windows.TopComponent;
@Messages({
"LBL_H_LOADER=Files of H"
@@ -42,7 +47,7 @@ import org.openide.util.NbBundle.Messages;
)
@DataObject.Registration(
mimeType = MIMETypes.H,
- iconBase = "org/netbeans/modules/cpplite/editor/file/resources/HDataIcon.gif",
+ iconBase = HDataObject.ICON,
displayName = "#LBL_H_LOADER",
position = 300
)
@@ -112,9 +117,12 @@ import org.openide.util.NbBundle.Messages;
@GrammarRegistration(grammar="resources/c.tmLanguage.json", mimeType=MIMETypes.H)
public class HDataObject extends MultiDataObject {
+ @StaticResource
+ static final String ICON = "org/netbeans/modules/cpplite/editor/file/resources/HDataIcon.gif";
+
public HDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
super(pf, loader);
- registerEditor(MIMETypes.H, false);
+ registerEditor(MIMETypes.H, true);
}
@Override
@@ -122,4 +130,15 @@ public class HDataObject extends MultiDataObject {
return 1;
}
+ @MultiViewElement.Registration(
+ displayName = "#Source",
+ iconBase = HDataObject.ICON,
+ persistenceType = TopComponent.PERSISTENCE_ONLY_OPENED,
+ mimeType = MIMETypes.H,
+ preferredID = "h.source",
+ position = 100
+ )
+ public static MultiViewEditorElement createEditor(Lookup lkp) {
+ return new MultiViewEditorElement(lkp);
+ }
}
diff --git a/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/HPPDataObject.java b/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/HPPDataObject.java
index 1222141..bd870eb 100644
--- a/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/HPPDataObject.java
+++ b/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/HPPDataObject.java
@@ -19,6 +19,9 @@
package org.netbeans.modules.cpplite.editor.file;
import java.io.IOException;
+import org.netbeans.api.annotations.common.StaticResource;
+import org.netbeans.core.spi.multiview.MultiViewElement;
+import org.netbeans.core.spi.multiview.text.MultiViewEditorElement;
import org.netbeans.modules.textmate.lexer.api.GrammarRegistration;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
@@ -29,7 +32,9 @@ import org.openide.loaders.DataObject;
import org.openide.loaders.DataObjectExistsException;
import org.openide.loaders.MultiDataObject;
import org.openide.loaders.MultiFileLoader;
+import org.openide.util.Lookup;
import org.openide.util.NbBundle.Messages;
+import org.openide.windows.TopComponent;
@Messages({
"LBL_HPP_LOADER=Files of HPP"
@@ -42,7 +47,7 @@ import org.openide.util.NbBundle.Messages;
)
@DataObject.Registration(
mimeType = MIMETypes.HPP,
- iconBase = "org/netbeans/modules/cpplite/editor/file/resources/HDataIcon.gif",
+ iconBase = HPPDataObject.ICON,
displayName = "#LBL_HPP_LOADER",
position = 300
)
@@ -112,9 +117,12 @@ import org.openide.util.NbBundle.Messages;
@GrammarRegistration(grammar="resources/cpp.tmLanguage.json", mimeType=MIMETypes.HPP)
public class HPPDataObject extends MultiDataObject {
+ @StaticResource
+ static final String ICON = "org/netbeans/modules/cpplite/editor/file/resources/HDataIcon.gif";
+
public HPPDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
super(pf, loader);
- registerEditor(MIMETypes.HPP, false);
+ registerEditor(MIMETypes.HPP, true);
}
@Override
@@ -122,4 +130,15 @@ public class HPPDataObject extends MultiDataObject {
return 1;
}
+ @MultiViewElement.Registration(
+ displayName = "#Source",
+ iconBase = HPPDataObject.ICON,
+ persistenceType = TopComponent.PERSISTENCE_ONLY_OPENED,
+ mimeType = MIMETypes.HPP,
+ preferredID = "hpp.source",
+ position = 100
+ )
+ public static MultiViewEditorElement createEditor(Lookup lkp) {
+ return new MultiViewEditorElement(lkp);
+ }
}
diff --git a/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/package-info.java b/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/package-info.java
index 3c26ac2..13ef515 100644
--- a/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/package-info.java
+++ b/cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/file/package-info.java
@@ -22,25 +22,25 @@
scriptEngine = "freemarker",
category = "cpplite",
displayName = "#CTemplate",
- iconBase = "org/netbeans/modules/cpplite/editor/file/resources/CSrcIcon.gif"),
+ iconBase = CDataObject.ICON),
@TemplateRegistration(folder = "cpplite",
content = "CPPTemplate.cpp",
scriptEngine="freemarker",
category = "cpplite",
displayName = "#CPPTemplate",
- iconBase = "org/netbeans/modules/cpplite/editor/file/resources/CCSrcIcon.gif"),
+ iconBase = CPPDataObject.ICON),
@TemplateRegistration(folder = "cpplite",
content = "HTemplate.h",
scriptEngine="freemarker",
category = "cpplite",
displayName = "#HTemplate",
- iconBase = "org/netbeans/modules/cpplite/editor/file/resources/HDataIcon.gif"),
+ iconBase = HDataObject.ICON),
@TemplateRegistration(folder = "cpplite",
content = "HPPTemplate.hpp",
scriptEngine="freemarker",
category = "cpplite",
displayName = "#HPPTemplate",
- iconBase = "org/netbeans/modules/cpplite/editor/file/resources/HDataIcon.gif")
+ iconBase = HPPDataObject.ICON)
})
@Messages({
"CTemplate=C file",
diff --git a/webcommon/typescript.editor/nbproject/project.xml b/webcommon/typescript.editor/nbproject/project.xml
index 595d49c..0192658 100644
--- a/webcommon/typescript.editor/nbproject/project.xml
+++ b/webcommon/typescript.editor/nbproject/project.xml
@@ -26,6 +26,15 @@
<code-name-base>org.netbeans.modules.typescript.editor</code-name-base>
<module-dependencies>
<dependency>
+ <code-name-base>org.netbeans.api.annotations.common</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>1</release-version>
+ <specification-version>1.41</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
<code-name-base>org.netbeans.api.templates</code-name-base>
<build-prerequisite/>
<compile-dependency/>
@@ -34,6 +43,15 @@
</run-dependency>
</dependency>
<dependency>
+ <code-name-base>org.netbeans.core.multiview</code-name-base>
+ <build-prerequisite/>
+ <compile-dependency/>
+ <run-dependency>
+ <release-version>1</release-version>
+ <specification-version>1.57</specification-version>
+ </run-dependency>
+ </dependency>
+ <dependency>
<code-name-base>org.netbeans.modules.editor</code-name-base>
<build-prerequisite/>
<compile-dependency/>
diff --git a/webcommon/typescript.editor/src/org/netbeans/modules/typescript/editor/TypeScriptDataObjectDataObject.java b/webcommon/typescript.editor/src/org/netbeans/modules/typescript/editor/TypeScriptDataObjectDataObject.java
index 25a6c0b..a3db164 100644
--- a/webcommon/typescript.editor/src/org/netbeans/modules/typescript/editor/TypeScriptDataObjectDataObject.java
+++ b/webcommon/typescript.editor/src/org/netbeans/modules/typescript/editor/TypeScriptDataObjectDataObject.java
@@ -19,6 +19,8 @@
package org.netbeans.modules.typescript.editor;
import java.io.IOException;
+import org.netbeans.core.spi.multiview.MultiViewElement;
+import org.netbeans.core.spi.multiview.text.MultiViewEditorElement;
import org.netbeans.modules.textmate.lexer.api.GrammarRegistration;
import org.openide.awt.ActionID;
import org.openide.awt.ActionReference;
@@ -29,20 +31,25 @@ import org.openide.loaders.DataObject;
import org.openide.loaders.DataObjectExistsException;
import org.openide.loaders.MultiDataObject;
import org.openide.loaders.MultiFileLoader;
+import org.openide.util.Lookup;
import org.openide.util.NbBundle.Messages;
+import org.openide.windows.TopComponent;
+
+import static org.netbeans.modules.typescript.editor.TypeScriptEditorKit.TYPESCRIPT_MIME_TYPE;
+import static org.netbeans.modules.typescript.editor.TypeScriptEditorKit.TYPESCRIPT_ICON;
@Messages({
"LBL_TypeScriptDataObject_LOADER=Files of TypeScriptDataObject"
})
@MIMEResolver.ExtensionRegistration(
displayName = "#LBL_TypeScriptDataObject_LOADER",
- mimeType = "application/x-typescript",
+ mimeType = TYPESCRIPT_MIME_TYPE,
extension = {"ts"},
position = 193 // lower than 218 as CND also recognizes .ts file
)
@DataObject.Registration(
- mimeType = "application/x-typescript",
- iconBase = "org/netbeans/modules/typescript/editor/icon.png",
+ mimeType = TYPESCRIPT_MIME_TYPE,
+ iconBase = TYPESCRIPT_ICON,
displayName = "#LBL_TypeScriptDataObject_LOADER",
position = 300
)
@@ -109,12 +116,12 @@ import org.openide.util.NbBundle.Messages;
separatorAfter = 1550
)
})
-@GrammarRegistration(mimeType="application/x-typescript", grammar="TypeScript.tmLanguage.json")
+@GrammarRegistration(mimeType=TYPESCRIPT_MIME_TYPE, grammar="TypeScript.tmLanguage.json")
public class TypeScriptDataObjectDataObject extends MultiDataObject {
public TypeScriptDataObjectDataObject(FileObject pf, MultiFileLoader loader) throws DataObjectExistsException, IOException {
super(pf, loader);
- registerEditor("application/x-typescript", false);
+ registerEditor(TYPESCRIPT_MIME_TYPE, true);
}
@Override
@@ -122,4 +129,16 @@ public class TypeScriptDataObjectDataObject extends MultiDataObject {
return 1;
}
+ @Messages("Source=&Source")
+ @MultiViewElement.Registration(
+ displayName = "#Source",
+ iconBase = TYPESCRIPT_ICON,
+ persistenceType = TopComponent.PERSISTENCE_ONLY_OPENED,
+ mimeType = TYPESCRIPT_MIME_TYPE,
+ preferredID = "typescript.source",
+ position = 100
+ )
+ public static MultiViewEditorElement createEditor(Lookup lkp) {
+ return new MultiViewEditorElement(lkp);
+ }
}
diff --git a/webcommon/typescript.editor/src/org/netbeans/modules/typescript/editor/TypeScriptEditorKit.java b/webcommon/typescript.editor/src/org/netbeans/modules/typescript/editor/TypeScriptEditorKit.java
index d510fa0..15bbd00 100644
--- a/webcommon/typescript.editor/src/org/netbeans/modules/typescript/editor/TypeScriptEditorKit.java
+++ b/webcommon/typescript.editor/src/org/netbeans/modules/typescript/editor/TypeScriptEditorKit.java
@@ -21,12 +21,15 @@ package org.netbeans.modules.typescript.editor;
import javax.swing.Action;
import javax.swing.text.EditorKit;
import javax.swing.text.TextAction;
+import org.netbeans.api.annotations.common.StaticResource;
import org.netbeans.api.editor.mimelookup.MimeRegistration;
import org.netbeans.modules.editor.NbEditorKit;
@MimeRegistration(mimeType = TypeScriptEditorKit.TYPESCRIPT_MIME_TYPE, service = EditorKit.class)
public class TypeScriptEditorKit extends NbEditorKit {
+ @StaticResource
+ static final String TYPESCRIPT_ICON = "org/netbeans/modules/typescript/editor/icon.png";
public static final String TYPESCRIPT_MIME_TYPE = "application/x-typescript"; // NOI18N
@Override
diff --git a/webcommon/typescript.editor/src/org/netbeans/modules/typescript/editor/TypeScriptLSP.java b/webcommon/typescript.editor/src/org/netbeans/modules/typescript/editor/TypeScriptLSP.java
index 3f3176e..f741044 100644
--- a/webcommon/typescript.editor/src/org/netbeans/modules/typescript/editor/TypeScriptLSP.java
+++ b/webcommon/typescript.editor/src/org/netbeans/modules/typescript/editor/TypeScriptLSP.java
@@ -33,13 +33,18 @@ import org.openide.util.ImageUtilities;
import org.openide.util.Lookup;
import org.openide.util.NbBundle.Messages;
+import static org.netbeans.modules.typescript.editor.TypeScriptEditorKit.TYPESCRIPT_ICON;
+import static org.netbeans.modules.typescript.editor.TypeScriptEditorKit.TYPESCRIPT_MIME_TYPE;
+
/**
*
* @author jlahoda
*/
-@MimeRegistration(mimeType="application/x-typescript", service=LanguageServerProvider.class)
+@MimeRegistration(mimeType=TYPESCRIPT_MIME_TYPE, service=LanguageServerProvider.class)
public class TypeScriptLSP implements LanguageServerProvider {
+ private static final Logger LOG = Logger.getLogger(TypeScriptLSP.class.getName());
+
private final AtomicBoolean missingNodeWarningIssued = new AtomicBoolean();
@Override
@@ -50,7 +55,7 @@ public class TypeScriptLSP implements LanguageServerProvider {
String node = NodeJsSupport.getInstance().getNode(null);
if (node == null || node.isEmpty()) {
if (!missingNodeWarningIssued.getAndSet(true)) {
- NotificationDisplayer.getDefault().notify(Bundle.WARN_NoNode(), ImageUtilities.loadImageIcon("org/netbeans/modules/typescript/editor/icon.png", true), Bundle.DESC_NoNode(), evt -> {
+ NotificationDisplayer.getDefault().notify(Bundle.WARN_NoNode(), ImageUtilities.loadImageIcon(TYPESCRIPT_ICON, true), Bundle.DESC_NoNode(), evt -> {
OptionsDisplayer.getDefault().open("Html5/NodeJs");
});
}
@@ -66,6 +71,4 @@ public class TypeScriptLSP implements LanguageServerProvider {
}
}
- private static final Logger LOG = Logger.getLogger(TypeScriptLSP.class.getName());
-
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@netbeans.apache.org
For additional commands, e-mail: commits-help@netbeans.apache.org
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists