From 26ecc021f29ae5cd72cd2c3dbfc1d10784661e72 Mon Sep 17 00:00:00 2001 From: Egbert Broerse Date: Thu, 10 Nov 2022 16:52:40 +0100 Subject: [PATCH 1/4] clean up NB help, tables, button class --- help/en/html/doc/Technical/GitFAQ.shtml | 2 +- help/en/html/doc/Technical/NetBeans.shtml | 1437 +++++++++------------ 2 files changed, 587 insertions(+), 852 deletions(-) diff --git a/help/en/html/doc/Technical/GitFAQ.shtml b/help/en/html/doc/Technical/GitFAQ.shtml index 3e1b180fa1e..2fe550665ce 100644 --- a/help/en/html/doc/Technical/GitFAQ.shtml +++ b/help/en/html/doc/Technical/GitFAQ.shtml @@ -592,7 +592,7 @@ to do that command once to define "arnie" as an alias you can use in "git fetch"

There is a ".gitattributes" file that tells (most) command-line Git implementations how to handle this properly. Unfortunately, not all IDEs obey the directives in the file. For example, to get NetBeans on Windows to handle line-ends properly, a specific plugin - must be installed. See the NetBeans JMRI page for + must be installed. See the NetBeans JMRI help page for specifics.

If a file with changed line-ends is accidentally committed and forwarded in a diff --git a/help/en/html/doc/Technical/NetBeans.shtml b/help/en/html/doc/Technical/NetBeans.shtml index 6f4424a6612..96fa5f8dbd2 100644 --- a/help/en/html/doc/Technical/NetBeans.shtml +++ b/help/en/html/doc/Technical/NetBeans.shtml @@ -17,22 +17,22 @@

- +

JMRI Code: Building with Apache NetBeans

-
-
+
+

Table of Contents -

+ -
-
-
-

Introduction

- -
-

Apache NetBeans makes a great platform - for working with JMRI. The JMRI code is set up to work with Apache NetBeans with - almost no additional setup.

- -

Apache NetBeans is a very powerful Integrated Development Environment (IDE), which - can make working with the JMRI code pretty easy. But it takes a little getting used - to, and reading the tutorials will be - helpful.

-
-
- -
-

Installation

- -
-
-
    -
  1. -

    Download and install a Java 8 or newer Java - Development Kit (JDK) (It is recommended to use a package manager if possible - to ensure security updates can be automatically installed)

    -
  2. - -
  3. -

    Download Apache NetBeans from netbeans.apache.org (It is recommended - to use a package manager if possible to ensure security updates can be - automatically installed)

    -
  4. - -
  5. -

    Run the Apache NetBeans installer

    -
  6. -
-
- -
-

Linux

- -

Apache NetBeans can also be installed as a snap package for Linux.

-
- -
-

macOS

- -

Apache NetBeans and the Java 8 JDK can be installed using Homebrew from the terminal:

- -
-
-
brew install --cask  openjdk@11 netbeans
-
-
-
- -
-

Windows

- -
- - - - - -
-
- Note -
-
-

Due to different handling of Line Endings characters (LF / CR - LF) between Windows and other systems - namely Unix and OS X (see - Handling Line Ends) - it is of the - utmost importance that all Windows users adopt the following settings for - their development environment. This is absolutely required so that Git can - track individual changes on files that you commit.

- -

If you don’t follow these instructions, you’ll mess up the line endings - in the files you commit, which will in turn make their revision history - much harder to access. Files in this condition will not be accepted as pull - requests.

- -

As a first step, as JMRI has adopted LF as a convention for - Line Endings, it is required to set the core.autocrlf setting - to true (see "Dealing with - line endings" on GitHub Help)

-
-
- -
- - - - - -
-
- Important -
-
-

You must install and configure the "Change - Line Endings on Save" plugin before using Git via Apache NetBeans.

-
-
- -
-

Change Line Endings on Save - Plugin

- -
-
Installation
- -
-
    -
  1. -

    Choose Tools  Plugins

    -
  2. - -
  3. -

    Click Settings

    -
  4. - -
  5. -

    Select Netbeans Plugin Portal and ensure it is active

    -
  6. - -
  7. -

    Click Available Plugins

    -
  8. - -
  9. -

    Select Change Line Endings on Save

    -
  10. - -
  11. -

    Click Install

    -
  12. - -
  13. -

    Follow the prompts to complete installation

    -
  14. - -
  15. -

    Restart Apache NetBeans when prompted

    -
  16. -
-
-
-
- -
-

Configuration

- -

- -

