KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ozoneDB > adminGui > feature > data > DataPanel


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: DataPanel.java,v 1.2 2003/03/27 16:05:55 per_nyfelt Exp $
8
package org.ozoneDB.adminGui.feature.data;
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 DataPanel extends FeaturePanel {
22
23     private Map components = new HashMap();
24     private DataInfoPanel dataInfoPanel;
25
26     public DataPanel() {
27         this.setLayout(new FlowLayout());
28     }
29
30     public void activateFeature() {
31         System.out.println("activating Data 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(dataInfoPanel = new DataInfoPanel());
45         splitter.setLeftComponent(new DataFeatureBar(dataInfoPanel));
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 DataFeatureBar(admin), BorderLayout.WEST);
53
//add(new UserInfoPanel(), BorderLayout.CENTER);
54
}
55
56     protected Properties getCriteria() {
57         Properties criteria = new Properties();
58
59         Iterator it = components.keySet().iterator();
60         while (it.hasNext()) {
61             String JavaDoc name = (String JavaDoc) it.next();
62             String JavaDoc value = ((JTextField) components.get(name)).getText();
63             if (value.trim().length() > 0) {
64                 criteria.setProperty(name, value);
65             }
66         }
67         return criteria;
68     }
69 }
Popular Tags