~ubuntu-branches/ubuntu/quantal/zeroc-ice/quantal

« back to all changes in this revision

Viewing changes to java/src/IceGridGUI/LiveActions.java

  • Committer: Bazaar Package Importer
  • Author(s): Cleto Martin Angelina
  • Date: 2011-04-25 18:44:24 UTC
  • mfrom: (6.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110425184424-sep9i9euu434vq4c
Tags: 3.4.1-7
* Bug fix: "libdb5.1-java.jar was renamed to db.jar", thanks to Ondřej
  Surý (Closes: #623555).
* Bug fix: "causes noise in php5", thanks to Jayen Ashar (Closes:
  #623533).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
// **********************************************************************
2
2
//
3
 
// Copyright (c) 2003-2009 ZeroC, Inc. All rights reserved.
 
3
// Copyright (c) 2003-2010 ZeroC, Inc. All rights reserved.
4
4
//
5
5
// This copy of Ice is licensed to you under the terms described in the
6
6
// ICE_LICENSE file included in this distribution.
7
7
//
8
8
// **********************************************************************
 
9
 
9
10
package IceGridGUI;
10
11
 
11
12
import java.awt.event.ActionEvent;
26
27
        {
27
28
            super(name);
28
29
            _name = name;
29
 
            putValue(Action.SHORT_DESCRIPTION, 
30
 
                     "Send " + _name);
 
30
            putValue(Action.SHORT_DESCRIPTION, "Send " + _name);
31
31
        }
32
32
 
33
 
        public void actionPerformed(ActionEvent e) 
 
33
        public void actionPerformed(ActionEvent e)
34
34
        {
35
35
            _target.signal(_name);
36
36
        }
37
37
        private String _name;
38
 
    };
39
 
 
 
38
    }
40
39
 
41
40
    public Action get(int index)
42
41
    {
43
42
        return _array[index];
44
43
    }
45
 
    
 
44
 
46
45
    public boolean[] setTarget(TreeNode target)
47
46
    {
48
47
        _target = target;
53
52
            availableActions = new boolean[TreeNode.ACTION_COUNT];
54
53
        }
55
54
        else
56
 
        {   
 
55
        {
57
56
            availableActions = _target.getAvailableActions();
58
57
        }
59
58
 
67
66
 
68
67
    LiveActions()
69
68
    {
70
 
        _array[TreeNode.START] = new AbstractAction(
71
 
            "Start", Utils.getIcon("/icons/16x16/start.png"))
 
69
        _array[TreeNode.START] = new AbstractAction("Start", Utils.getIcon("/icons/16x16/start.png"))
72
70
            {
73
 
                public void actionPerformed(ActionEvent e) 
 
71
                public void actionPerformed(ActionEvent e)
74
72
                {
75
73
                    _target.start();
76
74
                }
77
75
            };
78
 
        _array[TreeNode.START].putValue(Action.SHORT_DESCRIPTION, 
79
 
                                        "Start this server or service");
 
76
        _array[TreeNode.START].putValue(Action.SHORT_DESCRIPTION, "Start this server or service");
80
77
 
81
 
        _array[TreeNode.STOP] = new AbstractAction(
82
 
            "Stop", Utils.getIcon("/icons/16x16/stop.png"))
 
78
        _array[TreeNode.STOP] = new AbstractAction("Stop", Utils.getIcon("/icons/16x16/stop.png"))
83
79
            {
84
 
                public void actionPerformed(ActionEvent e) 
 
80
                public void actionPerformed(ActionEvent e)
85
81
                {
86
82
                    _target.stop();
87
83
                }
88
84
            };
89
 
        _array[TreeNode.STOP].putValue(Action.SHORT_DESCRIPTION, 
90
 
                                       "Stop this server or service");
91
 
        
92
 
 
93
 
        _array[TreeNode.ENABLE] = new AbstractAction(
94
 
            "Enable", Utils.getIcon("/icons/16x16/enable.png"))
 
85
        _array[TreeNode.STOP].putValue(Action.SHORT_DESCRIPTION, "Stop this server or service");
 
86
 
 
87
 
 
88
        _array[TreeNode.ENABLE] = new AbstractAction("Enable", Utils.getIcon("/icons/16x16/enable.png"))
95
89
            {
96
 
                public void actionPerformed(ActionEvent e) 
 
90
                public void actionPerformed(ActionEvent e)
97
91
                {
98
92
                    _target.enable();
99
93
                }
100
94
            };
101
 
        _array[TreeNode.ENABLE].putValue(Action.SHORT_DESCRIPTION, 
102
 
                                             "Enable this server");
103
 
        
104
 
        _array[TreeNode.DISABLE] = new AbstractAction(
105
 
            "Disable", Utils.getIcon("/icons/16x16/disable.png"))
 
95
        _array[TreeNode.ENABLE].putValue(Action.SHORT_DESCRIPTION, "Enable this server");
 
96
 
 
97
        _array[TreeNode.DISABLE] = new AbstractAction("Disable", Utils.getIcon("/icons/16x16/disable.png"))
106
98
            {
107
 
                public void actionPerformed(ActionEvent e) 
 
99
                public void actionPerformed(ActionEvent e)
108
100
                {
109
101
                    _target.disable();
110
102
                }
111
103
            };
112
 
        _array[TreeNode.DISABLE].putValue(Action.SHORT_DESCRIPTION, 
113
 
                                              "Disable this server");
 
104
        _array[TreeNode.DISABLE].putValue(Action.SHORT_DESCRIPTION, "Disable this server");
114
105
 
115
106
        _array[TreeNode.SIGHUP] = new SendSignal("SIGHUP");
116
107
        _array[TreeNode.SIGINT] = new SendSignal("SIGINT");
122
113
 
123
114
        _array[TreeNode.WRITE_MESSAGE] = new AbstractAction("Write Message")
124
115
            {
125
 
                public void actionPerformed(ActionEvent e) 
 
116
                public void actionPerformed(ActionEvent e)
126
117
                {
127
118
                    _target.writeMessage();
128
119
                }
129
120
            };
130
 
        _array[TreeNode.WRITE_MESSAGE].putValue(Action.SHORT_DESCRIPTION, 
131
 
                                               "Write message to stdout or stderr");
132
 
        
 
121
        _array[TreeNode.WRITE_MESSAGE].putValue(Action.SHORT_DESCRIPTION, "Write message to stdout or stderr");
 
122
 
133
123
 
134
124
        _array[TreeNode.RETRIEVE_STDOUT] = new AbstractAction("Retrieve stdout")
135
125
            {
136
 
                public void actionPerformed(ActionEvent e) 
 
126
                public void actionPerformed(ActionEvent e)
137
127
                {
138
128
                    _target.retrieveOutput(true);
139
129
                }
140
130
            };
141
 
        _array[TreeNode.RETRIEVE_STDOUT].putValue(Action.SHORT_DESCRIPTION, 
142
 
                                               "Retrieve stdout");
 
131
        _array[TreeNode.RETRIEVE_STDOUT].putValue(Action.SHORT_DESCRIPTION, "Retrieve stdout");
143
132
 
144
133
        _array[TreeNode.RETRIEVE_STDERR] = new AbstractAction("Retrieve stderr")
145
134
            {
146
 
                public void actionPerformed(ActionEvent e) 
 
135
                public void actionPerformed(ActionEvent e)
147
136
                {
148
137
                    _target.retrieveOutput(false);
149
138
                }
150
139
            };
151
 
        _array[TreeNode.RETRIEVE_STDERR].putValue(Action.SHORT_DESCRIPTION, 
152
 
                                                  "Retrieve stderr");
 
140
        _array[TreeNode.RETRIEVE_STDERR].putValue(Action.SHORT_DESCRIPTION, "Retrieve stderr");
153
141
 
154
142
        _array[TreeNode.RETRIEVE_LOG] = new AbstractAction("Retrieve Log")
155
143
            {
156
 
                public void actionPerformed(ActionEvent e) 
 
144
                public void actionPerformed(ActionEvent e)
157
145
                {
158
146
                    _target.retrieveLog();
159
147
                }
160
148
            };
161
 
        _array[TreeNode.RETRIEVE_LOG].putValue(Action.SHORT_DESCRIPTION, 
162
 
                                               "Retrieve log file from the server");
163
 
 
 
149
        _array[TreeNode.RETRIEVE_LOG].putValue(Action.SHORT_DESCRIPTION, "Retrieve log file from the server");
164
150
 
165
151
        _array[TreeNode.SHUTDOWN_NODE] = new AbstractAction("Shutdown")
166
152
            {
167
 
                public void actionPerformed(ActionEvent e) 
 
153
                public void actionPerformed(ActionEvent e)
168
154
                {
169
155
                    _target.shutdownNode();
170
156
                }
172
158
 
173
159
        _array[TreeNode.SHUTDOWN_REGISTRY] = new AbstractAction("Shutdown")
174
160
            {
175
 
                public void actionPerformed(ActionEvent e) 
 
161
                public void actionPerformed(ActionEvent e)
176
162
                {
177
163
                    _target.shutdownRegistry();
178
164
                }
179
165
            };
180
 
        
181
 
        _array[TreeNode.PATCH_SERVER] = 
182
 
            new AbstractAction("Patch Distribution")
 
166
 
 
167
        _array[TreeNode.PATCH_SERVER] = new AbstractAction("Patch Distribution")
183
168
            {
184
 
                public void actionPerformed(ActionEvent e) 
 
169
                public void actionPerformed(ActionEvent e)
185
170
                {
186
171
                    _target.patchServer();
187
172
                }
188
173
            };
189
174
 
190
 
        _array[TreeNode.ADD_OBJECT] = 
191
 
            new AbstractAction("Add Well-known Object")
 
175
        _array[TreeNode.ADD_OBJECT] = new AbstractAction("Add Well-known Object")
192
176
            {
193
 
                public void actionPerformed(ActionEvent e) 
 
177
                public void actionPerformed(ActionEvent e)
194
178
                {
195
179
                    _target.addObject();
196
180
                }
197
181
            };
198
182
 
199
 
        _array[TreeNode.OPEN_DEFINITION] =
200
 
            new AbstractAction("Open Definition")
 
183
        _array[TreeNode.OPEN_DEFINITION] = new AbstractAction("Open Definition")
201
184
            {
202
 
                public void actionPerformed(ActionEvent e) 
 
185
                public void actionPerformed(ActionEvent e)
203
186
                {
204
187
                    _target.openDefinition();
205
188
                }
206
189
            };
207
 
            
 
190
 
208
191
    }
209
192
 
210
193
    private TreeNode _target;