ludc
2024-09-14 36c2449aec5b51e5ed4e5c6841154b746060e09a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package com.vci.client.ui.date;
 
import java.awt.event.ActionEvent;
 
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.JButton;
import javax.swing.JComboBox;
 
import com.vci.client.ui.image.BundleImage;
import com.vci.client.ui.swing.components.VCIJComboBox;
 
/***
 *  得到一个可以设置日期的button
 * @author Administrator
 * @deprecated 废用,
 */
@Deprecated
public class PopupCalendarMethod {
    public JButton createDateDialogButton(String key, VCIJComboBox jcb) {
        Action a = new CreateDateAction("", key, "选择日期",jcb);
        return createButton(a);
}
    
private class CreateDateAction extends AbstractAction {
 
 private VCIJComboBox jcb;
 private static final long serialVersionUID = -8853426640336336204L;
 
 public CreateDateAction(String name, String fileName, String description,VCIJComboBox jcb) {
     this.jcb = jcb;
        putValue(NAME, name);
        putValue(SMALL_ICON, new BundleImage().createImageIcon (fileName));
        putValue(SHORT_DESCRIPTION, description);
    }
    
    public void actionPerformed(ActionEvent e) {
        new PopupCalendarPanel(jcb).show();
    }
}
    
public JButton createButton(Action a) {
        JButton b = new JButton();
        b.setAction(a);
        return b;
}
 
}