KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > him > actions > move > ActionAlias


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * See the License for the specific language governing rights and
10  * limitations under the License.
11  *
12  * The Initial Developer of the Original Code is Simulacra Media Ltd.
13  * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14  *
15  * All Rights Reserved.
16  *
17  * Contributor(s):
18  */

19 package org.openharmonise.him.actions.move;
20
21 import java.awt.event.ActionEvent JavaDoc;
22
23 import javax.swing.Icon JavaDoc;
24
25 import org.openharmonise.him.actions.*;
26 import org.openharmonise.him.actions.rules.*;
27 import org.openharmonise.vfs.*;
28 import org.openharmonise.vfs.gui.*;
29
30
31 /**
32  * Action to create a shortcut to a virtual file. Used in the drag context menu.
33  *
34  * @author Matthew Large
35  * @version $Revision: 1.1 $
36  *
37  */

38 public class ActionAlias extends AbstractHIMAction implements HIMAction {
39
40     public static String JavaDoc ACTION_NAME = "SHORTCUT";
41
42     /**
43      * Virtual file shortcut will go to.
44      */

45     private VirtualFile m_vfToFile = null;
46
47     /**
48      *
49      */

50     private ActionAlias() {
51         super();
52         this.setup();
53     }
54
55     /**
56      * @param vfFile
57      */

58     public ActionAlias(VirtualFile vfFromFile, VirtualFile vfToFile) {
59         super(vfFromFile);
60         this.m_vfToFile = vfToFile;
61         this.setup();
62     }
63     
64     /**
65      * Configures this action.
66      *
67      */

68     private void setup() {
69         SecurityRule secRule = new SecurityRule(VirtualFile.METHOD_SHORTCUT);
70         super.addEnableRule(secRule);
71     }
72
73     /* (non-Javadoc)
74      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
75      */

76     public void actionPerformed(ActionEvent JavaDoc arg0) {
77     }
78
79     /* (non-Javadoc)
80      * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getText()
81      */

82     public String JavaDoc getText() {
83         return "Create Alias";
84     }
85
86     /* (non-Javadoc)
87      * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getToolTip()
88      */

89     public String JavaDoc getToolTip() {
90         return this.getDescription();
91     }
92
93     /* (non-Javadoc)
94      * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getIcon()
95      */

96     public Icon JavaDoc getIcon() {
97         return IconManager.getInstance().getIcon("16-command-alias.png");
98     }
99
100     /* (non-Javadoc)
101      * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getMnemonic()
102      */

103     public String JavaDoc getMnemonic() {
104         return "A";
105     }
106
107     /* (non-Javadoc)
108      * @see com.simulacramedia.contentmanager.actions.CMAction#getDescription()
109      */

110     public String JavaDoc getDescription() {
111         return "Creates an alias for this resource in another collection";
112     }
113
114     /* (non-Javadoc)
115      * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorKeycode()
116      */

117     public int getAcceleratorKeycode() {
118         return 0;
119     }
120
121     /* (non-Javadoc)
122      * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorMask()
123      */

124     public int getAcceleratorMask() {
125         return 0;
126     }
127
128 }
129
Popular Tags