- -
-
    -
  1. -

    Choose Tools  Options

    -
  2. - -
  3. -

    Click Editor

    -
  4. - -
  5. -

    Click Line Endings

    -
  6. - -
  7. -

    Select Enable adjusting the line endings

    -
  8. - -
  9. -

    Choose Unix (LF) from the popup menu

    -
  10. - -
  11. -

    To be prompted before line endings are adjusted, select Show - confirmation dialog before adjusting the line endings

    -
  12. - -
  13. -

    Click OK You can check that the plug-in is - properly installed by going to go to Tools > Plugins > - Installed, where you should see something like this (versions might - differ):

    -
  14. -
-
-
-
-
-
- -
-

Using Apache NetBeans with - JMRI’s Git Code Repository

- -
-
-

GitHub provides JMRI’s code repository using the Git tool. For more information on - how JMRI uses Git, see the JMRI Help on Getting the code - via Git and Git FAQ.

-
- -
-

Once set up, Apache NetBeans provides built-in support for using Git.

-
- -
-

For more information on Git and Apache NetBeans, see the NetBeans Git help page

-
- -
-

Checking out code

- -
-

In Apache NetBeans, under the "Team" menu, select Git, then Clone Repository. - Enter the https://github.com/JMRI/JMRI.git repository URL from the JMRI GitHub page on the Apache NetBeans form - under "Repository URL". We recommend that you also enter your GitHub user name and - password on the form, so we can attribute your contributions to you later. Click - "Next". Make sure that the "master*" box is checked to pull down the main version - of the code. Click "Next", and then click "Finish".

-
- -
-

It’ll take a long time to pull down a copy of the code (note the progress bar in - the lower right), but then you’re good to go.

-
-
- -
-

Local Commits

- -
-

When using Git, the "commit" operation is local to your computer. It doesn’t - make any changes to the main JMRI repository.

-
- -
-

You’re encouraged to commit often, so that your changes are safely stored away - from your working directory. Having each small change separately recorded can be - incredibly helpful later on if you have to track down where a problem was - introduced.

-
-
- -
-

Updating the code from Git

- -
-

From time to time, you should update your local copy of the code to match the - current "HEAD" of the main JMRI Git repository contents. The basic process is to - pull the most recent copies from the main JMRI repository, doing any merging that’s - needed if you’ve made conflicting changes, and then pushing that up to your own - GitHub repository.

-
- -
-

To do this, use the Apache NetBeans [Team] → [Remote] → [Pull from Upstream] - menu choice. Tell Apache NetBeans to pull from the "github" remote you defined - above.

-
- -
-

You may also update a single file or the contents of a folder, by right-clicking - on an item in the "Files" window, then selecting [Git] → [Remote] → [Pull from - Upstream].

-
-
- -
-

Creating a Pull Request

- -
-

A "Pull Request" (PR) is an easy way to gather all your changes, even if they - span multiple files, into something that you can then submit for inclusion in the - main JMRI repository.

-
- -
-

First, you need to set up a GitHub account and your own repository.

-
- -
- -
- -
-

This gives you your own repository, which you can then work with freely.

-
- -
-

Next, push the changes up to your repository. (Anybody can push to their own - repository, but most people don’t have permission to directly modify the main JMRI - repository; that’s why the pull request is needed) To do this:

-
- -
-
    -
  • -

    Use the Apache NetBeans [Team] > [Remote] > [Push...] menu choice. (If - you try to use the "Push to Upstream" choice, it will try to write back to the - main repository, and will fail.)

    -
  • - -
  • -

    Click on Specify Git Repository, and enter the URL for your own repository, - e.g.
    - https://github.com/<yourname>/JMRI.git -

    -
  • - -
  • -

    Then click next.

    -
  • - -
  • -

    Apache NetBeans will check with the repository, and show an indication of - branches to push e.g. "master → master" Check the appropriate box to for the - branch you’ve been working on.

    -
  • - -
  • -

    Click Next and Finish. Netbeans will do the actual push to your - repository.

    -
  • -
-
- -
-

You can repeat this as many times as you’d like as you’re working on your - changes. Each time, the most recent changes are pushed up and made available.

-
- -
-

Finally, when your change is ready to submit, go to the GitHub website to - fill out and submit a pull request.

-
- -
-

Eventually, somebody will look at the pull request and decide whether to merge - it in. Sometimes they’ll ask for additional changes. In that case, you can update - the pull request by just pushing new changes to your repository, where they’ll - automatically be picked up.

-
-
-
-
- -
-

Building and running JMRI

- -
-
- - - - - -
-
- Tip -
-
Ensure your computer is connected to the internet the first - time you build, test, or run JMRI after checking out a new copy of JMRI from - GitHub to allow any potentially missing external dependencies or build tools to - be automatically downloaded.
-
- -
-

