|
|
@ -157,7 +157,7 @@ public class UIDatePicker extends UIComboBox implements Serializable { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 设置当前选择的日期 |
|
|
|
* 设置当前选择的日期 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void setSelectedDate(Date date) throws ParseException { |
|
|
|
public synchronized void setSelectedDate(Date date) throws ParseException { |
|
|
|
if (date == null) { |
|
|
|
if (date == null) { |
|
|
|
this.setSelectedItem(null); |
|
|
|
this.setSelectedItem(null); |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -165,6 +165,7 @@ public class UIDatePicker extends UIComboBox implements Serializable { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void setSelectedItem(Object anObject) { |
|
|
|
public void setSelectedItem(Object anObject) { |
|
|
|
model.setSelectedItem(anObject); |
|
|
|
model.setSelectedItem(anObject); |
|
|
|
super.setSelectedItem(anObject); |
|
|
|
super.setSelectedItem(anObject); |
|
|
@ -192,12 +193,14 @@ public class UIDatePicker extends UIComboBox implements Serializable { |
|
|
|
setBorder(BorderFactory.createEmptyBorder()); |
|
|
|
setBorder(BorderFactory.createEmptyBorder()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void hide() { |
|
|
|
public void hide() { |
|
|
|
if (isWillHide) { |
|
|
|
if (isWillHide) { |
|
|
|
super.hide(); |
|
|
|
super.hide(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public void show() { |
|
|
|
public void show() { |
|
|
|
if (isWillHide || UIDatePicker.this.isEnabled() == false) { |
|
|
|
if (isWillHide || UIDatePicker.this.isEnabled() == false) { |
|
|
|
return; |
|
|
|
return; |
|
|
@ -211,6 +214,7 @@ public class UIDatePicker extends UIComboBox implements Serializable { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 显示弹出面板 |
|
|
|
* 显示弹出面板 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
@Override |
|
|
|
protected void firePropertyChange(String propertyName, |
|
|
|
protected void firePropertyChange(String propertyName, |
|
|
|
Object oldValue, |
|
|
|
Object oldValue, |
|
|
|
Object newValue) { |
|
|
|
Object newValue) { |
|
|
@ -250,12 +254,14 @@ public class UIDatePicker extends UIComboBox implements Serializable { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
protected ComboBoxUI getUIComboBoxUI() { |
|
|
|
protected ComboBoxUI getUIComboBoxUI() { |
|
|
|
return new UIComboBoxUI() { |
|
|
|
return new UIComboBoxUI() { |
|
|
|
|
|
|
|
@Override |
|
|
|
protected ComboPopup createPopup() { |
|
|
|
protected ComboPopup createPopup() { |
|
|
|
return new DatePopup(comboBox); |
|
|
|
return new DatePopup(comboBox); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
if (UIDatePicker.this.isPopupVisible()) { |
|
|
|
if (UIDatePicker.this.isPopupVisible()) { |
|
|
|
isWillHide = true; |
|
|
|
isWillHide = true; |
|
|
|