KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > him > actions > system > ActionSystemSettings


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.system;
20
21 import java.awt.event.*;
22 import java.net.*;
23 import java.rmi.*;
24
25 import javax.swing.*;
26 import javax.xml.rpc.*;
27
28 import org.openharmonise.him.*;
29 import org.openharmonise.him.actions.*;
30 import org.openharmonise.him.harmonise.*;
31 import org.openharmonise.him.serverconfig.*;
32 import org.openharmonise.vfs.*;
33 import org.openharmonise.vfs.authentication.*;
34 import org.openharmonise.vfs.context.*;
35 import org.openharmonise.vfs.gui.*;
36 import org.openharmonise.vfs.servers.*;
37
38
39 /**
40  * Action to open the server properties dialog.
41  *
42  * @author Matthew Large
43  * @version $Revision: 1.2 $
44  *
45  */

46 public class ActionSystemSettings
47     extends AbstractHIMAction
48     implements HIMAction {
49
50
51     /**
52      *
53      */

54     public ActionSystemSettings() {
55         super();
56     }
57
58     /**
59      * @param vfFile
60      */

61     public ActionSystemSettings(VirtualFile vfFile) {
62         super(vfFile);
63     }
64     
65     /* (non-Javadoc)
66      * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
67      */

68     public void actionPerformed(ActionEvent arg0) {
69         JFrame frame = new JFrame();
70         frame.setIconImage( ((ImageIcon)IconManager.getInstance().getIcon("16-command-server-properties.gif")).getImage() );
71         
72         
73         ServerConfigDialog dialog = new ServerConfigDialog(frame, "Server Properties");
74         dialog.show();
75     }
76
77     /* (non-Javadoc)
78      * @see com.simulacramedia.contentmanager.actions.CMAction#getDescription()
79      */

80     public String JavaDoc getDescription() {
81         return "Opens a dialog in which you can alter settings on the server";
82     }
83
84     /* (non-Javadoc)
85      * @see com.simulacramedia.contentmanager.actions.CMAction#getText()
86      */

87     public String JavaDoc getText() {
88         return "Server properties...";
89     }
90
91     /* (non-Javadoc)
92      * @see com.simulacramedia.contentmanager.actions.CMAction#getToolTip()
93      */

94     public String JavaDoc getToolTip() {
95         return this.getDescription();
96     }
97
98     /* (non-Javadoc)
99      * @see com.simulacramedia.contentmanager.actions.CMAction#getIcon()
100      */

101     public Icon getIcon() {
102         return IconManager.getInstance().getIcon("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 JavaDoc 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 }
138
Popular Tags