KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > adminGui > feature > account > AccountPanel


1 // You can redistribute this software and/or modify it under the terms of
2
// the Ozone Library License version 1 published by ozone-db.org.
3
//
4
// The original code and portions created by SMB are
5
// Copyright (C) 1997-@year@ by SMB GmbH. All rights reserved.
6
//
7
// $Id: AccountPanel.java,v 1.1 2003/11/09 15:47:32 per_nyfelt Exp $
8
package org.ozoneDB.adminGui.feature.account;
9
10 import org.ozoneDB.adminGui.widget.MessageBox;
11 import org.ozoneDB.adminGui.feature.FeaturePanel;
12 import org.ozoneDB.adminGui.res.Settings;
13
14 import java.awt.*;
15 import java.util.*;
16 import javax.swing.*;
17
18 /**
19  * @author Per Nyfelt
20  */

21 public class AccountPanel extends FeaturePanel {
22
23     private Map components = new HashMap();
24     private UserInfoPanel userInfoPanel;
25
26     public AccountPanel() {
27         this.setLayout(new FlowLayout());
28     }
29
30     public void activateFeature() {
31         System.out.println("activating User feature");
32         try {
33             addComponents();
34         } catch (Exception JavaDoc e) {
35             MessageBox.showError("Failed to find Admin object", e.toString());
36             e.printStackTrace();
37         }
38     }
39
40     protected void addComponents() {
41
42         this.removeAll();
43         JSplitPane splitter = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
44         splitter.setRightComponent(userInfoPanel = new UserInfoPanel());
45         splitter.setLeftComponent(new AccountFeatureBar(userInfoPanel));
46         splitter.setOneTouchExpandable(false);
47         //splitter.setDividerLocation(.20);
48
splitter.setDividerSize(3);
49         splitter.setEnabled(false);
50         splitter.setBackground(Settings.COLOR_COBALT);
51         add(splitter);
52         //add(new UserInfoPanel(), BorderLayout.CENTER);
53
}
54
55     protected Properties getCriteria() {
56         Properties criteria = new Properties();
57
58         Iterator it = components.keySet().iterator();
59         while (it.hasNext()) {
60             String JavaDoc name = (String JavaDoc) it.next();
61             String JavaDoc value = ((JTextField) components.get(name)).getText();
62             if (value.trim().length() > 0) {
63                 criteria.setProperty(name, value);
64             }
65         }
66         return criteria;
67     }
68 }
Popular Tags