Automate switching between languages
This commit is contained in:
@@ -5,6 +5,8 @@
|
||||
<?import javafx.scene.control.MenuItem?>
|
||||
<?import javafx.scene.control.Menu?>
|
||||
<?import javafx.scene.control.SeparatorMenuItem?>
|
||||
<?import javafx.scene.control.ToggleGroup?>
|
||||
<?import javafx.scene.control.RadioMenuItem?>
|
||||
|
||||
<MenuBar
|
||||
fx:id="menubar"
|
||||
@@ -24,10 +26,22 @@
|
||||
<MenuItem mnemonicParsing="false" text="Save" accelerator="Shortcut+s"/>
|
||||
<MenuItem mnemonicParsing="false" text="Save as" accelerator="Shortcut+S"/>
|
||||
<SeparatorMenuItem/>
|
||||
|
||||
<fx:define>
|
||||
<ToggleGroup fx:id="languageToggleGroup"/>
|
||||
</fx:define>
|
||||
|
||||
<Menu mnemonicParsing="false" text="Change programming language">
|
||||
<items>
|
||||
<MenuItem mnemonicParsing="false" text="Java"/>
|
||||
<MenuItem mnemonicParsing="false" text="Markdown"/>
|
||||
<!-- TODO: Generate buttons based on classes -->
|
||||
<RadioMenuItem text="Java"
|
||||
fx:id="toggleJava"
|
||||
onAction="#handleLanguageChange"
|
||||
toggleGroup="$languageToggleGroup"/>
|
||||
<RadioMenuItem text="Markdown"
|
||||
fx:id="toggleMarkdown"
|
||||
onAction="#handleLanguageChange"
|
||||
toggleGroup="$languageToggleGroup"/>
|
||||
</items>
|
||||
</Menu>
|
||||
<SeparatorMenuItem/>
|
||||
|
||||
61
src/main/resources/styling/language/java.css
Normal file
61
src/main/resources/styling/language/java.css
Normal file
@@ -0,0 +1,61 @@
|
||||
|
||||
.code-area .this {
|
||||
-fx-fill: #FFFF00;
|
||||
-fx-font-weight: bold;
|
||||
}
|
||||
|
||||
.code-area .true {
|
||||
-fx-fill: #00FF00;
|
||||
-fx-font-weight: bold;
|
||||
}
|
||||
|
||||
.code-area .false {
|
||||
-fx-fill: #FF0000;
|
||||
-fx-font-weight: bold;
|
||||
}
|
||||
|
||||
.code-area .paranthesis {
|
||||
-fx-fill: -main-fg-color;
|
||||
}
|
||||
|
||||
.code-area .curlyBrackets {
|
||||
-fx-fill: -main-fg-color;
|
||||
}
|
||||
|
||||
.code-area .squareBrackets {
|
||||
-fx-fill: -main-fg-color;
|
||||
}
|
||||
|
||||
.code-area .semicolon {
|
||||
-fx-fill: -main-fg-color;
|
||||
}
|
||||
|
||||
.code-area .identifier {
|
||||
-fx-fill: -main-blue-color;
|
||||
-fx-font-weight: bold;
|
||||
}
|
||||
|
||||
.code-area .property {
|
||||
-fx-fill: -main-fg-color;
|
||||
}
|
||||
|
||||
.code-area .method {
|
||||
-fx-fill: -main-green-color;
|
||||
}
|
||||
|
||||
.code-area .keyword {
|
||||
-fx-fill: -main-red-color;
|
||||
-fx-font-weight: bold;
|
||||
}
|
||||
|
||||
.code-area .comment {
|
||||
-fx-fill: -light-bg-color;
|
||||
}
|
||||
|
||||
.code-area .string {
|
||||
-fx-fill: -main-yellow-color;
|
||||
}
|
||||
|
||||
.code-area .escapeChar {
|
||||
-fx-fill: -main-magenta-color;
|
||||
}
|
||||
71
src/main/resources/styling/language/markdown.css
Normal file
71
src/main/resources/styling/language/markdown.css
Normal file
@@ -0,0 +1,71 @@
|
||||
.code-area {
|
||||
-test-color: #193814
|
||||
}
|
||||
|
||||
.code-area .header {
|
||||
-fx-fill: -main-green-color;
|
||||
-fx-font-size: 200%;
|
||||
-fx-font-weight: bold;
|
||||
}
|
||||
|
||||
.code-area .sheader {
|
||||
-fx-fill: -main-blue-color;
|
||||
-fx-font-size: 150%;
|
||||
-fx-font-weight: bold;
|
||||
}
|
||||
|
||||
.code-area .ssheader {
|
||||
-fx-fill: -main-red-color;
|
||||
-fx-font-size: 130%;
|
||||
}
|
||||
|
||||
.code-area .sssheader {
|
||||
-fx-fill: -main-magenta-color;
|
||||
-fx-font-size: 120%;
|
||||
}
|
||||
|
||||
.code-area .ssssheader {
|
||||
-fx-fill: -main-cyan-color;
|
||||
-fx-font-size: 110%;
|
||||
}
|
||||
|
||||
.code-area .emphasized {
|
||||
-fx-fill: -main-blue-color;
|
||||
-fx-font-weight: bold;
|
||||
}
|
||||
|
||||
.code-area .italic {
|
||||
-fx-fill: -main-cyan-color;
|
||||
-fx-font-style: italic;
|
||||
}
|
||||
|
||||
.code-area .emphasizedItalic {
|
||||
-fx-fill: -main-magenta-color;
|
||||
-fx-font-weight: bold;
|
||||
-fx-font-style: italic;
|
||||
}
|
||||
|
||||
.code-area .strikethrough {
|
||||
-fx-fill: -main-red-color;
|
||||
-fx-strikethrough: true;
|
||||
}
|
||||
|
||||
.code-area .listItem {
|
||||
-fx-fill: -main-yellow-color;
|
||||
}
|
||||
|
||||
.code-area .numberedItem {
|
||||
-fx-fill: -main-yellow-color;
|
||||
}
|
||||
|
||||
.code-area .link {
|
||||
-fx-fill: -main-red-color;
|
||||
}
|
||||
|
||||
.code-area .image {
|
||||
-fx-fill: -main-magenta-color;
|
||||
}
|
||||
|
||||
.code-area .source {
|
||||
-fx-fill: -main-magenta-color;
|
||||
}
|
||||
Reference in New Issue
Block a user