Browse Source

控件校验完善需求剩下的控件整改

master
kerry 8 years ago
parent
commit
5f56d3db18
  1. 2
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  2. 2
      designer/src/com/fr/design/widget/ui/ButtonDefinePane.java
  3. 5
      designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java
  4. 5
      designer/src/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java
  5. 2
      designer/src/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java
  6. 92
      designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java
  7. 13
      designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java
  8. 42
      designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java
  9. 15
      designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java
  10. 17
      designer/src/com/fr/design/widget/ui/MultiFileEditorPane.java
  11. 24
      designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java
  12. 5
      designer/src/com/fr/design/widget/ui/RadioGroupDefinePane.java
  13. 23
      designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java
  14. 4
      designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java
  15. 2
      designer/src/com/fr/design/widget/ui/WritableRepeatEditorPane.java
  16. 4
      designer/src/com/fr/design/widget/ui/WriteUnableRepeatEditorPane.java
  17. 6
      designer/src/com/fr/design/widget/ui/btn/TreeNodeToogleButtonDefinePane.java
  18. 21
      designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java
  19. 56
      designer_form/src/com/fr/design/designer/creator/XPassword.java
  20. 72
      designer_form/src/com/fr/design/designer/creator/XTextArea.java

2
designer/src/com/fr/design/widget/CellWidgetCardPane.java

@ -87,7 +87,7 @@ public class CellWidgetCardPane extends BasicPane {
attriPane.remove(widgetPropertyPane);
widgetPropertyPane = new BasicWidgetPropertySettingPane();
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.setBorder(BorderFactory.createEmptyBorder(10, 8, 5, 8));
northPane.setBorder(BorderFactory.createEmptyBorder(5, 8, 0, 8));
JPanel basic = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Form-Basic_Properties"));
northPane.add(basic);
basic.add(widgetPropertyPane);

2
designer/src/com/fr/design/widget/ui/ButtonDefinePane.java

@ -24,7 +24,7 @@ public class ButtonDefinePane extends AbstractDataModify<Button> {
private void initComponent() {
setLayout(FRGUIPaneFactory.createBorderLayout());
setBorder(BorderFactory.createEmptyBorder(0, 13, 0, 0));
setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8));
}
@Override

5
designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java

@ -32,12 +32,15 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
//
// this.add(infoLabel, BorderLayout.CENTER);
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8));
JPanel textPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
textPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Advanced"));
advancedPane.add(textPane);
textPane.add(new UILabel(Inter.getLocText("Text") + ":"));
text = new UITextField(8);
textPane.add(text);
this.add(textPane);
this.add(advancedPane);
}
@Override

5
designer/src/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java

@ -41,7 +41,8 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
protected JPanel setFirstContentPane() {
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Advanced"));
advancedPane.add(attrPane);
// JPanel northPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
// checkBoxDictPane = new CheckBoxDictPane();
// northPane.add(checkBoxDictPane);
@ -67,7 +68,7 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
centerPane.add(buttonGroupDictPane);
attrPane.add(centerPane, BorderLayout.CENTER);
return attrPane;
return advancedPane;
}
@Override

2
designer/src/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java

@ -1 +1 @@
package com.fr.design.widget.ui; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : Shockway * Date: 13-9-18 * Time: 下午2:17 */ public abstract class CustomWritableRepeatEditorPane<T extends CustomWriteAbleRepeatEditor> extends WritableRepeatEditorPane<T> { private UICheckBox customDataCheckBox; public CustomWritableRepeatEditorPane() { this.initComponents(); } @Override protected JPanel setThirdContentPane() { JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane(); contentPane.add(contenter, BorderLayout.NORTH); this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false); contenter.add(this.customDataCheckBox); JPanel otherContentPane = this.setForthContentPane(); if (otherContentPane != null) { contentPane.add(otherContentPane,BorderLayout.CENTER); } return contentPane; } protected abstract JPanel setForthContentPane(); protected void populateSubWritableRepeatEditorBean(T e) { this.customDataCheckBox.setSelected(e.isCustomData()); populateSubCustomWritableRepeatEditorBean(e); } protected abstract void populateSubCustomWritableRepeatEditorBean(T e); protected T updateSubWritableRepeatEditorBean() { T e = updateSubCustomWritableRepeatEditorBean(); e.setCustomData(this.customDataCheckBox.isSelected()); return e; } protected abstract T updateSubCustomWritableRepeatEditorBean(); }
package com.fr.design.widget.ui; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : Shockway * Date: 13-9-18 * Time: 下午2:17 */ public abstract class CustomWritableRepeatEditorPane<T extends CustomWriteAbleRepeatEditor> extends WritableRepeatEditorPane<T> { private UICheckBox customDataCheckBox; public CustomWritableRepeatEditorPane() { this.initComponents(); } @Override protected JPanel setThirdContentPane() { JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false); this.customDataCheckBox.setPreferredSize(new Dimension(100, 30)); getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); JPanel otherContentPane = this.setForthContentPane(); if (otherContentPane != null) { contentPane.add(otherContentPane,BorderLayout.CENTER); } return contentPane; } protected abstract JPanel setForthContentPane(); protected void populateSubWritableRepeatEditorBean(T e) { this.customDataCheckBox.setSelected(e.isCustomData()); populateSubCustomWritableRepeatEditorBean(e); } protected abstract void populateSubCustomWritableRepeatEditorBean(T e); protected T updateSubWritableRepeatEditorBean() { T e = updateSubCustomWritableRepeatEditorBean(); e.setCustomData(this.customDataCheckBox.isSelected()); return e; } protected abstract T updateSubCustomWritableRepeatEditorBean(); }

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

@ -9,6 +9,8 @@ import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.editor.ValueEditorPane;
import com.fr.design.editor.ValueEditorPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.ComboBox;
import com.fr.form.ui.DateEditor;
import com.fr.general.ComparatorUtils;
import com.fr.general.DateUtils;
@ -24,6 +26,8 @@ import javax.swing.event.DocumentListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.text.SimpleDateFormat;
import java.util.Date;
@ -32,7 +36,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
private UILabel sampleLabel;// preview
// content
private UITextField patternTextField = null;
private JList patternList = null;
// private JList patternList = null;
private ValueEditorPane startDv;
private ValueEditorPane endDv;
@ -53,43 +57,59 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
@Override
protected JPanel setSecondContentPane() {
JPanel otherContentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
otherContentPane.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));
JPanel returnTypePane = FRGUIPaneFactory.createBorderLayout_S_Pane();
returnTypePane.add(new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), BorderLayout.WEST);
returnTypeComboBox = new UIComboBox(new String[] { Inter.getLocText("String"), Inter.getLocText("Date") });
returnTypeComboBox.setPreferredSize(new Dimension(70, 20));
returnTypePane.add(returnTypeComboBox, BorderLayout.CENTER);
otherContentPane.add(returnTypePane);
JPanel firstPanel = GUICoreUtils.createFlowPane(new JComponent[]{returnTypePane}, FlowLayout.LEFT, 5);
firstPanel.setPreferredSize(new Dimension(141,30));
otherContentPane.add(firstPanel);
// sample pane
JPanel samplePane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("StyleFormat-Sample"));
otherContentPane.add(samplePane, BorderLayout.NORTH);
// JPanel samplePane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("StyleFormat-Sample"));
// otherContentPane.add(samplePane, BorderLayout.NORTH);
sampleLabel = new UILabel("");
samplePane.add(sampleLabel, BorderLayout.CENTER);
// samplePane.add(sampleLabel, BorderLayout.CENTER);
sampleLabel.setBorder(BorderFactory.createEmptyBorder(2, 4, 4, 4));
sampleLabel.setHorizontalAlignment(SwingConstants.CENTER);
sampleLabel.setFont(FRContext.getDefaultValues().getFRFont());
// content pane
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
otherContentPane.add(contentPane, BorderLayout.CENTER);
contentPane.setBorder(BorderFactory.createEmptyBorder(4, 0, 2, 0));
// JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
// contentPane.setPreferredSize(new Dimension(400,100));
// otherContentPane.add(contentPane, BorderLayout.CENTER);
// contentPane.setBorder(BorderFactory.createEmptyBorder(4, 0, 2, 0));
patternTextField = new UITextField();
contentPane.add(patternTextField, BorderLayout.NORTH);
// contentPane.add(patternTextField, BorderLayout.NORTH);
patternTextField.getDocument().addDocumentListener(patternTextDocumentListener);
patternList = new JList(new DefaultListModel());
DefaultListModel model = (DefaultListModel) patternList.getModel();
model.removeAllElements();
// patternList = new JList(new DefaultListModel());
// DefaultListModel model = (DefaultListModel) patternList.getModel();
// model.removeAllElements();
String[] arr = getDateFormateArray();
for (int i = 0; i < arr.length; i++) {
model.addElement(arr[i]);
}
JScrollPane pScrollPane = new JScrollPane(patternList);
pScrollPane.setPreferredSize(new Dimension(100, 120));
contentPane.add(pScrollPane, BorderLayout.CENTER);
patternList.addListSelectionListener(patternListSelectionListener);
// for (int i = 0; i < arr.length; i++) {
// model.addElement(arr[i]);
// }
// JScrollPane pScrollPane = new JScrollPane(patternList);
// pScrollPane.setPreferredSize(new Dimension(100, 120));
// contentPane.add(pScrollPane, BorderLayout.CENTER);
UIComboBox comboBox = new UIComboBox(arr);
comboBox.setPreferredSize(new Dimension(150,20));
comboBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
patternTextField.setText( (String)comboBox.getSelectedItem());
}
});
JPanel secondPanel = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"),comboBox,sampleLabel}, FlowLayout.LEFT, 5);
secondPanel.setPreferredSize(new Dimension(220,30));
otherContentPane.add(secondPanel);
// patternList.addListSelectionListener(patternListSelectionListener);
otherContentPane.add(initStartEndDatePane(), BorderLayout.SOUTH);
return otherContentPane;
}
@ -146,11 +166,11 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
}
}
private ListSelectionListener patternListSelectionListener = new ListSelectionListener() {
public void valueChanged(ListSelectionEvent evt) {
patternTextField.setText((String) patternList.getSelectedValue());
}
};
// private ListSelectionListener patternListSelectionListener = new ListSelectionListener() {
// public void valueChanged(ListSelectionEvent evt) {
// patternTextField.setText((String) patternList.getSelectedValue());
// }
// };
@Override
protected void populateSubDirectWriteEditorBean(DateEditor e) {
@ -161,17 +181,17 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
populateStartEnd(e);
DefaultListModel patternModel = (DefaultListModel) patternList.getModel();
if ((formatText == null || formatText.length() <= 0)) {
patternList.setSelectedIndex(0);
} else {
for (int i = 0; i < patternModel.size(); i++) {
if (ComparatorUtils.equals(patternModel.getElementAt(i).toString(), formatText)) {
patternList.setSelectedIndex(i);
return;
}
}
}
// DefaultListModel patternModel = (DefaultListModel) patternList.getModel();
// if ((formatText == null || formatText.length() <= 0)) {
// patternList.setSelectedIndex(0);
// } else {
// for (int i = 0; i < patternModel.size(); i++) {
// if (ComparatorUtils.equals(patternModel.getElementAt(i).toString(), formatText)) {
// patternList.setSelectedIndex(i);
// return;
// }
// }
// }
};
@Override

