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 fd9f6a8 [NETBEANS-4827] Add EditorKit for TypeScript and add action for toggle comment new f59e2ec Merge pull request #2588 from matthiasblaesing/netbeans-4827 fd9f6a8 is described below commit fd9f6a81e8c990b5d0c2e9651136808bf5b70c8a Author: Matthias Bläsing <mblaes...@doppel-helix.eu> AuthorDate: Fri Dec 11 19:57:39 2020 +0100 [NETBEANS-4827] Add EditorKit for TypeScript and add action for toggle comment --- webcommon/typescript.editor/nbproject/project.xml | 18 +++++++++ .../typescript/editor/TypeScriptEditorKit.java | 44 ++++++++++++++++++++++ 2 files changed, 62 insertions(+) diff --git a/webcommon/typescript.editor/nbproject/project.xml b/webcommon/typescript.editor/nbproject/project.xml index a7326c0..595d49c 100644 --- a/webcommon/typescript.editor/nbproject/project.xml +++ b/webcommon/typescript.editor/nbproject/project.xml @@ -34,6 +34,24 @@ </run-dependency> </dependency> <dependency> + <code-name-base>org.netbeans.modules.editor</code-name-base> + <build-prerequisite/> + <compile-dependency/> + <run-dependency> + <release-version>3</release-version> + <specification-version>1.98</specification-version> + </run-dependency> + </dependency> + <dependency> + <code-name-base>org.netbeans.modules.editor.lib</code-name-base> + <build-prerequisite/> + <compile-dependency/> + <run-dependency> + <release-version>3</release-version> + <specification-version>4.18</specification-version> + </run-dependency> + </dependency> + <dependency> <code-name-base>org.netbeans.modules.editor.mimelookup</code-name-base> <build-prerequisite/> <compile-dependency/> 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 new file mode 100644 index 0000000..d510fa0 --- /dev/null +++ b/webcommon/typescript.editor/src/org/netbeans/modules/typescript/editor/TypeScriptEditorKit.java @@ -0,0 +1,44 @@ +/* + * 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. + */ +package org.netbeans.modules.typescript.editor; + +import javax.swing.Action; +import javax.swing.text.EditorKit; +import javax.swing.text.TextAction; +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 { + + public static final String TYPESCRIPT_MIME_TYPE = "application/x-typescript"; // NOI18N + + @Override + public String getContentType() { + return TYPESCRIPT_MIME_TYPE; + } + + @Override + protected Action[] createActions() { + Action[] actions = new Action[] { + new ToggleCommentAction("//"), //NOI18N + }; + return TextAction.augmentList(super.createActions(), actions); + } +} --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org For additional commands, e-mail: commits-h...@netbeans.apache.org For further information about the NetBeans mailing lists, visit: https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists