src/Tools/jEdit/patches/jedit-4.5.0/extended_styles
author wenzelm
Sun, 04 Mar 2012 23:04:40 +0100
changeset 46817 90c8620852cf
permissions -rw-r--r--
updates for jedit-4.5.0 (still inactive);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
46817
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
     1
diff -ru 4.5.0/jEdit/org/gjt/sp/jedit/gui/StyleEditor.java 4.5.0/jEdit-patched/org/gjt/sp/jedit/gui/StyleEditor.java
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
     2
--- 4.5.0/jEdit/org/gjt/sp/jedit/gui/StyleEditor.java	2012-01-30 23:29:35.000000000 +0100
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
     3
+++ 4.5.0/jEdit-patched/org/gjt/sp/jedit/gui/StyleEditor.java	2012-03-04 22:14:51.000000000 +0100
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
     4
@@ -78,7 +78,7 @@
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
     5
 			start = next;
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
     6
 			token = token.next;
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
     7
 		}
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
     8
-		if (token.id == Token.END || token.id == Token.NULL)
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
     9
+		if (token.id == Token.END || (token.id % Token.ID_COUNT) == Token.NULL)
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    10
 		{
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    11
 			JOptionPane.showMessageDialog(textArea.getView(),
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    12
 				jEdit.getProperty("syntax-style-no-token.message"),
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    13
diff -ru 4.5.0/jEdit/org/gjt/sp/jedit/syntax/Chunk.java 4.5.0/jEdit-patched/org/gjt/sp/jedit/syntax/Chunk.java
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    14
--- 4.5.0/jEdit/org/gjt/sp/jedit/syntax/Chunk.java	2012-01-30 23:29:42.000000000 +0100
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    15
+++ 4.5.0/jEdit-patched/org/gjt/sp/jedit/syntax/Chunk.java	2012-03-04 22:12:25.000000000 +0100
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    16
@@ -380,7 +380,7 @@
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    17
 	// this is either style.getBackgroundColor() or
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    18
 	// styles[defaultID].getBackgroundColor()
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    19
 	private Color background;
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    20
-	private String str;
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    21
+	public String str;
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    22
 	//private GlyphVector gv;
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    23
 	private List<GlyphVector> glyphs;
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    24
 	private boolean visible;
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    25
diff -ru 4.5.0/jEdit/org/gjt/sp/jedit/syntax/Token.java 4.5.0/jEdit-patched/org/gjt/sp/jedit/syntax/Token.java
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    26
--- 4.5.0/jEdit/org/gjt/sp/jedit/syntax/Token.java	2012-01-30 23:29:42.000000000 +0100
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    27
+++ 4.5.0/jEdit-patched/org/gjt/sp/jedit/syntax/Token.java	2012-03-04 22:15:41.000000000 +0100
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    28
@@ -57,7 +57,7 @@
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    29
 	 */
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    30
 	public static String tokenToString(byte token)
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    31
 	{
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    32
-		return (token == Token.END) ? "END" : TOKEN_TYPES[token];
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    33
+		return (token == Token.END) ? "END" : TOKEN_TYPES[token % ID_COUNT];
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    34
 	} //}}}
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    35
 
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    36
 	//{{{ Token types
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    37
diff -ru 4.5.0/jEdit/org/gjt/sp/util/SyntaxUtilities.java 4.5.0/jEdit-patched/org/gjt/sp/util/SyntaxUtilities.java
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    38
--- 4.5.0/jEdit/org/gjt/sp/util/SyntaxUtilities.java	2012-01-30 23:29:44.000000000 +0100
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    39
+++ 4.5.0/jEdit-patched/org/gjt/sp/util/SyntaxUtilities.java	2012-03-04 22:27:19.000000000 +0100
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    40
@@ -194,7 +194,24 @@
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    41
 	{
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    42
 		return loadStyles(family,size,true);
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    43
 	}
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    44
-	
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    45
+
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    46
+	/**
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    47
+	 * Extended styles derived from the user-specified style array.
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    48
+	 */
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    49
+
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    50
+	public static class StyleExtender
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    51
+	{
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    52
+		public SyntaxStyle[] extendStyles(SyntaxStyle[] styles)
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    53
+		{
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    54
+			return styles;
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    55
+		}
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    56
+	}
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    57
+	volatile private static StyleExtender _styleExtender = new StyleExtender();
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    58
+	public static void setStyleExtender(StyleExtender ext)
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    59
+	{
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    60
+		_styleExtender = ext;
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    61
+	}
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    62
+
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    63
 	/**
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    64
 	 * Loads the syntax styles from the properties, giving them the specified
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    65
 	 * base font family and size.
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    66
@@ -224,9 +241,9 @@
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    67
 				Log.log(Log.ERROR,StandardUtilities.class,e);
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    68
 			}
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    69
 		}
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    70
-
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    71
-		return styles;
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    72
+		styles[0] = new SyntaxStyle(Color.black, null, new Font(family, 0, size));
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    73
+		return _styleExtender.extendStyles(styles);
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    74
 	} //}}}
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    75
-	
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    76
+
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    77
 	private SyntaxUtilities(){}
90c8620852cf updates for jedit-4.5.0 (still inactive);
wenzelm
parents:
diff changeset
    78
 }