Browse Source

Merge pull request #1262 in BA/design from ~PLOUGH/design:release/9.0 to release/9.0

* commit '97e461b5c1d4d0d65caa83caa06920d363fbfe15':
  REPORT-4672 单元格添加控件后删除单元格所在行,右侧属性面板保持不变=>若直接刷新,在编辑图表属性时,每次都会跳到第一页。加一个标记区分下
master
superman 7 years ago
parent
commit
0420e8ef07
  1. 6
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  2. 6
      designer/src/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java
  3. 4
      designer/src/com/fr/poly/creator/ECBlockEditor.java
  4. 2
      designer_base/src/com/fr/design/actions/TemplateComponentAction.java
  5. 19
      designer_base/src/com/fr/design/mainframe/DesignerContext.java

6
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -56,7 +56,11 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
this.addTargetModifiedListener(new TargetModifiedListener() {
@Override
public void targetModified(TargetModifiedEvent e) {
refreshPropertyPanes();
if (DesignerContext.isRefreshOnTargetModifiedEnabled()) {
refreshPropertyPanes();
} else {
CellElementPropertyPane.getInstance().populate(ElementCasePaneDelegate.this);
}
}
});
}

6
designer/src/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java

@ -42,7 +42,11 @@ public class FormElementCasePaneDelegate extends ElementCasePane<FormElementCase
this.addTargetModifiedListener(new TargetModifiedListener() {
@Override
public void targetModified(TargetModifiedEvent e) {
refreshPropertyPanes();
if (DesignerContext.isRefreshOnTargetModifiedEnabled()) {
refreshPropertyPanes();
} else {
CellElementPropertyPane.getInstance().populate(FormElementCasePaneDelegate.this);
}
}
});
}

4
designer/src/com/fr/poly/creator/ECBlockEditor.java

@ -47,7 +47,9 @@ public class ECBlockEditor extends BlockEditor<ECBlockPane, PolyECBlock> {
@Override
public void targetModified(TargetModifiedEvent e) {
designer.fireTargetModified();
resetSelectionAndChooseState();
if (DesignerContext.isRefreshOnTargetModifiedEnabled()) {
resetSelectionAndChooseState();
}
}
});
}

2
designer_base/src/com/fr/design/actions/TemplateComponentAction.java

@ -2,6 +2,7 @@ package com.fr.design.actions;
import com.fr.design.designer.TargetComponent;
import com.fr.design.mainframe.DesignerContext;
public abstract class TemplateComponentAction<T extends TargetComponent> extends UndoableAction implements TemplateComponentActionInterface<T> {
private T t;
@ -24,6 +25,7 @@ public abstract class TemplateComponentAction<T extends TargetComponent> extends
@Override
public void prepare4Undo() {
DesignerContext.enableRefreshOnTargetModified();
this.getEditingComponent().fireTargetModified();
T component = getEditingComponent();
if (component == null) {

19
designer_base/src/com/fr/design/mainframe/DesignerContext.java

@ -36,7 +36,8 @@ public class DesignerContext {
private static Hashtable<String, DesignerFrame> prop = new Hashtable<String, DesignerFrame>();
private static Hashtable<String, DesignerBean> beans = new Hashtable<String, DesignerBean>();
;
private static boolean refreshOnTargetModified = false;
/**
* Return the main design frame from context
@ -136,4 +137,20 @@ public class DesignerContext {
public static void setReportWritePane(BasicDialog dlg){
reportWriteThread.set(dlg);
}
/**
* 在修改 Target 刷新右侧属性面板
*/
public static void enableRefreshOnTargetModified() {
refreshOnTargetModified = true;
}
/**
* 在修改 Target 是否刷新右侧属性面板仅可刷新一次取值后重置为 false
*/
public static boolean isRefreshOnTargetModifiedEnabled() {
boolean isRefresh = refreshOnTargetModified;
refreshOnTargetModified = false;
return isRefresh;
}
}
Loading…
Cancel
Save