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

/*
 * DuplicateAction.java
 *
 * Modified on Tuesday, 3 September 2002 1611 MDT
 */

package com.example.nb.tutorial.chapter_5;

import org.openide.nodes.Node;
import org.openide.util.HelpCtx;
import org.openide.util.actions.CookieAction;

/**
 *
 * @author  adams
 * @version 1.1
 */
public class DuplicateAction extends CookieAction 
{

    /** Creates new DuplicateAction */
    public DuplicateAction() 
    {
    }

    public java.lang.String getName() 
    {
        return "Duplicate"; //NOI18N
    }
    
    public HelpCtx getHelpCtx() 
    {
        return HelpCtx.DEFAULT_HELP;
    }
    
    protected int mode() 
    {
        // enable duplication for as many qualifying nodes as are selected:
        return CookieAction.MODE_ALL;
    }
    
    protected java.lang.Class[] cookieClasses() 
    {
        // just the DuplicateCookie:
        return new Class[] {DuplicateCookie.class};
    }
    
    protected void performAction(final Node[] activatedNodes) 
    {
        for (int i=0; i
... 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.