Class XmlStyler
java.lang.Object
qupath.lib.gui.scripting.richtextfx.stylers.XmlStyler
- All Implemented Interfaces:
ScriptStyler
Styling to apply to a
CodeArea
for XML.
This is based on XMLEditorDemo.java
from RichTextFX, available at
https://github.com/FXMisc/RichTextFX/blob/master/richtextfx-demos/src/main/java/org/fxmisc/richtext/demo/XMLEditorDemo.java
and adapted for use in QuPath.
The license for RichTextFX is given below:
Copyright (c) 2013-2017, Tomas Mikula and contributors All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- Since:
- v0.4.0
- Author:
- Pete Bankhead
-
Method Summary
Modifier and TypeMethodDescriptionorg.fxmisc.richtext.model.StyleSpans
<Collection<String>> computeEditorStyles
(String text) Compute styling for the specifiedtext
, considering it will be used in the main editor.Get a set of the scripting languages supported by this styler.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface qupath.lib.gui.scripting.richtextfx.stylers.ScriptStyler
computeConsoleStyles, getBaseStyle
-
Method Details
-
getLanguageNames
Description copied from interface:ScriptStyler
Get a set of the scripting languages supported by this styler.Note: One of the names returned by this method must match exactly (but case-insensitive) that of the corresponding
ScriptLanguage
for QuPath to automatically apply it to the script editor when needed.- Specified by:
getLanguageNames
in interfaceScriptStyler
- Returns:
-
computeEditorStyles
Description copied from interface:ScriptStyler
Compute styling for the specifiedtext
, considering it will be used in the main editor.- Specified by:
computeEditorStyles
in interfaceScriptStyler
- Parameters:
text
- the text to process styling for- Returns:
- stylespans the
StyleSpans
to apply
-