13
designer/src/com/fr/design/widget/ui/DirectWriteEditorDefinePane.java

@ -2,10 +2,12 @@ package com.fr.design.widget.ui;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.DirectWriteEditor;
import com.fr.general.Inter;
import javax.swing.*;
import java.awt.*;
//richer:需要提供能否直接编辑的控件设置面板——下拉框、复选框、时间、日期、下拉树
public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> extends FieldEditorDefinePane<T> {
@ -21,17 +23,18 @@ public abstract class DirectWriteEditorDefinePane<T extends DirectWriteEditor> e
protected JPanel setFirstContentPane() {
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
contentPane.add(contenter);
directWriteCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_Edit"), false);
contenter.add(directWriteCheckBox);
directWriteCheckBox.setPreferredSize(new Dimension(100, 30));
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{directWriteCheckBox}, FlowLayout.LEFT, 5));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Advanced"));
waterMarkDictPane = new WaterMarkDictPane();
contenter.add(waterMarkDictPane);
advancedPane.add(contentPane);
contentPane.add(waterMarkDictPane);
JPanel otherContentPane = this.setSecondContentPane();
if (otherContentPane != null) {
contentPane.add(otherContentPane);
}
return contentPane;
return advancedPane;
}
protected abstract JPanel setSecondContentPane();

42
designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java

