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;

import java.awt.Image;
import java.beans.*;

import org.openide.util.NbBundle;
import org.netbeans.modules.javacvs.editors.RefreshModePropertyEditor;
import org.netbeans.modules.cvsclient.editors.StatesStringArrayCustomEditor;
import org.netbeans.modules.cvsclient.editors.StatesStringArrayEditor;
import org.netbeans.modules.cvsclient.editors.UiModePropertyEditor;
import org.netbeans.modules.cvsclient.editors.JCvsAnnotPatternEditor;
import org.netbeans.modules.cvsclient.editors.DisplayTypePropertyEditor;
import org.openide.ErrorManager;

/** BeanInfo for JavaCvsSettings
*
* @author Milos Kleint
*/
public class JavaCvsSettingsBeanInfo extends SimpleBeanInfo {


    /** @return the  icon */
    //TODO new ICONS
    public Image getIcon(int type) {
        if ((type == java.beans.BeanInfo.ICON_COLOR_16x16) || (type == java.beans.BeanInfo.ICON_MONO_16x16)) {
            return org.openide.util.Utilities.loadImage("org/netbeans/modules/cvsclient/JavaCvsSettingsIcon.gif"); //NOI18N;
        } else {
            return null;
        }

    }

    /** Descriptor of valid properties
    * @return array of properties
    */
    public PropertyDescriptor[] getPropertyDescriptors () {
        try {

            java.util.ResourceBundle bundle =
        NbBundle.getBundle(JavaCvsSettingsBeanInfo.class);

            
  // User Interface Mode
            PropertyDescriptor uiMode = new PropertyDescriptor ("uiMode", JavaCvsSettings.class); // NOI18N
            uiMode.setDisplayName (bundle.getString("PROP_uiMode")); // NOI18N
            uiMode.setShortDescription (bundle.getString("HINT_uiMode"));      // NOI18N       
            uiMode.setPropertyEditorClass(UiModePropertyEditor.class);
            
              // Display Type
            PropertyDescriptor displayType = new PropertyDescriptor ("displayType", JavaCvsSettings.class); // NOI18N
            displayType.setDisplayName (bundle.getString("PROP_displayType")); // NOI18N
            displayType.setShortDescription (bundle.getString("HINT_displayType"));      // NOI18N       
            displayType.setPropertyEditorClass(DisplayTypePropertyEditor.class);
            
            // cvs file states
            PropertyDescriptor cvsFileStates = new PropertyDescriptor ("cvsFileStates", JavaCvsSettings.class); // NOI18N
            cvsFileStates.setDisplayName (bundle.getString("PROP_cvsFileStates")); // NOI18N
            cvsFileStates.setShortDescription (bundle.getString("HINT_cvsFileStates"));  // NOI18N
            cvsFileStates.setPropertyEditorClass(StatesStringArrayEditor.class);

            PropertyDescriptor annotationPattern = new PropertyDescriptor ("annotationPattern", JavaCvsSettings.class); // NOI18N
            annotationPattern.setDisplayName (bundle.getString("PROP_annotationPattern")); // NOI18N
            annotationPattern.setShortDescription (bundle.getString("HINT_annotationPattern"));  // NOI18N
            annotationPattern.setPropertyEditorClass(JCvsAnnotPatternEditor.class);

            PropertyDescriptor firstTimer = new PropertyDescriptor ("firstTimer", JavaCvsSettings.class); // NOI18N
            firstTimer.setDisplayName (bundle.getString("PROP_firstTimer")); // NOI18N
            firstTimer.setShortDescription (bundle.getString("HINT_firstTimer"));  // NOI18N
//            firstTimer.setHidden(true);
            
            return new PropertyDescriptor[] {uiMode, 
                                             displayType, cvsFileStates, annotationPattern, firstTimer };
            
        } catch (IntrospectionException ie) {
            ErrorManager.getDefault().notify();
            return null;
        }
    }
}

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

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 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.