Prime

- -
-

- The first time you open the JMRI project - in Apache NetBeans, a warning icon will be shown on the project. This warning - indicates Apache NetBeans has a problem with the project. Usually the first time - warning indicates that build artifacts are missing.

-
- -
-

To resolve this problem:

-
- -
-
    -
  1. -

    Select the JMRI project

    -
  2. - -
  3. -

    Choose shortcut - menu  Resolve Project Problems… (the shortcut menu is - usually opened by right-clicking on the project) Show example...

    -
  4. - -
  5. -

    Resolve Project Problems dialog

    - Click Resolve... -
  6. - -
  7. -

    Click Close once the warning icon changes to - an OK icon

    -
  8. -
-
- -
- - - - - -
-
- Note -
-
You may also see an error icon if using a JDK version - greater than 8 due to changes in how Java interacts with macOS in JDK versions - 9 or newer.
-
-
- -
-

Build

- -
-

To build JMRI, choose Run  Build Project (JMRI) or Run  - Clean and Build Project (JMRI).

-
- -
- - - - - -
-
- Tip -
-
To build only the JMRI Java source code, run the maven - lifecycle phase compile.
-
-
- -
-

Run an Application

- -
-

- To run a JMRI - application, choose Run  Run Project (JMRI) or click the Run icon in the tool - bar. You will be prompted for the JMRI main class to run the first time you run the - project.

-
- -
-

The JMRI applications are launched from the main classes:

-
- -
- - - - - - - - - - - - - - - -
DecoderPro -

apps.DecoderPro.DecoderPro -

-
PanelPro -

apps.PanelPro.PanelPro -

-
SoundPro -

apps.SoundPro.SoundPro -

-
-
- -
- - - - - -
-
- Tip -
-
- A new JMRI checkout should build cleanly. If not, please check with the - developers group or project for help. -
-
-
- -
-

Debug an Application

- -
-

To debug a JMRI application, choose Debug  Debug Project (JMRI) or click the Debug icon in the tool - bar. You will be prompted for the JMRI main class to debug the first time you run - the project.

-
-
- -
-

Profile an Application

- -
-

To profile a JMRI application, choose Profile  Profile Project (JMRI) or click the Profile icon in the - tool bar. You will be prompted for the JMRI main class to profile the first time - you run the project.

-
-
-
-
- -
-

Making a Jar File

- -
-
-

Most of the code in a normal JMRI installation lives in a file called jmri.jar. If - you want to replace this with your updated version, you need to create a new jmri.jar - file from your modified code.

-
- -
-

To do this, ctrl-click (or right-click) on the name of the "JMRI" project in the - "Projects" window. This will open a pop-up menu, on which you’ll find "Make Jar - File". Select that, and a new jmri.jar file will be produced in the project’s main - directory.

-
- -
-

Alternately, from the "Files" window, right-click on the build.xml file, and - select "Run Target", then "jar".

-
-
-
- -
-

Making a release package for - Windows using NSIS

- -
-
-

It is possible for Apache NetBeans users to create a release package for use on - the Windows platform. This requires installation of the Nullsoft Scriptable Install - System (NSIS), which can be downloaded from the NSIS project website on - SourceForge.

-
- -
-

Once NSIS is installed on the computer, it is necessary to create a file called - local.properties in the same directory as JMRI's build.xml file. This file is - specifically not checked in via GitHub, so that your machine-specific tool - installation paths are not checked in to GitHub. Create the file, and add a - variable definition with the correct path to the directory which includes the NSIS - executable, such as:

-
- -
-

nsis.home=C:/Program Files (x86)/NSIS/

-
- -
-

or

-
- -
-

nsis.home=/opt/nsis/nsis-2.46/

-
- -
-

Note: Make sure the trailing / is present.

-
- -
-

With the NSIS package installed to your computer, and build.xml properly modified, - the Windows package may be created by running the "package-windows" ant target in - build.xml.

-
-
-
- -
-

Using Apache NetBeans XML tools

- -
-
-

Apache NetBeans has nice tools for working with XML files, including editing and - validating them. JMRI uses XInclude to include XML fragments in other XML files via - URLs to the JMRI website. JMRI programs convert - these at run time to local file references; however Apache NetBeans must be - configured to do this if you want to edit JMRI XML files while offline.

-
- -
-

To configure Apache NetBeans to allow offline XML editing:

