Browse Source

REPORT-3163 合作开发9.0设计器=>超级链接=>优化保存设置的时机,可正常撤销、重做;修复bug;完成

master
plough 7 years ago
parent
commit
48edcf18da
  1. 3
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  2. 7
      designer/src/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java
  3. 23
      designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java
  4. 3
      designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java

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

@ -61,8 +61,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
if (editingTemplate != null && !editingTemplate.isUpMode()) {
// 模板初始化完成后,才能初始化超级链接面板
// HyperlinkGroupPane hyperlinkGroupPane = ReportHyperlinkGroupPane.getInstance(HyperlinkGroupPaneActionImpl.getInstance());
HyperlinkGroupPane hyperlinkGroupPane = DesignerContext.getDesignerFrame().getSelectedJTemplate()
.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
HyperlinkGroupPane hyperlinkGroupPane = editingTemplate.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
hyperlinkGroupPane.populate(ElementCasePaneDelegate.this);
if (((ElementCasePaneDelegate)e.getSource()).getSelection() instanceof FloatSelection) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT);

7
designer/src/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java

@ -59,11 +59,12 @@ public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionPro
@Override
public void saveSettings(HyperlinkGroupPane hyperlinkGroupPane) {
TargetComponent tc = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane();
if (tc == null) {
// plough: 需要判断设计器是否初始化完成,不能用 HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()
JTemplate jt = DesignerContext.getDesignerFrame().getSelectedJTemplate();
if (jt == null) {
return;
}
ElementCasePane reportPane = (ElementCasePane)tc;
ElementCasePane reportPane = (ElementCasePane)jt.getCurrentElementCasePane();
final TemplateElementCase report = reportPane.getEditingElementCase();
final Selection sel = reportPane.getSelection();
final NameJavaScriptGroup updateNameHyperlinks = hyperlinkGroupPane.updateJSGroup();

23
designer_base/src/com/fr/design/gui/controlpane/UIListControlPane.java

@ -29,6 +29,8 @@ import com.fr.stable.Nameable;
import com.fr.stable.core.PropertyChangeAdapter;
import javax.swing.*;
import javax.swing.event.ListDataEvent;
import javax.swing.event.ListDataListener;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
@ -55,6 +57,7 @@ public abstract class UIListControlPane extends UIControlPane {
protected int editingIndex;
protected String selectedName;
private boolean isNameRepeated = false;
protected boolean isPopulating = false;
public UIListControlPane() {
this.initComponentPane();
@ -94,9 +97,23 @@ public abstract class UIListControlPane extends UIControlPane {
((JControlUpdatePane) UIListControlPane.this.controlUpdatePane).update();
((JControlUpdatePane) UIListControlPane.this.controlUpdatePane).populate();
UIListControlPane.this.checkButtonEnabled();
// plough:感觉每次valueChange都保存一下,会稍微影响效率
}
}
});
nameableList.getModel().addListDataListener(new ListDataListener() {
@Override
public void intervalAdded(ListDataEvent e) {
saveSettings();
}
@Override
public void intervalRemoved(ListDataEvent e) {
saveSettings();
}
@Override
public void contentsChanged(ListDataEvent e) {
saveSettings();
}
});
}
@ -179,9 +196,11 @@ public abstract class UIListControlPane extends UIControlPane {
@Override
public void populate(Nameable[] nameableArray) {
isPopulating = true; // 加一个标识位,避免切换单元格时,触发 saveSettings
DefaultListModel listModel = (DefaultListModel) this.nameableList.getModel();
listModel.removeAllElements();
if (ArrayUtils.isEmpty(nameableArray)) {
isPopulating = false;
return;
}
@ -193,6 +212,8 @@ public abstract class UIListControlPane extends UIControlPane {
this.nameableList.setSelectedIndex(0);
}
this.checkButtonEnabled();
isPopulating = false;
}
/**

3
designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java

@ -99,6 +99,9 @@ public abstract class HyperlinkGroupPane extends UIListControlPane {
@Override
public void saveSettings() {
if (isPopulating) {
return;
}
hyperlinkGroupPaneActionProvider.saveSettings(this);
}
}
Loading…
Cancel
Save