Browse Source

REPORT-4713 表单报表块工具栏状态切换后,没法撤销操作

master
kerry 7 years ago
parent
commit
dc8f26b127
  1. 10
      designer/src/com/fr/design/widget/ui/AbstractDataModify.java
  2. 2
      designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java
  3. 12
      designer_base/src/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java
  4. 5
      designer_base/src/com/fr/design/widget/DataModify.java
  5. 30
      designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleElementCaseToolBarEditor.java
  6. 13
      designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java
  7. 7
      designer_form/src/com/fr/design/widget/ui/designer/AbstractDataModify.java
  8. 10
      designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java
  9. 9
      designer_form/src/com/fr/design/widget/ui/designer/component/PaddingBoundPane.java
  10. 6
      designer_form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java
  11. 2
      designer_form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java
  12. 6
      designer_form/src/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java

10
designer/src/com/fr/design/widget/ui/AbstractDataModify.java

@ -3,6 +3,7 @@ package com.fr.design.widget.ui;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.data.DataCreatorUI;
import com.fr.design.widget.DataModify;
import com.fr.stable.StringUtils;
import javax.swing.*;
@ -10,6 +11,7 @@ import javax.swing.*;
* Created by richie on 15/11/16.
*/
public abstract class AbstractDataModify<T> extends BasicBeanPane<T> implements DataModify<T> {
protected String globalName;
@Override
public DataCreatorUI dataUI() {
@ -20,4 +22,12 @@ public abstract class AbstractDataModify<T> extends BasicBeanPane<T> implements
public JComponent toSwingComponent() {
return this;
}
public void setGlobalName(String globalName){
this.globalName = globalName;
}
public String getGlobalName(){
return globalName;
}
}

2
designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java

@ -25,7 +25,7 @@ public class BasicPropertyPane extends BasicPane {
this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
widgetName = new UITextField();
widgetName.setGlobalName(Inter.getLocText("FR-Designer_Widget_Name"));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p};

12
designer_base/src/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java

@ -7,6 +7,7 @@ import java.util.ArrayList;
import javax.swing.BorderFactory;
import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton;
import javax.swing.JComponent;
@ -77,7 +78,14 @@ public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor
setOpaque(false);
if (showButton) {
btPopup = new UIButton();
btPopup = new UIButton(){
public void registerChangeListener(UIObserverListener listener) {
return;
}
public boolean shouldResponseChangeListener() {
return false;
}
};
initPopupButton();
btPopup.addActionListener(new ActionListener() {
@ -189,4 +197,6 @@ public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor
public static void showMessage(String message, Component editorComponent) {
JOptionPane.showMessageDialog(editorComponent, message, "Validation Error", JOptionPane.ERROR_MESSAGE);
}
}

5
designer_base/src/com/fr/design/widget/DataModify.java

@ -15,4 +15,9 @@ public interface DataModify<T> {
DataCreatorUI dataUI();
JComponent toSwingComponent();
String getGlobalName();
void setGlobalName(String globalName);
}

30
designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleElementCaseToolBarEditor.java

@ -5,11 +5,16 @@ import com.fr.design.dialog.DialogActionAdapter;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.mainframe.FormWebWidgetConstants;
import com.fr.design.mainframe.widget.editors.ElementCaseToolBarPane;
import com.fr.design.mainframe.widget.editors.ITextComponent;
import com.fr.design.mainframe.widget.editors.TextField;
import com.fr.design.mainframe.widget.wrappers.ElementCaseToolBarWrapper;
import com.fr.form.web.FormToolBarManager;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
@ -54,4 +59,29 @@ public class AccessibleElementCaseToolBarEditor extends UneditableAccessibleEdit
options.addAll(defaultOptions);
return options.toArray(new WidgetOption[options.size()]);
}
protected ITextComponent createTextField() {
TextField textField = new TextField(){
protected void initListener() {
if (shouldResponseChangeListener()) {
getDocument().addDocumentListener(new DocumentListener() {
@Override
public void insertUpdate(DocumentEvent e) {
}
@Override
public void removeUpdate(DocumentEvent e) {
attributeChange();
}
@Override
public void changedUpdate(DocumentEvent e) {
}
});
}
}
};
textField.setGlobalName(Inter.getLocText("Form-EC_toolbar"));
return textField;
}
}

13
designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java

@ -18,6 +18,7 @@ import com.fr.form.ui.Widget;
import com.fr.form.ui.container.WScaleLayout;
import com.fr.form.ui.container.WTitleLayout;
import com.fr.form.ui.widget.CRBoundsWidget;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
@ -199,13 +200,19 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane {
public void updateCreator() {
currentEditorDefinePane.setGlobalName(getGlobalName());
Widget widget = currentEditorDefinePane.updateBean();
if(ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_Widget_Name"))){
widgetPropertyPane.update(widget);
if (widgetBoundPane != null) {
widgetBoundPane.update();
}
xCreator.resetCreatorName(widget.getWidgetName());
designer.getEditListenerTable().fireCreatorModified(xCreator, DesignerEvent.CREATOR_RENAMED);
return;
}
if (widgetBoundPane != null && ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_Coords_And_Size"))) {
widgetBoundPane.update();
}
fireValueChanged();
}

7
designer_form/src/com/fr/design/widget/ui/designer/AbstractDataModify.java

@ -12,6 +12,7 @@ import javax.swing.*;
*/
public abstract class AbstractDataModify<T> extends BasicBeanPane<T> implements DataModify<T> {
protected XCreator creator;
protected String globalName;
public AbstractDataModify(XCreator xCreator){
@ -28,5 +29,11 @@ public abstract class AbstractDataModify<T> extends BasicBeanPane<T> implements
return this;
}
public void setGlobalName(String globalName){
this.globalName = globalName;
}
public String getGlobalName(){
return globalName;
}
}

10
designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java

@ -64,12 +64,12 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField},
new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane},
new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"), formatHead},
new Component[]{new UILabel(Inter.getLocText("FS_Start_Date") + ":"), startDv},
new Component[]{new UILabel(Inter.getLocText("FS_End_Date") + ":"), endDv},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark") + ":"), waterMarkDictPane},
new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format")), formatHead},
new Component[]{new UILabel(Inter.getLocText("FS_Start_Date")), startDv},
new Component[]{new UILabel(Inter.getLocText("FS_End_Date")), endDv},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane},
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane},
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type") + ":"), returnTypeComboBox}
new Component[]{new UILabel(Inter.getLocText("Widget-Date_Selector_Return_Type")), returnTypeComboBox}
};
double[] rowSize = {p, p, p, p, p, p, p, p, p, p};

