001: /*
002: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003: *
004: * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
005: *
006: * The contents of this file are subject to the terms of either the GNU
007: * General Public License Version 2 only ("GPL") or the Common
008: * Development and Distribution License("CDDL") (collectively, the
009: * "License"). You may not use this file except in compliance with the
010: * License. You can obtain a copy of the License at
011: * http://www.netbeans.org/cddl-gplv2.html
012: * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
013: * specific language governing permissions and limitations under the
014: * License. When distributing the software, include this License Header
015: * Notice in each file and include the License file at
016: * nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
017: * particular file as subject to the "Classpath" exception as provided
018: * by Sun in the GPL Version 2 section of the License file that
019: * accompanied this code. If applicable, add the following below the
020: * License Header, with the fields enclosed by brackets [] replaced by
021: * your own identifying information:
022: * "Portions Copyrighted [year] [name of copyright owner]"
023: *
024: * Contributor(s):
025: *
026: * The Original Software is NetBeans. The Initial Developer of the Original
027: * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
028: * Microsystems, Inc. All Rights Reserved.
029: *
030: * If you wish your version of this file to be governed by only the CDDL
031: * or only the GPL Version 2, indicate your decision by adding
032: * "[Contributor] elects to include this software in this distribution
033: * under the [CDDL or GPL Version 2] license." If you do not indicate a
034: * single choice of license, a recipient has the option to distribute
035: * your version of this file under either the CDDL, the GPL Version 2 or
036: * to extend the choice of license to its licensees as provided above.
037: * However, if you add GPL Version 2 code and therefore, elected the GPL
038: * Version 2 license, then the option applies only if the new code is
039: * made subject to such option by the copyright holder.
040: */
041:
042: package org.netbeans.lib.ddl.adaptors;
043:
044: import java.awt.Component;
045: import java.awt.Graphics;
046: import java.awt.Rectangle;
047: import java.beans.PropertyChangeListener;
048: import java.beans.PropertyChangeSupport;
049: import java.beans.PropertyDescriptor;
050: import java.beans.PropertyEditor;
051: import java.beans.SimpleBeanInfo;
052: import org.openide.util.Exceptions;
053: import org.openide.util.NbBundle;
054:
055: public class DefaultAdaptorBeanInfo extends SimpleBeanInfo {
056: /** Descriptor of valid properties
057: * @return array of properties
058: */
059: public PropertyDescriptor[] getPropertyDescriptors() {
060: PropertyDescriptor[] desc = null;
061: try {
062:
063: desc = new PropertyDescriptor[] {
064:
065: // Basic properties: 65 items
066:
067: new PropertyDescriptor(
068: DefaultAdaptor.PROP_PROCEDURES_ARE_CALLABLE,
069: DefaultAdaptor.class),
070: new PropertyDescriptor(
071: DefaultAdaptor.PROP_TABLES_ARE_SELECTABLE,
072: DefaultAdaptor.class),
073: new PropertyDescriptor(
074: DefaultAdaptor.PROP_READONLY,
075: DefaultAdaptor.class, "getreadOnly",
076: "setreadOnly"), // NOI18N
077: new PropertyDescriptor(
078: DefaultAdaptor.PROP_LOCAL_FILES,
079: DefaultAdaptor.class),
080: new PropertyDescriptor(
081: DefaultAdaptor.PROP_FILE_PER_TABLE,
082: DefaultAdaptor.class),
083: new PropertyDescriptor(
084: DefaultAdaptor.PROP_MIXEDCASE_IDENTIFIERS,
085: DefaultAdaptor.class),
086: new PropertyDescriptor(
087: DefaultAdaptor.PROP_MIXEDCASE_QUOTED_IDENTIFIERS,
088: DefaultAdaptor.class),
089: new PropertyDescriptor(
090: DefaultAdaptor.PROP_ALTER_ADD,
091: DefaultAdaptor.class),
092: new PropertyDescriptor(
093: DefaultAdaptor.PROP_ALTER_DROP,
094: DefaultAdaptor.class),
095: new PropertyDescriptor(
096: DefaultAdaptor.PROP_COLUMN_ALIASING,
097: DefaultAdaptor.class),
098:
099: new PropertyDescriptor(
100: DefaultAdaptor.PROP_NULL_PLUS_NULL_IS_NULL,
101: DefaultAdaptor.class),
102: new PropertyDescriptor(DefaultAdaptor.PROP_CONVERT,
103: DefaultAdaptor.class),
104: new PropertyDescriptor(
105: DefaultAdaptor.PROP_TABLE_CORRELATION_NAMES,
106: DefaultAdaptor.class),
107: new PropertyDescriptor(
108: DefaultAdaptor.PROP_DIFF_TABLE_CORRELATION_NAMES,
109: DefaultAdaptor.class),
110: new PropertyDescriptor(
111: DefaultAdaptor.PROP_EXPRESSIONS_IN_ORDERBY,
112: DefaultAdaptor.class),
113: new PropertyDescriptor(
114: DefaultAdaptor.PROP_ORDER_BY_UNRELATED,
115: DefaultAdaptor.class),
116: new PropertyDescriptor(
117: DefaultAdaptor.PROP_GROUP_BY,
118: DefaultAdaptor.class),
119: new PropertyDescriptor(
120: DefaultAdaptor.PROP_UNRELATED_GROUP_BY,
121: DefaultAdaptor.class),
122: new PropertyDescriptor(
123: DefaultAdaptor.PROP_BEYOND_GROUP_BY,
124: DefaultAdaptor.class),
125: new PropertyDescriptor(
126: DefaultAdaptor.PROP_ESCAPE_LIKE,
127: DefaultAdaptor.class),
128:
129: new PropertyDescriptor(
130: DefaultAdaptor.PROP_MULTIPLE_RS,
131: DefaultAdaptor.class),
132: new PropertyDescriptor(
133: DefaultAdaptor.PROP_MULTIPLE_TRANSACTIONS,
134: DefaultAdaptor.class),
135: new PropertyDescriptor(
136: DefaultAdaptor.PROP_NON_NULL_COLUMNSS,
137: DefaultAdaptor.class),
138: new PropertyDescriptor(
139: DefaultAdaptor.PROP_MINUMUM_SQL_GRAMMAR,
140: DefaultAdaptor.class),
141: new PropertyDescriptor(
142: DefaultAdaptor.PROP_CORE_SQL_GRAMMAR,
143: DefaultAdaptor.class),
144: new PropertyDescriptor(
145: DefaultAdaptor.PROP_EXTENDED_SQL_GRAMMAR,
146: DefaultAdaptor.class),
147: new PropertyDescriptor(
148: DefaultAdaptor.PROP_ANSI_SQL_GRAMMAR,
149: DefaultAdaptor.class),
150: new PropertyDescriptor(
151: DefaultAdaptor.PROP_INTERMEDIATE_SQL_GRAMMAR,
152: DefaultAdaptor.class),
153: new PropertyDescriptor(
154: DefaultAdaptor.PROP_FULL_SQL_GRAMMAR,
155: DefaultAdaptor.class),
156: new PropertyDescriptor(
157: DefaultAdaptor.PROP_INTEGRITY_ENHANCEMENT,
158: DefaultAdaptor.class),
159:
160: new PropertyDescriptor(
161: DefaultAdaptor.PROP_OUTER_JOINS,
162: DefaultAdaptor.class),
163: new PropertyDescriptor(
164: DefaultAdaptor.PROP_FULL_OUTER_JOINS,
165: DefaultAdaptor.class),
166: new PropertyDescriptor(
167: DefaultAdaptor.PROP_LIMITED_OUTER_JOINS,
168: DefaultAdaptor.class),
169: new PropertyDescriptor(
170: DefaultAdaptor.PROP_CATALOG_AT_START,
171: DefaultAdaptor.class, "getcatalogAtStart",
172: "setcatalogAtStart"), // NOI18N
173: new PropertyDescriptor(
174: DefaultAdaptor.PROP_SCHEMAS_IN_DML,
175: DefaultAdaptor.class),
176: new PropertyDescriptor(
177: DefaultAdaptor.PROP_SCHEMAS_IN_PROCEDURE_CALL,
178: DefaultAdaptor.class),
179: new PropertyDescriptor(
180: DefaultAdaptor.PROP_SCHEMAS_IN_TABLE_DEFINITION,
181: DefaultAdaptor.class),
182: new PropertyDescriptor(
183: DefaultAdaptor.PROP_SCHEMAS_IN_INDEX,
184: DefaultAdaptor.class),
185: new PropertyDescriptor(
186: DefaultAdaptor.PROP_SCHEMAS_IN_PRIVILEGE_DEFINITION,
187: DefaultAdaptor.class),
188: new PropertyDescriptor(
189: DefaultAdaptor.PROP_CATALOGS_IN_DML,
190: DefaultAdaptor.class),
191:
192: new PropertyDescriptor(
193: DefaultAdaptor.PROP_CATALOGS_IN_PROCEDURE_CALL,
194: DefaultAdaptor.class),
195: new PropertyDescriptor(
196: DefaultAdaptor.PROP_CATALOGS_IN_TABLE_DEFINITION,
197: DefaultAdaptor.class),
198: new PropertyDescriptor(
199: DefaultAdaptor.PROP_CATALOGS_IN_INDEX,
200: DefaultAdaptor.class),
201: new PropertyDescriptor(
202: DefaultAdaptor.PROP_CATALOGS_IN_PRIVILEGE_DEFINITION,
203: DefaultAdaptor.class),
204: new PropertyDescriptor(
205: DefaultAdaptor.PROP_POSITIONED_DELETE,
206: DefaultAdaptor.class),
207: new PropertyDescriptor(
208: DefaultAdaptor.PROP_POSITIONED_UPDATE,
209: DefaultAdaptor.class),
210: new PropertyDescriptor(
211: DefaultAdaptor.PROP_SELECT_FOR_UPDATE,
212: DefaultAdaptor.class),
213: new PropertyDescriptor(
214: DefaultAdaptor.PROP_STORED_PROCEDURES,
215: DefaultAdaptor.class),
216: new PropertyDescriptor(
217: DefaultAdaptor.PROP_SUBQUERY_IN_COMPARSIONS,
218: DefaultAdaptor.class),
219: new PropertyDescriptor(
220: DefaultAdaptor.PROP_SUBQUERY_IN_EXISTS,
221: DefaultAdaptor.class),
222: new PropertyDescriptor(
223: DefaultAdaptor.PROP_SUBQUERY_IN_INS,
224: DefaultAdaptor.class),
225:
226: new PropertyDescriptor(
227: DefaultAdaptor.PROP_SUBQUERY_IN_QUANTIFIEDS,
228: DefaultAdaptor.class),
229: new PropertyDescriptor(
230: DefaultAdaptor.PROP_CORRELATED_SUBQUERIES,
231: DefaultAdaptor.class),
232: new PropertyDescriptor(DefaultAdaptor.PROP_UNION,
233: DefaultAdaptor.class),
234: new PropertyDescriptor(
235: DefaultAdaptor.PROP_UNION_ALL,
236: DefaultAdaptor.class),
237: new PropertyDescriptor(
238: DefaultAdaptor.PROP_OPEN_CURSORS_ACROSS_COMMIT,
239: DefaultAdaptor.class),
240: new PropertyDescriptor(
241: DefaultAdaptor.PROP_OPEN_CURSORS_ACROSS_ROLLBACK,
242: DefaultAdaptor.class),
243: new PropertyDescriptor(
244: DefaultAdaptor.PROP_OPEN_STATEMENTS_ACROSS_COMMIT,
245: DefaultAdaptor.class),
246: new PropertyDescriptor(
247: DefaultAdaptor.PROP_OPEN_STATEMENTS_ACROSS_ROLLBACK,
248: DefaultAdaptor.class),
249: new PropertyDescriptor(
250: DefaultAdaptor.PROP_ROWSIZE_INCLUDING_BLOBS,
251: DefaultAdaptor.class),
252: new PropertyDescriptor(
253: DefaultAdaptor.PROP_TRANSACTIONS,
254: DefaultAdaptor.class),
255:
256: new PropertyDescriptor(
257: DefaultAdaptor.PROP_DDL_AND_DML_TRANSACTIONS,
258: DefaultAdaptor.class),
259: new PropertyDescriptor(
260: DefaultAdaptor.PROP_DML_TRANSACTIONS_ONLY,
261: DefaultAdaptor.class),
262: new PropertyDescriptor(
263: DefaultAdaptor.PROP_DDL_CAUSES_COMMIT,
264: DefaultAdaptor.class),
265: new PropertyDescriptor(
266: DefaultAdaptor.PROP_DDL_IGNORED_IN_TRANSACTIONS,
267: DefaultAdaptor.class),
268: new PropertyDescriptor(
269: DefaultAdaptor.PROP_BATCH_UPDATES,
270: DefaultAdaptor.class),
271:
272: // Integer properties: 24 items
273:
274: new PropertyDescriptor(
275: DefaultAdaptor.PROP_NULL_SORT,
276: DefaultAdaptor.class),
277: new PropertyDescriptor(
278: DefaultAdaptor.PROP_IDENTIFIER_STORE,
279: DefaultAdaptor.class),
280: new PropertyDescriptor(
281: DefaultAdaptor.PROP_QUOTED_IDENTS,
282: DefaultAdaptor.class),
283: new PropertyDescriptor(
284: DefaultAdaptor.PROP_MAX_BINARY_LITERAL_LENGTH,
285: DefaultAdaptor.class),
286: new PropertyDescriptor(
287: DefaultAdaptor.PROP_MAX_CHAR_LITERAL_LENGTH,
288: DefaultAdaptor.class),
289: new PropertyDescriptor(
290: DefaultAdaptor.PROP_MAX_COLUMN_NAME_LENGTH,
291: DefaultAdaptor.class),
292: new PropertyDescriptor(
293: DefaultAdaptor.PROP_MAX_COLUMNS_IN_GROUPBY,
294: DefaultAdaptor.class),
295: new PropertyDescriptor(
296: DefaultAdaptor.PROP_MAX_COLUMNS_IN_INDEX,
297: DefaultAdaptor.class),
298: new PropertyDescriptor(
299: DefaultAdaptor.PROP_MAX_COLUMNS_IN_ORDERBY,
300: DefaultAdaptor.class),
301: new PropertyDescriptor(
302: DefaultAdaptor.PROP_MAX_COLUMNS_IN_SELECT,
303: DefaultAdaptor.class),
304:
305: new PropertyDescriptor(
306: DefaultAdaptor.PROP_MAX_COLUMNS_IN_TABLE,
307: DefaultAdaptor.class),
308: new PropertyDescriptor(
309: DefaultAdaptor.PROP_MAX_CONNECTIONS,
310: DefaultAdaptor.class),
311: new PropertyDescriptor(
312: DefaultAdaptor.PROP_MAX_CURSORNAME_LENGTH,
313: DefaultAdaptor.class),
314: new PropertyDescriptor(
315: DefaultAdaptor.PROP_MAX_INDEX_LENGTH,
316: DefaultAdaptor.class),
317: new PropertyDescriptor(
318: DefaultAdaptor.PROP_MAX_SCHEMA_NAME,
319: DefaultAdaptor.class),
320: new PropertyDescriptor(
321: DefaultAdaptor.PROP_MAX_PROCEDURE_NAME,
322: DefaultAdaptor.class),
323: new PropertyDescriptor(
324: DefaultAdaptor.PROP_MAX_CATALOG_NAME,
325: DefaultAdaptor.class),
326: new PropertyDescriptor(
327: DefaultAdaptor.PROP_MAX_ROW_SIZE,
328: DefaultAdaptor.class),
329: new PropertyDescriptor(
330: DefaultAdaptor.PROP_MAX_STATEMENT_LENGTH,
331: DefaultAdaptor.class),
332: new PropertyDescriptor(
333: DefaultAdaptor.PROP_MAX_STATEMENTS,
334: DefaultAdaptor.class),
335:
336: new PropertyDescriptor(
337: DefaultAdaptor.PROP_MAX_TABLENAME_LENGTH,
338: DefaultAdaptor.class),
339: new PropertyDescriptor(
340: DefaultAdaptor.PROP_MAX_TABLES_IN_SELECT,
341: DefaultAdaptor.class),
342: new PropertyDescriptor(
343: DefaultAdaptor.PROP_MAX_USERNAME,
344: DefaultAdaptor.class),
345: new PropertyDescriptor(
346: DefaultAdaptor.PROP_DEFAULT_ISOLATION,
347: DefaultAdaptor.class),
348:
349: // String properties: 20 items
350:
351: new PropertyDescriptor(DefaultAdaptor.PROP_URL,
352: DefaultAdaptor.class),
353: new PropertyDescriptor(
354: DefaultAdaptor.PROP_USERNAME,
355: DefaultAdaptor.class),
356: new PropertyDescriptor(
357: DefaultAdaptor.PROP_PRODUCTNAME,
358: DefaultAdaptor.class),
359: new PropertyDescriptor(
360: DefaultAdaptor.PROP_PRODUCTVERSION,
361: DefaultAdaptor.class),
362: new PropertyDescriptor(
363: DefaultAdaptor.PROP_DRIVERNAME,
364: DefaultAdaptor.class),
365: new PropertyDescriptor(
366: DefaultAdaptor.PROP_DRIVER_VERSION,
367: DefaultAdaptor.class),
368: new PropertyDescriptor(
369: DefaultAdaptor.PROP_DRIVER_MAJOR_VERSION,
370: DefaultAdaptor.class),
371: new PropertyDescriptor(
372: DefaultAdaptor.PROP_DRIVER_MINOR_VERSION,
373: DefaultAdaptor.class),
374: new PropertyDescriptor(
375: DefaultAdaptor.PROP_IDENTIFIER_QUOTE,
376: DefaultAdaptor.class),
377: new PropertyDescriptor(
378: DefaultAdaptor.PROP_SQL_KEYWORDS,
379: DefaultAdaptor.class),
380:
381: new PropertyDescriptor(
382: DefaultAdaptor.PROP_NUMERIC_FUNCTIONS,
383: DefaultAdaptor.class),
384: new PropertyDescriptor(
385: DefaultAdaptor.PROP_STRING_FUNCTIONS,
386: DefaultAdaptor.class),
387: new PropertyDescriptor(
388: DefaultAdaptor.PROP_SYSTEM_FUNCTIONS,
389: DefaultAdaptor.class),
390: new PropertyDescriptor(
391: DefaultAdaptor.PROP_TIME_FUNCTIONS,
392: DefaultAdaptor.class),
393: new PropertyDescriptor(
394: DefaultAdaptor.PROP_STRING_ESCAPE,
395: DefaultAdaptor.class),
396: new PropertyDescriptor(
397: DefaultAdaptor.PROP_EXTRA_CHARACTERS,
398: DefaultAdaptor.class),
399: new PropertyDescriptor(
400: DefaultAdaptor.PROP_SCHEMA_TERM,
401: DefaultAdaptor.class),
402: new PropertyDescriptor(
403: DefaultAdaptor.PROP_PROCEDURE_TERM,
404: DefaultAdaptor.class),
405: new PropertyDescriptor(
406: DefaultAdaptor.PROP_CATALOG_TERM,
407: DefaultAdaptor.class),
408: new PropertyDescriptor(
409: DefaultAdaptor.PROP_CATALOGS_SEPARATOR,
410: DefaultAdaptor.class),
411:
412: // Extensions
413:
414: new PropertyDescriptor(
415: DefaultAdaptor.PROP_CAPITALIZE_USERNAME,
416: DefaultAdaptor.class),
417:
418: // Queries
419:
420: new PropertyDescriptor(
421: DefaultAdaptor.PROP_PROCEDURES_QUERY,
422: DefaultAdaptor.class),
423: new PropertyDescriptor(
424: DefaultAdaptor.PROP_PROCEDURE_COLUMNS_QUERY,
425: DefaultAdaptor.class),
426: new PropertyDescriptor(
427: DefaultAdaptor.PROP_SCHEMAS_QUERY,
428: DefaultAdaptor.class),
429: new PropertyDescriptor(
430: DefaultAdaptor.PROP_CATALOGS_QUERY,
431: DefaultAdaptor.class),
432: new PropertyDescriptor(
433: DefaultAdaptor.PROP_TABLES_QUERY,
434: DefaultAdaptor.class),
435: new PropertyDescriptor(
436: DefaultAdaptor.PROP_TABLE_TYPES_QUERY,
437: DefaultAdaptor.class),
438: new PropertyDescriptor(
439: DefaultAdaptor.PROP_COLUMNS_QUERY,
440: DefaultAdaptor.class),
441: new PropertyDescriptor(
442: DefaultAdaptor.PROP_COLUMNS_PRIVILEGES_QUERY,
443: DefaultAdaptor.class),
444: new PropertyDescriptor(
445: DefaultAdaptor.PROP_TABLE_PRIVILEGES_QUERY,
446: DefaultAdaptor.class),
447: new PropertyDescriptor(
448: DefaultAdaptor.PROP_BEST_ROW_IDENTIFIER,
449: DefaultAdaptor.class),
450: new PropertyDescriptor(
451: DefaultAdaptor.PROP_VERSION_COLUMNS,
452: DefaultAdaptor.class),
453: new PropertyDescriptor(
454: DefaultAdaptor.PROP_PK_QUERY,
455: DefaultAdaptor.class),
456: new PropertyDescriptor(
457: DefaultAdaptor.PROP_IK_QUERY,
458: DefaultAdaptor.class),
459: new PropertyDescriptor(
460: DefaultAdaptor.PROP_EK_QUERY,
461: DefaultAdaptor.class),
462: new PropertyDescriptor(
463: DefaultAdaptor.PROP_CROSSREF_QUERY,
464: DefaultAdaptor.class),
465: new PropertyDescriptor(
466: DefaultAdaptor.PROP_TYPE_INFO_QUERY,
467: DefaultAdaptor.class),
468: new PropertyDescriptor(
469: DefaultAdaptor.PROP_INDEX_INFO_QUERY,
470: DefaultAdaptor.class),
471: new PropertyDescriptor(
472: DefaultAdaptor.PROP_UDT_QUERY,
473: DefaultAdaptor.class) };
474:
475: for (int i = 0; i < desc.length; i++) {
476: try {
477: String name = "PROP_" + desc[i].getName(); // NOI18N
478: if (i > 109)
479: desc[i]
480: .setDisplayName(NbBundle
481: .getBundle(
482: "org.netbeans.lib.ddl.resources.Bundle")
483: .getString(name)); //NOI18N
484: if (i < 65)
485: desc[i]
486: .setPropertyEditorClass(BooleanEditor.class);
487: if (i < 110)
488: desc[i].setExpert(true);
489: } catch (Exception ex) {
490: }
491: }
492:
493: } catch (Exception ex) {
494: Exceptions.printStackTrace(ex);
495: }
496: return desc;
497: }
498:
499: public static class BooleanEditor extends CommonEditor {
500: public BooleanEditor() {
501: super (
502: new int[] { DefaultAdaptor.NOT_SET,
503: DefaultAdaptor.YES, DefaultAdaptor.NO },
504: new String[] {
505: NbBundle
506: .getBundle(
507: "org.netbeans.lib.ddl.resources.Bundle")
508: .getString("NotSet"),
509: NbBundle
510: .getBundle(
511: "org.netbeans.lib.ddl.resources.Bundle")
512: .getString("Yes"),
513: NbBundle
514: .getBundle(
515: "org.netbeans.lib.ddl.resources.Bundle")
516: .getString("No") });
517: }
518: }
519:
520: private static class CommonEditor implements PropertyEditor {
521: private PropertyChangeSupport support;
522: private int[] constants;
523: private String[] names;
524: private int index;
525: private String name;
526:
527: public CommonEditor(int[] c, String[] n) {
528: support = new PropertyChangeSupport(this );
529: constants = c;
530: names = n;
531: }
532:
533: public Object getValue() {
534: return new Integer(constants[index]);
535: }
536:
537: public void setValue(Object object) {
538: int value, k = constants.length;
539:
540: if (object == null)
541: return;
542: if (object instanceof Integer) {
543: value = ((Integer) object).intValue();
544: } else
545: throw new IllegalArgumentException();
546:
547: for (int i = 0; i < k; i++) {
548: if (constants[i] == value) {
549: index = i;
550: name = names[i];
551: support.firePropertyChange("", null, null);
552: return;
553: }
554: }
555:
556: throw new IllegalArgumentException();
557: }
558:
559: public String getAsText() {
560: if (index == 0)
561: return "";
562: return name;
563: }
564:
565: public void setAsText(String string)
566: throws IllegalArgumentException {
567: if (string == null)
568: return;
569: int k = names.length;
570: for (int i = 0; i < k; i++) {
571: if (names[i].equals(string)) {
572: index = i;
573: name = names[i];
574: support.firePropertyChange("", null, null);
575: return;
576: }
577: }
578:
579: throw new IllegalArgumentException();
580: }
581:
582: public String getJavaInitializationString() {
583: return "" + index;
584: }
585:
586: public String[] getTags() {
587: return names;
588: }
589:
590: public boolean isPaintable() {
591: return false;
592: }
593:
594: public void paintValue(Graphics g, Rectangle rectangle) {
595: }
596:
597: public boolean supportsCustomEditor() {
598: return false;
599: }
600:
601: public Component getCustomEditor() {
602: return null;
603: }
604:
605: public void addPropertyChangeListener(
606: PropertyChangeListener propertyChangeListener) {
607: support.addPropertyChangeListener(propertyChangeListener);
608: }
609:
610: public void removePropertyChangeListener(
611: PropertyChangeListener propertyChangeListener) {
612: support
613: .removePropertyChangeListener(propertyChangeListener);
614: }
615: }
616: }
|