@ -1,20 +1,20 @@
package com.fr.design.widget.ui;
import java.awt.BorderLayout;
import java.awt.*;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import javax.swing.BorderFactory;
import javax.swing.*;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.FieldEditor;
import com.fr.general.Inter;
@ -23,6 +23,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
// richer:错误信息,是所有控件共有的属性,所以放到这里来
private UITextField errorMsgTextField;
private UITextField regErrorMsgTextField;
private JPanel validatePane;
public FieldEditorDefinePane() {
this.initComponents();
@ -30,6 +31,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8));
regErrorMsgTextField = new UITextField(16);
regErrorMsgTextField.getDocument().addDocumentListener(new DocumentListener() {
public void changedUpdate(DocumentEvent e) {
@ -47,7 +49,7 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
//JPanel firstPanel = FRGUIPaneFactory.createBorderLayout_M_Pane();
allowBlankCheckBox = new UICheckBox(Inter.getLocText("Allow_Blank"));
allowBlankCheckBox.setPreferredSize(new Dimension(75, 30));
allowBlankCheckBox.addItemListener(new ItemListener() {
@Override
@ -58,8 +60,6 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
// 错误信息
JPanel errorMsgPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
//目前只整改了文本、密码、文本域和数字四个控件
this.addAllowBlankPane(allowBlankCheckBox, errorMsgPane);
errorMsgPane.add(new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"));
errorMsgTextField = new UITextField(16);
errorMsgPane.add(errorMsgTextField);
@ -79,10 +79,11 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
errorMsgTextField.setToolTipText(errorMsgTextField.getText());
}
});
this.addAllowBlankPane(allowBlankCheckBox);
JPanel contentPane = this.setFirstContentPane();
if (contentPane != null) {
//contentPane.add(firstPanel);
this.add(contentPane, BorderLayout.CENTER);
this.add(contentPane, BorderLayout.NORTH);
} else {
//this.add(firstPanel, BorderLayout.CENTER);
}
@ -118,22 +119,21 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
}
public void addAllowBlankPane(UICheckBox allowBlankCheckBox, JPanel errorMsgPane) {
JPanel northPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
this.add(northPane, BorderLayout.NORTH);
JPanel firstPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
firstPanel.setBorder(BorderFactory.createEmptyBorder(0, -2, 0, 0));
firstPanel.add(allowBlankCheckBox);
firstPanel.add(errorMsgPane);
northPane.add(firstPanel);
}
public UICheckBox getAllowBlankCheckBox() {
return allowBlankCheckBox;
public void addAllowBlankPane(UICheckBox allowBlankCheckBox) {
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Validate"));
validatePane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
validatePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
northPane.add(validatePane);
this.add(northPane, BorderLayout.CENTER);
JPanel firstPane = GUICoreUtils.createFlowPane(new JComponent[]{allowBlankCheckBox}, FlowLayout.LEFT, 5);
validatePane.add(firstPane);
JPanel secondPane = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), errorMsgTextField}, FlowLayout.LEFT, 24);
secondPane.setPreferredSize(new Dimension(310, 23));
validatePane.add(secondPane);
}
public UITextField getErrorMsgTextField() {
return errorMsgTextField;
public JPanel getValidatePane() {
return validatePane;
}
public UITextField getRegErrorMsgTextField() {

15
designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java

@ -1,7 +1,6 @@
package com.fr.design.widget.ui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.*;
import java.util.List;
import javax.swing.BorderFactory;
@ -18,6 +17,7 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.present.dict.DictionaryPane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.IframeEditor;
import com.fr.general.Inter;
import com.fr.stable.ParameterProvider;
@ -36,6 +36,7 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
private void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8));
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
JPanel attr = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
@ -51,9 +52,15 @@ public class IframeEditorDefinePane extends AbstractDataModify<IframeEditor> {
{ new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField() },
{ new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } };
parameterViewPane.setPreferredSize(new Dimension(400, 256));
JPanel centerPane = TableLayoutHelper.createTableLayoutPane(coms, rowSize, columnSize);
JPanel centerPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
centerPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
centerPane.add(GUICoreUtils.createFlowPane(new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField(16), FlowLayout.LEFT));
centerPane.add(GUICoreUtils.createFlowPane( new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane(), FlowLayout.LEFT));
parameterViewPane.setPreferredSize(new Dimension(540, 235));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Advanced"));
advancedPane.add(contentPane);
contentPane.add(centerPane);
this.add(contentPane, BorderLayout.CENTER);
this.add(advancedPane, BorderLayout.CENTER);
}

17
designer/src/com/fr/design/widget/ui/MultiFileEditorPane.java

@ -1,16 +1,17 @@
package com.fr.design.widget.ui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.*;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel;
import javax.swing.*;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.icombobox.DictionaryComboBox;
import com.fr.design.gui.icombobox.DictionaryConstants;
import com.fr.design.gui.itextfield.UINumberField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.MultiFileEditor;
import com.fr.general.Inter;
@ -32,7 +33,7 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
@Override
protected JPanel setFirstContentPane() {
acceptType = new DictionaryComboBox(DictionaryConstants.acceptTypes, DictionaryConstants.fileTypeDisplays);
acceptType.setPreferredSize(new Dimension(400, 18));
acceptType.setPreferredSize(new Dimension(200, 18));
singleFileCheckBox = new UICheckBox(Inter.getLocText("SINGLE_FILE_UPLOAD"));
fileSizeField = new UINumberField();
fileSizeField.setPreferredSize(new Dimension(80, 18));
@ -40,20 +41,22 @@ public class MultiFileEditorPane extends FieldEditorDefinePane<MultiFileEditor>
JPanel centerPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
JPanel singleFilePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
singleFilePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
singleFilePane.add(singleFileCheckBox);
centerPane.add(singleFilePane, BorderLayout.NORTH);
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{singleFilePane}, FlowLayout.LEFT,0));
JPanel allowTypePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
allowTypePane.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
allowTypePane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
allowTypePane.add(new UILabel(" " + Inter.getLocText("File-Allow_Upload_Files") + ":"));
allowTypePane.add(acceptType);
centerPane.add(allowTypePane, BorderLayout.CENTER);
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{allowTypePane}, FlowLayout.LEFT,5));
JPanel fileSizePane = FRGUIPaneFactory.createNormalFlowInnerContainer_M_Pane();
fileSizePane.add(new UILabel(" " + Inter.getLocText("File-File_Size_Limit") + ":"));
fileSizePane.add(fileSizeField);
fileSizePane.add(new UILabel(" KB"));
allowTypePane.add(fileSizePane);
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{fileSizePane}, FlowLayout.LEFT,11));
return centerPane;
}

