001: /*
002: * Copyright (C) 2001, 2002 Robert MacGrogan
003: *
004: * This library is free software; you can redistribute it and/or
005: * modify it under the terms of the GNU Lesser General Public
006: * License as published by the Free Software Foundation; either
007: * version 2.1 of the License, or (at your option) any later version.
008: *
009: * This library is distributed in the hope that it will be useful,
010: * but WITHOUT ANY WARRANTY; without even the implied warranty of
011: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012: * Lesser General Public License for more details.
013: *
014: * You should have received a copy of the GNU Lesser General Public
015: * License along with this library; if not, write to the Free Software
016: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
017: *
018: *
019: * $Archive: SourceJammer$
020: * $FileName: SJTreeNodeSelectionListener.java$
021: * $FileID: 4006$
022: *
023: * Last change:
024: * $AuthorName: Rob MacGrogan$
025: * $Date: 4/23/03 5:10 PM$
026: * $Comment: Replaced GPL header with LGPL header.$
027: */
028:
029: package org.sourcejammer.client.gui.listener;
030:
031: import javax.swing.event.TreeSelectionListener;
032: import javax.swing.event.TreeSelectionEvent;
033: import javax.swing.JTable;
034: import javax.swing.table.TableColumn;
035: import javax.swing.tree.TreePath;
036: import org.sourcejammer.client.gui.*;
037: import java.awt.event.ActionEvent;
038: import org.sourcejammer.client.gui.action.ActionCentral;
039:
040: /**
041: * Title: $FileName: SJTreeNodeSelectionListener.java$
042: * @version $VerNum: 4$
043: * @author $AuthorName: Rob MacGrogan$<br><br>
044: *
045: * $Description: $<br>
046: * $KeyWordsOff: $
047: */
048: public class SJTreeNodeSelectionListener implements
049: TreeSelectionListener {
050:
051: public SJTreeNodeSelectionListener() {
052: }
053:
054: public void valueChanged(TreeSelectionEvent ev) {
055:
056: ActionEvent act = new ActionEvent(ev,
057: ActionEvent.ACTION_PERFORMED, "NodeSelected");
058: ActionCentral oActions = ActionCentral.getInstance();
059: oActions.fireActionThisThread(
060: ActionCentral.act_DISPLAY_PROJECT_DETAILS, act);
061:
062: CommandCentral oCentral = CommandCentral.getInstance();
063: if (oCentral.getCurrentTreeNode() != null) {
064: oActions.enableAction(ActionCentral.act_ADD_FILE);
065: oActions.enableAction(ActionCentral.act_REFRESH_PROJECT);
066: oActions.enableAction(ActionCentral.act_SET_DEFAULT_DIR);
067: oActions.enableAction(ActionCentral.act_MAKE_PROJECT);
068: oActions.enableAction(ActionCentral.act_REMOVE_PROJECT);
069: oActions.enableAction(ActionCentral.act_VIEW_REMOVED);
070: oActions
071: .enableAction(ActionCentral.act_VIEW_RESTORE_REMOVED);
072: oActions
073: .enableAction(ActionCentral.act_VIEW_DELETE_REMOVED);
074: oActions
075: .enableAction(ActionCentral.act_GET_FILES_IN_PROJECT);
076: oActions
077: .enableAction(ActionCentral.act_MAKE_LABELED_VERSION);
078: oActions.enableAction(ActionCentral.act_RENAME_PROJECT);
079: oActions.enableAction(ActionCentral.act_MOVE_COPY_PROJECT);
080: oActions.enableAction(ActionCentral.act_SHARE_PROJECT);
081: oActions.enableAction(ActionCentral.act_CHECK_OUT_RPT);
082: oActions.enableAction(ActionCentral.act_BRANCH_PROJECT);
083: oActions
084: .enableAction(ActionCentral.act_REMOVE_PROJECT_SHARES);
085: } else {
086: oActions.disableAction(ActionCentral.act_ADD_FILE);
087: oActions.disableAction(ActionCentral.act_REFRESH_PROJECT);
088: oActions.disableAction(ActionCentral.act_SET_DEFAULT_DIR);
089: oActions.disableAction(ActionCentral.act_MAKE_PROJECT);
090: oActions.disableAction(ActionCentral.act_REMOVE_PROJECT);
091: oActions.disableAction(ActionCentral.act_VIEW_REMOVED);
092: oActions
093: .disableAction(ActionCentral.act_VIEW_RESTORE_REMOVED);
094: oActions
095: .disableAction(ActionCentral.act_VIEW_DELETE_REMOVED);
096: oActions
097: .disableAction(ActionCentral.act_GET_FILES_IN_PROJECT);
098: oActions
099: .disableAction(ActionCentral.act_MAKE_LABELED_VERSION);
100: oActions.disableAction(ActionCentral.act_RENAME_PROJECT);
101: oActions.disableAction(ActionCentral.act_MOVE_COPY_PROJECT);
102: oActions.disableAction(ActionCentral.act_SHARE_PROJECT);
103: oActions.disableAction(ActionCentral.act_CHECK_OUT_RPT);
104: oActions.disableAction(ActionCentral.act_BRANCH_PROJECT);
105: oActions
106: .disableAction(ActionCentral.act_REMOVE_PROJECT_SHARES);
107: }
108: }
109:
110: }
|