-
- -
-
    -
  1. -

    Choose Tools  DTDs and XML Schemas

    -
  2. - -
  3. -

    Click Add Catalog...

    -
  4. - -
  5. -

    Select the Catalog Type OASIS Catalog Resolver

    -
  6. - -
  7. -

    Click Browse...

    -
  8. - -
  9. -

    Navigate to /path-to-your-JMRI-project/xml/catalog.xml

    -
  10. - -
  11. -

    Click OK

    -
  12. - -
  13. -

    Click OK

    -
  14. - -
  15. -

    Click Close

    -
  16. -
-
- -
- - - - - -
-
- Note -
-
the XML catalog location is not project specific, so if you - are working on multiple JMRI projects, whichever project you add the catalog from - will be used, not the current project.
-
-
-
- -
-

Running SpotBugs

- -
-
-

The SpotBugs tool is a static code analysis tool which examines JAVA source code - for common coding issues.

-
- -
-

To run the SpotBugs tool on JMRI code, execute the maven goal - spotbugs:check which is defined in pom.xml. Within Apache NetBeans this can - be accomplished by clicking JMRI in the Projects pane and then clicking - "spotbugs check" in the Navigator pane. When SpotBugs - completes, the Apache NetBeans Output window will show the SpotBugs results.

-
-
-
- -
-

Loading a Specific Branch from GitHub

- -
-
-

The process for building from a branch (i.e. the one where someone has put a - change) is a bit different from the standard instructions. (The following is NetBeans - 8.2, but it doesn’t vary with versions much)

-
- -
-
    -
  • -

    Under "Team" → "Remote" select "Fetch" (not Fetch from Upstream)
    - -

    -
  • - -
  • -

    Fill out the form to specify the correct user’s repository (After the 1st time - you do this, you’ll be able to select by name in the top choice)
    - -

    -
  • - -
  • -

    On the next screen to select a branch, you can either select all of them - (there’s a button) or find and select just the name of the branch that holds the - desired change:
    - -

    -
  • - -
  • -

    Click "Finish"

    -
  • -
-
- -

At this point, you’ve pulled my changes onto your local machine, but you’re not - using them yet. To have those files appear locally for Apache NetBeans to build:

- -
-
    -
  • -

    Back on the main menu, select "Team" → "Checkout" → "Checkout Revision...". On - the window you get, click "Select":
    - -

    -
  • - -
  • -

    In the upper left, find the imported branch you want, which in the example is - "bobjacobsen/ast-clock-power-bit". Either click to highlight (show) and then - click "Select", or just double-click on it. (Don’t worry about the upper right or - the lower box, they’ll be automatically set right)
    - -

    -
  • - -
  • -

    Back on the "Checkout Revision..." window, make sure the "Checkout as New - Branch" is not checked, and then click - "Checkout"

    -
  • -
-
- -
-

Now you’ve got a copy of my changes as your checked-out source. You should do a - "Clean and Build Project" to make sure that you get a consistent compilation, and - then you should be able to run it.

-
- -
- - - - - -
-
- Important -
-
When you want to get back to the standard JMRI - version, from the main repository, you need to check out the master - branch. The process is similar, and simpler. Choose Team  Checkout  Checkout Revision..., - type master in the Checkout Selected Revision box, and - click Checkout
-
-
-
-
+

Introduction

+ +

Apache NetBeans makes a great platform + for working with JMRI. The JMRI code is set up to work with Apache NetBeans with + almost no additional setup.

+ +

Apache NetBeans is a very powerful Integrated Development Environment (IDE), which + can make working with the JMRI code pretty easy. But it takes a little getting used + to, and reading the tutorials will be + helpful.

+ +

Installation

+ +
    +
  1. +

    Download and install a Java 11 or newer Java + Development Kit (JDK) (It is recommended to use a package manager if possible + to ensure security updates can be automatically installed)

    +
  2. + +
  3. +

    Download Apache NetBeans from netbeans.apache.org (It is recommended + to use a package manager if possible to ensure security updates can be + automatically installed)

    +
  4. + +
  5. +

    Run the Apache NetBeans installer

    +
  6. +
+ +

Linux

+ +

Apache NetBeans can also be installed as a snap package for Linux.

+ +

macOS

+ +

Apache NetBeans and the OpenJDK 11 JDK can be installed using Homebrew from the terminal:

+ + brew install --cask openjdk@11 netbeans + +

Windows

+ +

Note:
+ Due to different handling of Line Endings characters (LF / CR + LF) between Windows and other systems - namely Unix and OS X (see + Handling Line Ends) - it is of the + utmost importance that all Windows users adopt the following settings for + their development environment. This is absolutely required so that Git can + track individual changes on files that you commit.

+ +

