01: package net.sourceforge.squirrel_sql.plugins.hibernate;
02:
03: import net.sourceforge.squirrel_sql.client.session.ISyntaxHighlightTokenMatcher;
04: import net.sourceforge.squirrel_sql.client.session.ISession;
05: import net.sourceforge.squirrel_sql.client.session.SQLTokenListener;
06:
07: import javax.swing.*;
08:
09: public class HqlSyntaxHighlightTokenMatcherProxy implements
10: ISyntaxHighlightTokenMatcher {
11: private ISyntaxHighlightTokenMatcher _delegate;
12: private JEditorPane _editorPane;
13:
14: public boolean isTable(char[] buffer, int offset, int len) {
15: if (null == _delegate) {
16: return false;
17: }
18:
19: return _delegate.isTable(buffer, offset, len);
20: }
21:
22: public boolean isFunction(char[] buffer, int offset, int len) {
23: if (null == _delegate) {
24: return false;
25: }
26:
27: return _delegate.isFunction(buffer, offset, len);
28: }
29:
30: public boolean isDataType(char[] buffer, int offset, int len) {
31: if (null == _delegate) {
32: return false;
33: }
34:
35: return _delegate.isDataType(buffer, offset, len);
36: }
37:
38: public boolean isStatementSeparator(char[] buffer, int offset,
39: int len) {
40: if (null == _delegate) {
41: return false;
42: }
43:
44: return _delegate.isStatementSeparator(buffer, offset, len);
45: }
46:
47: public boolean isColumn(char[] buffer, int offset, int len) {
48: if (null == _delegate) {
49: return false;
50: }
51:
52: return _delegate.isColumn(buffer, offset, len);
53: }
54:
55: public boolean isKeyword(char[] buffer, int offset, int len) {
56: if (null == _delegate) {
57: return false;
58: }
59:
60: return _delegate.isKeyword(buffer, offset, len);
61: }
62:
63: public void removeSQLTokenListener(SQLTokenListener tl) {
64: }
65:
66: public void addSQLTokenListener(SQLTokenListener tl) {
67: }
68:
69: public void setDelegate(ISyntaxHighlightTokenMatcher delegate) {
70: _delegate = delegate;
71: if (null != _editorPane) {
72: _editorPane.repaint();
73: }
74: }
75:
76: public void setEditorPane(JEditorPane editorPane) {
77: _editorPane = editorPane;
78: _editorPane.repaint();
79: }
80: }
|