Browse Source

Merge pull request #413 in BA/design from ~KERRY/design:dev to dev

* commit '0a8aeb8c6188825ab614d25b777da60d9a2338ec':
  REPORT-560 && REPORT-565  解决日期控件设置format后无法保存和日文设计器下超链接对话框选项后显示的问题
  REPORT-565 解决日文设计器下超链接对话框后的文字显示不全问题。
  REPORT-565 解决日文设计器下超链接对话框后的文字显示不全问题。
master
superman 8 years ago
parent
commit
f2f263b744
  1. 39
      designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java
  2. 4
      designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java

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

@ -31,7 +31,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
private UIComboBox returnTypeComboBox; private UIComboBox returnTypeComboBox;
private UILabel sampleLabel;// preview private UILabel sampleLabel;// preview
// content // content
private UITextField patternTextField = null; private UIComboBox dateFormatComboBox;
private ValueEditorPane startDv; private ValueEditorPane startDv;
private ValueEditorPane endDv; private ValueEditorPane endDv;
@ -63,25 +63,21 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
// sample pane // sample pane
sampleLabel = new UILabel(""); sampleLabel = new UILabel("");
// samplePane.add(sampleLabel, BorderLayout.CENTER);
sampleLabel.setBorder(BorderFactory.createEmptyBorder(2, 4, 4, 4)); sampleLabel.setBorder(BorderFactory.createEmptyBorder(2, 4, 4, 4));
sampleLabel.setHorizontalAlignment(SwingConstants.CENTER); sampleLabel.setHorizontalAlignment(SwingConstants.CENTER);
sampleLabel.setFont(FRContext.getDefaultValues().getFRFont()); sampleLabel.setFont(FRContext.getDefaultValues().getFRFont());
// content pane // content pane
patternTextField = new UITextField();
patternTextField.getDocument().addDocumentListener(patternTextDocumentListener);
String[] arr = getDateFormateArray(); String[] arr = getDateFormateArray();
final UIComboBox comboBox = new UIComboBox(arr); dateFormatComboBox = new UIComboBox(arr);
comboBox.setPreferredSize(new Dimension(150,20)); dateFormatComboBox.setPreferredSize(new Dimension(150,20));
comboBox.addActionListener(new ActionListener(){ dateFormatComboBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){ public void actionPerformed(ActionEvent e){
patternTextField.setText( (String)comboBox.getSelectedItem()); refreshPreviewLabel();
} }
}); });
JPanel secondPanel = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"),comboBox,sampleLabel}, FlowLayout.LEFT, 5); JPanel secondPanel = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"),dateFormatComboBox,sampleLabel}, FlowLayout.LEFT, 5);
secondPanel.setPreferredSize(new Dimension(220,30)); secondPanel.setPreferredSize(new Dimension(220,30));
otherContentPane.add(secondPanel); otherContentPane.add(secondPanel);
otherContentPane.add(initStartEndDatePane(), BorderLayout.SOUTH); otherContentPane.add(initStartEndDatePane(), BorderLayout.SOUTH);
@ -104,22 +100,9 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
return rangePane; return rangePane;
} }
private DocumentListener patternTextDocumentListener = new DocumentListener() {
public void insertUpdate(DocumentEvent evt) {
refreshPreviewLabel();
}
public void removeUpdate(DocumentEvent evt) {
refreshPreviewLabel();
}
public void changedUpdate(DocumentEvent evt) {
refreshPreviewLabel();
}
};
private void refreshPreviewLabel() { private void refreshPreviewLabel() {
String text = patternTextField.getText(); String text = (String) dateFormatComboBox.getSelectedItem();
if (text != null && text.length() > 0) { if (text != null && text.length() > 0) {
try { try {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(text); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(text);
@ -143,12 +126,12 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
@Override @Override
protected void populateSubDirectWriteEditorBean(DateEditor e) { protected void populateSubDirectWriteEditorBean(DateEditor e) {
String formatText = e.getFormatText(); String formatText = e.getFormatText();
patternTextField.setText(formatText); dateFormatComboBox.setSelectedItem(formatText);
returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 1 : 0); returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 1 : 0);
populateStartEnd(e); populateStartEnd(e);
}; }
@Override @Override
protected DateEditor updateSubDirectWriteEditorBean() { protected DateEditor updateSubDirectWriteEditorBean() {
@ -231,11 +214,11 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
} }
private SimpleDateFormat getSimpleDateFormat() { private SimpleDateFormat getSimpleDateFormat() {
String text = patternTextField.getText(); String text = (String) dateFormatComboBox.getSelectedItem();
SimpleDateFormat simpleDateFormat; SimpleDateFormat simpleDateFormat;
if (text != null && text.length() > 0) { if (text != null && text.length() > 0) {
try { try {
simpleDateFormat = new SimpleDateFormat(patternTextField.getText()); simpleDateFormat = new SimpleDateFormat(text);
this.sampleLabel.setText(simpleDateFormat.format(new Date())); this.sampleLabel.setText(simpleDateFormat.format(new Date()));
} catch (Exception exp) { } catch (Exception exp) {
simpleDateFormat = new SimpleDateFormat(""); simpleDateFormat = new SimpleDateFormat("");

4
designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java

@ -63,12 +63,12 @@ public abstract class AbstractHyperlinkPane<T extends Hyperlink> extends BasicBe
newWindowConfPane.add(new UILabel(Inter.getLocText("FR-Designer_Height") + ": ")); newWindowConfPane.add(new UILabel(Inter.getLocText("FR-Designer_Height") + ": "));
heightTextFiled = new UINumberField(); heightTextFiled = new UINumberField();
heightTextFiled.setText(String.valueOf(DEFAULT_H_VALUE)); heightTextFiled.setText(String.valueOf(DEFAULT_H_VALUE));
heightTextFiled.setPreferredSize(new Dimension(60, 20)); heightTextFiled.setPreferredSize(new Dimension(40, 20));
newWindowConfPane.add(heightTextFiled); newWindowConfPane.add(heightTextFiled);
newWindowConfPane.add(new UILabel(" " + Inter.getLocText("FR-Designer_Width") + ": ")); newWindowConfPane.add(new UILabel(" " + Inter.getLocText("FR-Designer_Width") + ": "));
widthTextFiled = new UINumberField(); widthTextFiled = new UINumberField();
widthTextFiled.setText(String.valueOf(DEFAULT_V_VALUE)); widthTextFiled.setText(String.valueOf(DEFAULT_V_VALUE));
widthTextFiled.setPreferredSize(new Dimension(60, 20)); widthTextFiled.setPreferredSize(new Dimension(40, 20));
newWindowConfPane.add(widthTextFiled); newWindowConfPane.add(widthTextFiled);
JPanel centerPanel = new JPanel(new BorderLayout()); JPanel centerPanel = new JPanel(new BorderLayout());

Loading…
Cancel
Save