If you don’t follow these instructions, you’ll mess up the line endings + in the files you commit, which will in turn make their revision history + much harder to access. Files in this condition will not be accepted as pull + requests.

+ +

As a first step, as JMRI has adopted LF as a convention for + Line Endings, it is required to set the core.autocrlf setting + to true (see "Dealing with + line endings" on GitHub Help)

+ +

You must install and configure the "Change + Line Endings on Save" plugin as follows before using Git via Apache NetBeans.

+ +

Change Line Endings on Save + Plugin

+ +
Plugin Installation
+ +
    +
  1. +

    Choose Tools  + Plugins

    +
  2. + +
  3. +

    Click Settings

    +
  4. + +
  5. +

    Select Netbeans Plugin Portal and ensure it is active

    +
  6. + +
  7. +

    Click Available Plugins

    +
  8. + +
  9. +

    Select Change Line Endings on Save

    +
  10. + +
  11. +

    Click Install

    +
  12. + +
  13. +

    Follow the prompts to complete installation

    +
  14. + +
  15. +

    Restart Apache NetBeans when prompted

    +
  16. +
+ +

Plugin Configuration

+ +
    +
  1. +

    Choose Tools  Options

    +

    + +

    +
  2. + +
  3. +

    Click Editor

    +
  4. + +
  5. +

    Click the Line Endings tab

    +
  6. + +
  7. +

    Select Enable adjusting the line endings

    +
  8. + +
  9. +

    Choose Unix (LF) from the popup menu

    +
  10. + +
  11. +

    To be prompted before line endings are adjusted, select Show + confirmation dialog before adjusting the line endings

    +
  12. + +
  13. +

    Click OK.

  14. +
+ +

You can check that the plug-in is properly installed by going to go to Tools + > Plugins > Installed, where you should see the ChangeLineEndingsPlugin in the list.

+ +

Using Apache NetBeans with + JMRI’s Git Code Repository

+ +

GitHub provides JMRI’s code repository using the Git tool. For more information on + how JMRI uses Git, see the JMRI Help on Getting the code + via Git and Git FAQ.

+ +

Once set up, Apache NetBeans provides built-in support for using Git.

+ +

For more information on Git and Apache NetBeans, see the NetBeans Git help page

+ +

Checking out code

+ +

In Apache NetBeans, under the "Team" menu, select Git, then Clone Repository. + Enter the https://github.com/JMRI/JMRI.git repository URL from the JMRI GitHub page on the Apache NetBeans form + under "Repository URL". We recommend that you also enter your GitHub user name and + password on the form, so we can attribute your contributions to you later. Click + "Next". Make sure that the "master*" box is checked to pull down the main version + of the code. Click "Next", and then click "Finish".

+ +

It’ll take a long time to pull down a copy of the code (note the progress bar in + the lower right), but then you’re good to go.

+ +

Local Commits

+ +

When using Git, the "commit" operation is local to your computer. It doesn’t + make any changes to the main JMRI repository.

+ +

You’re encouraged to commit often, so that your changes are safely stored away + from your working directory. Having each small change separately recorded can be + incredibly helpful later on if you have to track down where a problem was + introduced.

+ +

Updating the code from Git

+ +

From time to time, you should update your local copy of the code to match the + current "HEAD" of the main JMRI Git repository contents. The basic process is to + pull the most recent copies from the main JMRI repository, doing any merging that’s + needed if you’ve made conflicting changes, and then pushing that up to your own + GitHub repository.

+ +

To do this, use the Apache NetBeans [Team] → [Remote] → [Pull from Upstream] + menu choice. Tell Apache NetBeans to pull from the "github" remote you defined + above.

+ +

You may also update a single file or the contents of a folder, by right-clicking + on an item in the "Files" window, then selecting [Git] → [Remote] → [Pull from + Upstream].

+ +

Creating a Pull Request

+ +

A "Pull Request" (PR) is an easy way to gather all your changes, even if they + span multiple files, into something that you can then submit for inclusion in the + main JMRI repository.

+ +

First, you need to set up a GitHub account and your own repository.

+ + + +

This gives you your own repository, which you can then work with freely.

+ +

Next, push the changes up to your repository. (Anybody can push to their own + repository, but most people don’t have permission to directly modify the main JMRI + repository; that’s why the pull request is needed) To do this:

+ +
    +
  • +

    Use the Apache NetBeans [Team] > [Remote] > [Push...] menu choice. (If + you try to use the "Push to Upstream" choice, it will try to write back to the + main repository, and will fail.)

    +
  • + +
  • +

    Click on Specify Git Repository, and enter the URL for your own repository, + e.g.
    + https://github.com/<yourname>/JMRI.git +

    +
  • + +
  • +

    Then click next.

    +
  • + +
  • +

    Apache NetBeans will check with the repository, and show an indication of + branches to push e.g. "master → master" Check the appropriate box to for the + branch you’ve been working on.

    +
  • + +
  • +

    Click Next and Finish. Netbeans will do the actual push to your + repository.

    +
  • +
