KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > enhydra > shark > corbaclient > actions > Connect


1 package org.enhydra.shark.corbaclient.actions;
2
3 import java.awt.event.*;
4
5
6 import org.enhydra.shark.corbaclient.*;
7
8 /**
9  * Class that realizes <B>connect</B> action.
10  *
11  * @author Sasa Bojanic
12  * @version 1.0
13  */

14 public class Connect extends ActionBase {
15
16    private Connection conn;
17
18    public Connect (SharkClient workflowClient) {
19       super(workflowClient);
20    }
21
22    public void actionPerformed(ActionEvent e) {
23       SharkClient workflowClient=(SharkClient)actionPanel;
24       try {
25          workflowClient.getAction(Utils.getUnqualifiedClassName(Disconnect.class)).actionPerformed(null);
26       } catch (Exception JavaDoc ex) {}
27       if (conn==null) {
28          conn=new Connection(workflowClient.getFrame(),workflowClient);
29       }
30       conn.showDialog();
31       SplashScreen ss=workflowClient.getSplashScreen();
32       ss.show("WaitImage",
33             workflowClient.getFullUserName(),
34             ResourceManager.getLanguageDependentString("MessagePleaseWait"));
35       if (workflowClient.getUsername()!=null) {
36          workflowClient.enableControls(false);
37          workflowClient.refresh(true);
38          workflowClient.enableControls(true);
39       }
40       ss.hide();
41       workflowClient.requestFocus();
42    }
43
44 }
45
Popular Tags