01: /*
02: * Copyright (c) 2000, Jacob Smullyan.
03: *
04: * This is part of SkunkDAV, a WebDAV client. See http://skunkdav.sourceforge.net/
05: * for the latest version.
06: *
07: * SkunkDAV is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License as published
09: * by the Free Software Foundation; either version 2, or (at your option)
10: * any later version.
11: *
12: * SkunkDAV is distributed in the hope that it will be useful,
13: * but WITHOUT ANY WARRANTY; without even the implied warranty of
14: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15: * General Public License for more details.
16: *
17: * You should have received a copy of the GNU General Public License
18: * along with SkunkDAV; see the file COPYING. If not, write to the Free
19: * Software Foundation, 59 Temple Place - Suite 330, Boston, MA
20: * 02111-1307, USA.
21: */
22:
23: package org.skunk.dav.client.gui.action;
24:
25: import java.awt.event.ActionEvent;
26: import javax.swing.AbstractAction;
27: import org.skunk.dav.client.DAVFile;
28: import org.skunk.dav.client.gui.DAVTreeNode;
29: import org.skunk.dav.client.gui.Explorer;
30: import org.skunk.trace.Debug;
31:
32: public class StealLockAction extends AbstractAction {
33: private Explorer ex;
34: private DAVFile file;
35: private DAVTreeNode node;
36:
37: public StealLockAction(Explorer ex) {
38: this (ex, null, null);
39: }
40:
41: public StealLockAction(Explorer ex, DAVFile file) {
42: this (ex, null, file);
43: }
44:
45: public StealLockAction(Explorer ex, DAVTreeNode node, DAVFile file) {
46: this .ex = ex;
47: this .node = node;
48: this .file = file;
49: }
50:
51: public void actionPerformed(ActionEvent ae) {
52: DAVTreeNode localNode = (node == null) ? ex.getSelectedNode()
53: : node;
54:
55: if (localNode == null) {
56: Debug
57: .trace(this , Debug.DP3,
58: "null node in StealLockAction");
59: return;
60: }
61: DAVFile localFile = (file == null) ? ex.getSelectedTableFile()
62: : file;
63: if (localFile == null) {
64: Debug
65: .trace(this , Debug.DP3,
66: "null file in StealLockAction");
67: return;
68: }
69: ex.stealLock(localNode, localFile);
70: }
71: }
72:
73: /* $Log: StealLockAction.java,v $
74: /* Revision 1.3 2000/12/19 22:36:05 smulloni
75: /* adjustments to preamble.
76: /*
77: /* Revision 1.2 2000/12/03 23:53:26 smulloni
78: /* added license and copyright preamble to java files.
79: /*
80: /* Revision 1.1 2000/11/09 23:35:05 smullyan
81: /* log added to every Java file, with the help of python. Lock stealing
82: /* implemented, and treatment of locks made more robust.
83: /* */
|