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: package org.netbeans.modules.collab.channel.output;
042:
043: import org.openide.util.*;
044:
045: import java.awt.Image;
046:
047: import java.beans.*;
048:
049: import java.util.*;
050:
051: import org.netbeans.modules.collab.core.Debug;
052:
053: public class OutputCollabletFactoryBeanInfo extends SimpleBeanInfo {
054: ////////////////////////////////////////////////////////////////////////////
055: // Instance variables
056: ////////////////////////////////////////////////////////////////////////////
057: private PropertyDescriptor[] descriptors;
058: private Image smallIcon;
059: private Image largeIcon;
060:
061: /**
062: *
063: *
064: */
065: public OutputCollabletFactoryBeanInfo() {
066: super ();
067: }
068:
069: /**
070: *
071: *
072: */
073: public PropertyDescriptor[] getPropertyDescriptors() {
074: if (descriptors == null) {
075: List descriptorList = new LinkedList();
076:
077: try {
078: PropertyDescriptor descriptor = null;
079:
080: // class
081: descriptor = new PropertyDescriptor("class", // NOI18N
082: OutputCollabletFactory.class, "getClass", null); // NOI18N
083: descriptor
084: .setDisplayName(NbBundle
085: .getMessage(
086: OutputCollabletFactoryBeanInfo.class,
087: "PROP_OutputCollabletFactoryBeanInfo_class_DisplayName")); // NOI18N
088: descriptor
089: .setShortDescription(NbBundle
090: .getMessage(
091: OutputCollabletFactoryBeanInfo.class,
092: "PROP_OutputCollabletFactoryBeanInfo_class_Description")); // NOI18N
093: descriptorList.add(descriptor);
094:
095: // displayName
096: descriptor = new PropertyDescriptor(
097: "displayName", // NOI18N
098: OutputCollabletFactory.class, "getDisplayName",
099: null); // NOI18N
100: descriptor
101: .setDisplayName(NbBundle
102: .getMessage(
103: OutputCollabletFactoryBeanInfo.class,
104: "PROP_OutputCollabletFactoryBeanInfo_displayName_DisplayName")); // NOI18N
105: descriptor
106: .setShortDescription(NbBundle
107: .getMessage(
108: OutputCollabletFactoryBeanInfo.class,
109: "PROP_OutputCollabletFactoryBeanInfo_displayName_Description")); // NOI18N
110: descriptorList.add(descriptor);
111:
112: // identifier
113: descriptor = new PropertyDescriptor(
114: "identifier", // NOI18N
115: OutputCollabletFactory.class, "getIdentifier",
116: null); // NOI18N
117: descriptor
118: .setDisplayName(NbBundle
119: .getMessage(
120: OutputCollabletFactoryBeanInfo.class,
121: "PROP_OutputCollabletFactoryBeanInfo_identifier_DisplayName")); // NOI18N
122: descriptor
123: .setShortDescription(NbBundle
124: .getMessage(
125: OutputCollabletFactoryBeanInfo.class,
126: "PROP_OutputCollabletFactoryBeanInfo_identifier_Description")); // NOI18N
127: descriptorList.add(descriptor);
128: } catch (IntrospectionException e) {
129: Debug.debugNotify(e);
130: }
131:
132: descriptors = (PropertyDescriptor[]) descriptorList
133: .toArray(new PropertyDescriptor[descriptorList
134: .size()]);
135: }
136:
137: return descriptors;
138: }
139:
140: /**
141: *
142: *
143: */
144: public Image getIcon(int type) {
145: if ((type == BeanInfo.ICON_COLOR_16x16)
146: || (type == BeanInfo.ICON_MONO_16x16)) {
147: if (smallIcon == null) {
148: smallIcon = Utilities.loadImage(
149: // "org/netbeans/modules/collab/channel/output/resources/output_png.gif"); // NOI18N
150: "org/netbeans/core/resources/frames/output.gif"); //NOI18N
151: }
152:
153: return smallIcon;
154: } else {
155: if (largeIcon == null) {
156: largeIcon = Utilities.loadImage(
157: // "org/netbeans/modules/collab/channel/output/resources/output_png.gif"); // NOI18N
158: "org/netbeans/core/resources/frames/output.gif"); //NOI18N
159: }
160:
161: return largeIcon;
162: }
163: }
164: }
|