01: /*
02: * Sun Public License Notice
03: *
04: * The contents of this file are subject to the Sun Public License
05: * Version 1.0 (the "License"). You may not use this file except in
06: * compliance with the License. A copy of the License is available at
07: * http://www.sun.com/
08: *
09: * The Original Code is NetBeans. The Initial Developer of the Original
10: * Code is Sun Microsystems, Inc. Portions Copyright 1997-2000 Sun
11: * Microsystems, Inc. All Rights Reserved.
12: */
13:
14: package org.netbeans.editor;
15:
16: /**
17: * Token-id with the fixed token image. The image text is provided in
18: * constructor and can be retrieved by <tt>getImage()</tt>.
19: *
20: * @author Miloslav Metelka
21: * @version 1.00
22: */
23:
24: public class BaseImageTokenID extends BaseTokenID implements
25: ImageTokenID {
26:
27: private final String image;
28:
29: /** Construct new imag-token-id if the name is the same as the image. */
30: public BaseImageTokenID(String nameAndImage) {
31: this (nameAndImage, nameAndImage);
32: }
33:
34: public BaseImageTokenID(String name, String image) {
35: super (name);
36: this .image = image;
37: }
38:
39: public BaseImageTokenID(String nameAndImage, int numericID) {
40: this (nameAndImage, numericID, nameAndImage);
41: }
42:
43: public BaseImageTokenID(String name, int numericID, String image) {
44: super (name, numericID);
45: this .image = image;
46: }
47:
48: public BaseImageTokenID(String nameAndImage, TokenCategory category) {
49: this (nameAndImage, category, nameAndImage);
50: }
51:
52: public BaseImageTokenID(String name, TokenCategory category,
53: String image) {
54: super (name, category);
55: this .image = image;
56: }
57:
58: public BaseImageTokenID(String nameAndImage, int numericID,
59: TokenCategory category) {
60: this (nameAndImage, numericID, category, nameAndImage);
61: }
62:
63: public BaseImageTokenID(String name, int numericID,
64: TokenCategory category, String image) {
65: super (name, numericID, category);
66: this .image = image;
67: }
68:
69: public String getImage() {
70: return image;
71: }
72:
73: public String toString() {
74: return super .toString() + ", image='" + getImage() + "'";
75: }
76:
77: }
|