24
designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java

@ -153,7 +153,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
@Override
protected JPanel setFirstContentPane() {
JPanel content = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
content.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8));
content.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
content.setLayout(FRGUIPaneFactory.createBorderLayout());
// richer:数字的允许直接编辑没有意义
@ -162,25 +162,17 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
waterMarkDictPane = new WaterMarkDictPane();
northPane.add(waterMarkDictPane);
JPanel centerPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Validate"));
JPanel validatePane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
validatePane.setPreferredSize(new Dimension(400, 200));
centerPane.add(validatePane);
content.add(northPane, BorderLayout.NORTH);
content.add(centerPane, BorderLayout.CENTER);
validatePane.add(GUICoreUtils.createFlowPane(getAllowBlankCheckBox(), FlowLayout.LEFT));
validatePane.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), getErrorMsgTextField()}, FlowLayout.LEFT, 24));
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals"));
this.decimalLength = new com.fr.design.editor.editor.IntegerEditor();
this.decimalLength.setColumns(4);
limitNumberPane = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Double", "Numbers"}) + ":"), this.decimalLength},
FlowLayout.LEFT, 4);
validatePane.add(GUICoreUtils.createFlowPane(new JComponent[]{this.allowDecimalsCheckBox, limitNumberPane}, FlowLayout.LEFT, 4));
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.allowDecimalsCheckBox, limitNumberPane}, FlowLayout.LEFT, 4));
this.allowDecimalsCheckBox.addActionListener(actionListener1);
this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative"));
validatePane.add(GUICoreUtils.createFlowPane(new JComponent[]{this.allowNegativeCheckBox}, FlowLayout.LEFT, 4));
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.allowNegativeCheckBox}, FlowLayout.LEFT, 4));
this.allowNegativeCheckBox.addActionListener(actionListener2);
this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("Need_Max_Value"), false);
@ -188,7 +180,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
maxValueSpinner.setPreferredSize(new Dimension(120, 20));
setNotAllowsInvalid(this.maxValueSpinner);
validatePane.add(GUICoreUtils.createFlowPane(new JComponent[]{this.setMaxValueCheckBox, this.maxValueSpinner}, FlowLayout.LEFT, 4));
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.setMaxValueCheckBox, this.maxValueSpinner}, FlowLayout.LEFT, 4));
this.maxValueSpinner.setVisible(false);
this.setMaxValueCheckBox.addActionListener(actionListener3);
this.maxValueSpinner.addChangeListener(changeListener1);
@ -197,11 +189,11 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
minValueSpinner.setPreferredSize(new Dimension(120, 20));
setNotAllowsInvalid(this.minValueSpinner);
validatePane.add(GUICoreUtils.createFlowPane(new JComponent[]{this.setMinValueCheckBox, this.minValueSpinner}, FlowLayout.LEFT, 4));
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.setMinValueCheckBox, this.minValueSpinner}, FlowLayout.LEFT, 4));
this.minValueSpinner.setVisible(false);
this.setMinValueCheckBox.addActionListener(actionListener4);
this.minValueSpinner.addChangeListener(changeListener2);
validatePane.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), getRegErrorMsgTextField()}, FlowLayout.LEFT, 24));
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), getRegErrorMsgTextField()}, FlowLayout.LEFT, 24));
return content;
}
@ -295,8 +287,4 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
}
}
@Override
public void addAllowBlankPane(UICheckBox allowBlankCheckBox, JPanel errorMsgPane) {
}
}

5
designer/src/com/fr/design/widget/ui/RadioGroupDefinePane.java

@ -10,6 +10,7 @@ import com.fr.design.data.DataCreatorUI;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.present.dict.DictionaryPane;
import com.fr.form.ui.RadioGroup;
import com.fr.general.Inter;
public class RadioGroupDefinePane extends FieldEditorDefinePane<RadioGroup> {
private DictionaryPane dictPane;
@ -34,8 +35,10 @@ public class RadioGroupDefinePane extends FieldEditorDefinePane<RadioGroup> {
JPanel centerPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
buttonGroupDictPane = new ButtonGroupDictPane();
buttonGroupDictPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5, 0));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Advanced"));
centerPane.add(buttonGroupDictPane);
attrPane.add(centerPane, BorderLayout.CENTER);
advancedPane.add(centerPane);
attrPane.add(advancedPane, BorderLayout.CENTER);
return attrPane;
}

23
designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java