9
designer_form/src/com/fr/design/widget/ui/designer/component/PaddingBoundPane.java

@ -17,7 +17,7 @@ import java.awt.*;
/**
* Created by ibm on 2017/8/3.
*/
public class PaddingBoundPane extends BasicPane {
public class PaddingBoundPane extends BasicPane{
protected UISpinner top;
protected UISpinner bottom;
protected UISpinner left;
@ -33,6 +33,10 @@ public class PaddingBoundPane extends BasicPane {
bottom = new UISpinner(0, 1000, 1, 0);
left = new UISpinner(0, 1000, 1, 0);
right = new UISpinner(0, 1000, 1, 0);
top.setGlobalName(Inter.getLocText("FR-Designer_Layout-Padding"));
bottom.setGlobalName(Inter.getLocText("FR-Designer_Layout-Padding"));
left.setGlobalName(Inter.getLocText("FR-Designer_Layout-Padding"));
right.setGlobalName(Inter.getLocText("FR-Designer_Layout-Padding"));
double f = TableLayout.FILL;
double p = TableLayout.PREFERRED;
double[] rowSize = {p, p, p, p};
@ -47,9 +51,9 @@ public class PaddingBoundPane extends BasicPane {
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
panel.setBorder(BorderFactory.createEmptyBorder(5, 0, 10, 0));
this.add(panel);
}
public void update(AbstractMarginWidget marginWidget) {
marginWidget.setMargin(new PaddingMargin((int)top.getValue(), (int)left.getValue(), (int)bottom.getValue(), (int)right.getValue() ));
}
@ -66,4 +70,5 @@ public class PaddingBoundPane extends BasicPane {
right.setValue(paddingMargin.getRight());
}
}

6
designer_form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java

@ -4,6 +4,8 @@ import com.fr.design.designer.creator.XCreator;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.widget.WidgetBoundsPaneFactory;
import com.fr.form.ui.container.WLayout;
import com.fr.general.Inter;
import java.awt.*;
/**
@ -22,6 +24,10 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane {
y = new UISpinner(0, 1200, 1);
width = new UISpinner(0, 1200, 1);
height = new UISpinner(0, 1200, 1);
x.setGlobalName(Inter.getLocText("FR-Designer_Coords_And_Size"));
y.setGlobalName(Inter.getLocText("FR-Designer_Coords_And_Size"));
width.setGlobalName(Inter.getLocText("FR-Designer_Coords_And_Size"));
height.setGlobalName(Inter.getLocText("FR-Designer_Coords_And_Size"));
this.add(WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height));
}

2
designer_form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java

@ -49,6 +49,8 @@ public class WidgetBoundPane extends BasicPane {
public void initBoundPane() {
width = new UISpinner(0, 1200, 1);
height = new UISpinner(0, 1200, 1);
width.setGlobalName(Inter.getLocText("FR-Designer_Coords_And_Size"));
height.setGlobalName(Inter.getLocText("FR-Designer_Coords_And_Size"));
if (creator.acceptType(XWCardLayout.class)) {
width.setEnabled(false);
height.setEnabled(false);

6
designer_form/src/com/fr/design/widget/ui/designer/layout/ElementEditorDefinePane.java

@ -8,6 +8,7 @@ import com.fr.design.mainframe.widget.accessibles.AccessibleElementCaseToolBarEd
import com.fr.design.widget.ui.designer.component.PaddingBoundPane;
import com.fr.form.ui.ElementCaseEditor;
import com.fr.form.web.FormToolBarManager;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import javax.swing.*;
@ -45,8 +46,13 @@ public class ElementEditorDefinePane extends WTitleLayoutDefinePane<ElementCaseE
protected ElementCaseEditor updateSubBean() {
ElementCaseEditor elementCaseEditor = (ElementCaseEditor) creator.toData();
if(ComparatorUtils.equals(getGlobalName(), Inter.getLocText("FR-Designer_Layout-Padding"))){
paddingBoundPane.update(elementCaseEditor);
}
if(ComparatorUtils.equals(getGlobalName(), Inter.getLocText("Form-EC_toolbar"))){
elementCaseEditor.setToolBars((FormToolBarManager[]) elementCaseToolBarEditor.getValue());
}
return elementCaseEditor;
}

Loading…
Cancel
Save