KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > him > actions > dir > ActionOrder


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.dir;
20
21 import java.awt.event.ActionEvent JavaDoc;
22
23 import javax.swing.Icon JavaDoc;
24 import javax.swing.ImageIcon JavaDoc;
25 import javax.swing.JFrame JavaDoc;
26
27 import org.openharmonise.him.actions.*;
28 import org.openharmonise.him.displaycomponents.table.order.*;
29 import org.openharmonise.vfs.*;
30 import org.openharmonise.vfs.context.*;
31 import org.openharmonise.vfs.gui.*;
32
33
34 /**
35  * Action for ordering the children of collections.
36  *
37  * @author Matthew Large
38  * @version $Revision: 1.1 $
39  *
40  */

41 public class ActionOrder extends AbstractHIMAction implements HIMAction {
42
43     public static String JavaDoc ACTION_NAME = "ORDER";
44
45     /**
46      *
47      */

48     public ActionOrder() {
49         super();
50     }
51
52     /**
53      *
54      * @param vfFile
55      */

56     public ActionOrder(VirtualFile vfFile) {
57         super(vfFile);
58     }
59
60     /* (non-Javadoc)
61      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
62      */

63     public void actionPerformed(ActionEvent JavaDoc arg0) {
64         JFrame JavaDoc frame = new JFrame JavaDoc();
65         frame.setIconImage( ((ImageIcon JavaDoc)IconManager.getInstance().getIcon("32-sim-logo.gif")).getImage() );
66         
67         ContextEvent ce = ContextHandler.getInstance().getLastEvent(ContextType.CONTEXT_DIRS);
68         VirtualFile vfDir = ce.getVFS().getVirtualFile(ce.getPath()).getResource();
69         
70         OrderDialog dialog = new OrderDialog(frame, "Set Server Order", vfDir);
71         dialog.show();
72     }
73
74     /* (non-Javadoc)
75      * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getText()
76      */

77     public String JavaDoc getText() {
78         return "Order";
79     }
80
81     /* (non-Javadoc)
82      * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getToolTip()
83      */

84     public String JavaDoc getToolTip() {
85         return "Opens a dialog to order the resources in the current collection";
86     }
87
88     /* (non-Javadoc)
89      * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getIcon()
90      */

91     public Icon JavaDoc getIcon() {
92         return IconManager.getInstance().getIcon("16-blank.gif");
93     }
94
95     /* (non-Javadoc)
96      * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getMnemonic()
97      */

98     public String JavaDoc getMnemonic() {
99         return "O";
100     }
101
102     /* (non-Javadoc)
103      * @see com.simulacramedia.contentmanager.actions.CMAction#getDescription()
104      */

105     public String JavaDoc getDescription() {
106         return this.getToolTip();
107     }
108
109     /* (non-Javadoc)
110      * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorKeycode()
111      */

112     public int getAcceleratorKeycode() {
113         return 0;
114     }
115
116     /* (non-Javadoc)
117      * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorMask()
118      */

119     public int getAcceleratorMask() {
120         return 0;
121     }
122
123 }
124
Popular Tags