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.jellytools.modules.db.nodes;

import javax.swing.tree.TreePath;
import org.netbeans.jellytools.actions.*;
/*
 * DriverNode.java
 *
 * Created on 1/14/03 5:23 PM
 */

import org.netbeans.jellytools.modules.db.actions.AddDriverAction;
import org.netbeans.jellytools.modules.db.actions.ConnectUsingAction;
import org.netbeans.jellytools.modules.db.actions.TestDriverAction;
import org.netbeans.jellytools.nodes.Node;
import org.netbeans.jemmy.operators.JTreeOperator;


/** DriverNode Class
 * @author ms113234 */
public class DriverNode extends DBNode {
    private static final Action connectUsingAction = new ConnectUsingAction();
    private static final Action addDriverAction = new AddDriverAction();
    private static final Action testDriverAction = new TestDriverAction();
    private static final Action cutAction = new CutAction();
    private static final Action copyAction = new CopyAction();
    private static final Action pasteAction = new PasteAction();
    private static final Action deleteAction = new DeleteAction();
    private static final Action propertiesAction = new PropertiesAction();

    /** creates new DriverNode
     * @param tree JTreeOperator of tree
     * @param treePath String tree path */
    public DriverNode(JTreeOperator tree, String treePath) {
        super(tree, treePath);
    }

    /** creates new DriverNode
     * @param tree JTreeOperator of tree
     * @param treePath TreePath of node */
    public DriverNode(JTreeOperator tree, TreePath treePath) {
        super(tree, treePath);
    }

    /** creates new DriverNode
     * @param parent parent Node
     * @param treePath String tree path from parent Node */
    public DriverNode(Node parent, String treePath) {
        super(parent, treePath);
    }

    /** tests popup menu items for presence */
    public void verifyPopup() {
        verifyPopup(new Action[]{
            connectUsingAction,
            addDriverAction,
            testDriverAction,
            cutAction,
            copyAction,
            pasteAction,
            deleteAction,
            propertiesAction
        });
    }

    /** performs ConnectUsingAction with this node */
    public void connectUsing() {
        connectUsingAction.perform(this);
    }

    /** performs AddDriverAction with this node */
    public void addDriver() {
        addDriverAction.perform(this);
    }

    /** performs TestDriverAction with this node */
    public void testDriver() {
        testDriverAction.perform(this);
    }

    /** performs CutAction with this node */
    public void cut() {
        cutAction.perform(this);
    }

    /** performs CopyAction with this node */
    public void copy() {
        copyAction.perform(this);
    }

    /** performs PasteAction with this node */
    public void paste() {
        pasteAction.perform(this);
    }

    /** performs DeleteAction with this node */
    public void delete() {
        deleteAction.perform(this);
    }

    /** performs PropertiesAction with this node */
    public void properties() {
        propertiesAction.perform(this);
    }
}
... 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.