alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

What this is

This file is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Other links

The source code

/*
 *                 Sun Public License Notice
 * 
 * The contents of this file are subject to the Sun Public License
 * Version 1.0 (the "License"). You may not use this file except in
 * compliance with the License. A copy of the License is available at
 * http://www.sun.com/
 * 
 * The Original Code is NetBeans. The Initial Developer of the Original
 * Code is Sun Microsystems, Inc. Portions Copyright 1997-2003 Sun
 * Microsystems, Inc. All Rights Reserved.
 */

package org.netbeans.modules.cvsclient.versioning;

import java.beans.*;

import java.awt.Image;
import org.openide.ErrorManager;

import org.openide.util.NbBundle;

/** BeanInfo for JavaCvsVersioningSystem.
 * 
 * @author Milos Kleint
 */

public class JavaCvsVersioningSystemBeanInfo extends SimpleBeanInfo {


    
    /**
     * Gets the bean's BeanDescriptors.
     * 
     * @return BeanDescriptor describing the editable
     * properties of this bean.  May return null if the
     * information should be obtained by automatic analysis.
     */
    public BeanDescriptor getBeanDescriptor() {
        BeanDescriptor bd = new BeanDescriptor (JavaCvsVersioningSystem.class);
        bd.setValue(org.netbeans.modules.vcscore.VcsFileSystem.VCS_PROVIDER_ATTRIBUTE, Boolean.TRUE);
        bd.setValue("helpID", JavaCvsVersioningSystem.class.getName ()); // NOI18N
        bd.setValue("propertiesHelpID", JavaCvsVersioningSystem.class.getName() + "_properties"); // NOI18N
        bd.setValue("expertHelpID", JavaCvsVersioningSystem.class.getName() + "_expert"); // NOI18N
        return bd;
    }