+ +

You can repeat this as many times as you’d like as you’re working on your + changes. Each time, the most recent changes are pushed up and made available.

+ +

Finally, when your change is ready to submit, go to the GitHub website to + fill out and submit a pull request.

+ +

Eventually, somebody will look at the pull request and decide whether to merge + it in. Sometimes they’ll ask for additional changes. In that case, you can update + the pull request by just pushing new changes to your repository, where they’ll + automatically be picked up.

+ +

Building and running JMRI

+ +

Tip:
+ Ensure your computer is connected to the internet the first + time you build, test, or run JMRI after checking out a new copy of JMRI from + GitHub to allow any potentially missing external dependencies or build tools to + be automatically downloaded.

+ +

Prime

+ +

+ The first time you open the JMRI project + in Apache NetBeans, a warning icon will be shown on the project. This warning + indicates Apache NetBeans has a problem with the project. Usually the first time + warning indicates that build artifacts are missing.

+ +

To resolve this problem:

+ +
    +
  1. +

    Select the JMRI project

    +
  2. + +
  3. +

    Choose shortcut + menu  Resolve Project Problems… (the shortcut menu is + usually opened by right-clicking on the project) Show example...

    +
  4. + +
  5. +

    Resolve Project Problems dialog

    + Click Resolve... +
  6. + +
  7. +

    Click Close once the warning icon changes to + an OK icon

    +
  8. +
+ +

Build

+ +

To build JMRI, choose Run  Build Project (JMRI) or Run  + Clean and Build Project (JMRI).

+ +

Tip:
+ To build only the JMRI Java source code, run the maven lifecycle phase compile.

+ +

Run an Application

+ +

+ To run a JMRI + application, choose Run  Run Project (JMRI) or click the Run icon in the tool + bar. You will be prompted for the JMRI main class to run the first time you run the + project.

+ +

The JMRI applications are launched from the main classes:

+ + + + + + + + + + + + + + + + +
DecoderPro +

apps.DecoderPro.DecoderPro +

+
PanelPro +

apps.PanelPro.PanelPro +

+
SoundPro +

apps.SoundPro.SoundPro +

+
+ +

+ Tip:
+ A new JMRI checkout should build cleanly. If not, please check with the + developers group or project for help. +

+ +

Debug an Application

+ +

To debug a JMRI application, choose Debug  Debug Project (JMRI) or click the Debug icon in the tool + bar. You will be prompted for the JMRI main class to debug the first time you run + the project.

+ +

Profile an Application

+ +

To profile a JMRI application, choose Profile  Profile Project (JMRI) or click the Profile icon in the + tool bar. You will be prompted for the JMRI main class to profile the first time + you run the project.

+ +

Making a Jar File

+ +

Most of the code in a normal JMRI installation lives in a file called jmri.jar. If + you want to replace this with your updated version, you need to create a new jmri.jar + file from your modified code.

+ +

To do this, ctrl-click (or right-click) on the name of the "JMRI" project in the + "Projects" window. This will open a pop-up menu, on which you’ll find "Make Jar + File". Select that, and a new jmri.jar file will be produced in the project’s main + directory.

+ +

Alternately, from the "Files" window, right-click on the build.xml file, and + select "Run Target", then "jar".

+ +

Making a release package for + Windows using NSIS

+ +

It is possible for Apache NetBeans users to create a release package for use on + the Windows platform. This requires installation of the Nullsoft Scriptable Install + System (NSIS), which can be downloaded from the NSIS project website on + SourceForge.

+ +

Once NSIS is installed on the computer, it is necessary to create a file called + local.properties in the same directory as JMRI's build.xml file. This file is + specifically not checked in via GitHub, so that your machine-specific tool + installation paths are not checked in to GitHub. Create the file, and add a + variable definition with the correct path to the directory which includes the NSIS + executable, such as:

+ +

nsis.home=C:/Program Files (x86)/NSIS/

+ +

or

+ +

nsis.home=/opt/nsis/nsis-2.46/

+ +

Note: Make sure the trailing / is present.

+ +

With the NSIS package installed to your computer, and build.xml properly modified, + the Windows package may be created by running the "package-windows" ant target in + build.xml.

+ +

Using Apache NetBeans XML tools

+ +

