forked from fanruan/design
plough
8 years ago
13 changed files with 88 additions and 26 deletions
@ -1 +1 @@
|
||||
package com.fr.design.widget.ui;
import com.fr.base.GraphHelper;
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(GraphHelper.getLocTextWidth("Form-Allow_CustomData") + 30, 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();
} |
||||
package com.fr.design.widget.ui;
import com.fr.base.GraphHelper;
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;
private static final int CUSTOM_DATA_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("Form-Allow_CustomData") + 30;
private static final int CUSTOM_DATA_CHECK_BOX_HEIGHT = 30;
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(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT));
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();
} |
@ -1 +1 @@
|
||||
package com.fr.design.write.submit;
import com.fr.base.GraphHelper;
import com.fr.data.AbstractClassJob;
import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.formula.JavaEditorPane;
import com.fr.design.gui.frpane.ObjectProperiesPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Author : Shockway
* Date: 13-7-29
* Time: 下午6:48
*/
public abstract class CustomJobPane extends BasicBeanPane {
protected UITextField classNameTextField;
protected ObjectProperiesPane objectProperiesPane;
public static final int DEFAULT_LENGTH = 30;
public CustomJobPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel reportletNamePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();
classNameTextField = new UITextField(getLengthOfTextField());
reportletNamePane.add(classNameTextField);
UIButton browserButton = new UIButton(Inter.getLocText("Select"));
browserButton.setPreferredSize(new Dimension(
GraphHelper.getLocTextWidth("Select") + 20,
classNameTextField.getPreferredSize().height));
UIButton editButton = new UIButton(Inter.getLocText("Edit"));
editButton.setPreferredSize(new Dimension(
GraphHelper.getLocTextWidth("Edit") + 20,
classNameTextField.getPreferredSize().height));
Select"));
Select"));
Select"));
Select"));
browserButton.setPreferredSize(new Dimension(
public void actionPerformed(ActionEvent evt) {
Select"));
classNameTextField.getPreferredSize().height));
bPane.setClassPath(classNameTextField.getText());
Select"));
UIButton editButton = new UIButton(Inter.getLocText("Edit"));
SwingUtilities.getWindowAncestor(getWindowAncestor()),
new DialogActionAdapter() {
Select"));
classNameTextField.getPreferredSize().height));
classNameTextField.setText(bPane.getClassPath());
checkAddButtonEnable();
}
}).setVisible(true);
}
});
editButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
final JavaEditorPane javaEditorPane = new JavaEditorPane(classNameTextField.getText(), JavaEditorPane.DEFAULT_SUBMIT_JOB);
final BasicDialog dlg = javaEditorPane.showMediumWindow(SwingUtilities.getWindowAncestor(CustomJobPane.this),
new DialogActionAdapter() {
public void doOk() {
classNameTextField.setText(javaEditorPane.getClassText());
browserButton.setPreferredSize(new Dimension(
Select"));
}
});
javaEditorPane.addSaveActionListener(new ActionListener() {
@Override
GraphHelper.getLocTextWidth("Select") + 20,
GraphHelper.getLocTextWidth("Edit") + 20,
dlg.doOK();
}
});
dlg.setVisible(true);
}
});
reportletNamePane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("ClassName"), null));
this.add(reportletNamePane, BorderLayout.NORTH);
objectProperiesPane = new ObjectProperiesPane();
objectProperiesPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Property"), null));
this.add(objectProperiesPane, BorderLayout.CENTER);
UITextArea area = new UITextArea(2, 1);
Select"));
JPanel dsPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
GraphHelper.getLocTextWidth("Select") + 20,
dsPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Description"), null));
this.add(dsPane, BorderLayout.SOUTH);
checkAddButtonEnable();
}
GraphHelper.getLocTextWidth("Edit") + 20,
return DEFAULT_LENGTH;
}
protected String title4PopupWindow() {
UIButton editButton = new UIButton(Inter.getLocText("Edit"));
Select"));
}
protected Component getWindowAncestor() {
return this;
}
UIButton editButton = new UIButton(Inter.getLocText("Edit"));
classNameTextField.getPreferredSize().height));
public void populateBean(Object ob) {
if (ob instanceof AbstractClassJob) {
AbstractClassJob cj = (AbstractClassJob) ob;
UIButton editButton = new UIButton(Inter.getLocText("Edit"));
GraphHelper.getLocTextWidth("Edit") + 20,
UIButton editButton = new UIButton(Inter.getLocText("Edit"));
classNameTextField.getPreferredSize().height));
editButton.setPreferredSize(new Dimension(
editButton.setPreferredSize(new Dimension(
Select"));
editButton.setPreferredSize(new Dimension(
editButton.setPreferredSize(new Dimension(
browserButton.setPreferredSize(new Dimension(
* 添加按钮可用
*/
public void checkAddButtonEnable() {
objectProperiesPane.enableAddButton(!StringUtils.isEmpty(classNameTextField.getText()));
}
/**
* 重置
*/
public void reset() {
this.classNameTextField.setText(null);
this.checkAddButtonEnable();
}
} |
||||
package com.fr.design.write.submit;
import com.fr.base.GraphHelper;
import com.fr.data.AbstractClassJob;
import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.formula.JavaEditorPane;
import com.fr.design.gui.frpane.ObjectProperiesPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import com.fr.design.utils.gui.GUICoreUtils;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* Author : Shockway
* Date: 13-7-29
* Time: 下午6:48
*/
public abstract class CustomJobPane extends BasicBeanPane {
protected UITextField classNameTextField;
protected ObjectProperiesPane objectProperiesPane;
public static final int DEFAULT_LENGTH = 30;
public CustomJobPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel reportletNamePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();
classNameTextField = new UITextField(getLengthOfTextField());
reportletNamePane.add(classNameTextField);
UIButton browserButton = new UIButton(Inter.getLocText("FR-Designer_Select"));
browserButton.setPreferredSize(new Dimension(
GraphHelper.getLocTextWidth("FR-Designer_Select") + 20,
classNameTextField.getPreferredSize().height));
GraphHelper.getLocTextWidth("Edit") + 20,
Select"));
GraphHelper.getLocTextWidth("Edit") + 20,
browserButton.setPreferredSize(new Dimension(
GraphHelper.getLocTextWidth("Edit") + 20,
GraphHelper.getLocTextWidth("Select") + 20,
GraphHelper.getLocTextWidth("Edit") + 20,
classNameTextField.getPreferredSize().height));
GraphHelper.getLocTextWidth("Edit") + 20,
GraphHelper.getLocTextWidth("Edit") + 20,
UIButton editButton = new UIButton(Inter.getLocText("Edit"));
GraphHelper.getLocTextWidth("Edit") + 20,
editButton.setPreferredSize(new Dimension(
GraphHelper.getLocTextWidth("Edit") + 20,
GraphHelper.getLocTextWidth("Edit") + 20,
GraphHelper.getLocTextWidth("Edit") + 20,
classNameTextField.getPreferredSize().height));
final ClassNameSelectPane bPane = new ClassNameSelectPane();
bPane.setClassPath(classNameTextField.getText());
bPane.showWindow(
SwingUtilities.getWindowAncestor(getWindowAncestor()),
new DialogActionAdapter() {
classNameTextField.getPreferredSize().height));
classNameTextField.setText(bPane.getClassPath());
checkAddButtonEnable();
}
}).setVisible(true);
Select"));
Select"));
Select"));
editButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
reportletNamePane.add(browserButton);
Select"));
UIButton editButton = new UIButton(Inter.getLocText("Edit"));
new DialogActionAdapter() {
public void doOk() {
classNameTextField.setText(javaEditorPane.getClassText());
checkAddButtonEnable();
}
});
reportletNamePane.add(editButton);
browserButton.setPreferredSize(new Dimension(
Select"));
public void actionPerformed(ActionEvent evt) {
Select"));
Select"));
classNameTextField.getPreferredSize().height));
Select"));
bPane.setClassPath(classNameTextField.getText());
Select"));
Select"));
UIButton editButton = new UIButton(Inter.getLocText("Edit"));
Select"));
SwingUtilities.getWindowAncestor(getWindowAncestor()),
Select"));
new DialogActionAdapter() {
Select"));
Select"));
classNameTextField.getPreferredSize().height));
Select"));
classNameTextField.setText(bPane.getClassPath());
Select"));
checkAddButtonEnable();
Select"));
}
Select"));
}).setVisible(true);
Select"));
}
Select"));
});
Select"));
editButton.addActionListener(new ActionListener() {
Select"));
@Override
Select"));
public void actionPerformed(ActionEvent e) {
Select"));
final JavaEditorPane javaEditorPane = new JavaEditorPane(classNameTextField.getText(), JavaEditorPane.DEFAULT_SUBMIT_JOB);
Select"));
final BasicDialog dlg = javaEditorPane.showMediumWindow(SwingUtilities.getWindowAncestor(CustomJobPane.this),
Select"));
new DialogActionAdapter() {
Select"));
public void doOk() {
Select"));
classNameTextField.setText(javaEditorPane.getClassText());
GraphHelper.getLocTextWidth("Edit") + 20,
Select"));
Select"));
}
Select"));
});
}
Select"));
javaEditorPane.addSaveActionListener(new ActionListener() {
Select"));
@Override
public void actionPerformed(ActionEvent evt) {
GraphHelper.getLocTextWidth("Select") + 20,
GraphHelper.getLocTextWidth("Edit") + 20,
Select"));
protected Component getWindowAncestor() {
Select"));
dlg.doOK();
}
Select"));
}
Select"));
});
Select"));
dlg.setVisible(true);
Select"));
}
Select"));
});
Select"));
reportletNamePane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("ClassName"), null));
Select"));
this.add(reportletNamePane, BorderLayout.NORTH);
Select"));
objectProperiesPane = new ObjectProperiesPane();
Select"));
GraphHelper.getLocTextWidth("Select") + 20,
GraphHelper.getLocTextWidth("Select") + 20,
GraphHelper.getLocTextWidth("Edit") + 20,
Select"));
Select"));
classNameTextField.getPreferredSize().height));
GraphHelper.getLocTextWidth("Edit") + 20,
final ClassNameSelectPane bPane = new ClassNameSelectPane();
classNameTextField.getPreferredSize().height));
bPane.setClassPath(classNameTextField.getText());
Select"));
Select"));
Select"));
browserButton.setPreferredSize(new Dimension(
Empty(classNameTextField.getText()));
}
/**
* 重置
*/
public void reset() {
this.classNameTextField.setText(null);
this.checkAddButtonEnable();
}
} |
Loading…
Reference in new issue