|
|
@ -2,9 +2,12 @@ package com.fr.design.widget.ui; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.base.FRContext; |
|
|
|
import com.fr.base.FRContext; |
|
|
|
import com.fr.data.core.FormatField; |
|
|
|
import com.fr.data.core.FormatField; |
|
|
|
|
|
|
|
import com.fr.design.ExtraDesignClassManager; |
|
|
|
|
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
import com.fr.design.border.UIRoundedBorder; |
|
|
|
import com.fr.design.border.UIRoundedBorder; |
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
import com.fr.design.constants.UIConstants; |
|
|
|
import com.fr.design.designer.IntervalConstants; |
|
|
|
import com.fr.design.designer.IntervalConstants; |
|
|
|
|
|
|
|
import com.fr.design.fun.WidgetAdvancedPaneProvider; |
|
|
|
import com.fr.design.gui.ibutton.UIButtonGroup; |
|
|
|
import com.fr.design.gui.ibutton.UIButtonGroup; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
@ -28,6 +31,7 @@ import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
import java.util.Set; |
|
|
|
|
|
|
|
|
|
|
|
public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor> { |
|
|
|
public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor> { |
|
|
|
private UIButtonGroup returnTypeComboBox; |
|
|
|
private UIButtonGroup returnTypeComboBox; |
|
|
@ -53,10 +57,8 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor |
|
|
|
protected JPanel setSecondContentPane() { |
|
|
|
protected JPanel setSecondContentPane() { |
|
|
|
returnTypeComboBox = new UIButtonGroup<>(new String[] {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date") , com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_String")}); |
|
|
|
returnTypeComboBox = new UIButtonGroup<>(new String[] {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Date") , com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_String")}); |
|
|
|
JPanel formatHead = createFormatHead(); |
|
|
|
JPanel formatHead = createFormatHead(); |
|
|
|
|
|
|
|
|
|
|
|
startDv = new DateValuePane(); |
|
|
|
startDv = new DateValuePane(); |
|
|
|
endDv = new DateValuePane(); |
|
|
|
endDv = new DateValuePane(); |
|
|
|
|
|
|
|
|
|
|
|
double f = TableLayout.FILL; |
|
|
|
double f = TableLayout.FILL; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
UILabel formatLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Format")); |
|
|
|
UILabel formatLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Engine_Format")); |
|
|
@ -65,23 +67,42 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor |
|
|
|
startDateLabel.setVerticalAlignment(SwingConstants.TOP); |
|
|
|
startDateLabel.setVerticalAlignment(SwingConstants.TOP); |
|
|
|
UILabel endDateLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_FS_End_Date")); |
|
|
|
UILabel endDateLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_FS_End_Date")); |
|
|
|
endDateLabel.setVerticalAlignment(SwingConstants.TOP); |
|
|
|
endDateLabel.setVerticalAlignment(SwingConstants.TOP); |
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{formatLabel, formatHead}, |
|
|
|
new Component[]{formatLabel, formatHead}, |
|
|
|
new Component[]{startDateLabel, startDv}, |
|
|
|
new Component[]{startDateLabel, startDv}, |
|
|
|
new Component[]{endDateLabel, endDv}, |
|
|
|
new Component[]{endDateLabel, endDv}, |
|
|
|
new Component[]{waterMarkDictPane, null}, |
|
|
|
new Component[]{waterMarkDictPane, null}, |
|
|
|
|
|
|
|
new Component[]{extraPane, null}, |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Date_Selector_Return_Type")), returnTypeComboBox } |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Widget_Date_Selector_Return_Type")), returnTypeComboBox } |
|
|
|
}; |
|
|
|
}; |
|
|
|
double[] rowSize = {p, p, p, p, p, p, p}; |
|
|
|
double[] rowSize = {p, p, p, p, p, p, p, p}; |
|
|
|
double[] columnSize = {p, f}; |
|
|
|
double[] columnSize = {p, f}; |
|
|
|
int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1, 1},{1, 1}}; |
|
|
|
int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1, 1},{1, 1}, {1, 1}}; |
|
|
|
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1); |
|
|
|
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return panel; |
|
|
|
return panel; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected void refreshExtraAdvancedPane() { |
|
|
|
|
|
|
|
extraPaneList.clear(); |
|
|
|
|
|
|
|
boolean containsExtraPane = false; |
|
|
|
|
|
|
|
Set<WidgetAdvancedPaneProvider<DateEditor>> providers = ExtraDesignClassManager.getInstance().getArray(WidgetAdvancedPaneProvider.XML_TAG); |
|
|
|
|
|
|
|
for (WidgetAdvancedPaneProvider<DateEditor> provider : providers) { |
|
|
|
|
|
|
|
if (!provider.accept(DateEditor.class)) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
insertShortCut(provider.getInsertPosition(extraPaneList.size()), provider.createExtraAdvancedPane()); |
|
|
|
|
|
|
|
containsExtraPane = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (containsExtraPane) { |
|
|
|
|
|
|
|
extraPane = FRGUIPaneFactory.createYBoxEmptyBorderPane(); |
|
|
|
|
|
|
|
for (BasicBeanPane<DateEditor> pane : extraPaneList) { |
|
|
|
|
|
|
|
extraPane.add(pane); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private JPanel createFormatPane(UIComboBox formatComboBox, UILabel sampleLabel){ |
|
|
|
private JPanel createFormatPane(UIComboBox formatComboBox, UILabel sampleLabel){ |
|
|
|
|
|
|
|
|
|
|
|
JPanel previewPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
JPanel previewPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|