01: // ResourceCell.java
02: // $Id: ResourceCell.java,v 1.6 2000/08/16 21:37:30 ylafon Exp $
03: // (c) COPYRIGHT MIT, INRIA and Keio, 1999.
04: // Please first read the full copyright statement in file COPYRIGHT.html
05: package org.w3c.jigadmin.editors;
06:
07: /**
08: * A wrapper of classname, used in dnd feature.
09: * @version $Revision: 1.6 $
10: * @author Benoît Mahé (bmahe@w3.org)
11: */
12: public class ResourceCell {
13:
14: static final public String INDEXER_S = "indexer";
15: static final public String CONTAINER_S = "container";
16: static final public String RESOURCE_S = "resource";
17: static final public String FRAME_S = "frame";
18: static final public String FILTER_S = "filter";
19: static final public String META_S = "meta";
20:
21: private String name = null;
22: private String spec = null;
23:
24: /**
25: * Return true if the Resource wrapped by this cell is an Indexer.
26: * @return a boolean
27: */
28: public boolean isIndexer() {
29: return spec.equals(INDEXER_S);
30: }
31:
32: /**
33: * Return true if the Resource wrapped by this cell is a container.
34: * @return a boolean
35: */
36: public boolean isContainer() {
37: return spec.equals(CONTAINER_S);
38: }
39:
40: /**
41: * Return true if the Resource wrapped by this cell is a resource.
42: * @return a boolean
43: */
44: public boolean isResource() {
45: return spec.equals(RESOURCE_S);
46: }
47:
48: /**
49: * Return true if the Resource wrapped by this cell is a frame.
50: * @return a boolean
51: */
52: public boolean isFrame() {
53: return spec.equals(FRAME_S);
54: }
55:
56: /**
57: * Return true if the Resource wrapped by this cell is a filter.
58: * @return a boolean
59: */
60: public boolean isFilter() {
61: return spec.equals(FILTER_S);
62: }
63:
64: /**
65: * Return true if the Resource wrapped by this cell is a MetaDataFrame.
66: * @return a boolean
67: */
68: public boolean isMetaDataFrame() {
69: return spec.equals(META_S);
70: }
71:
72: /**
73: * Constructor.
74: * @param name the resource classname
75: * @param spec INDEXER_S, CONTAINER_S, RESOURCE_S, FRAME_S or FILTER_S
76: */
77: public ResourceCell(String name, String spec) {
78: this .name = name;
79: this .spec = spec;
80: }
81:
82: /**
83: * Return the classname
84: * @return a String.
85: */
86: public String toString() {
87: return name;
88: }
89: }
|