Apache NetBeans has nice tools for working with XML files, including editing and + validating them. JMRI uses XInclude to include XML fragments in other XML files via + URLs to the JMRI website. JMRI programs convert + these at run time to local file references; however Apache NetBeans must be + configured to do this if you want to edit JMRI XML files while offline.

+ +

To configure Apache NetBeans to allow offline XML editing:

+ +
    +
  1. +

    Choose Tools  DTDs and XML Schemas

    +
  2. + +
  3. +

    Click Add Catalog...

    +
  4. + +
  5. +

    Select the Catalog Type OASIS Catalog Resolver

    +
  6. + +
  7. +

    Click Browse...

    +
  8. + +
  9. +

    Navigate to /path-to-your-JMRI-project/xml/catalog.xml

    +
  10. + +
  11. +

    Click OK

    +
  12. + +
  13. +

    Click OK

    +
  14. + +
  15. +

    Click Close

    +
  16. +
+ +

+ Note:
+ the XML catalog location is not project specific, so if you + are working on multiple JMRI projects, whichever project you add the catalog from + will be used, not the current project.

+ +

Running SpotBugs

- From 80cfcc8ce302634b37629bb0e6922c2537fa0bc4 Mon Sep 17 00:00:00 2001 From: Egbert Broerse Date: Thu, 10 Nov 2022 17:18:35 +0100 Subject: [PATCH 2/4] button tag, dev help corrections --- help/en/html/doc/Technical/Help.shtml | 51 +++++++++++----------- help/en/html/doc/Technical/NetBeans.shtml | 34 +++++++-------- help/en/html/doc/Technical/NewType.shtml | 2 +- help/en/html/hardware/loconet/LocoIO.shtml | 18 ++++---- 4 files changed, 53 insertions(+), 52 deletions(-) diff --git a/help/en/html/doc/Technical/Help.shtml b/help/en/html/doc/Technical/Help.shtml index 0fb843de9dc..5b021a49d23 100644 --- a/help/en/html/doc/Technical/Help.shtml +++ b/help/en/html/doc/Technical/Help.shtml @@ -30,7 +30,7 @@ any HTML tag, such as the header tags. Preferences ⇒ Help is used by the user to select the whether Window Help and General help references are displayed using the distribution help files or jmri.org - help files. The later provides fully formatted help pages.

+ help files. The latter provides fully formatted help pages.

  • @@ -95,29 +95,30 @@

    Within that, there are several file trees:

    -
      -
    • package - organized like the source package tree, this contains +
      +
      package/
      +
      organized like the source package tree, this contains code-specific help files for e.g. a particular window or component. For example, a window that's created by the jmri.jmrit.speedometer.SpeedometerFrame class (from the src/jmri/jmrit/speedometer/SpeedometerFrame.java file) should have its window-specific help in a file at - package/jmri/jmrit/speedometer/SpeedometerFrame.shtml.
    • + package/jmri/jmrit/speedometer/SpeedometerFrame.shtml. -
    • html - general descriptions, tutorials, etc. This in turn in - organized into directories that represent general areas.
    • +
      html/
      +
      general descriptions, tutorials, etc. This in turn in + organized into directories that represent general areas.
      -
    • - manual - the most recent version of the DecoderPro et al manuals - reformatted for use in the help system. (Older ones are stored in the main website) -
    • -
    +
    manual/
    +
    the most recent version of the DecoderPro et al manuals + reformatted for use in the help system. (Older ones are stored in the main website)
    +

    While this is how we would LIKE our help files organized, help pages are created by - members of the community and sometimes general descriptions are put in the package + members of the community and sometimes general descriptions are put in the package directory rather than the html directory and vice versa. [If you see something that needs - to be moved, please post a note to the jmri-developers online groups.io forum as there are - members who occassionally try to do some housekeeping.]

    + to be moved, please post a note to jmri-developers + groups.io as there are members who occasionally try to do some housekeeping.]

    In the long run, we want only two branches to the help file structure: the package part of the tree for help information that is specific to a @@ -147,8 +148,8 @@

  • When you create a new page, start with a copy of either the help/en/template-sidebar.shtml or - help/en/template-no-sidebar.shtml template file, depending on whether or - not you want to include a "sidebar" (via a file named Sidebar.shtml). This template will + help/en/template-no-sidebar.shtml template file, depending on whether + you want to include a "sidebar" (via a file named Sidebar.shtml). This template will put the proper top and bottom content in place to get the page properly displayed.
  • In general, all help files in the html directory tree use a sidebar @@ -161,7 +162,7 @@ the format of other Sidebar.shtml files in other subdirectories at the same level or in the parent directory. In 2020, there was a major effort to standardize the sidebar files, using server-side includes for common parts files in the /help/en/parts directory. Typically a Sidebar.shtml file in a + "../../../parts">/help/en/parts directory. Typically, a Sidebar.shtml file in a terminal subdirectory (one with no lower level) will further reference a local part in a file in the same subdirectory and named Sidebar[type]LocalPart.shtml, where [type] would be based on the name @@ -186,7 +187,7 @@
