@@ -14,7 +14,7 @@ public final class ElementBeschriftungPresets {
1414 public static final int PRESET_KLASSISCH = 0 ;
1515 public static final int PRESET_FORMAL = 1 ;
1616 public static final int PRESET_JAVA_NA = 2 ;
17- /** Syntaxnahe Java-Vorgaben ({@code if}, {@code condition}, …) — Programm-Standard; UI z. B. „Java (Standard)“ / „Java (Default)“ . */
17+ /** Syntaxnahe Java-Vorgaben — Programm-Standard; neue Blöcke mit Platzhaltertext, Palette mit {@link #javaStandardPaletteButtonLabel(int)} . */
1818 public static final int PRESET_ENGLISH_JAVA = 3 ;
1919 /** Didaktische Begriffe gemäß UI-Sprache ({@link StructureElementI18n}). */
2020 public static final int PRESET_DIDACTIC_I18N = 4 ;
@@ -44,13 +44,33 @@ public final class ElementBeschriftungPresets {
4444 "condition" , "condition" , "\u221e " , "break" , "method()" , "\u00f8 " },
4545 };
4646
47+ /**
48+ * Nur Palette bei {@link #PRESET_ENGLISH_JAVA}: echte Java-Schlüsselwörter / übliche Kurzformen (nicht {@code condition} für alles).
49+ * Reihenfolge = Elementtypen 0–9 wie {@link #PRESETS}.
50+ */
51+ private static final String [] JAVA_STANDARD_PALETTE_LABELS = {
52+ "Statement" ,
53+ "if" ,
54+ "switch" ,
55+ "for" ,
56+ "while" ,
57+ "do" ,
58+ "while(true)" ,
59+ "break" ,
60+ "method()" ,
61+ "\u00f8 " ,
62+ };
63+
4764 static {
4865 if (PRESETS .length != ANZAHL_PRESETS - 1 ) {
4966 throw new IllegalStateException ("Preset-Anzahl" );
5067 }
5168 if (PRESET_DIALOG_REIHENFOLGE .length != ANZAHL_PRESETS ) {
5269 throw new IllegalStateException ("Preset-Dialog-Reihenfolge" );
5370 }
71+ if (JAVA_STANDARD_PALETTE_LABELS .length != N ) {
72+ throw new IllegalStateException ("Java-Palette-L\u00e4 nge" );
73+ }
5474 for (String [] row : PRESETS ) {
5575 if (row .length != N ) {
5676 throw new IllegalStateException ("Preset-L\u00e4 nge" );
@@ -79,6 +99,14 @@ public static int presetIndexAtDialogPlatz(int dialogPlatz) {
7999 return PRESET_DIALOG_REIHENFOLGE [dialogPlatz ];
80100 }
81101
102+ /** Paletten-Button bei gewähltem Java-Standard-Preset ({@link #PRESET_ENGLISH_JAVA}). */
103+ public static String javaStandardPaletteButtonLabel (int typ ) {
104+ if (typ < 0 || typ >= JAVA_STANDARD_PALETTE_LABELS .length ) {
105+ return "" ;
106+ }
107+ return JAVA_STANDARD_PALETTE_LABELS [typ ];
108+ }
109+
82110 public static String getPresetAnzeigename (int index ) {
83111 switch (index ) {
84112 case PRESET_KLASSISCH :
0 commit comments