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.connection;
023:
024: import gruntspud.GruntspudContext;
025:
026: import javax.swing.JComponent;
027:
028: /**
029: * Description of the Class
030: *
031: *@author magicthize
032: *@created 26 May 2002
033: */
034: public abstract class CVSRootDefaultConnection implements
035: GruntspudConnection {
036: private GruntspudContext context;
037: private ConnectionProfile profile;
038: private JComponent parent;
039:
040: /**
041: * Constructor for the CVSRootDefaultConnection object
042: *
043: *@param host Description of the Parameter
044: *@param root Description of the Parameter
045: *@param alternateCVSCommandLocation Description of the Parameter
046: */
047: public CVSRootDefaultConnection() {
048: }
049:
050: /**
051: * DOCUMENT ME!
052: *
053: * @param parent DOCUMENT ME!
054: * @param context DOCUMENT ME!
055: * @param profile DOCUMENT ME!
056: */
057: public void init(JComponent parent, GruntspudContext context,
058: ConnectionProfile profile) {
059: setParent(parent);
060: setContext(context);
061: setProfile(profile);
062: }
063:
064: /**
065: * Sets the host attribute of the CVSRootDefaultConnection object
066: *
067: *@param host The new host value
068: */
069: public void setContext(GruntspudContext context) {
070: this .context = context;
071: }
072:
073: /**
074: * Sets the host attribute of the CVSRootDefaultConnection object
075: *
076: *@param host The new host value
077: */
078: public void setParent(JComponent parent) {
079: this .parent = parent;
080: }
081:
082: /**
083: * Sets the host attribute of the CVSRootDefaultConnection object
084: *
085: *@param host The new host value
086: */
087: public void setProfile(ConnectionProfile profile) {
088: this .profile = profile;
089: }
090:
091: /**
092: * Gets the host attribute of the CVSRootDefaultConnection object
093: *
094: *@return The host value
095: */
096: public GruntspudContext getContext() {
097: return context;
098: }
099:
100: /**
101: * Sets the host attribute of the CVSRootDefaultConnection object
102: *
103: *@param host The new host value
104: */
105: public JComponent getParent() {
106: return parent;
107: }
108:
109: /**
110: * Gets the repository attribute of the CVSRootDefaultConnection object
111: *
112: *@return The repository value
113: */
114: public String getRepository() {
115: return (getProfile().getCVSRoot() == null) ? null
116: : getProfile().getCVSRoot().getRepository();
117: }
118:
119: /**
120: * Gets the host attribute of the CVSRootDefaultConnection object
121: *
122: *@param host The new host value
123: */
124: public ConnectionProfile getProfile() {
125: return profile;
126: }
127: }
|