01: /*
02: * Copyright (C) 2001, 2002 Robert MacGrogan
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2.1 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: *
18: *
19: * $Archive: SourceJammer$
20: * $FileName: ViewRemovedAction.java$
21: * $FileID: 4095$
22: *
23: * Last change:
24: * $AuthorName: Rob MacGrogan$
25: * $Date: 6/24/03 12:54 AM$
26: * $Comment: Moved message box/error dialog methods to MessageBoxUtil.$
27: */
28:
29: package org.sourcejammer.client.gui.action;
30:
31: import org.sourcejammer.client.DisplayTextLibrary;
32: import java.awt.event.ActionEvent;
33: import java.awt.Cursor;
34: import javax.swing.*;
35: import org.sourcejammer.client.gui.*;
36: import org.sourcejammer.client.gui.dialog.ViewRemovedDialog;
37: import org.sourcejammer.project.view.NodeName;
38: import org.sourcejammer.client.gui.icons.IconBank;
39:
40: /**
41: * Title: $FileName: ViewRemovedAction.java$
42: * @version $VerNum: 4$
43: * @author $AuthorName: Rob MacGrogan$<br><br>
44: *
45: * $Description: $<br>
46: * $KeyWordsOff: $<br>
47: */
48: public class ViewRemovedAction extends AbstractAction {
49:
50: public ViewRemovedAction() {
51: super (DisplayTextLibrary.getInstance().getDisplayText(
52: DisplayTextLibrary.ACT_VIEW_REMOVED), IconBank
53: .getInstance().getIcon(IconBank.BLANK_TOOL));
54: }
55:
56: public ViewRemovedAction(String sName) {
57: super (sName, IconBank.getInstance()
58: .getIcon(IconBank.BLANK_TOOL));
59: }
60:
61: public void actionPerformed(ActionEvent ev) {
62: try {
63: CommandCentral oCommand = CommandCentral.getInstance();
64: oCommand.getRootAppFrame().setCursor(
65: Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
66: ProjectTreeNode ndTreeParent = oCommand
67: .getCurrentTreeNode();
68: long lProjectID = ndTreeParent.getUniqueID();
69: oCommand.getRootAppFrame().setCursor(
70: Cursor.getDefaultCursor());
71: RemovedItem[] removedItems = oCommand
72: .viewRemoved(lProjectID);
73: ViewRemovedDialog.showDialog(removedItems, oCommand
74: .getRootAppFrame());
75: } catch (Exception ex) {
76: MessageBoxUtil.displayErrorMessage(ex.toString(), true);
77: } finally {
78: CommandCentral.getInstance().getRootAppFrame().setCursor(
79: Cursor.getDefaultCursor());
80: }
81:
82: }
83: }
|