Browse Source

Merge pull request #1286 in BA/design from ~KERRY/design:release/9.0 to release/9.0

* commit '862a415590a6d8b71b341952835cd9a0f2e642d7':
  REPORT-4372 日期控件问题=>自定义日期格式提示显示不全(漏了一个)
master
superman 7 years ago
parent
commit
78ede5ca1d
  1. 18
      designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java

18
designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java

@ -36,7 +36,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
private UIComboBox currentFormatComboBox; private UIComboBox currentFormatComboBox;
private UILabel currentSamplelabel; private UILabel currentSamplelabel;
private UIButtonGroup fomatHeadGroup; private UIButtonGroup fomatHeadGroup;
private static final int SAMPLE_LABEL_PADDING = 4;
public DateEditorDefinePane() { public DateEditorDefinePane() {
@ -76,7 +76,13 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
private JPanel createFormatPane(UIComboBox formatComboBox, UILabel sampleLabel){ private JPanel createFormatPane(UIComboBox formatComboBox, UILabel sampleLabel){
JPanel previewPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Base_StyleFormat_Sample")); JPanel previewPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Base_StyleFormat_Sample"));
previewPane.add(sampleLabel); previewPane.setLayout(new BorderLayout());
JPanel sampleLabelWrapper = new JPanel(new BorderLayout());
sampleLabelWrapper.setBorder(BorderFactory.createEmptyBorder(0, SAMPLE_LABEL_PADDING, SAMPLE_LABEL_PADDING, SAMPLE_LABEL_PADDING));
sampleLabelWrapper.add(sampleLabel, BorderLayout.CENTER);
previewPane.add(sampleLabelWrapper, BorderLayout.CENTER);
JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane();
jPanel.add(previewPane, BorderLayout.NORTH); jPanel.add(previewPane, BorderLayout.NORTH);
jPanel.add(formatComboBox, BorderLayout.CENTER); jPanel.add(formatComboBox, BorderLayout.CENTER);
@ -84,7 +90,13 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
} }
private UILabel createSamplePane(){ private UILabel createSamplePane(){
UILabel sampleLabel = new UILabel(""); UILabel sampleLabel = new UILabel("") {
@Override
public void setText(String text) {
// 加上<html>可以自动换行
super.setText("<html>" + text + "</html>");
}
};
sampleLabel.setHorizontalAlignment(SwingConstants.CENTER); sampleLabel.setHorizontalAlignment(SwingConstants.CENTER);
sampleLabel.setFont(FRContext.getDefaultValues().getFRFont()); sampleLabel.setFont(FRContext.getDefaultValues().getFRFont());
return sampleLabel; return sampleLabel;

Loading…
Cancel
Save