    /**
     * Gets the bean's PropertyDescriptors.
     * 
     * @return An array of PropertyDescriptors describing the editable
     * properties supported by this bean.  May return null if the
     * information should be obtained by automatic analysis.
     * 

* If a property is indexed, then its entry in the result array will * belong to the IndexedPropertyDescriptor subclass of PropertyDescriptor. * A client of getPropertyDescriptors can use "instanceof" to check * if a given PropertyDescriptor is an IndexedPropertyDescriptor. */ public PropertyDescriptor[] getPropertyDescriptors() { PropertyDescriptor showDeadFiles = null; PropertyDescriptor showMessages = null; PropertyDescriptor messageLength = null; PropertyDescriptor showUnimportantFiles = null; PropertyDescriptor ignoreFiles = null; PropertyDescriptor[] properties = null; try { showDeadFiles = new PropertyDescriptor (JavaCvsVersioningSystem.PROP_SHOW_DEAD_FILES, JavaCvsVersioningSystem.class, "isShowDeadFiles", "setShowDeadFiles"); //NOI18N showDeadFiles.setDisplayName (NbBundle.getMessage(JavaCvsVersioningSystem.class, "PROP_showDeadFiles")); //NOI18N showDeadFiles.setShortDescription (NbBundle.getMessage(JavaCvsVersioningSystem.class, "HINT_showDeadFiles")); //NOI18N showMessages = new PropertyDescriptor (JavaCvsVersioningSystem.PROP_SHOW_MESSAGES, JavaCvsVersioningSystem.class, "isShowMessages", "setShowMessages"); // NOI18N showMessages.setDisplayName (NbBundle.getMessage(JavaCvsVersioningSystem.class, "PROP_showMessages")); //NOI18N showMessages.setShortDescription (NbBundle.getMessage(JavaCvsVersioningSystem.class, "HINT_showMessages")); //NOI18N messageLength = new PropertyDescriptor (JavaCvsVersioningSystem.PROP_MESSAGE_LENGTH, JavaCvsVersioningSystem.class, "getMessageLength", "setMessageLength"); // NOI18N messageLength.setDisplayName (NbBundle.getMessage(JavaCvsVersioningSystem.class, "PROP_messageLength")); //NOI18N messageLength.setShortDescription (NbBundle.getMessage(JavaCvsVersioningSystem.class, "HINT_messageLength")); //NOI18N showUnimportantFiles = new PropertyDescriptor (JavaCvsVersioningSystem.PROP_SHOW_UNIMPORTANT_FILES, JavaCvsVersioningSystem.class, "isShowUnimportantFiles", "setShowUnimportantFiles"); // NOI18N showUnimportantFiles.setDisplayName(NbBundle.getMessage(JavaCvsVersioningSystem.class, "PROP_showUnimportantFiles")); showUnimportantFiles.setShortDescription(NbBundle.getMessage(JavaCvsVersioningSystem.class, "HINT_showUnimportantFiles")); showUnimportantFiles.setExpert(true); ignoreFiles = new PropertyDescriptor (JavaCvsVersioningSystem.PROP_IGNORE_FILES, JavaCvsVersioningSystem.class); // NOI18N ignoreFiles.setDisplayName(NbBundle.getMessage(JavaCvsVersioningSystem.class, "PROP_ignoreFiles")); ignoreFiles.setShortDescription(NbBundle.getMessage(JavaCvsVersioningSystem.class, "HINT_ignoreFiles")); ignoreFiles.setExpert(true); properties = new PropertyDescriptor[] { showMessages, messageLength, ignoreFiles /*, showUnimportantFiles */}; } catch (IntrospectionException ex) { ErrorManager.getDefault().notify(ex); } return properties; } /** * Gets the bean's EventSetDescriptors. * * @return An array of EventSetDescriptors describing the kinds of * events fired by this bean. May return null if the information * should be obtained by automatic analysis. */ public EventSetDescriptor[] getEventSetDescriptors() { return null; } /** * Gets the bean's MethodDescriptors. * * @return An array of MethodDescriptors describing the methods * implemented by this bean. May return null if the information * should be obtained by automatic analysis. */ public MethodDescriptor[] getMethodDescriptors() { return null; } /** * A bean may have a "default" property that is the property that will * mostly commonly be initially chosen for update by human's who are * customizing the bean. * @return Index of default property in the PropertyDescriptor array * returned by getPropertyDescriptors. *

Returns -1 if there is no default property. */ public int getDefaultPropertyIndex() { return -1; } /** * A bean may have a "default" event that is the event that will * mostly commonly be used by human's when using the bean. * @return Index of default event in the EventSetDescriptor array * returned by getEventSetDescriptors. *

Returns -1 if there is no default event. */ public int getDefaultEventIndex() { return -1; } /** * This method returns an image object that can be used to * represent the bean in toolboxes, toolbars, etc. Icon images * will typically be GIFs, but may in future include other formats. *

* Beans aren't required to provide icons and may return null from * this method. *

* There are four possible flavors of icons (16x16 color, * 32x32 color, 16x16 mono, 32x32 mono). If a bean choses to only * support a single icon we recommend supporting 16x16 color. *

* We recommend that icons have a "transparent" background * so they can be rendered onto an existing background. * * @param iconKind The kind of icon requested. This should be * one of the constant values ICON_COLOR_16x16, ICON_COLOR_32x32, * ICON_MONO_16x16, or ICON_MONO_32x32. * @return An image object representing the requested icon. May * return null if no suitable icon is available. */ public Image getIcon (int type) { if ((type == BeanInfo.ICON_COLOR_16x16) || (type == BeanInfo.ICON_MONO_16x16)) { return org.openide.util.Utilities.loadImage ("org/netbeans/modules/cvsclient/JavaCvsFileSystemIcon.gif"); // NOI18N; } else { return org.openide.util.Utilities.loadImage ("org/netbeans/modules/cvsclient/JavaCvsFileSystemIcon32.gif"); // NOI18N; } } }

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.