001: /*
002: * The contents of this file are subject to the
003: * Mozilla Public License Version 1.1 (the "License");
004: * you may not use this file except in compliance with the License.
005: * You may obtain a copy of the License at http://www.mozilla.org/MPL/
006: *
007: * Software distributed under the License is distributed on an "AS IS"
008: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
009: * See the License for the specific language governing rights and
010: * limitations under the License.
011: *
012: * The Initial Developer of the Original Code is Simulacra Media Ltd.
013: * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
014: *
015: * All Rights Reserved.
016: *
017: * Contributor(s):
018: */
019: package org.openharmonise.him.actions.dir;
020:
021: import java.awt.event.ActionEvent;
022:
023: import javax.swing.Icon;
024: import javax.swing.ImageIcon;
025: import javax.swing.JFrame;
026:
027: import org.openharmonise.him.actions.*;
028: import org.openharmonise.him.displaycomponents.table.order.*;
029: import org.openharmonise.vfs.*;
030: import org.openharmonise.vfs.context.*;
031: import org.openharmonise.vfs.gui.*;
032:
033: /**
034: * Action for ordering the children of collections.
035: *
036: * @author Matthew Large
037: * @version $Revision: 1.1 $
038: *
039: */
040: public class ActionOrder extends AbstractHIMAction implements HIMAction {
041:
042: public static String ACTION_NAME = "ORDER";
043:
044: /**
045: *
046: */
047: public ActionOrder() {
048: super ();
049: }
050:
051: /**
052: *
053: * @param vfFile
054: */
055: public ActionOrder(VirtualFile vfFile) {
056: super (vfFile);
057: }
058:
059: /* (non-Javadoc)
060: * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
061: */
062: public void actionPerformed(ActionEvent arg0) {
063: JFrame frame = new JFrame();
064: frame.setIconImage(((ImageIcon) IconManager.getInstance()
065: .getIcon("32-sim-logo.gif")).getImage());
066:
067: ContextEvent ce = ContextHandler.getInstance().getLastEvent(
068: ContextType.CONTEXT_DIRS);
069: VirtualFile vfDir = ce.getVFS().getVirtualFile(ce.getPath())
070: .getResource();
071:
072: OrderDialog dialog = new OrderDialog(frame, "Set Server Order",
073: vfDir);
074: dialog.show();
075: }
076:
077: /* (non-Javadoc)
078: * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getText()
079: */
080: public String getText() {
081: return "Order";
082: }
083:
084: /* (non-Javadoc)
085: * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getToolTip()
086: */
087: public String getToolTip() {
088: return "Opens a dialog to order the resources in the current collection";
089: }
090:
091: /* (non-Javadoc)
092: * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getIcon()
093: */
094: public Icon getIcon() {
095: return IconManager.getInstance().getIcon("16-blank.gif");
096: }
097:
098: /* (non-Javadoc)
099: * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getMnemonic()
100: */
101: public String getMnemonic() {
102: return "O";
103: }
104:
105: /* (non-Javadoc)
106: * @see com.simulacramedia.contentmanager.actions.CMAction#getDescription()
107: */
108: public String getDescription() {
109: return this .getToolTip();
110: }
111:
112: /* (non-Javadoc)
113: * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorKeycode()
114: */
115: public int getAcceleratorKeycode() {
116: return 0;
117: }
118:
119: /* (non-Javadoc)
120: * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorMask()
121: */
122: public int getAcceleratorMask() {
123: return 0;
124: }
125:
126: }
|