@ -1,7 +1,6 @@
package com.fr.design.widget.ui;
import com.fr.design.gui.frpane.RegPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
@ -28,10 +27,6 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
@Override
protected JPanel setFirstContentPane() {
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
JPanel contenter = FRGUIPaneFactory.createBorderLayout_S_Pane();
contenter.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
attrPane.add(contenter);
regPane = createRegPane();
final RegPane.RegChangeListener rl = new RegPane.RegChangeListener() {
@ -51,14 +46,8 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
}
};
regPane.addPhoneRegListener(pl);
JPanel basicPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Validate"));
JPanel validateContent = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
getAllowBlankCheckBox().setPreferredSize(new Dimension(444, 40));
validateContent.add(GUICoreUtils.createFlowPane(getAllowBlankCheckBox(), FlowLayout.LEFT));
validateContent.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), getErrorMsgTextField()}, FlowLayout.LEFT, 24));
validateContent.add(GUICoreUtils.createFlowPane(regPane, FlowLayout.LEFT));
validateContent.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), getRegErrorMsgTextField()}, FlowLayout.LEFT, 24));
basicPane.add(validateContent);
getValidatePane().add(GUICoreUtils.createFlowPane(regPane, FlowLayout.LEFT));
getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), getRegErrorMsgTextField()}, FlowLayout.LEFT, 24));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Advanced"));
waterMarkDictPane = new WaterMarkDictPane();
waterMarkDictPane.addInputKeyListener(new KeyAdapter() {
@ -81,8 +70,7 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
}
});
advancedPane.add(waterMarkDictPane);
contenter.add(advancedPane, BorderLayout.NORTH);
contenter.add(basicPane, BorderLayout.CENTER);
attrPane.add(advancedPane, BorderLayout.NORTH);
return attrPane;
}
@ -116,9 +104,4 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
return new TextEditor();
}
@Override
public void addAllowBlankPane(UICheckBox allowBlankCheckBox, JPanel errorMsgPane) {
}
}

4
designer/src/com/fr/design/widget/ui/TreeEditorDefinePane.java

@ -46,7 +46,9 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
}
protected JPanel setSecondContentPane() {
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Advanced"));
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
advancedPane.add(contentPane);
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
contentPane.add(contenter,BorderLayout.NORTH);
@ -56,7 +58,7 @@ public class TreeEditorDefinePane extends FieldEditorDefinePane<TreeEditor> {
if (otherContentPane != null) {
contentPane.add(otherContentPane,BorderLayout.CENTER);
}
return contentPane;
return advancedPane;
}
protected JPanel setThirdContentPane() {

2
designer/src/com/fr/design/widget/ui/WritableRepeatEditorPane.java

@ -17,8 +17,6 @@ public abstract class WritableRepeatEditorPane<E extends WriteAbleRepeatEditor>
protected JPanel setSecondContentPane() {
JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel contenter = FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
contentPane.add(contenter,BorderLayout.NORTH);
JPanel otherContentPane = this.setThirdContentPane();
if (otherContentPane != null) {
contentPane.add(otherContentPane,BorderLayout.CENTER);

4
designer/src/com/fr/design/widget/ui/WriteUnableRepeatEditorPane.java

@ -20,7 +20,9 @@ public abstract class WriteUnableRepeatEditorPane<E extends WriteUnableRepeatEdi
@Override
protected JPanel setFirstContentPane() {
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Advanced"));
JPanel contentPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
advancedPane.add(contentPane);
contentPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0));
JPanel contenter=FRGUIPaneFactory.createMediumHGapFlowInnerContainer_M_Pane();
removeRepeatCheckBox = new UICheckBox(Inter.getLocText("Form-Remove_Repeat_Data"), false);
@ -29,7 +31,7 @@ public abstract class WriteUnableRepeatEditorPane<E extends WriteUnableRepeatEdi
JPanel otherContentPane = this.setThirdContentPane();
if (otherContentPane != null)
contentPane.add(otherContentPane,BorderLayout.CENTER);
return contentPane;
return advancedPane;
}
protected abstract JPanel setThirdContentPane();
@Override

6
designer/src/com/fr/design/widget/ui/btn/TreeNodeToogleButtonDefinePane.java

@ -29,12 +29,14 @@ public class TreeNodeToogleButtonDefinePane<T extends TreeNodeToggleButton> exte
setLayout(FRGUIPaneFactory.createBorderLayout());
double p = TableLayout.PREFERRED;
double rowSize[] = {p};
double columnSize[] = {p, 300};
double columnSize[] = {p, 184};
Component[][] n_components = {
{new UILabel(Inter.getLocText(new String[]{"Form-Button", "Type"}) + ":"), createButtonTypeComboBox()}
};
JPanel northPane = TableLayoutHelper.createTableLayoutPane(n_components, rowSize, columnSize);
add(northPane, BorderLayout.CENTER);
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Advanced"));
advancedPane.add(northPane);
add(advancedPane, BorderLayout.CENTER);
}
@Override

21
designer_base/src/com/fr/design/widget/btn/ButtonWithHotkeysDetailPane.java

@ -1,9 +1,8 @@
package com.fr.design.widget.btn;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.*;
import javax.swing.JPanel;
import javax.swing.*;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
@ -32,7 +31,11 @@ public abstract class ButtonWithHotkeysDetailPane<T extends Button> extends Butt
}
private void initComponents() {
this.setLayout(new BorderLayout());
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Advanced"));
advancedPane.setPreferredSize(new Dimension(600,300));
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
this.add(advancedPane);
double p = TableLayout.PREFERRED;
double rowSize[] = {p, p, p, p};
double columnSize[] = {p, p};
@ -40,17 +43,17 @@ public abstract class ButtonWithHotkeysDetailPane<T extends Button> extends Butt
iconPane = new IconDefinePane();
labelPane.add(iconPane);
Component[][] n_components = {
{new UILabel(Inter.getLocText("FR-Designer_Button-Name") + ":"), buttonNameTextField = new UITextField(20)},
{new UILabel(Inter.getLocText("FR-Designer_Button-Name") + ":"), buttonNameTextField = new UITextField(16)},
{new UILabel(Inter.getLocText("FR-Designer_Button-Icon") + ":"), labelPane},
{new UILabel(Inter.getLocText("FR-Designer_Button-Type") + ":"), createButtonTypeComboBox()},
{new UILabel(Inter.getLocText("FR-Designer_Button-Hotkeys") + ":"), hotkeysTextField = new UITextField(40)}
{new UILabel(Inter.getLocText("FR-Designer_Button-Hotkeys") + ":"), hotkeysTextField = new UITextField(16)}
};
hotkeysTextField.setToolTipText(StableUtils.join(ButtonConstants.HOTKEYS, ","));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, 0, 4);
add(panel,BorderLayout.NORTH);
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(n_components, rowSize, columnSize, 0, 8);
advancedPane.add(panel,BorderLayout.NORTH);
Component comp = createCenterPane();
if(comp != null ) {
add(comp,BorderLayout.CENTER);
advancedPane.add(comp,BorderLayout.CENTER);
}
}

