mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
testcase
This commit is contained in:
@@ -1,49 +1,49 @@
|
||||
package com.alibaba.druid.pool.ui;
|
||||
|
||||
import java.awt.GridLayout;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextField;
|
||||
|
||||
public class DruidDataStatusPanel extends JPanel {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final Map<String, JTextField> fields = new HashMap<String, JTextField>();
|
||||
|
||||
private final String[] fieldNames = new String[] { //
|
||||
"CreateCount", "CreateErrorCount", "CreateTimespanMillis",
|
||||
"CreateTimespanNano", "DestroyCount", //
|
||||
"ConnectCount", "ConnectErrorCount", "CloseCount", "RecycleCount", "ActiveCount", //
|
||||
"PoolingCount", "IdleCheckCount", "UI_GettingCount", "UI_GetCount", "UI_ReleaseCount" //
|
||||
, "UI_ExecutingCount" //
|
||||
};
|
||||
|
||||
public DruidDataStatusPanel(){
|
||||
|
||||
this.setLayout(new GridLayout(6, 6));
|
||||
|
||||
for (String fieldName : fieldNames) {
|
||||
JLabel label = new JLabel(fieldName + " : ");
|
||||
this.add(label);
|
||||
|
||||
JTextField textField = new JTextField();
|
||||
this.add(textField);
|
||||
textField.setEditable(false);
|
||||
fields.put(fieldName, textField);
|
||||
}
|
||||
}
|
||||
|
||||
public void set(String fieldName, Object value) {
|
||||
JTextField textField = fields.get(fieldName);
|
||||
textField.setText(String.valueOf(value));
|
||||
}
|
||||
|
||||
public Map<String, JTextField> getFields() {
|
||||
return fields;
|
||||
}
|
||||
|
||||
}
|
||||
package com.alibaba.druid.pool.ui;
|
||||
|
||||
import java.awt.GridLayout;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextField;
|
||||
|
||||
public class DruidDataStatusPanel extends JPanel {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private final Map<String, JTextField> fields = new HashMap<String, JTextField>();
|
||||
|
||||
private final String[] fieldNames = new String[] { //
|
||||
"CreateCount", "CreateErrorCount", "CreateTimespanMillis",
|
||||
"CreateTimespanNano", "DestroyCount", //
|
||||
"ConnectCount", "ConnectErrorCount", "CloseCount", "RecycleCount", "ActiveCount", //
|
||||
"PoolingCount", "IdleCheckCount", "UI_GettingCount", "UI_GetCount", "UI_ReleaseCount" //
|
||||
, "UI_ExecutingCount" //
|
||||
};
|
||||
|
||||
public DruidDataStatusPanel(){
|
||||
|
||||
this.setLayout(new GridLayout(6, 6));
|
||||
|
||||
for (String fieldName : fieldNames) {
|
||||
JLabel label = new JLabel(fieldName + " : ");
|
||||
this.add(label);
|
||||
|
||||
JTextField textField = new JTextField();
|
||||
this.add(textField);
|
||||
textField.setEditable(false);
|
||||
fields.put(fieldName, textField);
|
||||
}
|
||||
}
|
||||
|
||||
public void set(String fieldName, Object value) {
|
||||
JTextField textField = fields.get(fieldName);
|
||||
textField.setText(String.valueOf(value));
|
||||
}
|
||||
|
||||
public Map<String, JTextField> getFields() {
|
||||
return fields;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user