PageRenderTime 33ms CodeModel.GetById 15ms app.highlight 12ms RepoModel.GetById 2ms app.codeStats 0ms

/www/tags/NOV_07_2009/htdocs/api/org/gjt/sp/util/SyntaxUtilities.html

#
HTML | 359 lines | 307 code | 40 blank | 12 comment | 0 complexity | b5c4902abdf18ef866105c5e164cccf5 MD5 | raw file
  1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2<!--NewPage-->
  3<HTML>
  4<HEAD>
  5<!-- Generated by javadoc (build 1.5.0_14) on Tue Jul 22 07:14:17 GMT-08:00 2008 -->
  6<TITLE>
  7SyntaxUtilities (jEdit API)
  8</TITLE>
  9
 10<META NAME="keywords" CONTENT="org.gjt.sp.util.SyntaxUtilities class">
 11
 12<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
 13
 14
 15<NOSCRIPT>
 16</NOSCRIPT>
 17
 18</HEAD>
 19
 20<BODY BGCOLOR="white" >
 21
 22
 23<!-- ========= START OF TOP NAVBAR ======= -->
 24<A NAME="navbar_top"><!-- --></A>
 25<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
 26<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
 27<TR>
 28<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
 29<A NAME="navbar_top_firstrow"><!-- --></A>
 30<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
 31  <TR ALIGN="center" VALIGN="top">
 32  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
 33  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
 34  <TD BGCOLOR="#00008B" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
 35  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/SyntaxUtilities.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
 36  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
 37  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
 38  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
 39  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
 40  </TR>
 41</TABLE>
 42</TD>
 43<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
 44</EM>
 45</TD>
 46</TR>
 47
 48<TR>
 49<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
 50&nbsp;<A HREF="../../../../org/gjt/sp/util/StringList.html" title="class in org.gjt.sp.util"><B>PREV CLASS</B></A>&nbsp;
 51&nbsp;<A HREF="../../../../org/gjt/sp/util/ThreadAbortMonitor.html" title="interface in org.gjt.sp.util"><B>NEXT CLASS</B></A></FONT></TD>
 52<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
 53  <A HREF="../../../../index.html?org/gjt/sp/util/SyntaxUtilities.html" target="_top"><B>FRAMES</B></A>  &nbsp;
 54&nbsp;<A HREF="SyntaxUtilities.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
 55&nbsp;
 56<NOSCRIPT>
 57  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
 58</NOSCRIPT>
 59
 60
 61</FONT></TD>
 62</TR>
 63<TR>
 64<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
 65  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
 66<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
 67DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
 68</TR>
 69</TABLE>
 70<A NAME="skip-navbar_top"></A>
 71<!-- ========= END OF TOP NAVBAR ========= -->
 72
 73<HR>
 74<!-- ======== START OF CLASS DATA ======== -->
 75<H2>
 76<FONT SIZE="-1">
 77org.gjt.sp.util</FONT>
 78<BR>
 79Class SyntaxUtilities</H2>
 80<PRE>
 81java.lang.Object
 82  <IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>org.gjt.sp.util.SyntaxUtilities</B>
 83</PRE>
 84<HR>
 85<DL>
 86<DT><PRE>public class <B>SyntaxUtilities</B><DT>extends java.lang.Object</DL>
 87</PRE>
 88
 89<P>
 90Syntax utilities that depends on JDK only and syntax package.
 91<P>
 92
 93<P>
 94<DL>
 95<DT><B>Since:</B></DT>
 96  <DD>4.3pre13</DD>
 97</DL>
 98<HR>
 99
