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.*;
022: import java.net.*;
023: import java.rmi.*;
024:
025: import javax.swing.*;
026: import javax.xml.rpc.*;
027:
028: import org.openharmonise.him.*;
029: import org.openharmonise.him.actions.*;
030: import org.openharmonise.him.harmonise.*;
031: import org.openharmonise.him.serverconfig.*;
032: import org.openharmonise.vfs.*;
033: import org.openharmonise.vfs.authentication.*;
034: import org.openharmonise.vfs.context.*;
035: import org.openharmonise.vfs.gui.*;
036: import org.openharmonise.vfs.servers.*;
037:
038: /**
039: * Action to open the server properties dialog.
040: *
041: * @author Matthew Large
042: * @version $Revision: 1.2 $
043: *
044: */
045: public class ActionSystemSettings extends AbstractHIMAction implements
046: HIMAction {
047:
048: /**
049: *
050: */
051: public ActionSystemSettings() {
052: super ();
053: }
054:
055: /**
056: * @param vfFile
057: */
058: public ActionSystemSettings(VirtualFile vfFile) {
059: super (vfFile);
060: }
061:
062: /* (non-Javadoc)
063: * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
064: */
065: public void actionPerformed(ActionEvent arg0) {
066: JFrame frame = new JFrame();
067: frame.setIconImage(((ImageIcon) IconManager.getInstance()
068: .getIcon("16-command-server-properties.gif"))
069: .getImage());
070:
071: ServerConfigDialog dialog = new ServerConfigDialog(frame,
072: "Server Properties");
073: dialog.show();
074: }
075:
076: /* (non-Javadoc)
077: * @see com.simulacramedia.contentmanager.actions.CMAction#getDescription()
078: */
079: public String getDescription() {
080: return "Opens a dialog in which you can alter settings on the server";
081: }
082:
083: /* (non-Javadoc)
084: * @see com.simulacramedia.contentmanager.actions.CMAction#getText()
085: */
086: public String getText() {
087: return "Server properties...";
088: }
089:
090: /* (non-Javadoc)
091: * @see com.simulacramedia.contentmanager.actions.CMAction#getToolTip()
092: */
093: public String getToolTip() {
094: return this .getDescription();
095: }
096:
097: /* (non-Javadoc)
098: * @see com.simulacramedia.contentmanager.actions.CMAction#getIcon()
099: */
100: public Icon getIcon() {
101: return IconManager.getInstance().getIcon(
102: "16-command-server-properties.gif");
103: }
104:
105: /* (non-Javadoc)
106: * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorKeycode()
107: */
108: public int getAcceleratorKeycode() {
109: return 0;
110: }
111:
112: /* (non-Javadoc)
113: * @see com.simulacramedia.contentmanager.actions.CMAction#getMnemonic()
114: */
115: public String getMnemonic() {
116: return "p";
117: }
118:
119: /* (non-Javadoc)
120: * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorMask()
121: */
122: public int getAcceleratorMask() {
123: return 0;
124: }
125:
126: /* (non-Javadoc)
127: * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#isEnabled(com.simulacramedia.contentmanager.context.ContextEvent)
128: */
129: public boolean isEnabled(ContextEvent ce) {
130: if (!m_bUserChecked) {
131: checkUser();
132: }
133: this.setEnabled(m_bShow);
134: return m_bShow;
135: }
136:
137: }
|