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.system;
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.configuration.*;
029: import org.openharmonise.vfs.*;
030: import org.openharmonise.vfs.gui.*;
031:
032: /**
033: * Action to open the customise dialog.
034: *
035: * @author Matthew Large
036: * @version $Revision: 1.1 $
037: *
038: */
039: public class ActionCustomise extends AbstractHIMAction implements
040: HIMAction {
041:
042: /**
043: *
044: */
045: public ActionCustomise() {
046: super ();
047: }
048:
049: /**
050: * @param vfFile
051: */
052: public ActionCustomise(VirtualFile vfFile) {
053: super (vfFile);
054: }
055:
056: /* (non-Javadoc)
057: * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
058: */
059: public void actionPerformed(ActionEvent arg0) {
060: JFrame frame = new JFrame();
061: frame.setIconImage(((ImageIcon) IconManager.getInstance()
062: .getIcon("16-command-preferences.gif")).getImage());
063:
064: ConfigDialog dialog = new ConfigDialog(frame, "Customise");
065: dialog.show();
066: }
067:
068: /* (non-Javadoc)
069: * @see com.simulacramedia.contentmanager.actions.CMAction#getDescription()
070: */
071: public String getDescription() {
072: return "Opens a dialog to personalise the application";
073: }
074:
075: /* (non-Javadoc)
076: * @see com.simulacramedia.contentmanager.actions.CMAction#getText()
077: */
078: public String getText() {
079: return "Customise...";
080: }
081:
082: /* (non-Javadoc)
083: * @see com.simulacramedia.contentmanager.actions.CMAction#getToolTip()
084: */
085: public String getToolTip() {
086: return this .getDescription();
087: }
088:
089: /* (non-Javadoc)
090: * @see com.simulacramedia.contentmanager.actions.CMAction#getIcon()
091: */
092: public Icon getIcon() {
093: return IconManager.getInstance().getIcon(
094: "16-command-preferences.gif");
095: }
096:
097: /* (non-Javadoc)
098: * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorKeycode()
099: */
100: public int getAcceleratorKeycode() {
101: return 0;
102: }
103:
104: /* (non-Javadoc)
105: * @see com.simulacramedia.contentmanager.actions.CMAction#getMnemonic()
106: */
107: public String getMnemonic() {
108: return "C";
109: }
110:
111: /* (non-Javadoc)
112: * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorMask()
113: */
114: public int getAcceleratorMask() {
115: return 0;
116: }
117:
118: }
|