Browse Source

REPORT-3163 合作开发9.0设计器=>将超级链接面板改为单例,插入右侧属性面板框架中

master
plough 7 years ago
parent
commit
07c5057047
  1. 3
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  2. 6
      designer/src/com/fr/design/mainframe/JWorkBook.java
  3. 55
      designer/src/com/fr/design/mainframe/ReportHyperlinkGroupPane.java
  4. 3
      designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java
  5. 8
      designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java
  6. 4
      designer_base/src/com/fr/design/mainframe/JTemplate.java
  7. 16
      designer_form/src/com/fr/design/gui/xpane/FormHyperlinkGroupPane.java
  8. 2
      designer_form/src/com/fr/design/mainframe/JForm.java

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

@ -58,6 +58,8 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
QuickEditorRegion.getInstance().populate(getCurrentEditor());
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (editingTemplate != null && !editingTemplate.isUpMode()) {
// 模板初始化完成后,才能初始化超级链接面板
ReportHyperlinkGroupPane.getInstance().populate(ElementCasePaneDelegate.this);
if (((ElementCasePaneDelegate)e.getSource()).getSelection() instanceof FloatSelection) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT);
// EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
@ -66,6 +68,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT);
EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance());
EastRegionContainerPane.getInstance().replaceHyperlinkPane(ReportHyperlinkGroupPane.getInstance());
}
EastRegionContainerPane.getInstance().removeParameterPane();
}

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

@ -23,6 +23,7 @@ import com.fr.design.event.TargetModifiedListener;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.MutilTempalteTabPane;
import com.fr.design.fun.PreviewProvider;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UIModeControlContainer;
import com.fr.design.gui.imenu.UIMenuItem;
@ -755,6 +756,11 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
return true;
}
@Override
public HyperlinkGroupPane getHyperLinkPane() {
return ReportHyperlinkGroupPane.getInstance();
}
public void setAuthorityMode(boolean isUpMode) {
centerPane.setAuthorityMode(isUpMode);
}

55
designer/src/com/fr/design/mainframe/ReportHyperlinkGroupPane.java

@ -0,0 +1,55 @@
package com.fr.design.mainframe;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection;
import com.fr.grid.selection.Selection;
import com.fr.js.NameJavaScriptGroup;
import com.fr.report.cell.CellElement;
import com.fr.report.cell.FloatElement;
import com.fr.report.elementcase.TemplateElementCase;
/**
* Created by plough on 2017/7/21.
*/
public class ReportHyperlinkGroupPane extends HyperlinkGroupPane {
private static ReportHyperlinkGroupPane singleton;
private ReportHyperlinkGroupPane() {
super();
}
public synchronized static ReportHyperlinkGroupPane getInstance() {
if (singleton == null) {
singleton = new ReportHyperlinkGroupPane();
}
return singleton;
}
public void populate(ElementCasePane reportPane) {
// TemplateElementCase elementCase = ePane.getEditingElementCase();
// if (elementCase == null) {
// return;
// }
// ePane.getSelection().populatePropertyPane(ePane);
final TemplateElementCase report = reportPane.getEditingElementCase();
NameJavaScriptGroup nameHyperlinks = getNameJSGroup(reportPane, report);
populate(nameHyperlinks);
}
private NameJavaScriptGroup getNameJSGroup(ElementCasePane reportPane, final TemplateElementCase report) {
NameJavaScriptGroup nameHyperlinks = null;
final Selection sel = reportPane.getSelection();
if (sel instanceof FloatSelection) {
FloatElement selectedFloatElement = report.getFloatElement(((FloatSelection)sel).getSelectedFloatName());
nameHyperlinks = selectedFloatElement.getNameHyperlinkGroup();
} else {
CellElement editCellElement = report.getCellElement(((CellSelection)sel).getColumn(), ((CellSelection)sel).getRow());
if (editCellElement != null) {
nameHyperlinks = editCellElement.getNameHyperlinkGroup();
}
}
return nameHyperlinks;
}
}

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

@ -23,8 +23,7 @@ import java.util.Set;
* @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2013-6-25 上午11:17:57
*/
public class HyperlinkGroupPane extends JListControlPane {
public abstract class HyperlinkGroupPane extends JListControlPane {
/**
* 生成添加按钮的NameableCreator
*

8
designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java

@ -267,6 +267,14 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
return propertyItemMap.get(KEY_WIDGET_SETTINGS).getContentPane();
}
public void replaceHyperlinkPane(JComponent pane) {
propertyItemMap.get(KEY_HYPERLINK).replaceContentPane(pane);
}
public JComponent getHyperlinkPane() {
return propertyItemMap.get(KEY_HYPERLINK).getContentPane();
}
public void replaceWidgetLibPane(JComponent pane) {
propertyItemMap.get(KEY_WIDGET_LIB).replaceContentPane(pane);
}

4
designer_base/src/com/fr/design/mainframe/JTemplate.java

@ -867,9 +867,7 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
* 返回当前支持的超链界面pane
* @return 超链连接界面
*/
public HyperlinkGroupPane getHyperLinkPane() {
return new HyperlinkGroupPane();
}
public abstract HyperlinkGroupPane getHyperLinkPane();
/**
* 是否是图表

16
designer_form/src/com/fr/design/gui/xpane/FormHyperlinkGroupPane.java

@ -8,8 +8,20 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.js.EmailJavaScript;
public class FormHyperlinkGroupPane extends HyperlinkGroupPane{
public class FormHyperlinkGroupPane extends HyperlinkGroupPane{
private static FormHyperlinkGroupPane singleton;
private FormHyperlinkGroupPane() {
super();
}
public synchronized static FormHyperlinkGroupPane getInstance() {
if (singleton == null) {
singleton = new FormHyperlinkGroupPane();
}
return singleton;
}
/**
* 生成添加按钮的NameableCreator
* 由于表单报表块的单元格超链和单元格条件属性超链中的emailPane都要用表单的emailPane这里调整下

2
designer_form/src/com/fr/design/mainframe/JForm.java

@ -124,7 +124,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
* @return 超链连接界面
*/
public HyperlinkGroupPane getHyperLinkPane() {
return new FormHyperlinkGroupPane();
return FormHyperlinkGroupPane.getInstance();
}
//表单返回 FORM_TAB or ELEMENTCASE_TAB

Loading…
Cancel
Save