|
|
@ -2,15 +2,17 @@ package com.fr.design.widget.ui.designer; |
|
|
|
|
|
|
|
|
|
|
|
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.designer.creator.XCreator; |
|
|
|
import com.fr.design.designer.creator.XCreator; |
|
|
|
|
|
|
|
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; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
import com.fr.design.layout.TableLayout; |
|
|
|
|
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.design.layout.TableLayoutHelper; |
|
|
|
import com.fr.design.widget.component.DateValuePane; |
|
|
|
import com.fr.design.widget.component.DateValuePane; |
|
|
|
import com.fr.design.widget.component.UIComboBoxNoArrow; |
|
|
|
import com.fr.design.widget.component.UIComboBoxNoArrow; |
|
|
@ -18,18 +20,23 @@ import com.fr.design.widget.ui.designer.component.FormWidgetValuePane; |
|
|
|
import com.fr.design.widget.ui.designer.date.DateFormatCheckManager; |
|
|
|
import com.fr.design.widget.ui.designer.date.DateFormatCheckManager; |
|
|
|
import com.fr.design.widget.ui.designer.date.DateFormatCheckResult; |
|
|
|
import com.fr.design.widget.ui.designer.date.DateFormatCheckResult; |
|
|
|
import com.fr.form.ui.DateEditor; |
|
|
|
import com.fr.form.ui.DateEditor; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
|
|
|
import javax.swing.JPanel; |
|
|
|
|
|
|
|
import javax.swing.SwingConstants; |
|
|
|
import javax.swing.border.TitledBorder; |
|
|
|
import javax.swing.border.TitledBorder; |
|
|
|
import javax.swing.event.ChangeEvent; |
|
|
|
import javax.swing.event.ChangeEvent; |
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
import javax.swing.event.ChangeListener; |
|
|
|
import java.awt.*; |
|
|
|
import java.awt.BorderLayout; |
|
|
|
|
|
|
|
import java.awt.CardLayout; |
|
|
|
|
|
|
|
import java.awt.Color; |
|
|
|
|
|
|
|
import java.awt.Component; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
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; |
|
|
@ -68,8 +75,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor |
|
|
|
JPanel formatHead = createFormatHead(); |
|
|
|
JPanel formatHead = createFormatHead(); |
|
|
|
startDv = new DateValuePane(); |
|
|
|
startDv = new DateValuePane(); |
|
|
|
endDv = new DateValuePane(); |
|
|
|
endDv = new DateValuePane(); |
|
|
|
double f = TableLayout.FILL; |
|
|
|
initExtraPane(); |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Label_Name")), labelNameTextField}, |
|
|
|
new Component[]{widgetValueLabel, formWidgetValuePane}, |
|
|
|
new Component[]{widgetValueLabel, formWidgetValuePane}, |
|
|
@ -77,12 +83,12 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor |
|
|
|
new Component[]{startDateLabel, startDv}, |
|
|
|
new Component[]{startDateLabel, startDv}, |
|
|
|
new Component[]{endDateLabel, endDv}, |
|
|
|
new Component[]{endDateLabel, endDv}, |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark")), waterMarkDictPane}, |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_WaterMark")), waterMarkDictPane}, |
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size")), fontSizePane}, |
|
|
|
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, p, p, p}; |
|
|
|
double[] rowSize = {P, P, P, P, P, P, P, P, P, P}; |
|
|
|
double[] columnSize = {p, f}; |
|
|
|
double[] columnSize = {P, F}; |
|
|
|
int[][] rowCount = {{1, 1}, {1, 3}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; |
|
|
|
int[][] rowCount = {{1, 1}, {1, 3}, {1, 1}, {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); |
|
|
|
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
|
JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); |
|
|
@ -90,6 +96,32 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor |
|
|
|
return boundsPane; |
|
|
|
return boundsPane; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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(creator)) { |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
insertShortCut(provider.getInsertPosition(extraPaneList.size()), provider.createExtraAdvancedPane()); |
|
|
|
|
|
|
|
containsExtraPane = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (containsExtraPane) { |
|
|
|
|
|
|
|
extraPane = FRGUIPaneFactory.createYBoxEmptyBorderPane(); |
|
|
|
|
|
|
|
for (BasicBeanPane<DateEditor> pane : extraPaneList) { |
|
|
|
|
|
|
|
extraPane.add(pane); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Font_Size")), fontSizePane}, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
double[] rowSize = {P}; |
|
|
|
|
|
|
|
double[] columnSize = {P, F}; |
|
|
|
|
|
|
|
int[][] rowCount = {{1, 1}}; |
|
|
|
|
|
|
|
extraPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_W1, IntervalConstants.INTERVAL_L1); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
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(); |
|
|
|