Source code: com/voytechs/html/component/LoginButton.java
1 /*
2 * File: LoginButton.java
3 * Auth: Mark Bednarczyk
4 * Date: DATE
5 * Id: $Id: LoginButton.java,v 1.1.1.1 2002/01/23 23:52:47 voytechs Exp $
6 ********************************************
7 * $Log: LoginButton.java,v $
8 * Revision 1.1.1.1 2002/01/23 23:52:47 voytechs
9 * Initial public release, BETA 1.0 - voytechs
10 *
11 */
12 package com.voytechs.html.component;
13
14 import com.voytechs.html.util.LogFacility;
15 import com.voytechs.html.io.*;
16 import com.voytechs.html.event.*;
17 import com.voytechs.html.event.*;
18
19 import java.lang.*;
20
21 import java.io.IOException;
22
23 /**
24 * A Link button.
25 */
26 public class LoginButton
27 extends Link {
28
29 /* Internal attributes */
30 private boolean loginInProgress = false;
31
32 /**
33 * Creates a Link element. A HTML anchor element. This constructor
34 * constructs a LoginButton suitable for invoking
35 */
36 public LoginButton() throws EventException {
37
38 }
39
40 /**
41 * Override the default processEvent() method and this is where we do the
42 * Auth stuff.
43 * @param event Event with the new state of the button.
44 */
45 public void processEvent(HtmlLinkEvent event, Object userData) {
46 LogFacility.log.println("LoginButton::processEvent()");
47
48 if(loginInProgress == false) {
49 loginInProgress = true;
50
51 Frame root = getRootFrame();
52 root.loginPopup("Desktop");
53
54 }
55 else { // Ignore this event.
56 loginInProgress = false;
57 }
58 }
59
60 /**
61 * Test function for LoginButton
62 * @param args command line arguments
63 */
64 public static void main(String [] args) {
65 }
66
67 } /* END OF: LoginButton */