KickJava   Java API By Example, From Geeks To Geeks.

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


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 preview settings dialog.
41  *
42  * @author matt treanor
43  * @version $Revision: 1.2 $
44  *
45  */

46 public class ActionPreviewSettings extends AbstractHIMAction implements HIMAction {
47
48     /**
49      *
50      */

51     public ActionPreviewSettings() {
52         super();
53     }
54
55     /**
56      * @param vfFile
57      */

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

65     public void actionPerformed(ActionEvent arg0) {
66         JFrame frame = new JFrame();
67         frame.setIconImage( ((ImageIcon)IconManager.getInstance().getIcon("16-command-server-properties.gif")).getImage() );
68         
69         
70         PreviewConfigDialog dialog = new PreviewConfigDialog(frame, "Preview Settings");
71         dialog.show();
72     }
73
74     /* (non-Javadoc)
75      * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getText()
76      */

77     public String JavaDoc getText() {
78         // TODO Auto-generated method stub
79
return "Preview settings...";
80     }
81
82     /* (non-Javadoc)
83      * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getToolTip()
84      */

85     public String JavaDoc getToolTip() {
86         return this.getDescription();
87     }
88
89     /* (non-Javadoc)
90      * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#getIcon()
91      */

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

99     public String JavaDoc getMnemonic() {
100         return "P";
101     }
102
103     /* (non-Javadoc)
104      * @see com.simulacramedia.contentmanager.actions.AbstractCMAction#isEnabled(com.simulacramedia.contentmanager.context.ContextEvent)
105      */

106     public boolean isEnabled(ContextEvent ce) {
107         if(!this.m_bUserChecked) {
108             this.checkUser();
109         }
110         this.setEnabled(this.m_bShow);
111         return this.m_bShow;
112     }
113
114     /* (non-Javadoc)
115      * @see com.simulacramedia.contentmanager.actions.CMAction#getDescription()
116      */

117     public String JavaDoc getDescription() {
118         return "Opens a dialog in which you can alter preview settings";
119     }
120
121     /* (non-Javadoc)
122      * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorKeycode()
123      */

124     public int getAcceleratorKeycode() {
125         // TODO Auto-generated method stub
126
return 0;
127     }
128
129     /* (non-Javadoc)
130      * @see com.simulacramedia.contentmanager.actions.CMAction#getAcceleratorMask()
131      */

132     public int getAcceleratorMask() {
133         // TODO Auto-generated method stub
134
return 0;
135     }
136 }
137
Popular Tags