org.fxmisc.richtext.demo.Editor4XML Maven / Gradle / Ivy
package org.fxmisc.richtext.demo;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.layout.StackPane;
import javafx.stage.Stage;
import org.fxmisc.flowless.VirtualizedScrollPane;
import org.fxmisc.richtext.CodeArea;
/**
* Name: Editor4XML
* Description: .
*
* Comment: ...
*
* Copyright: Copyright (c) 2016-2019
* Company: >StA-Soft<
* @author StA
* @version 1.0
*/
public class Editor4XML extends Application
{
/**
* Beispiel-Text.
*/
private static final String SAMPLE_CODE = String.join("\n", new String[]{
"",
"",
"< orders >",
" ",
" ",
" - ",
"
ESPRESSO ",
" 2 ",
" false ",
" 1 ",
" ",
" - ",
"
CAPPUCCINO ",
" 1 ",
" false ",
" 1 ",
" ",
" - ",
"
LATTE ",
" 2 ",
" false ",
" 1 ",
" ",
" - ",
"
MOCHA ",
" 3 ",
" true ",
" 1 ",
" ",
" ",
" ",
""
});
/**
* Main-Methode.
* @param args Kommandozeilenparameter
*/
public static void main(String[] args)
{
launch(args);
}
@Override
public void start(Stage primaryStage)
{
CodeArea codeArea = new TextArea4XML(true);
codeArea.replaceText(SAMPLE_CODE);
Scene scene = new Scene(new StackPane(new VirtualizedScrollPane<>(codeArea)), 600, 400);
primaryStage.setScene(scene);
primaryStage.setTitle("XML Editor Demo");
primaryStage.show();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy