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

/*
 * TomcatFactoryNode.java
 *
 * Created on January 6, 2004, 2:53 PM
 */

package org.netbeans.modules.tomcat5.nodes;

import org.openide.nodes.*;
import org.openide.util.actions.*;
import org.openide.actions.DeleteAction;
import org.openide.util.NbBundle;

import org.netbeans.modules.tomcat5.ide.AddServerAction;

import java.awt.Image;
import org.openide.util.HelpCtx;
import org.openide.util.Lookup;

/**
 *
 * @author  mg116726
 */
public class TomcatFactoryNode extends AbstractNode{
    
    private String ICON_BASE = "org/netbeans/modules/tomcat5/resources/tomcat5"; // NOI18N

    /** Creates a new instance of TomcatFactoryNode */
    public TomcatFactoryNode(org.openide.nodes.Children ch, Lookup lookup) {
        super(ch);
        setIconBase(ICON_BASE);
        this.setName("TomcatFactoryNode"); //NOI18N        
    }
    
    protected SystemAction[] createActions(){
        return new SystemAction[] {
            SystemAction.get (AddServerAction.class)
        };
    }

    /** @param type Desired type of the icon
     * @return returns the Image loader's icon
     */
    public Image getIcon(final int type) {
        return org.openide.util.Utilities.loadImage("org/netbeans/modules/tomcat5/resources/tomcat5.gif"); // NOI18N
    }
    
    public String getDisplayName() {
        return NbBundle.getMessage(TomcatFactoryNode.class, "LBL_TomcatFactoryNode_Name");
    }    

    public Image getOpenedIcon(int type) {
        return getIcon(type);
    }
    
    public HelpCtx getHelpCtx () {
        return new HelpCtx ("org.netbeans.modules.tomcat5.nodes.TomcatFactoryNode"); //NOI18N
    }
}
... 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.