100<P>
101<!-- =========== FIELD SUMMARY =========== -->
102
103<A NAME="field_summary"><!-- --></A>
104<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
105<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
106<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
107<B>Field Summary</B></FONT></TH>
108</TR>
109<TR BGCOLOR="white" CLASS="TableRowColor">
110<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
111<CODE>static&nbsp;<A HREF="../../../../org/gjt/sp/jedit/IPropertyManager.html" title="interface in org.gjt.sp.jedit">IPropertyManager</A></CODE></FONT></TD>
112<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/SyntaxUtilities.html#propertyManager">propertyManager</A></B></CODE>
113
114<BR>
115&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
116</TR>
117</TABLE>
118&nbsp;
119<!-- ========== METHOD SUMMARY =========== -->
120
121<A NAME="method_summary"><!-- --></A>
122<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
123<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
124<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
125<B>Method Summary</B></FONT></TH>
126</TR>
127<TR BGCOLOR="white" CLASS="TableRowColor">
128<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
129<CODE>static&nbsp;java.lang.String</CODE></FONT></TD>
130<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/SyntaxUtilities.html#getColorHexString(java.awt.Color)">getColorHexString</A></B>(java.awt.Color&nbsp;c)</CODE>
131
132<BR>
133&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts a color object to its hex value.</TD>
134</TR>
135<TR BGCOLOR="white" CLASS="TableRowColor">
136<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
137<CODE>static&nbsp;<A HREF="../../../../org/gjt/sp/jedit/syntax/SyntaxStyle.html" title="class in org.gjt.sp.jedit.syntax">SyntaxStyle</A>[]</CODE></FONT></TD>
138<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/SyntaxUtilities.html#loadStyles(java.lang.String, int)">loadStyles</A></B>(java.lang.String&nbsp;family,
139           int&nbsp;size)</CODE>
140
141<BR>
142&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Loads the syntax styles from the properties, giving them the specified
143 base font family and size.</TD>
144</TR>
145<TR BGCOLOR="white" CLASS="TableRowColor">
146<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
147<CODE>static&nbsp;<A HREF="../../../../org/gjt/sp/jedit/syntax/SyntaxStyle.html" title="class in org.gjt.sp.jedit.syntax">SyntaxStyle</A>[]</CODE></FONT></TD>
148<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/SyntaxUtilities.html#loadStyles(java.lang.String, int, boolean)">loadStyles</A></B>(java.lang.String&nbsp;family,
149           int&nbsp;size,
150           boolean&nbsp;color)</CODE>
151
152<BR>
153&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Loads the syntax styles from the properties, giving them the specified
154 base font family and size.</TD>
155</TR>
156<TR BGCOLOR="white" CLASS="TableRowColor">
157<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
158<CODE>static&nbsp;java.awt.Color</CODE></FONT></TD>
159<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/SyntaxUtilities.html#parseColor(java.lang.String, java.awt.Color)">parseColor</A></B>(java.lang.String&nbsp;name,
160           java.awt.Color&nbsp;defaultColor)</CODE>
161
162<BR>
163&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD>
164</TR>
165<TR BGCOLOR="white" CLASS="TableRowColor">
166<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
167<CODE>static&nbsp;<A HREF="../../../../org/gjt/sp/jedit/syntax/SyntaxStyle.html" title="class in org.gjt.sp.jedit.syntax">SyntaxStyle</A></CODE></FONT></TD>
168<TD><CODE><B><A HREF="../../../../org/gjt/sp/util/SyntaxUtilities.html#parseStyle(java.lang.String, java.lang.String, int, boolean)">parseStyle</A></B>(java.lang.String&nbsp;str,
169           java.lang.String&nbsp;family,
170           int&nbsp;size,
171           boolean&nbsp;color)</CODE>
172
173<BR>
174&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Converts a style string to a style object.</TD>
175</TR>
176</TABLE>
177&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
178<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
179<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
180<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
181</TR>
182<TR BGCOLOR="white" CLASS="TableRowColor">
183<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
184</TR>
185</TABLE>
186&nbsp;
187<P>
188
189<!-- ============ FIELD DETAIL =========== -->
190
191<A NAME="field_detail"><!-- --></A>
192<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
193<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
194<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
195<B>Field Detail</B></FONT></TH>
196</TR>
197</TABLE>
198
199<A NAME="propertyManager"><!-- --></A><H3>
200propertyManager</H3>
201<PRE>
202public static <A HREF="../../../../org/gjt/sp/jedit/IPropertyManager.html" title="interface in org.gjt.sp.jedit">IPropertyManager</A> <B>propertyManager</B></PRE>
203<DL>
204<DL>
205</DL>
206</DL>
207
208<!-- ============ METHOD DETAIL ========== -->
209
210<A NAME="method_detail"><!-- --></A>
211<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
212<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
213<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
214<B>Method Detail</B></FONT></TH>
215</TR>
216</TABLE>
217
218<A NAME="getColorHexString(java.awt.Color)"><!-- --></A><H3>
219getColorHexString</H3>
220<PRE>
221public static java.lang.String <B>getColorHexString</B>(java.awt.Color&nbsp;c)</PRE>
222<DL>
223<DD>Converts a color object to its hex value. The hex value
224 prefixed is with `#', for example `#ff0088'.
225<P>
226<DD><DL>
227<DT><B>Parameters:</B><DD><CODE>c</CODE> - The color object<DT><B>Since:</B></DT>
228  <DD>jEdit 4.3pre13</DD>
229</DL>
230</DD>
231</DL>
232<HR>
233
234<A NAME="parseColor(java.lang.String, java.awt.Color)"><!-- --></A><H3>
235parseColor</H3>
236<PRE>
237public static java.awt.Color <B>parseColor</B>(java.lang.String&nbsp;name,
238                                        java.awt.Color&nbsp;defaultColor)</PRE>
239<DL>
240<DD><DL>
241<DT><B>Since:</B></DT>
242  <DD>jEdit 4.3pre13</DD>
243</DL>
244</DD>
245</DL>
246<HR>
247
248<A NAME="parseStyle(java.lang.String, java.lang.String, int, boolean)"><!-- --></A><H3>
249parseStyle</H3>
250<PRE>
251public static <A HREF="../../../../org/gjt/sp/jedit/syntax/SyntaxStyle.html" title="class in org.gjt.sp.jedit.syntax">SyntaxStyle</A> <B>parseStyle</B>(java.lang.String&nbsp;str,
252                                     java.lang.String&nbsp;family,
253                                     int&nbsp;size,
254                                     boolean&nbsp;color)
255                              throws java.lang.IllegalArgumentException</PRE>
256<DL>
257<DD>Converts a style string to a style object.
258<P>
259<DD><DL>
260<DT><B>Parameters:</B><DD><CODE>str</CODE> - The style string<DD><CODE>family</CODE> - Style strings only specify font style, not font family<DD><CODE>size</CODE> - Style strings only specify font style, not font family<DD><CODE>color</CODE> - If false, the styles will be monochrome
261<DT><B>Throws:</B>
262<DD><CODE>java.lang.IllegalArgumentException</CODE> - if the style is invalid<DT><B>Since:</B></DT>
263  <DD>jEdit 4.3pre13</DD>
264</DL>
265</DD>
266</DL>
267<HR>
268
269<A NAME="loadStyles(java.lang.String, int)"><!-- --></A><H3>
270loadStyles</H3>
271<PRE>
272public static <A HREF="../../../../org/gjt/sp/jedit/syntax/SyntaxStyle.html" title="class in org.gjt.sp.jedit.syntax">SyntaxStyle</A>[] <B>loadStyles</B>(java.lang.String&nbsp;family,
273                                       int&nbsp;size)</PRE>
274<DL>
275<DD>Loads the syntax styles from the properties, giving them the specified
276 base font family and size.
277<P>
278<DD><DL>
279<DT><B>Parameters:</B><DD><CODE>family</CODE> - The font family<DD><CODE>size</CODE> - The font size<DT><B>Since:</B></DT>
280  <DD>jEdit 4.3pre13</DD>
281</DL>
282</DD>
283</DL>
284<HR>
285
286<A NAME="loadStyles(java.lang.String, int, boolean)"><!-- --></A><H3>
287loadStyles</H3>
288<PRE>
289public static <A HREF="../../../../org/gjt/sp/jedit/syntax/SyntaxStyle.html" title="class in org.gjt.sp.jedit.syntax">SyntaxStyle</A>[] <B>loadStyles</B>(java.lang.String&nbsp;family,
290                                       int&nbsp;size,
291                                       boolean&nbsp;color)</PRE>
292<DL>
293<DD>Loads the syntax styles from the properties, giving them the specified
294 base font family and size.
295<P>
296<DD><DL>
297<DT><B>Parameters:</B><DD><CODE>family</CODE> - The font family<DD><CODE>size</CODE> - The font size<DD><CODE>color</CODE> - If false, the styles will be monochrome<DT><B>Since:</B></DT>
298  <DD>jEdit 4.3pre13</DD>
299</DL>
300</DD>
301</DL>
302<!-- ========= END OF CLASS DATA ========= -->
303<HR>
304
305
306<!-- ======= START OF BOTTOM NAVBAR ====== -->
307<A NAME="navbar_bottom"><!-- --></A>
308<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
309<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
310<TR>
311<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
312<A NAME="navbar_bottom_firstrow"><!-- --></A>
313<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
314  <TR ALIGN="center" VALIGN="top">
315  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
316  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
317  <TD BGCOLOR="#00008B" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
318  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/SyntaxUtilities.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
319  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
320  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
321  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
322  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
323  </TR>
324</TABLE>
325</TD>
326<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
327</EM>
328</TD>
329</TR>
330
331<TR>
332<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
333&nbsp;<A HREF="../../../../org/gjt/sp/util/StringList.html" title="class in org.gjt.sp.util"><B>PREV CLASS</B></A>&nbsp;
334&nbsp;<A HREF="../../../../org/gjt/sp/util/ThreadAbortMonitor.html" title="interface in org.gjt.sp.util"><B>NEXT CLASS</B></A></FONT></TD>
335<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
336  <A HREF="../../../../index.html?org/gjt/sp/util/SyntaxUtilities.html" target="_top"><B>FRAMES</B></A>  &nbsp;
337&nbsp;<A HREF="SyntaxUtilities.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
338&nbsp;
339<NOSCRIPT>
340  <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
341</NOSCRIPT>
342
343
344</FONT></TD>
345</TR>
346<TR>
347<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
348  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
349<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
350DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;CONSTR&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
351</TR>
352</TABLE>
353<A NAME="skip-navbar_bottom"></A>
354<!-- ======== END OF BOTTOM NAVBAR ======= -->
355
356<HR>
357
358</BODY>
359</HTML>