56
designer_form/src/com/fr/design/designer/creator/XPassword.java

@ -14,8 +14,11 @@ import com.fr.design.mainframe.widget.editors.RegexEditor;
import com.fr.design.mainframe.widget.editors.WidgetValueEditor;
import com.fr.design.mainframe.widget.renderer.RegexCellRencerer;
import com.fr.form.ui.Password;
import com.fr.form.ui.TextEditor;
import com.fr.form.ui.reg.RegExp;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
/**
* @author richer
@ -26,7 +29,7 @@ public class XPassword extends XWrapperedFieldEditor {
public XPassword(Password widget, Dimension initSize) {
super(widget, initSize);
}
@Override
protected JComponent initEditor() {
if (editor == null) {
@ -39,31 +42,38 @@ public class XPassword extends XWrapperedFieldEditor {
protected String getIconName() {
return "password_field_16.png";
}
/**
* 控件的属性列表
*
* @return 此控件所用的属性列表
* @throws IntrospectionException 异常
*/
@Override
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
CRPropertyDescriptor[] sup = (CRPropertyDescriptor[]) ArrayUtils.addAll(
new CRPropertyDescriptor[] {
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(
WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")}
, super.supportedDescriptor());
return (CRPropertyDescriptor[]) ArrayUtils.addAll(sup,
new CRPropertyDescriptor[] {
new CRPropertyDescriptor("regex", this.data.getClass())
.setI18NName(Inter.getLocText("FR-Designer_Input_Rule"))
.setEditorClass(RegexEditor.RegexEditor4TextArea.class)
.putKeyValue("renderer", RegexCellRencerer.class)
.putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"),
new CRPropertyDescriptor("waterMark", this.data.getClass())
.setI18NName(Inter.getLocText("FR-Designer_WaterMark"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
});
}
@Override
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
CRPropertyDescriptor[] sup = (CRPropertyDescriptor[]) ArrayUtils.addAll(
new CRPropertyDescriptor[]{
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(
WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")}
, super.supportedDescriptor());
CRPropertyDescriptor regex = new CRPropertyDescriptor("regex", this.data.getClass())
.setI18NName(Inter.getLocText("FR-Designer_Input_Rule"))
.setEditorClass(RegexEditor.RegexEditor4TextArea.class)
.putKeyValue("renderer", RegexCellRencerer.class)
.putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate");
CRPropertyDescriptor regErrorMessage = new CRPropertyDescriptor("regErrorMessage", this.data.getClass()).setI18NName(
Inter.getLocText("Verify-Message")).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate");
CRPropertyDescriptor waterMark = new CRPropertyDescriptor("waterMark", this.data.getClass())
.setI18NName(Inter.getLocText("FR-Designer_WaterMark"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced");
Boolean displayRegField = true;
RegExp reg = ((TextEditor) toData()).getRegex();
if (reg == null || !StringUtils.isNotEmpty(reg.toRegText())) {
displayRegField = false;
}
return displayRegField ? (CRPropertyDescriptor[]) ArrayUtils.addAll(sup, new CRPropertyDescriptor[]{regex, regErrorMessage, waterMark}) :
(CRPropertyDescriptor[]) ArrayUtils.addAll(sup, new CRPropertyDescriptor[]{regex, waterMark});
}
}

72
designer_form/src/com/fr/design/designer/creator/XTextArea.java

@ -19,10 +19,13 @@ import com.fr.design.mainframe.widget.editors.WidgetValueEditor;
import com.fr.design.mainframe.widget.renderer.RegexCellRencerer;
import com.fr.form.ui.TextArea;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.form.ui.TextEditor;
import com.fr.form.ui.reg.RegExp;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
/**
* @author richer
@ -34,42 +37,49 @@ public class XTextArea extends XFieldEditor {
super(widget, initSize);
}
@Override
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
CRPropertyDescriptor[] sup=(CRPropertyDescriptor[]) ArrayUtils.addAll(
new CRPropertyDescriptor[] {
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(
WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")},super.supportedDescriptor());
return (CRPropertyDescriptor[]) ArrayUtils.addAll(sup,
new CRPropertyDescriptor[] {
new CRPropertyDescriptor("regex", this.data.getClass()).setI18NName(
Inter.getLocText("Input_Rule")).setEditorClass(RegexEditor.RegexEditor4TextArea.class)
.putKeyValue("renderer", RegexCellRencerer.class).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"),
new CRPropertyDescriptor("waterMark", this.data.getClass()).setI18NName(
Inter.getLocText("WaterMark")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced"), });
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
TextArea area = (TextArea) data;
if (area.getWidgetValue() != null) {
Graphics2D g2d = (Graphics2D) g.create();
BaseUtils.drawStringStyleInRotation(g2d, this.getWidth(), this.getHeight(), area.getWidgetValue()
.toString(), Style.getInstance(FRFont.getInstance()).deriveHorizontalAlignment(Constants.LEFT)
.deriveVerticalAlignment(SwingConstants.TOP)
.deriveTextStyle(Style.TEXTSTYLE_WRAPTEXT), ScreenResolution.getScreenResolution());
}
}
@Override
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
CRPropertyDescriptor[] sup = (CRPropertyDescriptor[]) ArrayUtils.addAll(
new CRPropertyDescriptor[]{
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(
WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")}, super.supportedDescriptor());
CRPropertyDescriptor regex = new CRPropertyDescriptor("regex", this.data.getClass()).setI18NName(
Inter.getLocText("Input_Rule")).setEditorClass(RegexEditor.RegexEditor4TextArea.class)
.putKeyValue("renderer", RegexCellRencerer.class).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate");
CRPropertyDescriptor regErrorMessage = new CRPropertyDescriptor("regErrorMessage", this.data.getClass()).setI18NName(
Inter.getLocText("Verify-Message")).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate");
CRPropertyDescriptor waterMark = new CRPropertyDescriptor("waterMark", this.data.getClass()).setI18NName(
Inter.getLocText("WaterMark")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced");
Boolean displayRegField = true;
RegExp reg = ((TextEditor) toData()).getRegex();
if (reg == null || !StringUtils.isNotEmpty(reg.toRegText())) {
displayRegField = false;
}
return displayRegField ? (CRPropertyDescriptor[]) ArrayUtils.addAll(sup, new CRPropertyDescriptor[]{regex, regErrorMessage, waterMark}) :
(CRPropertyDescriptor[]) ArrayUtils.addAll(sup, new CRPropertyDescriptor[]{regex, waterMark});
}
@Override
protected void paintComponent(Graphics g) {
super.paintComponent(g);
TextArea area = (TextArea) data;
if (area.getWidgetValue() != null) {
Graphics2D g2d = (Graphics2D) g.create();
BaseUtils.drawStringStyleInRotation(g2d, this.getWidth(), this.getHeight(), area.getWidgetValue()
.toString(), Style.getInstance(FRFont.getInstance()).deriveHorizontalAlignment(Constants.LEFT)
.deriveVerticalAlignment(SwingConstants.TOP)
.deriveTextStyle(Style.TEXTSTYLE_WRAPTEXT), ScreenResolution.getScreenResolution());
}
}
@Override
protected JComponent initEditor() {
setBorder(FIELDBORDER);
setBorder(FIELDBORDER);
return this;
}
@Override
public Dimension initEditorSize() {
return BIG_PREFERRED_SIZE;

Loading…
Cancel
Save