-

Note: The French web pages have not been updated to the new sidebar structure.

+

Note: The French web pages were updated to the new sidebar structure in 2022.

[Go to top of page]

@@ -203,14 +204,14 @@

The file name cannot contain an underscore character. The file suffix is .shtml.

-

The id attribute can assigned to HTML tags and then referenced by +

The id attribute can be assigned to HTML tags and then referenced by JmriHelp. This makes it possible to display window specific help information within a larger help document.

Do not use spaces or %20 in id names. If you must use a phrase for a name, use the underscore character: "This_Anchor", not "This Anchor.

-

When describing a sequence of user actions or pulldowns, use the double right arrow HTML +

When describing a sequence of user actions or pull downs, use the double right arrow HTML entity ampersand-rArr-semicolon, and label the whole sequence as "strong". For example:
File ⇒ Store Panels
@@ -223,8 +224,8 @@

Links to web pages outside the help system work and should be specified as fully qualified, preferably with https://. These pages may be opened in a new tab or in the same tab (overwriting the current page), depending on how the person who wrote the help page - coded the reference. As of this writing (2020/04/04), there is an on-going debate as to the - prefered method.] The browser preferences might also affect the new tab / replace tab + coded the reference. As of this writing (2020/04/04), there is an ongoing debate as to the + preferred method.] The browser preferences might also affect the new tab / replace tab behavior.

[Go to top of page] @@ -236,7 +237,7 @@

Within the JMRI code, access to the help system comes via the - jmri.util.HelpUtil class. (For historical reasons, there's a little bit of + jmri.util.HelpUtil class. (For historical reasons, there's a bit of code in apps.Apps, but you should ignore that).

The easiest way to add a help menu to a frame is to have it be a JmriJFrame (which you @@ -404,7 +405,7 @@ pages for the help system and the web. There are several steps involved to ensure that your new hardware help is integrated into the JMRI Help system and its website. All references below to files are to the JMRI Repository - structure in Github. Note use of capitalization in references to (fictitious) product + structure in GitHub. Note use of capitalization in references to (fictitious) product "X" from manufacturer "M":

    diff --git a/help/en/html/doc/Technical/NetBeans.shtml b/help/en/html/doc/Technical/NetBeans.shtml index 96fa5f8dbd2..ac9fde032fe 100644 --- a/help/en/html/doc/Technical/NetBeans.shtml +++ b/help/en/html/doc/Technical/NetBeans.shtml @@ -199,7 +199,7 @@
  1. -

    Click Settings

    +

    Click Settings

  2. @@ -207,7 +207,7 @@
  3. -

    Click Available Plugins

    +

    Click Available Plugins

  4. @@ -215,7 +215,7 @@
  5. -

    Click Install

    +

    Click Install

  6. @@ -241,11 +241,11 @@
  7. -

    Click Editor

    +

    Click Editor

  8. -

    Click the Line Endings tab

    +

    Click the Line Endings tab

  9. @@ -262,7 +262,7 @@
  10. -

    Click OK.

  11. +

    Click OK.

You can check that the plug-in is properly installed by going to go to Tools @@ -426,11 +426,11 @@

Resolve Project Problems dialog

- Click Resolve... + Click Resolve...
  • -

    Click Close once the warning icon changes to +

    Click Close once the warning icon changes to an OK icon

  • @@ -487,9 +487,9 @@

    Tip:
    - A new JMRI checkout should build cleanly. If not, please check with the - developers group or project for help. + A new JMRI checkout should build cleanly. If not, please share your configuration on + jmri-developers groups.io or on GitHub create an + issue applying for assistance.

    Debug an Application

    @@ -568,7 +568,7 @@
  • -

    Click Add Catalog...

    +

    Click Add Catalog...

  • @@ -576,7 +576,7 @@
  • -

    Click Browse...

    +

    Click Browse...

  • @@ -584,15 +584,15 @@
  • -

    Click OK

    +

    Click OK

  • -

    Click OK

    +

    Click OK

  • -

    Click Close

    +

    Click Close

  • @@ -691,7 +691,7 @@ "caret">› Checkout  Checkout Revision..., type master in the Checkout Selected Revision box, and - click Checkout. + click Checkout.