diff --git a/netbeans.apache.org/src/content/tutorials/68/nbm-google.asciidoc b/netbeans.apache.org/src/content/tutorials/68/nbm-google.asciidoc index 1add19abb1..5ea682351d 100644 --- a/netbeans.apache.org/src/content/tutorials/68/nbm-google.asciidoc +++ b/netbeans.apache.org/src/content/tutorials/68/nbm-google.asciidoc @@ -189,11 +189,11 @@ image::images/google_60_add-module-dependency.png[] Click OK, then click OK agai 1. Right-click in the Source Editor and choose Fix Imports (Alt+Shift+F). The Fix All Imports dialog displays, listing suggested paths for unrecognized classes: image::images/google_60_fix-all-imports.png[] Click OK. The IDE creates the following import statements for ``GooglePanel.java`` : -[source,java] +[source,java,subs="macros"] ---- import java.net.URL; -import link:http://bits.netbeans.org/dev/javadoc/org-openide-awt/org/openide/awt/HtmlBrowser.URLDisplayer.html[org.openide.awt.HtmlBrowser.URLDisplayer]; +import link:http://bits.netbeans.org/dev/javadoc/org-openide-awt/org/openide/awt/HtmlBrowser.URLDisplayer.html[org.openide.awt.HtmlBrowser.URLDisplayer]; ---- diff --git a/netbeans.apache.org/src/content/tutorials/71/nbm-idioms.asciidoc b/netbeans.apache.org/src/content/tutorials/71/nbm-idioms.asciidoc deleted file mode 100644 index 34d3268898..0000000000 --- a/netbeans.apache.org/src/content/tutorials/71/nbm-idioms.asciidoc +++ /dev/null @@ -1,19 +0,0 @@ -// -// 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. -// - diff --git a/netbeans.apache.org/src/content/tutorials/72/nbm-idioms.asciidoc b/netbeans.apache.org/src/content/tutorials/72/nbm-idioms.asciidoc deleted file mode 100644 index 34d3268898..0000000000 --- a/netbeans.apache.org/src/content/tutorials/72/nbm-idioms.asciidoc +++ /dev/null @@ -1,19 +0,0 @@ -// -// 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. -// - diff --git a/netbeans.apache.org/src/content/tutorials/73/nbm-idioms.asciidoc b/netbeans.apache.org/src/content/tutorials/73/nbm-idioms.asciidoc deleted file mode 100644 index 34d3268898..0000000000 --- a/netbeans.apache.org/src/content/tutorials/73/nbm-idioms.asciidoc +++ /dev/null @@ -1,19 +0,0 @@ -// -// 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. -// - diff --git a/netbeans.apache.org/src/content/tutorials/74/nbm-idioms.asciidoc b/netbeans.apache.org/src/content/tutorials/74/nbm-idioms.asciidoc deleted file mode 100644 index 34d3268898..0000000000 --- a/netbeans.apache.org/src/content/tutorials/74/nbm-idioms.asciidoc +++ /dev/null @@ -1,19 +0,0 @@ -// -// 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. -// - diff --git a/netbeans.apache.org/src/content/tutorials/80/nbm-idioms.asciidoc b/netbeans.apache.org/src/content/tutorials/80/nbm-idioms.asciidoc deleted file mode 100644 index 34d3268898..0000000000 --- a/netbeans.apache.org/src/content/tutorials/80/nbm-idioms.asciidoc +++ /dev/null @@ -1,19 +0,0 @@ -// -// 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. -// - diff --git a/netbeans.apache.org/src/content/tutorials/nbm-copyfqn.asciidoc b/netbeans.apache.org/src/content/tutorials/nbm-copyfqn.asciidoc index 87575fd135..d468b426e1 100644 --- a/netbeans.apache.org/src/content/tutorials/nbm-copyfqn.asciidoc +++ b/netbeans.apache.org/src/content/tutorials/nbm-copyfqn.asciidoc @@ -207,14 +207,14 @@ In this section, we begin using one of the new "Retouche" APIs, called link:htt [start=1] 1. Fill out the ``actionPerformed`` method by adding the lines highlighted below: -[source,java] +[source,java,subs="macros,quotes"] ---- public void actionPerformed(ActionEvent ev) { *FileObject fileObject = context.getPrimaryFile(); -link:https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-java-source/org/netbeans/api/java/source/JavaSource.html[JavaSource] javaSource = link:https://bits.netbeans.org/dev/javadocorg-netbeans-modules-java-source/org/netbeans/api/java/source/JavaSource.html#forFileObject(org.openide.filesystems.FileObject)[JavaSource.forFileObject(fileObject)]; + link:https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-java-source/org/netbeans/api/java/source/JavaSource.html[JavaSource] javaSource = link:https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-java-source/org/netbeans/api/java/source/JavaSource.html#forFileObject-org.openide.filesystems.FileObject-[JavaSource.forFileObject(fileObject)]; if (javaSource == null) { StatusDisplayer.getDefault().setStatusText("Not a Java file: " + fileObject.getPath()); } else { @@ -257,10 +257,10 @@ In this section, we are introduced to our first explicitly invoked "Retouche" ta [start=1] 1. Replace the "Hurray!" message in the ``actionPerformed`` method with this line: link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-java-source/org/netbeans/api/java/source/JavaSource.html#runUserActionTask(org.netbeans.api.java.source.Task,%20boolean)[javaSource.runUserActionTask] -[source,java] +[source,java,subs="verbatim,macros,quotes"] ---- -(new link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-java-source/org/netbeans/api/java/source/Task.html[Task]< link:https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-java-source/org/netbeans/api/java/source/CompilationController.html[CompilationController]>()); +(new link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-java-source/org/netbeans/api/java/source/Task.html[Task]< link:https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-java-source/org/netbeans/api/java/source/CompilationController.html[CompilationController]>()); ---- You should now see a lightbulb in the editor's left sidebar, as shown here: @@ -279,7 +279,7 @@ Click the lightbulb in the editor. Alternatively, put the caret in the line and [start=2] 1. Tweak the generated method slightly, by adding a ``true`` boolean to the end of the method, and letting the IDE wrap the snippet in a try/catch block. At the end, the result should be as follows: -[source,java] +[source,java,subs="verbatim,quotes"] ---- public void actionPerformed(ActionEvent ev) { @@ -310,15 +310,15 @@ public void actionPerformed(ActionEvent ev) { [start=3] 1. Implement the ``run()`` method as follows: -[source,java] +[source,java,subs="macros"] ---- @Override public void run(CompilationController compilationController) throws Exception { -link:https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-java-source/org/netbeans/api/java/source/CompilationController.html#toPhase(org.netbeans.api.java.source.JavaSource.Phase)[compilationController.toPhase(Phase.ELEMENTS_RESOLVED)]; + link:https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-java-source/org/netbeans/api/java/source/CompilationController.html#toPhase(org.netbeans.api.java.source.JavaSource.Phase)[compilationController.toPhase(Phase.ELEMENTS_RESOLVED)]; -link:https://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/text/Document.html[Document] document = link:https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-java-source/org/netbeans/api/java/source/CompilationController.html#getDocument()[compilationController.getDocument()]; + link:https://docs.oracle.com/javase/1.5.0/docs/api/javax/swing/text/Document.html[Document] document = link:https://bits.netbeans.org/dev/javadoc/org-netbeans-modules-java-source/org/netbeans/api/java/source/CompilationController.html#getDocument()[compilationController.getDocument()]; if (document != null) { StatusDisplayer.getDefault().setStatusText("Hurray, the Java file is open!"); } else { @@ -370,7 +370,7 @@ In this section, now that we know that we are dealing with a Java file and that [start=2] 1. Replace the "Hurray!" message in the ``run()`` method with the lines highlighted below: -[source,java] +[source,java,subs="quotes"] ---- public void run(CompilationController compilationController) throws Exception { @@ -449,7 +449,7 @@ image::images/copyfqn_72_four1.png[] [start=5] 1. Next, instead of printing all the elements to the Output window, we will only print the element under the caret. Only replace the ``visitClass`` method, with the code highlighted below: -[source,java] +[source,java,subs="quotes"] ---- private class MemberVisitor extends TreePathScanner { @@ -509,7 +509,7 @@ image::images/copyfqn_72_four2.png[] [start=7] 1. But we can detect a lot more than just the name of the element under the caret. In the ``visitClass`` method, replace the lines in bold below: -[source,java] +[source,java,subs="quotes"] ---- @Override diff --git a/netbeans.apache.org/src/content/tutorials/nbm-crud.asciidoc b/netbeans.apache.org/src/content/tutorials/nbm-crud.asciidoc index b6fe23760f..60aaf7accf 100644 --- a/netbeans.apache.org/src/content/tutorials/nbm-crud.asciidoc +++ b/netbeans.apache.org/src/content/tutorials/nbm-crud.asciidoc @@ -417,7 +417,7 @@ public class CustomerChildFactory extends ChildFactory { [start=6] 1. Back in the ``CustomerViewerTopComponent`` , use the ``ExplorerManager`` to pass the result list from the JPA query in to the ``Node`` : -[source,java] +[source,java,subs="quotes"] ---- EntityManager entityManager = Persistence.createEntityManagerFactory("CustomerLibraryPU").createEntityManager(); @@ -500,7 +500,7 @@ In this section, you allow the user to show the currently selected Customer obje [start=1] 1. Start by tweaking the ``CustomerViewer`` module so that the current ``Customer`` object is added to the viewer window's ``Lookup`` whenever a new ``Node`` is selected. Do this by adding the current ``Customer`` object to the ``Lookup`` of the Node, as follows (note the parts in bold): -[source,java] +[source,java,subs="quotes"] ---- @Override @@ -744,7 +744,7 @@ When the ``handleSave`` method is invoked, the ``Savable`` is unregistered f NOTE: All the code below is an inner class within ``CustomerEditorTopComponent`` . -[source,java] +[source,java,subs="macros"] ---- private static final Icon ICON = ImageUtilities.loadImageIcon("org/shop/editor/Icon.png", true); @@ -1021,7 +1021,7 @@ public void resetFields() { [start=2] 1. In the `` link:http://bits.netbeans.org/dev/javadoc/org-openide-awt/org/netbeans/spi/actions/AbstractSavable.html[AbstractSavable]`` , ensure that a return of ``null`` indicates that a new entry is saved, instead of an existing entry being updated: -[source,java] +[source,java,subs="verbatim,quotes"] ---- @Override diff --git a/netbeans.apache.org/src/content/tutorials/nbm-emf.asciidoc b/netbeans.apache.org/src/content/tutorials/nbm-emf.asciidoc index 020fb53517..ebe8989b47 100644 --- a/netbeans.apache.org/src/content/tutorials/nbm-emf.asciidoc +++ b/netbeans.apache.org/src/content/tutorials/nbm-emf.asciidoc @@ -338,17 +338,17 @@ The other OSGi-related dependencies you see in the screenshot above were added b 1. Create a new Java class named `LibraryNode`, which provides a new Node for the Library object, as well as a new Node for the Book object and Borrower object: -[source,java] +[source,java,subs="verbatim,macros"] ---- -public class LibraryNode extends link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/AbstractNode.html[AbstractNode] { +public class LibraryNode extends link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/AbstractNode.html[AbstractNode] { public LibraryNode(Library library) { super(Children.create(new BookOrBorrowerChildFactory(library), true)); setDisplayName(library.getName()); } - private static class BookOrBorrowerChildFactory extends link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/ChildFactory.html[ChildFactory] { + private static class BookOrBorrowerChildFactory extends link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/ChildFactory.html[ChildFactory] { private final Library library; @@ -371,7 +371,7 @@ public class LibraryNode extends link:http://bits.netbeans.org/dev/javadoc/org- @Override protected Node createNodeForKey(Object key) { -link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/BeanNode.html[BeanNode] childNode = null; + link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/BeanNode.html[BeanNode] childNode = null; try { childNode = new BeanNode(key); if (key instanceof Book) { @@ -399,10 +399,10 @@ link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/Be 1. Create a new Java class named `LibraryChildFactory`, which is a factory class for creating new `LibraryNode`s: -[source,java] +[source,java,subs="verbatim,macros"] ---- -public class LibraryChildFactory extends link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/ChildFactory.html[ChildFactory] { +public class LibraryChildFactory extends link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/ChildFactory.html[ChildFactory] { @Override protected boolean createKeys(List list) { @@ -467,10 +467,10 @@ public class LibraryChildFactory extends link:http://bits.netbeans.org/dev/java 1. Create a new Java class named `LibraryViewer`, which provides the window where the `LibraryNode` will be displayed: -[source,java] +[source,java,subs="macros"] ---- -public class LibraryViewer extends link:http://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/TopComponent.html[TopComponent] implements link:http://bits.netbeans.org/dev/javadoc/org-openide-explorer/org/openide/explorer/ExplorerManager.Provider.html[ExplorerManager.Provider] { +public class LibraryViewer extends link:http://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/TopComponent.html[TopComponent] implements link:http://bits.netbeans.org/dev/javadoc/org-openide-explorer/org/openide/explorer/ExplorerManager.Provider.html[ExplorerManager.Provider] { private ExplorerManager em = new ExplorerManager(); @@ -480,7 +480,7 @@ public class LibraryViewer extends link:http://bits.netbeans.org/dev/javadoc/or //Set the layout of the window: setLayout(new BorderLayout()); //Create a new BeanTreeView: -link:http://bits.netbeans.org/dev/javadoc/org-openide-explorer/org/openide/explorer/view/BeanTreeView.html[BeanTreeView] btv = new BeanTreeView(); + link:http://bits.netbeans.org/dev/javadoc/org-openide-explorer/org/openide/explorer/view/BeanTreeView.html[BeanTreeView] btv = new BeanTreeView(); //Hide the root node: btv.setRootVisible(false); //Add the BeanTreeView: diff --git a/netbeans.apache.org/src/content/tutorials/nbm-feedreader.asciidoc b/netbeans.apache.org/src/content/tutorials/nbm-feedreader.asciidoc index 48c2e8de81..5f00c3e251 100644 --- a/netbeans.apache.org/src/content/tutorials/nbm-feedreader.asciidoc +++ b/netbeans.apache.org/src/content/tutorials/nbm-feedreader.asciidoc @@ -247,11 +247,12 @@ Press Ctrl-Shift-I to let the IDE generate the required import statement. [start=3] -1. Register the ``FeedTopComponent`` in the window system by adding annotations to the top of the class, as shown here, and then press Ctrl-Shift-I to let the IDE generate the appropriate import statements: link:http://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/TopComponent.Description.html[@TopComponent.Description] +1. Register the ``FeedTopComponent`` in the window system by adding annotations to the top of the class, as shown here, and then press Ctrl-Shift-I to let the IDE generate the appropriate import statements: -[source,java] +[source,java,subs="macros"] ---- +link:http://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/TopComponent.Description.html[@TopComponent.Description] ( preferredID = "FeedTopComponent", persistenceType = TopComponent.PERSISTENCE_ALWAYS) @@ -454,7 +455,7 @@ Take the following steps: [start=2] 1. Replace the default class with the following: -[source,java] +[source,java,subs="macros"] ---- package org.myorg.feedreader; @@ -466,7 +467,7 @@ import org.openide.nodes.FilterNode; import org.openide.nodes.Node; import org.openide.util.Utilities; -public class RootNode extends link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/FilterNode.html[FilterNode] { +public class RootNode extends link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/FilterNode.html[FilterNode] { public RootNode(Node filterNode) throws DataObjectNotFoundException { super(filterNode, new RssFolderChildren(filterNode)); @@ -499,7 +500,7 @@ To create this class, take the following steps: Replace the default class with the following: -[source,java] +[source,java,subs="macros"] ---- package org.myorg.feedreader; @@ -513,7 +514,7 @@ import org.openide.nodes.Node; import org.openide.util.Exceptions; import org.openide.util.Lookup; -public class RssFolderChildren extends link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/FilterNode.Children.html[FilterNode.Children] { +public class RssFolderChildren extends link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/FilterNode.Children.html[FilterNode.Children] { RssFolderChildren(Node rssFolderNode) { super(rssFolderNode); @@ -522,7 +523,7 @@ public class RssFolderChildren extends link:http://bits.netbeans.org/dev/javado @Override protected Node[] createNodes(Node n) { FileObject fo = n.getLookup().lookup(FileObject.class); - if (fo != null && fo.isFolder()) { + if (fo != null && fo.isFolder()) { try { return new Node[]{new RootNode(n)}; } catch (DataObjectNotFoundException ex) { @@ -578,7 +579,7 @@ Take the following steps to create this class: [start=2] 1. Replace the default class with the following: -[source,java] +[source,java,subs="macros"] ---- package org.myorg.feedreader; @@ -596,7 +597,7 @@ import org.openide.util.lookup.Lookups; /** * Getting the feed node and wrapping it in a FilterNode */ -public class OneFeedNode extends link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/FilterNode.html[FilterNode] { +public class OneFeedNode extends link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/FilterNode.html[FilterNode] { OneFeedNode(Node feedFileNode, SyndFeed feed) { super(feedFileNode, Children.create(new FeedChildFactory(feed), false), Lookups.fixed(feed)); @@ -643,7 +644,7 @@ To create this class, take the following steps: Replace the default class with the following: -[source,java] +[source,java,subs="macros"] ---- package org.myorg.feedreader; @@ -657,7 +658,7 @@ import org.openide.nodes.Node; import org.openide.util.Exceptions; import org.openide.util.NbCollections; -public class FeedChildFactory extends link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/ChildFactory.html[ChildFactory] { +public class FeedChildFactory extends link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/ChildFactory.html[ChildFactory] { private final SyndFeed feed; @@ -667,7 +668,7 @@ public class FeedChildFactory extends link:http://bits.netbeans.org/dev/javadoc @Override protected boolean createKeys(List list) { - list.addAll( link:http://bits.netbeans.org/dev/javadoc/org-openide-util/org/openide/util/NbCollections.html[NbCollections].checkedListByCopy(feed.getEntries(), SyndEntry.class, true)); + list.addAll(link:http://bits.netbeans.org/dev/javadoc/org-openide-util/org/openide/util/NbCollections.html[NbCollections].checkedListByCopy(feed.getEntries(), SyndEntry.class, true)); return true; } @@ -702,7 +703,7 @@ To create this class, take the following steps: [start=2] 1. Replace the default class with the following: -[source,java] +[source,java,subs="macros"] ---- package org.myorg.feedreader; @@ -722,7 +723,7 @@ import org.openide.util.actions.SystemAction; import org.openide.util.lookup.Lookups; import org.openide.windows.TopComponent; -class OneEntryNode extends link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/FilterNode.html[FilterNode] { +class OneEntryNode extends link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/FilterNode.html[FilterNode] { private final SyndEntry entry; @@ -900,7 +901,7 @@ To create this class, take the following steps: Replace the default class with the following: -[source,java] +[source,java,subs="macros"] ---- package org.myorg.feedreader; @@ -1014,7 +1015,7 @@ To create this class, take the following steps: Replace the default class with the following: -[source,java] +[source,java,subs="macros"] ---- package org.myorg.feedreader; diff --git a/netbeans.apache.org/src/content/tutorials/nbm-idioms.asciidoc b/netbeans.apache.org/src/content/tutorials/nbm-idioms.asciidoc deleted file mode 100644 index 34d3268898..0000000000 --- a/netbeans.apache.org/src/content/tutorials/nbm-idioms.asciidoc +++ /dev/null @@ -1,19 +0,0 @@ -// -// 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. -// - diff --git a/netbeans.apache.org/src/content/tutorials/nbm-javacc-parser.asciidoc b/netbeans.apache.org/src/content/tutorials/nbm-javacc-parser.asciidoc index 4e48227294..e02e1c3eaf 100644 --- a/netbeans.apache.org/src/content/tutorials/nbm-javacc-parser.asciidoc +++ b/netbeans.apache.org/src/content/tutorials/nbm-javacc-parser.asciidoc @@ -81,7 +81,7 @@ The class will still not compile because the implementing class ``Token`` does * We need to make sure that the classes that JavaCC will generate for us will be generated with the correct package statements. Add "package org.simplejava.jccparser;" to ``Java1.5.jj`` file after the "PARSER_BEGIN(JavaParser)" line: -[source,java] +[source,java,subs="quotes"] ---- PARSER_BEGIN(JavaParser) @@ -123,7 +123,7 @@ image::images/javacc_72_parser-4.png[] 1. The first NetBeans APIclass you need to implement is `` link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/Parser.html[org.netbeans.modules.parsing.spi.Parser]`` . Create a class named ``SJParser`` and define it as follows: -[source,java] +[source,java,subs="macros"] ---- package org.simplejava.parser; @@ -133,14 +133,14 @@ import java.io.StringReader; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.event.ChangeListener; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/api/Snapshot.html[org.netbeans.modules.parsing.api.Snapshot]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/api/Task.html[org.netbeans.modules.parsing.api.Task]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/Parser.html[org.netbeans.modules.parsing.spi.Parser]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/ParserResultTask.html[org.netbeans.modules.parsing.spi.Parser.Result]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/SourceModificationEvent.html[org.netbeans.modules.parsing.spi.SourceModificationEvent]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/api/Snapshot.html[org.netbeans.modules.parsing.api.Snapshot]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/api/Task.html[org.netbeans.modules.parsing.api.Task]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/Parser.html[org.netbeans.modules.parsing.spi.Parser]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/ParserResultTask.html[org.netbeans.modules.parsing.spi.Parser.Result]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/SourceModificationEvent.html[org.netbeans.modules.parsing.spi.SourceModificationEvent]; import org.simplejava.jccparser.JavaParser; -public class SJParser extends link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/Parser.html[Parser] { +public class SJParser extends link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/Parser.html[Parser] { private Snapshot snapshot; private JavaParser javaParser; @@ -257,7 +257,7 @@ Before working on the related code, we need to make some modifications to the ge * Change "ERROR_REPORTING = false;" to "ERROR_REPORTING = true;": -[source,java] +[source,java,subs="quotes"] ---- options { @@ -273,7 +273,7 @@ options { * Add "import java.util.*;" to your Java1.5.jj file: -[source,java] +[source,java,subs="quotes"] ---- PARSER_BEGIN(JavaParser) @@ -281,7 +281,7 @@ PARSER_BEGIN(JavaParser) package org.simplejava.jccparser; import java.io.*; -*import java.util.*;* +*import java.util.\*;* ---- @@ -305,13 +305,13 @@ void recover (ParseException ex, int recoveryPoint) { Token t; do { t = getNextToken (); - } while (t.kind != EOF && t.kind != recoveryPoint); + } while (t.kind != EOF && t.kind != recoveryPoint); } ---- * Catch ``ParseExceptions`` in ``CompilationUnit`` , ``FieldDeclaration`` , ``MethodDeclaration`` , and ``Statement`` : -[source,java] +[source,java,subs="quotes"] ---- final public void CompilationUnit() throws ParseException { @@ -380,7 +380,7 @@ final public void CompilationUnit() throws ParseException { ---- -[source,java] +[source,java,subs="quotes"] ---- final public void FieldDeclaration(int modifiers) throws ParseException { @@ -407,7 +407,7 @@ final public void FieldDeclaration(int modifiers) throws ParseException { ---- -[source,java] +[source,java,subs="quotes"] ---- final public void MethodDeclaration(int modifiers) throws ParseException { @@ -447,7 +447,7 @@ final public void MethodDeclaration(int modifiers) throws ParseException { ---- -[source,java] +[source,java,subs="quotes"] ---- final public void Statement() throws ParseException { @@ -563,7 +563,7 @@ The above steps are standard in the sense that they are common to all tasks impl 1. Create the ``SJSyntaxErrorHighlightingTask`` class: -[source,java] +[source,java,subs="macros"] ---- package org.simplejava.parser; @@ -573,21 +573,21 @@ import java.util.List; import javax.swing.text.BadLocationException; import javax.swing.text.Document; import javax.swing.text.StyledDocument; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/Parser.Result.html[org.netbeans.modules.parsing.spi.Parser.Result]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/ParserResultTask.html[org.netbeans.modules.parsing.spi.ParserResultTask]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/Scheduler.html[org.netbeans.modules.parsing.spi.Scheduler]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/SchedulerEvent.html[org.netbeans.modules.parsing.spi.SchedulerEvent]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-editor-hints/org/netbeans/spi/editor/hints/ErrorDescription.html[org.netbeans.spi.editor.hints.ErrorDescription]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-editor-hints/org/netbeans/spi/editor/hints/ErrorDescriptionFactory.html[org.netbeans.spi.editor.hints.ErrorDescriptionFactory]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-editor-hints/org/netbeans/spi/editor/hints/HintsController.html[org.netbeans.spi.editor.hints.HintsController]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-editor-hints/org/netbeans/spi/editor/hints/Severity.html[org.netbeans.spi.editor.hints.Severity]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/Parser.Result.html[org.netbeans.modules.parsing.spi.Parser.Result]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/ParserResultTask.html[org.netbeans.modules.parsing.spi.ParserResultTask]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/Scheduler.html[org.netbeans.modules.parsing.spi.Scheduler]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/SchedulerEvent.html[org.netbeans.modules.parsing.spi.SchedulerEvent]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-editor-hints/org/netbeans/spi/editor/hints/ErrorDescription.html[org.netbeans.spi.editor.hints.ErrorDescription]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-editor-hints/org/netbeans/spi/editor/hints/ErrorDescriptionFactory.html[org.netbeans.spi.editor.hints.ErrorDescriptionFactory]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-editor-hints/org/netbeans/spi/editor/hints/HintsController.html[org.netbeans.spi.editor.hints.HintsController]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-editor-hints/org/netbeans/spi/editor/hints/Severity.html[org.netbeans.spi.editor.hints.Severity]; import org.openide.text.NbDocument; import org.openide.util.Exceptions; import org.simplejava.jccparser.ParseException; import org.simplejava.jccparser.Token; import org.simplejava.parser.SJParser.SJParserResult; -public class SJSyntaxErrorHighlightingTask extends link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/ParserResultTask.html[ParserResultTask] { +public class SJSyntaxErrorHighlightingTask extends link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/ParserResultTask.html[ParserResultTask] { @Override public void run (Result result, SchedulerEvent event) { @@ -639,7 +639,7 @@ public class SJSyntaxErrorHighlightingTask extends link:http://bits.netbeans.or 1. Create the ``SJSyntaxErrorHighlightingTaskFactory`` class in the ``org.simplejava.parser`` package: -[source,java] +[source,java,subs="macros"] ---- package org.simplejava.parser; @@ -647,11 +647,11 @@ package org.simplejava.parser; import java.util.Collection; import java.util.Collections; import org.netbeans.api.editor.mimelookup.MimeRegistration; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/api/Snapshot.html[org.netbeans.modules.parsing.api.Snapshot]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/TaskFactory.html[org.netbeans.modules.parsing.spi.TaskFactory]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/api/Snapshot.html[org.netbeans.modules.parsing.api.Snapshot]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/TaskFactory.html[org.netbeans.modules.parsing.spi.TaskFactory]; @MimeRegistration(mimeType="text/x-sj",service=TaskFactory.class) -public class SJSyntaxErrorHighlightingTaskFactory extends link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/TaskFactory.html[TaskFactory] { +public class SJSyntaxErrorHighlightingTaskFactory extends link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-parsing-api/org/netbeans/modules/parsing/spi/TaskFactory.html[TaskFactory] { @Override public Collection create (Snapshot snapshot) { @@ -682,18 +682,18 @@ Next, we'll create the skeleton of an indentation task for our language. Create a new `` link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/IndentTask.html[IndentTask]`` : -[source,java] +[source,java,subs="macros"] ---- package org.simplejava.parser; import javax.swing.text.BadLocationException; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/Context.html[org.netbeans.modules.editor.indent.spi.Context]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/ExtraLock.html[org.netbeans.modules.editor.indent.spi.ExtraLock]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/IndentTask.html[org.netbeans.modules.editor.indent.spi.IndentTask]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/Context.html[org.netbeans.modules.editor.indent.spi.Context]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/ExtraLock.html[org.netbeans.modules.editor.indent.spi.ExtraLock]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/IndentTask.html[org.netbeans.modules.editor.indent.spi.IndentTask]; import org.openide.awt.StatusDisplayer; -public class SJIndentTask implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/IndentTask.html[IndentTask] { +public class SJIndentTask implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/IndentTask.html[IndentTask] { private Context context; @@ -721,17 +721,17 @@ NOTE: The indent task will make a callback to the ``reindent()`` method when 1. Create a new `` link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/IndentTask.Factory.html[IndentTask.Factory]`` : -[source,java] +[source,java,subs="macros"] ---- package org.simplejava.parser; import org.netbeans.api.editor.mimelookup.MimeRegistration; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/Context.html[org.netbeans.modules.editor.indent.spi.Context]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/IndentTask.html[org.netbeans.modules.editor.indent.spi.IndentTask]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/Context.html[org.netbeans.modules.editor.indent.spi.Context]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/IndentTask.html[org.netbeans.modules.editor.indent.spi.IndentTask]; @MimeRegistration(mimeType="text/x-sj",service=IndentTask.Factory.class) -public class SJIndentTaskFactory implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/IndentTask.Factory.html[IndentTask.Factory] { +public class SJIndentTaskFactory implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/IndentTask.Factory.html[IndentTask.Factory] { @Override public IndentTask createTask(Context context) { @@ -757,18 +757,18 @@ Next, we'll create the skeleton of a reformat task for our language. Create a new `` link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/ReformatTask.html[ReformatTask]`` : -[source,java] +[source,java,subs="macros"] ---- package org.simplejava.parser; import javax.swing.text.BadLocationException; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/Context.html[org.netbeans.modules.editor.indent.spi.Context]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/ExtraLock.html[org.netbeans.modules.editor.indent.spi.ExtraLock]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/ReformatTask.html[org.netbeans.modules.editor.indent.spi.ReformatTask]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/Context.html[org.netbeans.modules.editor.indent.spi.Context]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/ExtraLock.html[org.netbeans.modules.editor.indent.spi.ExtraLock]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/ReformatTask.html[org.netbeans.modules.editor.indent.spi.ReformatTask]; import org.openide.awt.StatusDisplayer; -public class SJReformatTask implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/ReformatTask.html[ReformatTask] { +public class SJReformatTask implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/ReformatTask.html[ReformatTask] { private Context context; @@ -796,17 +796,17 @@ NOTE: The reformat task will make a callback to the ``reformat()`` method whe 1. Create a new `` link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/ReformatTask.Factory.html[ReformatTask.Factory]`` : -[source,java] +[source,java,subs="macros"] ---- package org.simplejava.parser; import org.netbeans.api.editor.mimelookup.MimeRegistration; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/Context.html[org.netbeans.modules.editor.indent.spi.Context]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/ReformatTask.Factory.html[org.netbeans.modules.editor.indent.spi.ReformatTask]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/Context.html[org.netbeans.modules.editor.indent.spi.Context]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/ReformatTask.Factory.html[org.netbeans.modules.editor.indent.spi.ReformatTask]; @MimeRegistration(mimeType="text/x-sj",service=ReformatTask.Factory.class) -public class SJReformatTaskFactory implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/ReformatTask.Factory.html[ReformatTask.Factory] { +public class SJReformatTaskFactory implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-indent/org/netbeans/modules/editor/indent/spi/ReformatTask.Factory.html[ReformatTask.Factory] { @Override public ReformatTask createTask(Context context) { @@ -844,19 +844,19 @@ image::images/javacc_72_add-brace-2.png[] Create a new `` link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-bracesmatching/org/netbeans/spi/editor/bracesmatching/BracesMatcherFactory.html[BracesMatcherFactory]`` : -[source,java] +[source,java,subs="macros"] ---- package org.simplejava.parser; import org.netbeans.api.editor.mimelookup.MimeRegistration; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-bracesmatching/org/netbeans/spi/editor/bracesmatching/BracesMatcher.html[org.netbeans.spi.editor.bracesmatching.BracesMatcher]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-bracesmatching/org/netbeans/spi/editor/bracesmatching/BracesMatcherFactory.html[org.netbeans.spi.editor.bracesmatching.BracesMatcherFactory]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-bracesmatching/org/netbeans/spi/editor/bracesmatching/MatcherContext.html[org.netbeans.spi.editor.bracesmatching.MatcherContext]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-bracesmatching/org/netbeans/spi/editor/bracesmatching/support/BracesMatcherSupport.html[org.netbeans.spi.editor.bracesmatching.support.BracesMatcherSupport]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-bracesmatching/org/netbeans/spi/editor/bracesmatching/BracesMatcher.html[org.netbeans.spi.editor.bracesmatching.BracesMatcher]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-bracesmatching/org/netbeans/spi/editor/bracesmatching/BracesMatcherFactory.html[org.netbeans.spi.editor.bracesmatching.BracesMatcherFactory]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-bracesmatching/org/netbeans/spi/editor/bracesmatching/MatcherContext.html[org.netbeans.spi.editor.bracesmatching.MatcherContext]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-bracesmatching/org/netbeans/spi/editor/bracesmatching/support/BracesMatcherSupport.html[org.netbeans.spi.editor.bracesmatching.support.BracesMatcherSupport]; @MimeRegistration(mimeType="text/x-sj",service=BracesMatcherFactory.class) -public class SJBracesMatcherFactory implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-bracesmatching/org/netbeans/spi/editor/bracesmatching/BracesMatcherFactory.html[BracesMatcherFactory] { +public class SJBracesMatcherFactory implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-bracesmatching/org/netbeans/spi/editor/bracesmatching/BracesMatcherFactory.html[BracesMatcherFactory] { @Override public BracesMatcher createMatcher(MatcherContext context) { @@ -894,7 +894,7 @@ image::images/javacc_72_add-fold-2.png[] Create a new `` link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-fold/org/netbeans/spi/editor/fold/FoldManager.html[FoldManager]`` : -[source,java] +[source,java,subs="verbatim,macros"] ---- package org.simplejava.parser; @@ -908,13 +908,13 @@ import org.netbeans.api.editor.fold.FoldType; import org.netbeans.api.lexer.Token; import org.netbeans.api.lexer.TokenHierarchy; import org.netbeans.api.lexer.TokenSequence; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-fold/org/netbeans/spi/editor/fold/FoldHierarchyTransaction.html[org.netbeans.spi.editor.fold.FoldHierarchyTransaction]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-fold/org/netbeans/spi/editor/fold/FoldHierarchyTransaction.html[org.netbeans.spi.editor.fold.FoldHierarchyTransaction]; import org.netbeans.spi.editor.fold.FoldManager; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-fold/org/netbeans/spi/editor/fold/FoldOperation.html[org.netbeans.spi.editor.fold.FoldOperation]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-fold/org/netbeans/spi/editor/fold/FoldOperation.html[org.netbeans.spi.editor.fold.FoldOperation]; import org.openide.util.Exceptions; import org.simplejava.lexer.SJTokenId; -public class SJFoldManager implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-fold/org/netbeans/spi/editor/fold/FoldManager.html[FoldManager] { +public class SJFoldManager implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-fold/org/netbeans/spi/editor/fold/FoldManager.html[FoldManager] { private FoldOperation operation; public static final FoldType COMMENT_FOLD_TYPE = new FoldType("/*...*/"); @@ -937,7 +937,7 @@ public class SJFoldManager implements link:http://bits.netbeans.org/dev/javadoc offset = ts.offset(); Token token = ts.token(); SJTokenId id = token.id(); - if (id.name().equals("FORMAL_COMMENT") && type == null) { + if (id.name().equals("FORMAL_COMMENT") && type == null) { type = COMMENT_FOLD_TYPE; start = offset; try { @@ -994,7 +994,7 @@ public class SJFoldManager implements link:http://bits.netbeans.org/dev/javadoc 1. Create a new `` link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-fold/org/netbeans/spi/editor/fold/FoldManagerFactory.html[FoldManagerFactory]`` : -[source,java] +[source,java,subs="macros"] ---- package org.simplejava.parser; @@ -1004,7 +1004,7 @@ link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-fold/org/n link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-fold/org/netbeans/spi/editor/fold/FoldManagerFactory.html[import org.netbeans.spi.editor.fold.FoldManagerFactory]; @MimeRegistration(mimeType="text/x-sj",service=FoldManagerFactory.class) -public class SJFoldManagerFactory implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-fold/org/netbeans/spi/editor/fold/FoldManagerFactory.html[FoldManagerFactory] { +public class SJFoldManagerFactory implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-fold/org/netbeans/spi/editor/fold/FoldManagerFactory.html[FoldManagerFactory] { @Override public FoldManager createFoldManager() { diff --git a/netbeans.apache.org/src/content/tutorials/nbm-javafx.asciidoc b/netbeans.apache.org/src/content/tutorials/nbm-javafx.asciidoc index a5890eeaca..e6f0737c0d 100644 --- a/netbeans.apache.org/src/content/tutorials/nbm-javafx.asciidoc +++ b/netbeans.apache.org/src/content/tutorials/nbm-javafx.asciidoc @@ -233,7 +233,7 @@ In this section, you move the useful parts of the Swing Interop sample into your [start=5] 1. Change the constructor of the ``TopComponent`` to set the layout and to call the ``init`` metod, as follows, that is, by adding the two highlighted lines below: -[source,java] +[source,java,subs="quotes"] ---- public CoreTopComponent() { @@ -368,7 +368,7 @@ public void init() { } ---- - `` link:http://docs.oracle.com/javafx/2/api/javafx/application/Platform.html[Platform.setImplicitExit]`` sets the implicitExit attribute to the specified value. If this attribute is true, the JavaFX runtime will implicitly shutdown when the last window is closed; the JavaFX launcher will call the Application.stop() method and terminate the JavaFX application thread. If this attribute is false, the application will continue to run normally even after the last window is closed, until the application calls exit(). The default value is true. +`` link:http://docs.oracle.com/javafx/2/api/javafx/application/Platform.html[Platform.setImplicitExit]`` sets the implicitExit attribute to the specified value. If this attribute is true, the JavaFX runtime will implicitly shutdown when the last window is closed; the JavaFX launcher will call the Application.stop() method and terminate the JavaFX application thread. If this attribute is false, the application will continue to run normally even after the last window is closed, until the application calls exit(). The default value is true. Notice how modulerizing the code is little more than refactoring. And, in the end, you have code that is much clearer than it was in the beginning. diff --git a/netbeans.apache.org/src/content/tutorials/nbm-mark-occurrences.asciidoc b/netbeans.apache.org/src/content/tutorials/nbm-mark-occurrences.asciidoc index 66c010c595..cc4e2251a5 100644 --- a/netbeans.apache.org/src/content/tutorials/nbm-mark-occurrences.asciidoc +++ b/netbeans.apache.org/src/content/tutorials/nbm-mark-occurrences.asciidoc @@ -136,21 +136,21 @@ To use the Highlighting SPI to create the palette in this tutorial, take the fol [start=2] 1. Replace the default content of the ``MarkHTMLOccurrencesHighlightsLayerFactory.java`` file with the following: -[source,java] +[source,java,subs="macros"] ---- import javax.swing.text.Document; import org.netbeans.api.editor.mimelookup.MimeRegistration; import org.netbeans.api.editor.mimelookup.MimeRegistrations; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-lib2/org/netbeans/spi/editor/highlighting/HighlightsLayer.html[org.netbeans.spi.editor.highlighting.HighlightsLayer]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-lib2/org/netbeans/spi/editor/highlighting/HighlightsLayerFactory.html[org.netbeans.spi.editor.highlighting.HighlightsLayerFactory]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-lib2/org/netbeans/spi/editor/highlighting/ZOrder.html[org.netbeans.spi.editor.highlighting.ZOrder]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-lib2/org/netbeans/spi/editor/highlighting/HighlightsLayer.html[org.netbeans.spi.editor.highlighting.HighlightsLayer]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-lib2/org/netbeans/spi/editor/highlighting/HighlightsLayerFactory.html[org.netbeans.spi.editor.highlighting.HighlightsLayerFactory]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-lib2/org/netbeans/spi/editor/highlighting/ZOrder.html[org.netbeans.spi.editor.highlighting.ZOrder]; @MimeRegistrations({ @MimeRegistration(mimeType = "text/html", service = HighlightsLayerFactory.class), @MimeRegistration(mimeType = "text/xml", service = HighlightsLayerFactory.class) }) -public class MarkHTMLOccurrencesHighlightsLayerFactory implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-lib2/org/netbeans/spi/editor/highlighting/HighlightsLayerFactory.html[HighlightsLayerFactory] { +public class MarkHTMLOccurrencesHighlightsLayerFactory implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-lib2/org/netbeans/spi/editor/highlighting/HighlightsLayerFactory.html[HighlightsLayerFactory] { public static MarkHTMLOccurrencesHighlighter getMarkOccurrencesHighlighter(Document doc) { MarkHTMLOccurrencesHighlighter highlighter = @@ -163,7 +163,7 @@ public class MarkHTMLOccurrencesHighlightsLayerFactory implements link:http://b } @Override - public HighlightsLayer[] link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-lib2/org/netbeans/spi/editor/highlighting/HighlightsLayerFactory.html#createLayers(org.netbeans.spi.editor.highlighting.HighlightsLayerFactory.Context)[createLayers]( link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-lib2/org/netbeans/spi/editor/highlighting/HighlightsLayerFactory.Context.html[Context] context) { + public HighlightsLayer[] link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-lib2/org/netbeans/spi/editor/highlighting/HighlightsLayerFactory.html#createLayers(org.netbeans.spi.editor.highlighting.HighlightsLayerFactory.Context)[createLayers]( link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-lib2/org/netbeans/spi/editor/highlighting/HighlightsLayerFactory.Context.html[Context] context) { return new HighlightsLayer[]{ link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-lib2/org/netbeans/spi/editor/highlighting/HighlightsLayer.html#create(java.lang.String,%20org.netbeans.spi.editor.highlighting.ZOrder,%20boolean,%20org.netbeans.spi.editor.highlighting.HighlightsContainer)[HighlightsLayer.create]( MarkHTMLOccurrencesHighlighter.class.getName(), @@ -184,7 +184,7 @@ Several statements remain underlined in red because they refer to the "MarkHTMLO In this section, we create the highlight layer. Create a new Java class named ``MarkHTMLOccurrencesHighlighter`` , with the content below. -[source,java] +[source,java,subs="macros"] ---- import java.awt.Color; @@ -198,12 +198,12 @@ import javax.swing.text.AttributeSet; import javax.swing.text.Document; import javax.swing.text.JTextComponent; import javax.swing.text.StyleConstants; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-settings/org/netbeans/api/editor/settings/AttributesUtilities.html[org.netbeans.api.editor.settings.AttributesUtilities]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor/org/netbeans/modules/editor/NbEditorUtilities.html[org.netbeans.modules.editor.NbEditorUtilities]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-lib2/org/netbeans/spi/editor/highlighting/support/OffsetsBag.html[org.netbeans.spi.editor.highlighting.support.OffsetsBag]; -import link:http://bits.netbeans.org/dev/javadoc/org-openide-text/org/openide/cookies/EditorCookie.html[org.openide.cookies.EditorCookie]; -import link:http://bits.netbeans.org/dev/javadoc/org-openide-loaders/org/openide/loaders/DataObject.html[org.openide.loaders.DataObject]; -import link:http://bits.netbeans.org/dev/javadoc/org-openide-util/org/openide/util/RequestProcessor.html[org.openide.util.RequestProcessor]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-settings/org/netbeans/api/editor/settings/AttributesUtilities.html[org.netbeans.api.editor.settings.AttributesUtilities]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor/org/netbeans/modules/editor/NbEditorUtilities.html[org.netbeans.modules.editor.NbEditorUtilities]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-lib2/org/netbeans/spi/editor/highlighting/support/OffsetsBag.html[org.netbeans.spi.editor.highlighting.support.OffsetsBag]; +import link:http://bits.netbeans.org/dev/javadoc/org-openide-text/org/openide/cookies/EditorCookie.html[org.openide.cookies.EditorCookie]; +import link:http://bits.netbeans.org/dev/javadoc/org-openide-loaders/org/openide/loaders/DataObject.html[org.openide.loaders.DataObject]; +import link:http://bits.netbeans.org/dev/javadoc/org-openide-util/org/openide/util/RequestProcessor.html[org.openide.util.RequestProcessor]; public class MarkHTMLOccurrencesHighlighter implements CaretListener { diff --git a/netbeans.apache.org/src/content/tutorials/nbm-nodesapi3.asciidoc b/netbeans.apache.org/src/content/tutorials/nbm-nodesapi3.asciidoc index 76870a46d2..6c3b28b4fa 100644 --- a/netbeans.apache.org/src/content/tutorials/nbm-nodesapi3.asciidoc +++ b/netbeans.apache.org/src/content/tutorials/nbm-nodesapi3.asciidoc @@ -105,10 +105,10 @@ In this section, we use wizards to create a module project and a custom window c [start=8] 1. Open the Inspector, if it isn't open. (Use the Window menu.) In the Inspector, select the ``moviePane`` , open the Properties window (Ctrl-Shift-7), click the "Code" tab, and add this line to the Custom Creation Code property (the very last property in the list): -[source,java] +[source,java,subs="macros"] ---- -new link:https://bits.netbeans.org/dev/javadoc/org-openide-explorer/org/openide/explorer/view/BeanTreeView.html[BeanTreeView()]; +new link:https://bits.netbeans.org/dev/javadoc/org-openide-explorer/org/openide/explorer/view/BeanTreeView.html[BeanTreeView()]; ---- Click OK. @@ -167,11 +167,11 @@ public ExplorerManager getExplorerManager() { [start=4] -1. Now go to the Constructor and add the following after the last existing line: link:https://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/TopComponent.html#associateLookup(org.openide.util.Lookup)[associateLookup] +1. Now go to the Constructor and add the following after the last existing line: -[source,java] +[source,java,subs="macros"] ---- - +link:https://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/TopComponent.html#associateLookup(org.openide.util.Lookup)[associateLookup] ( link:https://bits.netbeans.org/dev/javadocorg-openide-explorer/org/openide/explorer/ExplorerUtils.html[ExplorerUtils]. link:https://bits.netbeans.org/dev/javadocorg-openide-explorer/org/openide/explorer/ExplorerUtils.html#createLookup(org.openide.explorer.ExplorerManager,%20javax.swing.ActionMap)[createLookup(explorerManager, getActionMap())]); explorerManager.setRootContext(new link:https://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/AbstractNode.html[AbstractNode(new CategoryChildren())]); explorerManager.getRootContext().setDisplayName("Marilyn Monroe's Movies"); @@ -220,7 +220,7 @@ From the above, you can see that a category has a name, and nothing more. [start=2] 1. Create another class, this time for creating the nodes for the categories: -[source,java] +[source,java,subs="macros"] ---- public class CategoryChildren extends link:https://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/Children.Keys.html[Children.Keys] { @@ -256,7 +256,7 @@ public class CategoryChildren extends link:https://bits.netbeans.org/dev/javado In this example, a popular children implementation called ``Children.Keys`` is used. By subclassing ``Children.Keys`` , you need not explicitly keep track of the nodes. Instead, you keep track of a set of keys, which are lighter weight objects. Each key typically represents one node. You must tell the implementation how to create a node for each key. You can decide for yourself what type of keys to use. - ``addNotify()`` is called the first time that a list of nodes is needed. An example of this is when a node is expanded. Here, when ``addNotify()`` is called, a new category is instantiated. When a child node needs to be constructed, the ``createNodes()`` method is called. It is passed the key for which it is making a node. It returns either none, one, or more nodes corresponding to what should be displayed for the key. In this example, a new instance of one category node is being created, and the key is passed into its constructor. +``addNotify()`` is called the first time that a list of nodes is needed. An example of this is when a node is expanded. Here, when ``addNotify()`` is called, a new category is instantiated. When a child node needs to be constructed, the ``createNodes()`` method is called. It is passed the key for which it is making a node. It returns either none, one, or more nodes corresponding to what should be displayed for the key. In this example, a new instance of one category node is being created, and the key is passed into its constructor. [start=3] @@ -268,16 +268,16 @@ Note that in the code above, we create a node called ``CategoryNode`` . We will [start=4] 1. Create a class called ``CategoryNode.java`` and define it as follows: -[source,java] +[source,java,subs="macros"] ---- -public class CategoryNode extends link:https://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/AbstractNode.html[AbstractNode] { +public class CategoryNode extends link:https://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/AbstractNode.html[AbstractNode] { /** Creates a new instance of CategoryNode */ public CategoryNode( Category category ) { super( new MovieChildren(category), Lookups.singleton(category) ); -link:https://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/Node.html#setDisplayName(java.lang.String)[setDisplayName(category.getName())]; -link:https://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/Node.html#setDisplayName(java.lang.String)[setIconBaseWithExtension("org/netbeans/myfirstexplorer/marilyn_category.gif")]; + link:https://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/Node.html#setDisplayName(java.lang.String)[setDisplayName(category.getName())]; + link:https://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/Node.html#setDisplayName(java.lang.String)[setIconBaseWithExtension("org/netbeans/myfirstexplorer/marilyn_category.gif")]; } public PasteType link:https://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/AbstractNode.html#getDropType(java.awt.datatransfer.Transferable,%20int,%20int)[getDropType(Transferable t, final int action, int index)] { @@ -285,11 +285,11 @@ link:https://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/N DnDConstants.ACTION_COPY_OR_MOVE+NodeTransfer.CLIPBOARD_CUT ); if( null != dropNode ) { final Movie movie = (Movie)dropNode.getLookup().lookup( Movie.class ); - if( null != movie && !this.equals( dropNode.getParentNode() )) { + if( null != movie && !this.equals( dropNode.getParentNode() )) { return new PasteType() { public Transferable paste() throws IOException { getChildren().add( new Node[] { new MovieNode(movie) } ); - if( (action & DnDConstants.ACTION_MOVE) != 0 ) { + if( (action & DnDConstants.ACTION_MOVE) != 0 ) { dropNode.getParentNode().getChildren().remove( new Node[] {dropNode} ); } return null; @@ -391,10 +391,10 @@ From the above, you can see that a movie has a number, belongs to a category, an [start=2] 1. Now let's create the category's children. The class to be created is called ``MovieChildren.java`` . We use link:https://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/Index.ArrayChildren.html[Index.ArrayChildren], so that we can put the nodes in an array list, which is loaded as needed. Until a child node is needed, such as when the parent node is expanded, it is not created. This is the content of the class: -[source,java] +[source,java,subs="macros"] ---- -public class MovieChildren extends link:https://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/Index.ArrayChildren.html[Index.ArrayChildren] { +public class MovieChildren extends link:https://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/Index.ArrayChildren.html[Index.ArrayChildren] { private Category category; @@ -415,9 +415,9 @@ public class MovieChildren extends link:https://bits.netbeans.org/dev/javadoc/ this.category = Category; } - protected java.util.List link:https://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/Index.ArrayChildren.html#initCollection()[initCollection()] { + protected java.util.List link:https://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/Index.ArrayChildren.html#initCollection()[initCollection()] { ArrayList childrenNodes = new ArrayList( items.length ); - for( int i=0; i @@ -447,11 +448,11 @@ image::images/codesnippet_71_result.png[] Optionally, you can let a ``JPanel`` appear when the palette item is dropped. In the ``JPanel`` , you can let the user define values for attributes that relate to the snippet that is about to be created. However, note that adding such a customizer is optional. In the case of a line break, which is what we are creating in this tutorial, there are no attributes that relate to the BR tag. For that reason, to illustrate the customizer functionality, we will add a comment before the BR tag, by means of a customizer. -NOTE: If you check out the `` link:https://github.com/apache/netbeans/bdb88f1fa043/html[html]`` module from the link:https://github.com/apache/netbeans/[NetBeans sources], you will find many examples of customizers in the `` link:https://github.com/apache/netbeans/tree/master/ide/html/src/org/netbeans/modules/html/palette/items[org/netbeans/modules/html/palette/items]`` package. +NOTE: If you check out the `` link:https://github.com/apache/netbeans/bdb88f1fa043/html[html]`` module from the link:https://github.com/apache/netbeans/[NetBeans sources], you will find many examples of customizers in the `` link:https://github.com/apache/netbeans/tree/master/ide/html/src/org/netbeans/modules/html/palette/items[org/netbeans/modules/html/palette/items]`` package. [start=1] -1. Add a dependency on the NetBeans `` link:http://bits.netbeans.org/dev/javadoc/org-openide-dialogs/overview-summary.html[Dialogs API]`` and the link:http://bits.netbeans.org/dev/javadoc/org-openide-awt/overview-summary.html[ ``UI Utilities API`` ]. +1. Add a dependency on the NetBeans `` link:http://bits.netbeans.org/dev/javadoc/org-openide-dialogs/overview-summary.html[Dialogs API]`` and the link:http://bits.netbeans.org/dev/javadoc/org-openide-awt/overview-summary.html[ ``UI Utilities API`` ]. [start=2] 1. @@ -468,7 +469,7 @@ image::images/codesnippet_customizer-in-palette-60.png[] [start=4] 1. You will need to declare the following at the top of the ``BRCustomizer`` class: -[source,java] +[source,java,subs="macros"] ---- private Dialog dialog = null; @@ -483,7 +484,7 @@ private JTextComponent target; [start=5] 1. Rewrite the ``BRCustomizer`` constructor as follows: -[source,java] +[source,java,subs="macros"] ---- public BRCustomizer(BR br, JTextComponent target) { @@ -498,7 +499,7 @@ public BRCustomizer(BR br, JTextComponent target) { [start=6] 1. In your ``BRCustomizer`` class, add this method, so that, in the next steps, you can open the customizer from your ``ActiveEditorDrop`` implementation class: -[source,java] +[source,java,subs="macros"] ---- @NbBundle.Messages({ @@ -528,7 +529,7 @@ public boolean showDialog() { [start=7] 1. Define the ``evaluateInput()`` method, which is called in the ``showDialog()`` method above, as follows: -[source,java] +[source,java,subs="macros"] ---- private void evaluateInput() { @@ -541,7 +542,7 @@ private void evaluateInput() { [start=8] 1. Hook your customizer into the ``ActiveEditorDrop`` implementation class as follows (only the lines that are changed are highlighted below): -[source,java] +[source,java,subs="verbatim,macros,quotes"] ---- package org.netbeans.modules.newsnippets2; @@ -549,9 +550,9 @@ package org.netbeans.modules.newsnippets2; import javax.swing.text.BadLocationException; import javax.swing.text.JTextComponent; import org.netbeans.modules.newsnippets2.HTMLPaletteUtilities; -import link:https://bits.netbeans.org/dev/javadoc/org-openide-text/org/openide/text/ActiveEditorDrop.html[org.openide.text.ActiveEditorDrop]; +import link:https://bits.netbeans.org/dev/javadoc/org-openide-text/org/openide/text/ActiveEditorDrop.html[org.openide.text.ActiveEditorDrop]; -public class BR implements link:https://bits.netbeans.org/dev/javadoc/org-openide-text/org/openide/text/ActiveEditorDrop.html[ActiveEditorDrop] { +public class BR implements link:https://bits.netbeans.org/dev/javadoc/org-openide-text/org/openide/text/ActiveEditorDrop.html[ActiveEditorDrop] { *private String comment = "";* @@ -566,7 +567,7 @@ public class BR implements link:https://bits.netbeans.org/dev/javadoc/org-openi } @Override - public boolean link:https://bits.netbeans.org/dev/javadoc/org-openide-text/org/openide/text/ActiveEditorDrop.html#handleTransfer(javax.swing.text.JTextComponent)[handleTransfer(JTextComponent targetComponent]) { + public boolean link:https://bits.netbeans.org/dev/javadoc/org-openide-text/org/openide/text/ActiveEditorDrop.html#handleTransfer(javax.swing.text.JTextComponent)[handleTransfer(JTextComponent targetComponent]) { *BRCustomizer c = new BRCustomizer(this, targetComponent); boolean accept = c.showDialog(); @@ -602,5 +603,5 @@ link:http://netbeans.apache.org/community/mailing-lists.html[Send Us Your Feedba For more information about creating and developing NetBeans modules, see the following resources: -* link:https://netbeans.apache.org/kb/docs/platform.html[Other Related Tutorials] -* link:http://bits.netbeans.org/dev/javadoc/index.html[NetBeans API Javadoc] +* link:https://netbeans.apache.org/kb/docs/platform.html[Other Related Tutorials] +* link:http://bits.netbeans.org/dev/javadoc/index.html[NetBeans API Javadoc] diff --git a/netbeans.apache.org/src/content/tutorials/nbm-palette-api2.asciidoc b/netbeans.apache.org/src/content/tutorials/nbm-palette-api2.asciidoc index 221fbc1059..0476037e07 100644 --- a/netbeans.apache.org/src/content/tutorials/nbm-palette-api2.asciidoc +++ b/netbeans.apache.org/src/content/tutorials/nbm-palette-api2.asciidoc @@ -32,22 +32,15 @@ This tutorial demonstrates how to create a component palette that provides drag-and-drop code snippets for a new file type. Code snippets serve to speed up coding. The IDE provides a component palette for JSP files, HTML files, and Form files. In this tutorial, you learn how to create a component palette for Java source files. -NOTE: If you are using an earlier version of Apache NetBeans, see link:74/nbm-palette-api2.html[the previous version of this document]. - - - - - - - -For troubleshooting purposes, you are welcome to download the link:http://web.archive.org/web/20170409072842/http://java.net/projects/nb-api-samples/show/versions/8.0/tutorials/palette[completed tutorial source code]. +NOTE: If you are using an earlier version of Apache NetBeans, see link:74/nbm-palette-api2.html[the previous version of this document]. +For troubleshooting purposes, you are welcome to download the link:http://web.archive.org/web/20170409072842/http://java.net/projects/nb-api-samples/show/versions/8.0/tutorials/palette[completed tutorial source code]. == Introduction to Component Palettes -In this tutorial, you implement several classes provided by the link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/overview-summary.html[NetBeans Palette API]. Then you register the new component palette in the ``layer.xml`` file, for the ``text/x-java`` MIME type. The palette that you create in this way will only be visible if a Java source file is open. +In this tutorial, you implement several classes provided by the link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/overview-summary.html[NetBeans Palette API]. Then you register the new component palette in the ``layer.xml`` file, for the ``text/x-java`` MIME type. The palette that you create in this way will only be visible if a Java source file is open. -If you do not want to create a new component palette, but only want to add a code snippet to an existing component palette, see the link:nbm-palette-api1.html[NetBeans Code Snippet Module Tutorial]. +If you do not want to create a new component palette, but only want to add a code snippet to an existing component palette, see the link:nbm-palette-api1.html[NetBeans Code Snippet Module Tutorial]. == Setting up the Module Project @@ -72,7 +65,7 @@ The IDE creates the ``JavaSourceFilePalette`` project. The project contains al === Specifying the Module's Dependencies -You will need to subclass several classes that belong to link:http://bits.netbeans.org/dev/javadoc/index.html[NetBeans APIs]. Each has to be declared as a module dependency. Use the Project Properties dialog box for this purpose, as described below. +You will need to subclass several classes that belong to link:http://bits.netbeans.org/dev/javadoc/index.html[NetBeans APIs]. Each has to be declared as a module dependency. Use the Project Properties dialog box for this purpose, as described below. [start=1] @@ -100,7 +93,7 @@ For each of the following APIs, click "Add...", select the name from the Module === Integrating with the Component Palette -Component Palettes are defined by the link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/overview-summary.html[NetBeans Component Palette API]. The NetBeans Component Palette API consists of the following APIs: +Component Palettes are defined by the link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/overview-summary.html[NetBeans Component Palette API]. The NetBeans Component Palette API consists of the following APIs: |=== |*File* |*Description* @@ -124,18 +117,18 @@ To use the Palette API to create the palette in this tutorial, take the followin [start=2] 1. Replace the default content of the ``JavaSourceFileLayerPaletteFactory.java`` file with the following: -[source,java] +[source,java,subs="macros,quotes"] ---- package org.netbeans.modules.javasourcefilepalette; import java.io.IOException; import javax.swing.Action; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-mimelookup/org/netbeans/api/editor/mimelookup/MimeRegistration.html[org.netbeans.api.editor.mimelookup.MimeRegistration]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/org/netbeans/spi/palette/DragAndDropHandler.html[org.netbeans.spi.palette.DragAndDropHandler]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/org/netbeans/spi/palette/PaletteActions.html[org.netbeans.spi.palette.PaletteActions]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/org/netbeans/spi/palette/PaletteController.html[org.netbeans.spi.palette.PaletteController]; -import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/org/netbeans/spi/palette/PaletteFactory.html[org.netbeans.spi.palette.PaletteFactory]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-mimelookup/org/netbeans/api/editor/mimelookup/MimeRegistration.html[org.netbeans.api.editor.mimelookup.MimeRegistration]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/org/netbeans/spi/palette/DragAndDropHandler.html[org.netbeans.spi.palette.DragAndDropHandler]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/org/netbeans/spi/palette/PaletteActions.html[org.netbeans.spi.palette.PaletteActions]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/org/netbeans/spi/palette/PaletteController.html[org.netbeans.spi.palette.PaletteController]; +import link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/org/netbeans/spi/palette/PaletteFactory.html[org.netbeans.spi.palette.PaletteFactory]; import org.openide.util.Exceptions; import org.openide.util.Lookup; import org.openide.util.datatransfer.ExTransferable; @@ -144,25 +137,25 @@ public class JavaSourceFileLayerPaletteFactory { private static PaletteController palette = null; -link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-mimelookup/org/netbeans/api/editor/mimelookup/MimeRegistration.html[@MimeRegistration](mimeType = "text/x-java", service = PaletteController.class) - public static link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/org/netbeans/spi/palette/PaletteController.html[PaletteController] createPalette() { + link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-editor-mimelookup/org/netbeans/api/editor/mimelookup/MimeRegistration.html[@MimeRegistration](mimeType = "text/x-java", service = PaletteController.class) + public static link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/org/netbeans/spi/palette/PaletteController.html[PaletteController] createPalette() { try { if (null == palette) { - return link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/org/netbeans/spi/palette/PaletteFactory.html[PaletteFactory].createPalette( - *//Folder:* + return link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/org/netbeans/spi/palette/PaletteFactory.html[PaletteFactory].createPalette( + *//Folder:* "JavaPalette", *//Palette Actions:* - new link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/org/netbeans/spi/palette/PaletteActions.html[PaletteActions]() { + new link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/org/netbeans/spi/palette/PaletteActions.html[PaletteActions]() { @Override public Action[] getImportActions() {return null;} @Override public Action[] getCustomPaletteActions() {return null;} @Override public Action[] getCustomCategoryActions(Lookup lkp) {return null;} @Override public Action[] getCustomItemActions(Lookup lkp) {return null;} @Override public Action getPreferredAction(Lookup lkp) {return null;} }, - *//Palette Filter:* + *//Palette Filter:* null, - *//Drag and Drop Handler:* - new link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/org/netbeans/spi/palette/DragAndDropHandler.html[DragAndDropHandler](true) { + *//Drag and Drop Handler:* + new link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/org/netbeans/spi/palette/DragAndDropHandler.html[DragAndDropHandler](true) { @Override public void customize(ExTransferable et, Lookup lkp) {} }); } @@ -202,10 +195,10 @@ After you have created or added the above files to the NetBeans module, you decl ---- -The above can be generated automatically for you if you use the link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/org/netbeans/spi/palette/PaletteItemRegistration.html[@PaletteItemRegistration] annotation, as shown below, in a ``package-info.java`` class: +The above can be generated automatically for you if you use the link:http://bits.netbeans.org/dev/javadoc/org-netbeans-spi-palette/org/netbeans/spi/palette/PaletteItemRegistration.html[@PaletteItemRegistration] annotation, as shown below, in a ``package-info.java`` class: -[source,java] +[source,java,subs="macros"] ---- @PaletteItemRegistration( @@ -222,7 +215,7 @@ package org.netbeans.modules.javasourcefilepalette; import org.netbeans.spi.palette.PaletteItemRegistration; ---- -For all the details on the information referred to in this subsection, work through the link:nbm-palette-api1.html[NetBeans Code Snippet Module Tutorial]. +For all the details on the information referred to in this subsection, work through the link:nbm-palette-api1.html[NetBeans Code Snippet Module Tutorial]. == Building and Installing the Module @@ -247,5 +240,5 @@ link:http://netbeans.apache.org/community/mailing-lists.html[Send Us Your Feedba For more information about creating and developing NetBeans modules, see the following resources: -* link:https://netbeans.apache.org/kb/docs/platform.html[Other Related Tutorials] -* link:http://bits.netbeans.org/dev/javadoc/index.html[NetBeans API Javadoc] +* link:https://netbeans.apache.org/kb/docs/platform.html[Other Related Tutorials] +* link:http://bits.netbeans.org/dev/javadoc/index.html[NetBeans API Javadoc] diff --git a/netbeans.apache.org/src/content/tutorials/nbm-porting-basic.asciidoc b/netbeans.apache.org/src/content/tutorials/nbm-porting-basic.asciidoc index 555c1edc7e..a4fd4a2f9c 100644 --- a/netbeans.apache.org/src/content/tutorials/nbm-porting-basic.asciidoc +++ b/netbeans.apache.org/src/content/tutorials/nbm-porting-basic.asciidoc @@ -261,7 +261,7 @@ Click OK. Next, add another dependency, this time on the Utilities API, which pr 1. Now you can annotate your `Action` class as follows: -[source,java] +[source,java,subs="macros"] ---- package com.toy.anagrams.core; @@ -430,7 +430,7 @@ Next, we will create an action that will obtain the content of a Manifest file, [start=3] 1. Create a Java class named `SetScrambledAnagramsAction`, in the `com.toy.anagrams.core` package, and define it as follows: -[source,java] +[source,java,subs="macros,quotes"] ---- package com.toy.anagrams.core; diff --git a/netbeans.apache.org/src/content/tutorials/nbm-projecttypeant.asciidoc b/netbeans.apache.org/src/content/tutorials/nbm-projecttypeant.asciidoc index 8a8eda8d56..7706c98305 100644 --- a/netbeans.apache.org/src/content/tutorials/nbm-projecttypeant.asciidoc +++ b/netbeans.apache.org/src/content/tutorials/nbm-projecttypeant.asciidoc @@ -175,7 +175,7 @@ Do the following: 1. Change the default code to the following. Notice that we begin with an annotation that registers the project as applying to projects that have a ``project.xml`` as defined above. -[source,java] +[source,java,subs="macros"] ---- @AntBasedProjectRegistration(type = "org.netbeans.demo.project.DemoProject", @@ -184,7 +184,7 @@ sharedName = "data", sharedNamespace = "https://netbeans.org/ns/demo-project/1", privateName = "project-private", privateNamespace = "https://netbeans.org/ns/demo-project-private/1") -public class DemoProject implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectapi/org/netbeans/api/project/Project.html[Project] { +public class DemoProject implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectapi/org/netbeans/api/project/Project.html[Project] { final AntProjectHelper helper; @@ -204,7 +204,7 @@ public class DemoProject implements link:http://bits.netbeans.org/dev/javadoc/o return helper.getProjectDirectory(); } - private final class Info implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectapi/org/netbeans/api/project/ProjectInformation.html[ProjectInformation] { + private final class Info implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectapi/org/netbeans/api/project/ProjectInformation.html[ProjectInformation] { @Override public String getName() { @@ -262,10 +262,10 @@ Do the following: 1. Change the default code to the following: -[source,java] +[source,java,subs="macros"] ---- -class DemoProjectLogicalView implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectuiapi/org/netbeans/spi/project/ui/LogicalViewProvider.html[LogicalViewProvider] { +class DemoProjectLogicalView implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectuiapi/org/netbeans/spi/project/ui/LogicalViewProvider.html[LogicalViewProvider] { private final DemoProject project; @@ -361,11 +361,11 @@ image::images/projecttypes_demo-2.png[] Create a new class called ``DemoNodeFactory`` and define it as follows: -[source,java] +[source,java,subs="macros"] ---- @NodeFactory.Registration(projectType="org-netbeans-demo-project-DemoProject", position=200) -public class DemoNodeFactory implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectuiapi/org/netbeans/spi/project/ui/support/NodeFactory.html[NodeFactory] { +public class DemoNodeFactory implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectuiapi/org/netbeans/spi/project/ui/support/NodeFactory.html[NodeFactory] { public DemoNodeFactory() { } @@ -434,11 +434,11 @@ Do the following: 1. Replace ``DemoNodeFactory`` with the following: -[source,java] +[source,java,subs="macros"] ---- @NodeFactory.Registration(projectType="org-netbeans-demo-project-DemoProject", position=200) -public class DemoNodeFactory implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectuiapi/org/netbeans/spi/project/ui/support/NodeFactory.html[NodeFactory] { +public class DemoNodeFactory implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectuiapi/org/netbeans/spi/project/ui/support/NodeFactory.html[NodeFactory] { public DemoNodeFactory() { } @@ -465,10 +465,10 @@ public class DemoNodeFactory implements link:http://bits.netbeans.org/dev/javad Create a new class called ``DemoFilterNode`` and define it as follows: -[source,java] +[source,java,subs="macros"] ---- -public class DemoFilterNode extends link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/FilterNode.html[FilterNode] { +public class DemoFilterNode extends link:http://bits.netbeans.org/dev/javadoc/org-openide-nodes/org/openide/nodes/FilterNode.html[FilterNode] { private static Image smallImage = ImageUtilities.loadImage("org/netbeans/demo/project/icon1.png"); // NOI18N @@ -526,7 +526,7 @@ Do the following: 1. First, add an ``ActionProvider`` implementation to the project's lookup, as shown below. Note that included in the ``DemoActionProvider`` is the Build command: -[source,java] +[source,java,subs="macros,quotes"] ---- @AntBasedProjectRegistration(type = "org.netbeans.demo.project.DemoProject", @@ -535,7 +535,7 @@ sharedName = "data", sharedNamespace = "https://netbeans.org/ns/demo-project/1", privateName = "project-private", privateNamespace = "https://netbeans.org/ns/demo-project-private/1") -public class DemoProject implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectapi/org/netbeans/api/project/Project.html[Project] { +public class DemoProject implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectapi/org/netbeans/api/project/Project.html[Project] { final AntProjectHelper helper; @@ -547,9 +547,9 @@ public class DemoProject implements link:http://bits.netbeans.org/dev/javadoc/o public Lookup getLookup() { return Lookups.fixed(new Object[]{ new Info(), - new DemoProjectLogicalView(this),* - new DemoActionProvider(), - * }); + new DemoProjectLogicalView(this), + #new DemoActionProvider(),# + }); } @Override @@ -557,7 +557,7 @@ public class DemoProject implements link:http://bits.netbeans.org/dev/javadoc/o return helper.getProjectDirectory(); } - private final class Info implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectapi/org/netbeans/api/project/ProjectInformation.html[ProjectInformation] { + private final class Info implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectapi/org/netbeans/api/project/ProjectInformation.html[ProjectInformation] { @Override public String getName() { @@ -587,8 +587,8 @@ public class DemoProject implements link:http://bits.netbeans.org/dev/javadoc/o return DemoProject.this; } } -* - private final class DemoActionProvider implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectapi/org/netbeans/spi/project/ActionProvider.html[ActionProvider] { + + #private final class DemoActionProvider implements link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-projectapi/org/netbeans/spi/project/ActionProvider.html[ActionProvider] { private String[] supported = new String[]{ ActionProvider.COMMAND_DELETE, @@ -631,8 +631,8 @@ public class DemoProject implements link:http://bits.netbeans.org/dev/javadoc/o throw new IllegalArgumentException(command); } } - } -* + }# + } ---- diff --git a/netbeans.apache.org/src/content/tutorials/nbm-test.asciidoc b/netbeans.apache.org/src/content/tutorials/nbm-test.asciidoc index 169e6651a8..270207c86a 100644 --- a/netbeans.apache.org/src/content/tutorials/nbm-test.asciidoc +++ b/netbeans.apache.org/src/content/tutorials/nbm-test.asciidoc @@ -133,13 +133,13 @@ The NetBeans Platform's extension to JUnit is named " link:http://bits.netbeans. An example unit test for the NetBeans Platform Paint sample: -[source,java] +[source,java,subs="macros"] ---- import org.netbeans.junit.*; import org.netbeans.paint.PaintCanvas; -public class PaintCanvasTest extends link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-nbjunit/org/netbeans/junit/NbTestCase.html[NbTestCase] { +public class PaintCanvasTest extends link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-nbjunit/org/netbeans/junit/NbTestCase.html[NbTestCase] { public PaintCanvasTest(java.lang.String testName) { super(testName); diff --git a/netbeans.apache.org/src/content/tutorials/nbm-wizard.asciidoc b/netbeans.apache.org/src/content/tutorials/nbm-wizard.asciidoc index 22e4ecf2f5..a91b27d205 100644 --- a/netbeans.apache.org/src/content/tutorials/nbm-wizard.asciidoc +++ b/netbeans.apache.org/src/content/tutorials/nbm-wizard.asciidoc @@ -165,11 +165,9 @@ public final class DemoWizardAction implements ActionListener { [start=2] 1. At the top of the Action class, notice that some Action annotations have been commented out. Remove the comments and add a category and a position, so that the annotations are as follows: -link:http://bits.netbeans.org/dev/javadoc/org-openide-awt/org/openide/awt/ActionID.html[@ActionID] - -[source,java] +[source,java,subs="macros"] ---- - +link:http://bits.netbeans.org/dev/javadoc/org-openide-awt/org/openide/awt/ActionID.html[@ActionID] (category="Demo", id="org.demo.wizard.DemoWizardAction") link:http://bits.netbeans.org/dev/javadoc/org-openide-awt/org/openide/awt/ActionRegistration.html[@ActionRegistration](displayName="Open Demo Wizard") link:http://bits.netbeans.org/dev/javadoc/org-openide-awt/org/openide/awt/ActionReference.html[@ActionReference](path="Menu/Tools", position=10) @@ -305,7 +303,7 @@ public void storeSettings(WizardDescriptor wiz) { 1. Next, use the ``DemoWizardAction.java`` file to retrieve the properties you have set and do something with them: -[source,java] +[source,java,subs="quotes"] ---- if (DialogDisplayer.getDefault().notify(wiz) == WizardDescriptor.FINISH_OPTION) { @@ -391,7 +389,7 @@ public boolean isValid() { And, when ``validate()`` is called, which is when the "Next" button is clicked, return false: -[source,java] +[source,java,subs="quotes"] ---- @Override @@ -430,7 +428,7 @@ In this section, you learn how to store the data when the wizard closes and retr 1. In ``DemoWizardPanel1.java`` , override the ``readSettings`` and the ``storeSettings`` methods as follows: -[source,java] +[source,java,subs="quotes"] ---- @Override @@ -499,7 +497,7 @@ image::images/wizard_70_branding-1.png[] [source,java] ---- -CTL_NEXT=&Advance > +CTL_NEXT=&Advance > ---- Other strings you might like to brand are as follows: diff --git a/netbeans.apache.org/src/content/tutorials/nbm-workflow.asciidoc b/netbeans.apache.org/src/content/tutorials/nbm-workflow.asciidoc index e10cfb0b22..7dca767327 100644 --- a/netbeans.apache.org/src/content/tutorials/nbm-workflow.asciidoc +++ b/netbeans.apache.org/src/content/tutorials/nbm-workflow.asciidoc @@ -192,18 +192,18 @@ image::images/workflow_72_new-control-3.png[] [start=4] 1. Create a new Java class named ``Installer`` in the package ``org.prediction.control`` . Define it as follows and click the links for further information: -[source,java] +[source,java,subs="macros"] ---- package org.prediction.control; -import link:http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/OnStart.html[org.openide.modules.OnStart]; +import link:http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/OnStart.html[org.openide.modules.OnStart]; import org.openide.windows.WindowManager; import org.openide.windows.WindowSystemEvent; -import link:http://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/WindowSystemListener.html[org.openide.windows.WindowSystemListener]; +import link:http://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/WindowSystemListener.html[org.openide.windows.WindowSystemListener]; link:http://bits.netbeans.org/dev/javadoc/org-openide-modules/org/openide/modules/OnStart.html[@OnStart] -public class Installer implements Runnable, link:http://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/WindowSystemListener.html[WindowSystemListener] { +public class Installer implements Runnable, link:http://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/WindowSystemListener.html[WindowSystemListener] { @Override public void run() { @@ -212,7 +212,7 @@ public class Installer implements Runnable, link:http://bits.netbeans.org/dev/j @Override public void beforeLoad(WindowSystemEvent wse) { -link:http://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/WindowManager.html#setRole(java.lang.String)[WindowManager.getDefault().setRole("specify")]; + link:http://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/WindowManager.html#setRole(java.lang.String)[WindowManager.getDefault().setRole("specify")]; WindowManager.getDefault().removeWindowSystemListener(this); } @@ -243,17 +243,17 @@ In this section, you create new menu items to control switching between canvases In each canvas module, create an ActionListener such as the below for switching between roles. The example below is for the specify role, create the same class in the other two modules, changing "specify" to "diagnose" and "forecast" for the other modules. -[source,java] +[source,java,subs="macros"] ---- package org.prediction.specify; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; -import link:http://bits.netbeans.org/dev/javadoc/org-openide-awt/org/openide/awt/ActionID.html[org.openide.awt.ActionID]; -import link:http://bits.netbeans.org/dev/javadoc/org-openide-awt/org/openide/awt/ActionReference.html[org.openide.awt.ActionReference]; -import link:http://bits.netbeans.org/dev/javadoc/org-openide-awt/org/openide/awt/ActionRegistration.html[org.openide.awt.ActionRegistration]; -import link:http://bits.netbeans.org/dev/javadoc/org-openide-util/org/openide/util/NbBundle.Messages.html[org.openide.util.NbBundle.Messages]; +import link:http://bits.netbeans.org/dev/javadoc/org-openide-awt/org/openide/awt/ActionID.html[org.openide.awt.ActionID]; +import link:http://bits.netbeans.org/dev/javadoc/org-openide-awt/org/openide/awt/ActionReference.html[org.openide.awt.ActionReference]; +import link:http://bits.netbeans.org/dev/javadoc/org-openide-awt/org/openide/awt/ActionRegistration.html[org.openide.awt.ActionRegistration]; +import link:http://bits.netbeans.org/dev/javadoc/org-openide-util/org/openide/util/NbBundle.Messages.html[org.openide.util.NbBundle.Messages]; import org.openide.windows.WindowManager; link:http://bits.netbeans.org/dev/javadoc/org-openide-awt/org/openide/awt/ActionID.html[@ActionID]( @@ -269,7 +269,7 @@ public final class SwitchToSpecifyRole implements ActionListener { @Override public void actionPerformed(ActionEvent e) { -link:http://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/WindowManager.html#setRole(java.lang.String)[WindowManager.getDefault().setRole("specify")]; + link:http://bits.netbeans.org/dev/javadoc/org-openide-windows/org/openide/windows/WindowManager.html#setRole(java.lang.String)[WindowManager.getDefault().setRole("specify")]; } } diff --git a/netbeans.apache.org/src/content/wiki/DevFaqAccessSourcesWeb.asciidoc b/netbeans.apache.org/src/content/wiki/DevFaqAccessSourcesWeb.asciidoc index 5c5d10f616..9baa000207 100644 --- a/netbeans.apache.org/src/content/wiki/DevFaqAccessSourcesWeb.asciidoc +++ b/netbeans.apache.org/src/content/wiki/DevFaqAccessSourcesWeb.asciidoc @@ -33,7 +33,7 @@ 1. Go to the nightly build download site: -[source,java] +[source,java,subs="macros"] ---- link:http://bits.netbeans.org/dev/nightly/[http://bits.netbeans.org/dev/nightly/] @@ -51,7 +51,7 @@ [start=4] . Click the link or add "zip/" to the end of the URL in your browser's address bar manually and hit enter. In other words, the complete URL might look like this: -[source,java] +[source,java,subs="macros"] ---- link:http://bits.netbeans.org/dev/nightly/2010-06-11_00-01-15/zip/[http://bits.netbeans.org/dev/nightly/2010-06-11_00-01-15/zip/] diff --git a/netbeans.apache.org/src/content/wiki/DevFaqDotSettingsFiles.asciidoc b/netbeans.apache.org/src/content/wiki/DevFaqDotSettingsFiles.asciidoc index f2d8a89824..cdda518c92 100644 --- a/netbeans.apache.org/src/content/wiki/DevFaqDotSettingsFiles.asciidoc +++ b/netbeans.apache.org/src/content/wiki/DevFaqDotSettingsFiles.asciidoc @@ -41,7 +41,7 @@ Settings files are also useful if you are declaring some objects in a layer file === Example -[source,xml] +[source,xml,subs="verbatim,macros"] ---- diff --git a/netbeans.apache.org/src/content/wiki/DevFaqHelpGuidelines.asciidoc b/netbeans.apache.org/src/content/wiki/DevFaqHelpGuidelines.asciidoc index 03836e9c9b..90f7b6ed80 100644 --- a/netbeans.apache.org/src/content/wiki/DevFaqHelpGuidelines.asciidoc +++ b/netbeans.apache.org/src/content/wiki/DevFaqHelpGuidelines.asciidoc @@ -114,7 +114,7 @@ Every help set has a Map file. Every help ID should have a unique entry in _one [source,java] ---- -&lt;mapID target="UniqueHelpId" url="PathFromMapFileToHelpFileInHelpSet"/&gt; + ---- === How do I find unmapped help IDs? @@ -181,7 +181,7 @@ in the desired category. For example, say you wanted to list a help file under the Java Project Basics -> Building Java Applications category. You would enter the following in your TOC file: -[source,xml] +[source,xml,subs="verbatim,macros"] ---- @@ -270,7 +270,7 @@ Use the following syntax to link to the glossary page: Use the following syntax: -[source,xml] +[source,xml,subs="verbatim,macros"] ---- diff --git a/netbeans.apache.org/src/content/wiki/DevFaqHowToChangeUpdateCenterURL.asciidoc b/netbeans.apache.org/src/content/wiki/DevFaqHowToChangeUpdateCenterURL.asciidoc index fde7d65981..ce5f0c8487 100644 --- a/netbeans.apache.org/src/content/wiki/DevFaqHowToChangeUpdateCenterURL.asciidoc +++ b/netbeans.apache.org/src/content/wiki/DevFaqHowToChangeUpdateCenterURL.asciidoc @@ -31,7 +31,7 @@ Use UpdateUnitProviderFactory link:http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-autoupdate-services/org/netbeans/api/autoupdate/UpdateUnitProviderFactory.html[http://bits.netbeans.org/dev/javadoc/org-netbeans-modules-autoupdate-services/org/netbeans/api/autoupdate/UpdateUnitProviderFactory.html] -[source,java] +[source,java,subs="verbatim,macros"] ---- List updateUnitProviders = UpdateUnitProviderFactory.getDefault().getUpdateUnitProviders(true); diff --git a/netbeans.apache.org/src/content/wiki/DevFaqMIMEResolver.asciidoc b/netbeans.apache.org/src/content/wiki/DevFaqMIMEResolver.asciidoc index c45c647ad7..3295e371a9 100644 --- a/netbeans.apache.org/src/content/wiki/DevFaqMIMEResolver.asciidoc +++ b/netbeans.apache.org/src/content/wiki/DevFaqMIMEResolver.asciidoc @@ -40,7 +40,7 @@ Description of declarative MIME resolve can be found in link:http://bits.netbean Applies to: NetBeans 6.1+, pattern and name elements to 6.7+ ---- -[source,java] +[source,java,subs="macros"] ---- Related: link:DevFaqFileRecognition.asciidoc[DevFaqFileRecognition] diff --git a/netbeans.apache.org/src/content/wiki/DevFaqSignNbm.asciidoc b/netbeans.apache.org/src/content/wiki/DevFaqSignNbm.asciidoc index 967d694469..64433d49fc 100644 --- a/netbeans.apache.org/src/content/wiki/DevFaqSignNbm.asciidoc +++ b/netbeans.apache.org/src/content/wiki/DevFaqSignNbm.asciidoc @@ -222,7 +222,7 @@ Yes. link:https://github.com/mojohaus/nbm-maven-plugin[nbm-maven-plugin] will si . Update the `nbm-maven-plugin`-configuration in the pom.xml like this ` -[source,xml] +[source,xml,subs="verbatim,macros"] ---- diff --git a/netbeans.apache.org/src/content/wiki/DevFaqWhatIsACluster.asciidoc b/netbeans.apache.org/src/content/wiki/DevFaqWhatIsACluster.asciidoc index 8a9c818c94..cfa25ff1ab 100644 --- a/netbeans.apache.org/src/content/wiki/DevFaqWhatIsACluster.asciidoc +++ b/netbeans.apache.org/src/content/wiki/DevFaqWhatIsACluster.asciidoc @@ -75,33 +75,16 @@ In short, while it is typical for all of the parts of an application to be under Here is the structure of the (comparatively small - it contains only one module) `ergonomics` cluster in a NetBeans 6.9 development build. -
    +* *ergonomics/* _The cluster directory_ +** .lastModified _An empty file used as a timestamp so NetBeans can cache information about the cluster for performance, but know if its cache is out-of-date_ +** *config/* _Contains metadata about module state_ +*** *Modules/* _Contains files which tell NetBeans some things about the module, mostly relating to if/when it should be enabled_ +**** org-netbeans-modules-ide-ergonomics.xml _Metadata about the Ergonomics module, whose code-name is org.netbeans.modules.ide.ergonomics_ +** *modules/* _Directory that contains the actual (multiple) module JAR files and any 3rd-party libraries they include_ +*** org-netbeans-modules-ide-ergonomics.jar _This is the actual JAR file of the Ergonomics module's classes_ +** *update_tracking/* _Contains metadata about the module which is needed by Tools > Plugins_ +*** org-netbeans-modules-ide-ergonomics.xml _Contains installation date, version and CRC checksums of module JAR and enablement data_ -[source,xml] ----- - -
  • `*ergonomics/* The cluster directory` -
      -
    • `.lastModified An empty file used as a timestamp so NetBeans can cache information about the cluster for performance, but know if its cache is out-of-date`
    • -
    • `*config/* Contains metadata about module state` -
        -
      • `*Modules/* Contains files which tell NetBeans some things about the module, mostly relating to if/when it should be enabled` -
          -
        • `org-netbeans-modules-ide-ergonomics.xml Metadata about the Ergonomics module, whose code-name is org.netbeans.modules.ide.ergonomics`
        • -
      • -
    • -
    • `*modules/* Directory that contains the actual (multiple) module JAR files and any 3rd-party libraries they include` -
        -
      • `org-netbeans-modules-ide-ergonomics.jar This is the actual JAR file of the Ergonomics module's classes`
      • -
    • -
    • `*update_tracking/* Contains metadata about the module which is needed by Tools > Plugins` -
        -
      • `org-netbeans-modules-ide-ergonomics.xml Contains installation date, version and CRC checksums of module JAR and enablement data`
      • -
    • -
  • ----- - -
In a larger cluster, all of the child directories described above would contain one file for each module (i.e. module JAR file, etc.). @@ -109,18 +92,18 @@ In a larger cluster, all of the child directories described above would contain The metadata in `$CLUSTER/config/Modules/$MODULE.xml` is fairly simple and straightforward - it enables the NetBeans module-system to determine when a module should be loaded: -[source,xml] +[source,xml,subs="verbatim,macros"] ---- - - - false - false - true - modules/org-netbeans-modules-ide-ergonomics.jar - false + + + + false + false + true + modules/org-netbeans-modules-ide-ergonomics.jar + false ---- @@ -129,14 +112,14 @@ Similarly, the metadata in `$CLUSTER/update_tracking/$MODULE.xml` contains data [source,xml] ---- - - - - - + + + + + ----