Skip to content

Commit 6269e30

Browse files
authored
Merge pull request #9244 from mbien/toml-yaml-templates
Add toml template and update yaml template registration
2 parents dcffc60 + bebfd18 commit 6269e30

11 files changed

Lines changed: 115 additions & 20 deletions

File tree

ide/languages.jflex/src/org/netbeans/modules/languages/jflex/resources/layer.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<folder name="Templates">
6969
<folder name="Grammar">
7070
<!--less priority than XML-->
71-
<attr name="position" intvalue="1800"/>
71+
<attr name="position" intvalue="1840"/>
7272
</folder>
7373
</folder>
7474
</filesystem>

ide/languages.toml/nbproject/project.properties

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,4 @@
1414
# KIND, either express or implied. See the License for the
1515
# specific language governing permissions and limitations
1616
# under the License.
17-
javac.source=1.8
18-
javac.target=1.8
19-
20-
17+
javac.release=17

ide/languages.toml/nbproject/project.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@
2525
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
2626
<code-name-base>org.netbeans.modules.languages.toml</code-name-base>
2727
<module-dependencies>
28+
<dependency>
29+
<code-name-base>org.netbeans.api.templates</code-name-base>
30+
<build-prerequisite/>
31+
<compile-dependency/>
32+
<run-dependency>
33+
<specification-version>1.40</specification-version>
34+
</run-dependency>
35+
</dependency>
2836
<dependency>
2937
<code-name-base>org.netbeans.core.multiview</code-name-base>
3038
<build-prerequisite/>

ide/languages.toml/src/org/netbeans/modules/languages/toml/Bundle.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ OpenIDE-Module-Short-Description=Support for editing TOML files.
2121
OpenIDE-Module-Long-Description=Support for editing TOML files.
2222

2323
Editors/text/x-toml=TOML
24+
Templates/Other/TomlFileTemplate.toml=TOML File
2425

2526
boolean=Boolean
2627
comment=Comment
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!--
2+
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
20+
-->
21+
22+
<html>
23+
<head>
24+
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
25+
</head>
26+
<BODY>
27+
Creates an empty TOML file.
28+
</BODY></HTML>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# TOML document
2+
3+
title = "Hello World"
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
@TemplateRegistration(
21+
folder = "Other",
22+
content = "TomlFileTemplate.toml",
23+
displayName = "#Templates/Other/TomlFileTemplate.toml",
24+
targetName = "EmptyTOML",
25+
position = 840,
26+
requireProject = false,
27+
category = "simple-files",
28+
description = "TomlFileDescription.html"
29+
)
30+
package org.netbeans.modules.languages.toml;
31+
32+
import org.netbeans.api.templates.TemplateRegistration;

ide/languages.yaml/nbproject/project.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@
2525
<data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
2626
<code-name-base>org.netbeans.modules.languages.yaml</code-name-base>
2727
<module-dependencies>
28+
<dependency>
29+
<code-name-base>org.netbeans.api.templates</code-name-base>
30+
<build-prerequisite/>
31+
<compile-dependency/>
32+
<run-dependency>
33+
<specification-version>1.40</specification-version>
34+
</run-dependency>
35+
</dependency>
2836
<dependency>
2937
<code-name-base>org.netbeans.core.multiview</code-name-base>
3038
<build-prerequisite/>

ide/languages.yaml/src/org/netbeans/modules/languages/yaml/EmptyYAMLFileDescription.html

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,5 @@
2424
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
2525
</head>
2626
<BODY>
27-
Creates an empty YAML file. You can edit the file in the IDE's Source Editor.
28-
To change this template, choose Tools | Template Manager
29-
and open the template in the editor.
27+
Creates an empty YAML file.
3028
</BODY></HTML>

ide/languages.yaml/src/org/netbeans/modules/languages/yaml/layer.xml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,18 +70,6 @@
7070
</folder>
7171
</folder>
7272
</folder>
73-
<folder name="Templates">
74-
<folder name="Other">
75-
<file name="EmptyYAML.yml" url="EmptyYAML.yml">
76-
<attr name="position" intvalue="850"/>
77-
<attr name="template" boolvalue="true"/>
78-
<attr name="templateCategory" stringvalue="simple-files"/>
79-
<attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.languages.yaml.Bundle"/>
80-
<attr name="templateWizardURL" urlvalue="nbresloc:/org/netbeans/modules/languages/yaml/EmptyYAMLFileDescription.html"/>
81-
<attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/languages/yaml/yaml_files_16.png"/>
82-
</file>
83-
</folder>
84-
</folder>
8573
<folder name="Loaders">
8674
<folder name="text">
8775
<folder name="x-yaml">

0 commit comments

Comments
 (0)