jEdit Syntax Highlighting library

Associate
Joined
3 Oct 2006
Posts
2,304
Location
London
Hi,

I'm trying to get some syntax highlighting in a java project of mine, but I didn't fancy writing the highlighting engine thing myself. Instead I went on the hunt of a library to use and found the jEdit one.

The problem is that there is an error related to enum's (according to netbeans) in one of the methods. Basically It won't compile with java 1.5

Code:
	/**
	 * Returns the name of the specified text area action.
	 * @param listener The action
	 */
	public static String getActionName(ActionListener listener)
	{
		Enumeration enum = getActions();
		while(enum.hasMoreElements())
		{
			String name = (String)enum.nextElement();
			ActionListener _listener = getAction(name);
			if(_listener == listener)
				return name;
		}
		return null;
	}

http://skitch.com/jonb/h24d/jbird-alpha-netbeans-ide-6.5




Is anyone able to help me fix this problem, or can they suggest an alternative syntax highlighting library?

Many thanks,

Jon
 
Ignore me, I was being such an idiot. All I had to do was to change the variable name of the enum as 'enum' is a protected word in 1.5+.

:)

Code:
/**
	 * Returns the name of the specified text area action.
	 * @param listener The action
	 */
	public static String getActionName(ActionListener listener)
	{
		Enumeration enums = getActions();
		while(enums.hasMoreElements())
		{
			String name = (String)enums.nextElement();
			ActionListener _listener = getAction(name);
			if(_listener == listener)
				return name;
		}
		return null;
	}
 
Back
Top Bottom