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.HelpCtx;
import org.openide.util.NbBundle;
//import org.openide.explorer.propertysheet.editors.DirectoryOnlyEditor;
import org.openide.filesystems.FileSystem;
import org.netbeans.modules.cvsclient.customizer.NbJavaCvsCustomizer;
import org.netbeans.modules.javacvs.editors.RefreshModePropertyEditor;
import org.netbeans.modules.cvsclient.editors.UiModePropertyEditor;
import org.netbeans.modules.cvsclient.editors.DisplayTypePropertyEditor;
import org.netbeans.modules.javacvs.JavaCvsFileSystem;
import org.openide.ErrorManager;

/** Description of the file system.
 *
 * @author mkleint
 */
public class NbJavaCvsFileSystemBeanInfo extends SimpleBeanInfo {

    public BeanInfo[] getAdditionalBeanInfo () {
        try {
            return new BeanInfo[] { Introspector.getBeanInfo (org.netbeans.modules.javacvs.JavaCvsFileSystem.class) };
        } catch (IntrospectionException ie) {
            ErrorManager.getDefault().notify();
            return null;
        }
    }

    
    // If you have a visual dialog to customize configuration of the file system:
    public BeanDescriptor getBeanDescriptor () {
        BeanDescriptor bd = new BeanDescriptor (NbJavaCvsFileSystem.class, NbJavaCvsCustomizer.Dialog.class);
        bd.setValue(org.netbeans.modules.vcscore.VcsFileSystem.VCS_PROVIDER_ATTRIBUTE, Boolean.TRUE);
        bd.setValue(org.netbeans.modules.vcscore.VcsFileSystem.VCS_FILESYSTEM_ICON_BASE, "org/netbeans/modules/cvsclient/JavaCvsFileSystemIcon"); //NOI18N
        bd.setValue ("helpID", NbJavaCvsFileSystem.class.getName ()); // NOI18N
        bd.setValue ("propertiesHelpID", NbJavaCvsFileSystem.class.getName() + "_properties"); // NOI18N
        bd.setValue ("expertHelpID", NbJavaCvsFileSystem.class.getName() + "_expert"); // NOI18N
        return bd;
    }
    

    public PropertyDescriptor[] getPropertyDescriptors () {
        try {
  // User Interface Mode
            PropertyDescriptor uiMode = new PropertyDescriptor ("uiMode", NbJavaCvsFileSystem.class); // NOI18N
            uiMode.setDisplayName (NbBundle.getMessage (NbJavaCvsFileSystemBeanInfo.class, "PROP_uiMode")); // NOI18N
            uiMode.setShortDescription (NbBundle.getMessage (NbJavaCvsFileSystemBeanInfo.class, "HINT_uiMode"));      // NOI18N       
            uiMode.setPropertyEditorClass(UiModePropertyEditor.class);
  // Display Type
            PropertyDescriptor displayType = new PropertyDescriptor ("displayType", NbJavaCvsFileSystem.class); // NOI18N
            displayType.setDisplayName (NbBundle.getMessage (NbJavaCvsFileSystemBeanInfo.class, "PROP_displayType")); // NOI18N
            displayType.setShortDescription (NbBundle.getMessage (NbJavaCvsFileSystemBeanInfo.class, "HINT_displayType"));      // NOI18N       
            displayType.setPropertyEditorClass(DisplayTypePropertyEditor.class);

            PropertyDescriptor processAll = new PropertyDescriptor ("processAllFiles", NbJavaCvsFileSystem.class); // NOI18N
            processAll.setDisplayName (NbBundle.getMessage (NbJavaCvsFileSystemBeanInfo.class, "PROP_processAllFiles")); // NOI18N
            processAll.setShortDescription (NbBundle.getMessage (NbJavaCvsFileSystemBeanInfo.class, "HINT_processAllFiles")); // NOI18N
            
            return new PropertyDescriptor[] {uiMode, displayType, processAll};
        } catch (IntrospectionException ie) {
            ErrorManager.getDefault().notify();
            return null;
        }
    }

    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;
        }
    }

    /** A directory chooser with special context help. */
//    public static class RootEd extends DirectoryOnlyEditor {
//
//        protected HelpCtx getHelpCtx () {
//            return new HelpCtx (RootEd.class);
//        }
//
//    }
 

}
... 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.