001: /*
002: * Sun Public License Notice
003: *
004: * The contents of this file are subject to the Sun Public License
005: * Version 1.0 (the "License"). You may not use this file except in
006: * compliance with the License. A copy of the License is available at
007: * http://www.sun.com/
008: *
009: * The Original Code is NetBeans. The Initial Developer of the Original
010: * Code is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
011: * Microsystems, Inc. All Rights Reserved.
012:
013: If you wish your version of this file to be governed by only the CDDL
014: or only the GPL Version 2, indicate your decision by adding
015: "[Contributor] elects to include this software in this distribution
016: under the [CDDL or GPL Version 2] license." If you do not indicate a
017: single choice of license, a recipient has the option to distribute
018: your version of this file under either the CDDL, the GPL Version 2 or
019: to extend the choice of license to its licensees as provided above.
020: However, if you add GPL Version 2 code and therefore, elected the GPL
021: Version 2 license, then the option applies only if the new code is
022: made subject to such option by the copyright holder.
023:
024: If you wish your version of this file to be governed by only the CDDL
025: or only the GPL Version 2, indicate your decision by adding
026: "[Contributor] elects to include this software in this distribution
027: under the [CDDL or GPL Version 2] license." If you do not indicate a
028: single choice of license, a recipient has the option to distribute
029: your version of this file under either the CDDL, the GPL Version 2 or
030: to extend the choice of license to its licensees as provided above.
031: However, if you add GPL Version 2 code and therefore, elected the GPL
032: Version 2 license, then the option applies only if the new code is
033: made subject to such option by the copyright holder.
034: */
035: package org.netbeans.modules.mashup.db.ui;
036:
037: import java.awt.Image;
038: import java.beans.BeanDescriptor;
039: import java.beans.BeanInfo;
040: import java.beans.IntrospectionException;
041: import java.beans.PropertyDescriptor;
042: import java.beans.SimpleBeanInfo;
043: import net.java.hulp.i18n.Logger;
044: import org.netbeans.modules.etl.logger.Localizer;
045: import org.netbeans.modules.etl.logger.LogUtil;
046: import org.openide.ErrorManager;
047: import org.openide.util.Utilities;
048:
049: /**
050: *
051: * @author karthikeyan s
052: */
053: public class AxionDBConfigurationBeanInfo extends SimpleBeanInfo {
054:
055: private static transient final Logger mLogger = LogUtil
056: .getLogger(AxionDBConfigurationBeanInfo.class.getName());
057: private static transient final Localizer mLoc = Localizer.get();
058:
059: /**
060: * Creates a new instance of AxionDBConfigurationBeanInfo
061: */
062: public AxionDBConfigurationBeanInfo() {
063: }
064:
065: public PropertyDescriptor[] getPropertyDescriptors() {
066: try {
067: PropertyDescriptor[] descriptors = new PropertyDescriptor[2];
068: descriptors[0] = new PropertyDescriptor(
069: AxionDBConfiguration.PROP_LOC,
070: AxionDBConfiguration.class);
071: String nbBundle1 = mLoc
072: .t("PRSR001: Mashup Database Location");
073: descriptors[0].setDisplayName(Localizer.parse(nbBundle1));
074: String nbBundle2 = mLoc
075: .t("PRSR001: The directory where the Mashup Database should be created.");
076: descriptors[0].setShortDescription(Localizer
077: .parse(nbBundle2));
078: descriptors[1] = new PropertyDescriptor(
079: AxionDBConfiguration.PROP_DRV_LOC,
080: AxionDBConfiguration.class);
081: String nbBundle3 = mLoc
082: .t("PRSR001: MashupDB Driver Location");
083: descriptors[1].setDisplayName(Localizer.parse(nbBundle3));
084: String nbBundle4 = mLoc
085: .t("PRSR001: The directory where the MashupDB Driver(MashupDB.zip) is located.");
086: descriptors[1].setShortDescription(Localizer
087: .parse(nbBundle4));
088: return descriptors;
089: } catch (IntrospectionException ex) {
090: ErrorManager.getDefault().notify(ex);
091: return new PropertyDescriptor[0];
092: }
093: }
094:
095: public Image getIcon(int type) {
096: Image image = null;
097: if (type == BeanInfo.ICON_COLOR_16x16) {
098: image = Utilities
099: .loadImage("org/netbeans/modules/sql/framework/ui/resources/images/DatabaseProperties.png"); // NOI18N
100: }
101:
102: return image != null ? image : super .getIcon(type);
103: }
104:
105: public BeanDescriptor getBeanDescriptor() {
106: BeanDescriptor descriptor = new BeanDescriptor(
107: AxionDBConfiguration.class);
108: descriptor.setName("Mashup Database Configuration");
109: return descriptor;
110: }
111: }
|