GruntspudContext.java :  » Source-Control » gruntspud » gruntspud » Java Open Source

Java Open Source » Source Control » gruntspud 
gruntspud » gruntspud » GruntspudContext.java
/*
 *  Gruntspud
 *
 *  Copyright (C) 2002 Brett Smith.
 *
 *  Written by: Brett Smith <t_magicthize@users.sourceforge.net>
 *
 *  This program is free software; you can redistribute it and/or
 *  modify it under the terms of the GNU Library General Public License
 *  as published by the Free Software Foundation; either version 2 of
 *  the License, or (at your option) any later version.
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU Library General Public License for more details.
 *
 *  You should have received a copy of the GNU Library General Public
 *  License along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */

package gruntspud;

import gruntspud.connection.ConnectionProfileModel;
import gruntspud.file.FileTypeMappingModel;
import gruntspud.filter.CVSFileFilterModel;
import gruntspud.project.ProjectListModel;
import gruntspud.style.TextStyleModel;
import gruntspud.ui.view.ViewManager;

import java.io.File;
import java.io.IOException;
import java.util.Iterator;

import plugspud.PluginHostContext;
import plugspud.PluginManager;

/**
 *  An implementation of this interface is passed to pretty much all of
 *  Gruntspud's componented. Implementations must provide basic services that
 *  are common to all environments that Gruntspud may run in.
 *
 *@author     magicthize
 *@created    26 May 2002
 */
public interface GruntspudContext
    extends PluginHostContext {
    /**
     * Invoked when Gruntspud exits
     */
    public void cleanUp();

    /**
     * Return the connection profile model.
     *
     * @return connection profile model
     */
    public ConnectionProfileModel getConnectionProfileModel();

    /**
     * Return the project list  model.
     *
     * @return project list model
     */
    public ProjectListModel getProjectListModel();

    /**
     * Register option tab. Plugins may use this to place a tab in the options
     * pane. The class must extend <code>AbstractOptionsTab</code> and have an
     * empty constructor to be able to be registered. An new instance of the
     * class is created whenever the options dialog is opened.
     *
     * @param optionsTabClass class of options tab.
     */
    public void registerOptionsTab(Class optionsTabClass);

    /**
     * Return an iterator of Class of all registered options tab classes
     *
     * @return registered options tab classes
     */
    public Iterator optionsTabs();

    /**
     * Execute a command appendending the path of the file specified to the
     * end of the command
     *
     * @param application full path of command to run
     * @param file file to append
     * @throws IOException on any errors
     */
    public void runApplicationForFile(String application, File file) throws
        IOException;

    /**
     * Return the plugin manager
     *
     * @retuyrn plugin manager
     */
    public PluginManager getPluginManager();

    /**
     * Return the host
     *
     * @return host
     */
    public GruntspudHost getHost();

    /**
     * Return the filter.
     *
     * @return filter
     */
    public CVSFileFilterModel getFilterModel();

    /**
     * Return the model used to map file types to applications thay be used
     * to open them
     *
     * @return file type mapping model
     */
    public FileTypeMappingModel getFileTypeMappingModel();

    /**
     * Return the view manager
     *
     * @return the view mananger
     */
    public ViewManager getViewManager();

    /**
     * Implement to register an <code>Encrypter</code> implementation. The password
     * manager may use this to encrypt the password list. Only one implementation
     * can be registered, subsequent attempts will thrown an an exception.
     *
     * @param encrypter the encrypter implementation
     */
    public void setEncrypter(Encrypter encrypter) throws Exception;

    /**
     * Implement to return the current <code>Encrypter</code>, or <code>null</code>
     * if none is registered.
     *
     * @return the encrypter
     */
    public Encrypter getEncrypter();

    /**
     * Implement to return the text style model.
     *
     * @return text style mode
     */
    public TextStyleModel getTextStyleModel();


    /**
     * Open a node using the specified action. The action may be one of<br><br>
     *
     * @param node node to open
     * @param action action to take
     */
    public void openNode(CVSFileNode node, int action);
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.