|
|
|
@ -1,10 +1,7 @@
|
|
|
|
|
package com.fr.design.gui.date; |
|
|
|
|
|
|
|
|
|
import com.fine.theme.icon.LazyIcon; |
|
|
|
|
import com.fine.theme.utils.FineUIStyle; |
|
|
|
|
import com.fr.design.gui.ibutton.UIButton; |
|
|
|
|
import com.fine.theme.light.ui.FineComboBoxUI; |
|
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
|
import com.fr.design.gui.icombobox.UIComboBoxUI; |
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
|
import com.fr.design.utils.gui.GUICoreUtils; |
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
@ -13,6 +10,7 @@ import com.fr.stable.StringUtils;
|
|
|
|
|
import com.fr.design.carton.FeedbackToolboxDialog; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.JButton; |
|
|
|
|
import javax.swing.JComboBox; |
|
|
|
|
import javax.swing.JFrame; |
|
|
|
|
import javax.swing.JPanel; |
|
|
|
@ -26,6 +24,7 @@ import javax.swing.plaf.basic.ComboPopup;
|
|
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
import java.awt.Cursor; |
|
|
|
|
import java.awt.LayoutManager; |
|
|
|
|
import java.awt.event.MouseAdapter; |
|
|
|
|
import java.awt.event.MouseEvent; |
|
|
|
|
import java.io.Serializable; |
|
|
|
|
import java.text.ParseException; |
|
|
|
@ -292,40 +291,44 @@ public class UIDatePicker extends UIComboBox implements Serializable {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected ComboBoxUI getUIComboBoxUI() { |
|
|
|
|
return new UIComboBoxUI() { |
|
|
|
|
|
|
|
|
|
return new FineComboBoxUI() { |
|
|
|
|
@Override |
|
|
|
|
protected UIButton createArrowButton() { |
|
|
|
|
arrowButton = new UIButton(new LazyIcon("down_arrow")) { |
|
|
|
|
public boolean shouldResponseChangeListener() { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
arrowButton.addMouseListener(this); |
|
|
|
|
comboBox.addMouseListener(this); |
|
|
|
|
FineUIStyle.setStyle(arrowButton, FineUIStyle.PLAIN_BUTTON); |
|
|
|
|
return (UIButton) arrowButton; |
|
|
|
|
protected JButton createArrowButton() { |
|
|
|
|
JButton button = super.createArrowButton(); |
|
|
|
|
button.addMouseListener(getPopupMouseAdapter()); |
|
|
|
|
return button; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected ComboPopup createPopup() { |
|
|
|
|
return new DatePopup(comboBox); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
|
if (UIDatePicker.this.isPopupVisible()) { |
|
|
|
|
willHide = true; |
|
|
|
|
UIDatePicker.this.hidePopup(); |
|
|
|
|
} else { |
|
|
|
|
willHide = false; |
|
|
|
|
UIDatePicker.this.showPopup(); |
|
|
|
|
} |
|
|
|
|
protected void installListeners() { |
|
|
|
|
super.installListeners(); |
|
|
|
|
comboBox.addMouseListener(getPopupMouseAdapter()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
MouseAdapter getPopupMouseAdapter() { |
|
|
|
|
return new MouseAdapter() { |
|
|
|
|
@Override |
|
|
|
|
public void mousePressed(MouseEvent e) { |
|
|
|
|
if (UIDatePicker.this.isPopupVisible()) { |
|
|
|
|
willHide = true; |
|
|
|
|
UIDatePicker.this.hidePopup(); |
|
|
|
|
} else { |
|
|
|
|
willHide = false; |
|
|
|
|
UIDatePicker.this.showPopup(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//设置dataFormat
|
|
|
|
|
public void setDateFormat(SimpleDateFormat format){ |
|
|
|
|
this.dateFormat = format; |
|
|
|
|