001: /*
002: * Gruntspud
003: *
004: * Copyright (C) 2002 Brett Smith.
005: *
006: * Written by: Brett Smith <t_magicthize@users.sourceforge.net>
007: *
008: * This program is free software; you can redistribute it and/or
009: * modify it under the terms of the GNU Library General Public License
010: * as published by the Free Software Foundation; either version 2 of
011: * the License, or (at your option) any later version.
012: * This program is distributed in the hope that it will be useful,
013: * but WITHOUT ANY WARRANTY; without even the implied warranty of
014: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
015: * GNU Library General Public License for more details.
016: *
017: * You should have received a copy of the GNU Library General Public
018: * License along with this program; if not, write to the Free Software
019: * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
020: */
021:
022: package gruntspud;
023:
024: import gruntspud.connection.ConnectionProfileModel;
025: import gruntspud.file.FileTypeMappingModel;
026: import gruntspud.filter.CVSFileFilterModel;
027: import gruntspud.project.ProjectListModel;
028: import gruntspud.style.TextStyleModel;
029: import gruntspud.ui.view.ViewManager;
030:
031: import java.io.File;
032: import java.io.IOException;
033: import java.util.Iterator;
034:
035: import plugspud.PluginHostContext;
036: import plugspud.PluginManager;
037:
038: /**
039: * An implementation of this interface is passed to pretty much all of
040: * Gruntspud's componented. Implementations must provide basic services that
041: * are common to all environments that Gruntspud may run in.
042: *
043: *@author magicthize
044: *@created 26 May 2002
045: */
046: public interface GruntspudContext extends PluginHostContext {
047: /**
048: * Invoked when Gruntspud exits
049: */
050: public void cleanUp();
051:
052: /**
053: * Return the connection profile model.
054: *
055: * @return connection profile model
056: */
057: public ConnectionProfileModel getConnectionProfileModel();
058:
059: /**
060: * Return the project list model.
061: *
062: * @return project list model
063: */
064: public ProjectListModel getProjectListModel();
065:
066: /**
067: * Register option tab. Plugins may use this to place a tab in the options
068: * pane. The class must extend <code>AbstractOptionsTab</code> and have an
069: * empty constructor to be able to be registered. An new instance of the
070: * class is created whenever the options dialog is opened.
071: *
072: * @param optionsTabClass class of options tab.
073: */
074: public void registerOptionsTab(Class optionsTabClass);
075:
076: /**
077: * Return an iterator of Class of all registered options tab classes
078: *
079: * @return registered options tab classes
080: */
081: public Iterator optionsTabs();
082:
083: /**
084: * Execute a command appendending the path of the file specified to the
085: * end of the command
086: *
087: * @param application full path of command to run
088: * @param file file to append
089: * @throws IOException on any errors
090: */
091: public void runApplicationForFile(String application, File file)
092: throws IOException;
093:
094: /**
095: * Return the plugin manager
096: *
097: * @retuyrn plugin manager
098: */
099: public PluginManager getPluginManager();
100:
101: /**
102: * Return the host
103: *
104: * @return host
105: */
106: public GruntspudHost getHost();
107:
108: /**
109: * Return the filter.
110: *
111: * @return filter
112: */
113: public CVSFileFilterModel getFilterModel();
114:
115: /**
116: * Return the model used to map file types to applications thay be used
117: * to open them
118: *
119: * @return file type mapping model
120: */
121: public FileTypeMappingModel getFileTypeMappingModel();
122:
123: /**
124: * Return the view manager
125: *
126: * @return the view mananger
127: */
128: public ViewManager getViewManager();
129:
130: /**
131: * Implement to register an <code>Encrypter</code> implementation. The password
132: * manager may use this to encrypt the password list. Only one implementation
133: * can be registered, subsequent attempts will thrown an an exception.
134: *
135: * @param encrypter the encrypter implementation
136: */
137: public void setEncrypter(Encrypter encrypter) throws Exception;
138:
139: /**
140: * Implement to return the current <code>Encrypter</code>, or <code>null</code>
141: * if none is registered.
142: *
143: * @return the encrypter
144: */
145: public Encrypter getEncrypter();
146:
147: /**
148: * Implement to return the text style model.
149: *
150: * @return text style mode
151: */
152: public TextStyleModel getTextStyleModel();
153:
154: /**
155: * Open a node using the specified action. The action may be one of<br><br>
156: *
157: * @param node node to open
158: * @param action action to take
159: */
160: public void openNode(CVSFileNode node, int action);
161: }
|