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-2000 Sun
 * Microsystems, Inc. All Rights Reserved.
 */

package org.netbeans.api.vcs.commands;

import org.openide.filesystems.FileObject;

/**
 * This interface represents the VCS command, that is executed to acually perform a VCS action.
 *
 * @author  Martin Entlicher
 */
public interface Command {
    
    /**
     * Get the name of the command.
     */
    public String getName();
    
    /**
     * Get the display name of the command. It will be visible on the popup menu under this name.
     * When null, the command will not be visible on the popup menu.
     */
    public String getDisplayName();
    
    /**
     * Set files to act on.
     */
    public void setFiles(FileObject[] files);
    
    /**
     * Get files this command acts on.
     */
    public FileObject[] getFiles();
    
    /**
     * Find, whether this command can act on a set of files.
     * @param files The array of files to inspect
     * @return an array of files the command can act on or null when
     * it can not act on any file listed.
     */
    public FileObject[] getApplicableFiles(FileObject[] files);
    
    /**
     * Use this method to set or unset the GUI mode for the command execution.
     * If the GUI mode is set to false, the command tasks are not permitted to open
     * any GUI components. Setting this property does not influence the already
     * running tasks. The default is GUI mode (true).
     * @param gui true for GUI mode, false for non-GUI
     *            mode
     */
    public void setGUIMode(boolean gui);
    
    /**
     * Test whether the command is in GUI mode or not.
     * @return true for GUI mode, false for non-GUI
     *         mode
     */
    public boolean isGUIMode();
    
    /**
     * Use this method to set or unset the expert mode for the command execution.
     * If the expert mode is set to false, the command customization should be
     * simpler and tasks should present simpler GUI components.
     * Setting this property does not influence the already
     * running tasks. The default is non-expert mode (false).
     * @param expert true for expert mode, false for
     *               non-expert mode
     */
    public void setExpertMode(boolean expert);
    
    /**
     * Test whether the command is in expert mode or not.
     * @return true for expert mode, false for non-expert
     *         mode
     */
    public boolean isExpertMode();
    
    /**
     * Execute the command.
     */
    public CommandTask execute();
}

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