Browse Source

REPORT-3163 合作开发9.0设计器=>超级链接=>重构代码,处理表单报表块的超级链接面板

master
plough 7 years ago
parent
commit
492b8055d9
  1. 3
      designer/src/com/fr/design/actions/edit/HyperlinkAction.java
  2. 3
      designer/src/com/fr/design/condition/HyperlinkPane.java
  3. 8
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  4. 91
      designer/src/com/fr/design/mainframe/HyperlinkGroupPaneActionImpl.java
  5. 10
      designer/src/com/fr/design/mainframe/JWorkBook.java
  6. 67
      designer/src/com/fr/design/mainframe/ReportHyperlinkGroupPane.java
  7. 9
      designer/src/com/fr/design/mainframe/form/FormElementCaseDesigner.java
  8. 19
      designer/src/com/fr/design/mainframe/form/FormElementCasePaneDelegate.java
  9. 16
      designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPane.java
  10. 11
      designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPaneActionProvider.java
  11. 5
      designer_base/src/com/fr/design/mainframe/JTemplate.java
  12. 13
      designer_base/src/com/fr/design/mainframe/form/FormECDesignerProvider.java
  13. 14
      designer_form/src/com/fr/design/gui/xpane/FormHyperlinkGroupPane.java
  14. 12
      designer_form/src/com/fr/design/mainframe/JForm.java

3
designer/src/com/fr/design/actions/edit/HyperlinkAction.java

@ -15,6 +15,7 @@ import com.fr.design.actions.utils.ReportActionUtils.IterAction;
import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.HyperlinkGroupPaneActionImpl;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
@ -55,7 +56,7 @@ public class HyperlinkAction extends ElementCaseAction {
final TemplateElementCase report = reportPane.getEditingElementCase(); final TemplateElementCase report = reportPane.getEditingElementCase();
NameJavaScriptGroup nameHyperlinks = getNameJSGroup(reportPane, report); NameJavaScriptGroup nameHyperlinks = getNameJSGroup(reportPane, report);
final HyperlinkGroupPane pane = DesignerContext.getDesignerFrame().getSelectedJTemplate().getHyperLinkPane(); final HyperlinkGroupPane pane = DesignerContext.getDesignerFrame().getSelectedJTemplate().getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
pane.populate(nameHyperlinks); pane.populate(nameHyperlinks);
final Selection sel = reportPane.getSelection(); final Selection sel = reportPane.getSelection();

3
designer/src/com/fr/design/condition/HyperlinkPane.java

@ -8,6 +8,7 @@ import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.HyperlinkGroupPaneActionImpl;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.js.*; import com.fr.js.*;
import com.fr.report.cell.cellattr.highlight.HighlightAction; import com.fr.report.cell.cellattr.highlight.HighlightAction;
@ -36,7 +37,7 @@ public class HyperlinkPane extends ConditionAttrSingleConditionPane<HighlightAct
hyperlinkButton.addActionListener(new ActionListener() { hyperlinkButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
NameJavaScriptGroup nameHyperlinks = jsGroup; NameJavaScriptGroup nameHyperlinks = jsGroup;
pane = DesignerContext.getDesignerFrame().getSelectedJTemplate().getHyperLinkPane(); pane = DesignerContext.getDesignerFrame().getSelectedJTemplate().getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
pane.populate(nameHyperlinks); pane.populate(nameHyperlinks);
dialog = pane.showWindow(SwingUtilities.getWindowAncestor(conditionAttributesPane)); dialog = pane.showWindow(SwingUtilities.getWindowAncestor(conditionAttributesPane));
dialog.addDialogActionListener(new DialogActionAdapter() { dialog.addDialogActionListener(new DialogActionAdapter() {

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

@ -2,6 +2,7 @@ package com.fr.design.mainframe;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.design.fun.MenuHandler; import com.fr.design.fun.MenuHandler;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.FloatSelection;
@ -59,7 +60,10 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (editingTemplate != null && !editingTemplate.isUpMode()) { if (editingTemplate != null && !editingTemplate.isUpMode()) {
// 模板初始化完成后,才能初始化超级链接面板 // 模板初始化完成后,才能初始化超级链接面板
ReportHyperlinkGroupPane.getInstance().populate(ElementCasePaneDelegate.this); // HyperlinkGroupPane hyperlinkGroupPane = ReportHyperlinkGroupPane.getInstance(HyperlinkGroupPaneActionImpl.getInstance());
HyperlinkGroupPane hyperlinkGroupPane = DesignerContext.getDesignerFrame().getSelectedJTemplate()
.getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
hyperlinkGroupPane.populate(ElementCasePaneDelegate.this);
if (((ElementCasePaneDelegate)e.getSource()).getSelection() instanceof FloatSelection) { if (((ElementCasePaneDelegate)e.getSource()).getSelection() instanceof FloatSelection) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT);
// EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance()); // EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
@ -69,7 +73,7 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance()); EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance()); EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance());
} }
EastRegionContainerPane.getInstance().replaceHyperlinkPane(ReportHyperlinkGroupPane.getInstance()); EastRegionContainerPane.getInstance().replaceHyperlinkPane(hyperlinkGroupPane);
EastRegionContainerPane.getInstance().removeParameterPane(); EastRegionContainerPane.getInstance().removeParameterPane();
} }
} }

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

@ -0,0 +1,91 @@
package com.fr.design.mainframe;
import com.fr.base.Style;
import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.designer.TargetComponent;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider;
import com.fr.general.FRFont;
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;
import com.fr.stable.Constants;
import java.awt.*;
/**
* Created by plough on 2017/7/26.
*/
public class HyperlinkGroupPaneActionImpl implements HyperlinkGroupPaneActionProvider {
private static HyperlinkGroupPaneActionProvider instance;
private HyperlinkGroupPaneActionImpl() {
}
public static HyperlinkGroupPaneActionProvider getInstance() {
if (instance == null) {
instance = new HyperlinkGroupPaneActionImpl();
}
return instance;
}
@Override
public void populate(HyperlinkGroupPane hyperlinkGroupPane, TargetComponent elementCasePane) {
ElementCasePane reportPane = (ElementCasePane)elementCasePane;
final TemplateElementCase report = reportPane.getEditingElementCase();
NameJavaScriptGroup nameHyperlinks = getNameJSGroup(reportPane, report);
hyperlinkGroupPane.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;
}
@Override
public void saveSettings(HyperlinkGroupPane hyperlinkGroupPane) {
TargetComponent tc = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getCurrentElementCasePane();
if (tc == null) {
return;
}
ElementCasePane reportPane = (ElementCasePane)tc;
final TemplateElementCase report = reportPane.getEditingElementCase();
final Selection sel = reportPane.getSelection();
final NameJavaScriptGroup updateNameHyperlinks = hyperlinkGroupPane.updateJSGroup();
if (sel instanceof FloatSelection) {
FloatElement selectedFloatElement = report.getFloatElement(((FloatSelection)sel).getSelectedFloatName());
selectedFloatElement.setNameHyperlinkGroup(updateNameHyperlinks);
} else {
ReportActionUtils.actionIterateWithCellSelection((CellSelection)sel, report, new ReportActionUtils.IterAction() {
public void dealWith(CellElement editCellElement) {
Style elementStyle = editCellElement.getStyle();
FRFont frFont = elementStyle.getFRFont();
if (updateNameHyperlinks.size() > 0) {
frFont = frFont.applyForeground(Color.blue);
frFont = frFont.applyUnderline(Constants.LINE_THIN);
} else {
frFont = frFont.applyForeground(Color.black);
frFont = frFont.applyUnderline(Constants.LINE_NONE);
}
editCellElement.setStyle(elementStyle.deriveFRFont(frFont));
editCellElement.setNameHyperlinkGroup(updateNameHyperlinks);
}
});
}
}
}

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

@ -22,6 +22,7 @@ import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.file.MutilTempalteTabPane; import com.fr.design.file.MutilTempalteTabPane;
import com.fr.design.fun.PreviewProvider; import com.fr.design.fun.PreviewProvider;
import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icontainer.UIModeControlContainer; import com.fr.design.gui.icontainer.UIModeControlContainer;
import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIMenuItem;
@ -113,6 +114,11 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
EastRegionContainerPane.getInstance().replaceCellAttrPane(getEastDownPane()); EastRegionContainerPane.getInstance().replaceCellAttrPane(getEastDownPane());
} }
@Override
public TargetComponent getCurrentElementCasePane() {
return getEditingElementCasePane();
}
@Override @Override
protected UIModeControlContainer createCenterPane() { protected UIModeControlContainer createCenterPane() {
parameterPane = ModuleContext.isModuleStarted(Module.FORM_MODULE) ? new ParameterDefinitePane() : null; parameterPane = ModuleContext.isModuleStarted(Module.FORM_MODULE) ? new ParameterDefinitePane() : null;
@ -825,8 +831,8 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
} }
@Override @Override
public HyperlinkGroupPane getHyperLinkPane() { public HyperlinkGroupPane getHyperLinkPane(HyperlinkGroupPaneActionProvider hyperlinkGroupPaneActionProvider) {
return ReportHyperlinkGroupPane.getInstance(); return ReportHyperlinkGroupPane.getInstance(hyperlinkGroupPaneActionProvider);
} }
public void setAuthorityMode(boolean isUpMode) { public void setAuthorityMode(boolean isUpMode) {

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

@ -4,6 +4,7 @@ import com.fr.base.Style;
import com.fr.design.actions.utils.ReportActionUtils; import com.fr.design.actions.utils.ReportActionUtils;
import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.FloatSelection;
@ -22,13 +23,13 @@ import java.awt.*;
public class ReportHyperlinkGroupPane extends HyperlinkGroupPane { public class ReportHyperlinkGroupPane extends HyperlinkGroupPane {
private static ReportHyperlinkGroupPane singleton; private static ReportHyperlinkGroupPane singleton;
private ReportHyperlinkGroupPane() { private ReportHyperlinkGroupPane(HyperlinkGroupPaneActionProvider hyperlinkGroupPaneActionProvider) {
super(); super(hyperlinkGroupPaneActionProvider);
} }
public synchronized static ReportHyperlinkGroupPane getInstance() { public synchronized static ReportHyperlinkGroupPane getInstance(HyperlinkGroupPaneActionProvider hyperlinkGroupPaneActionProvider) {
if (singleton == null) { if (singleton == null) {
singleton = new ReportHyperlinkGroupPane(); singleton = new ReportHyperlinkGroupPane(hyperlinkGroupPaneActionProvider);
} }
singleton.refreshPane(); singleton.refreshPane();
return singleton; return singleton;
@ -39,62 +40,6 @@ public class ReportHyperlinkGroupPane extends HyperlinkGroupPane {
if (reportPane == null) { if (reportPane == null) {
return; return;
} }
// populate(reportPane);
final TemplateElementCase report = reportPane.getEditingElementCase();
NameJavaScriptGroup nameHyperlinks = getNameJSGroup(reportPane, report);
populate(nameHyperlinks);
}
public void populate(ElementCasePane reportPane) {
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;
}
@Override
public void saveSettings() {
ElementCasePane reportPane = ((JWorkBook)HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()).getEditingElementCasePane();
if (reportPane == null) {
return;
}
final TemplateElementCase report = reportPane.getEditingElementCase();
final Selection sel = reportPane.getSelection();
final NameJavaScriptGroup updateNameHyperlinks = updateJSGroup();
if (sel instanceof FloatSelection) {
FloatElement selectedFloatElement = report.getFloatElement(((FloatSelection)sel).getSelectedFloatName());
selectedFloatElement.setNameHyperlinkGroup(updateNameHyperlinks);
} else {
ReportActionUtils.actionIterateWithCellSelection((CellSelection)sel, report, new ReportActionUtils.IterAction() {
public void dealWith(CellElement editCellElement) {
Style elementStyle = editCellElement.getStyle();
FRFont frFont = elementStyle.getFRFont();
if (updateNameHyperlinks.size() > 0) {
frFont = frFont.applyForeground(Color.blue);
frFont = frFont.applyUnderline(Constants.LINE_THIN);
} else {
frFont = frFont.applyForeground(Color.black);
frFont = frFont.applyUnderline(Constants.LINE_NONE);
}
editCellElement.setStyle(elementStyle.deriveFRFont(frFont));
editCellElement.setNameHyperlinkGroup(updateNameHyperlinks);
}
});
}
} }
} }

9
designer/src/com/fr/design/mainframe/form/FormElementCaseDesigner.java

@ -22,10 +22,7 @@ import com.fr.design.designer.TargetComponent;
import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener; import com.fr.design.event.TargetModifiedListener;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.AuthorityEditPane; import com.fr.design.mainframe.*;
import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.mainframe.ElementCasePaneAuthorityEditPane;
import com.fr.design.mainframe.JWorkBook;
import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus; import com.fr.design.mainframe.toolbar.ToolBarMenuDockPlus;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.NameSeparator; import com.fr.design.menu.NameSeparator;
@ -225,6 +222,10 @@ public class FormElementCaseDesigner<T extends FormElementCaseProvider, E extend
return elementCasePane.getEastDownPane(); return elementCasePane.getEastDownPane();
} }
public JPanel getHyperlinkPane() {
return DesignerContext.getDesignerFrame().getSelectedJTemplate().getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
}
public S getSelection() { public S getSelection() {
return (S) elementCasePane.getSelection(); return (S) elementCasePane.getSelection();

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

@ -11,14 +11,17 @@ import com.fr.design.actions.form.FormECColumnsAction;
import com.fr.design.actions.form.FormECFrozenAction; import com.fr.design.actions.form.FormECFrozenAction;
import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener; import com.fr.design.event.TargetModifiedListener;
import com.fr.design.mainframe.CellElementPropertyPane; import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.mainframe.*;
import com.fr.design.mainframe.cell.QuickEditorRegion; import com.fr.design.mainframe.cell.QuickEditorRegion;
import com.fr.design.menu.KeySetUtils; import com.fr.design.menu.KeySetUtils;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
import com.fr.js.NameJavaScriptGroup;
import com.fr.page.ReportSettingsProvider; import com.fr.page.ReportSettingsProvider;
import com.fr.report.elementcase.TemplateElementCase;
import com.fr.report.worksheet.FormElementCase; import com.fr.report.worksheet.FormElementCase;
import com.fr.design.selection.SelectionEvent; import com.fr.design.selection.SelectionEvent;
import com.fr.design.selection.SelectionListener; import com.fr.design.selection.SelectionListener;
@ -34,6 +37,12 @@ public class FormElementCasePaneDelegate extends ElementCasePane<FormElementCase
public void selectionChanged(SelectionEvent e) { public void selectionChanged(SelectionEvent e) {
CellElementPropertyPane.getInstance().populate(FormElementCasePaneDelegate.this); CellElementPropertyPane.getInstance().populate(FormElementCasePaneDelegate.this);
QuickEditorRegion.getInstance().populate(getCurrentEditor()); QuickEditorRegion.getInstance().populate(getCurrentEditor());
HyperlinkGroupPane hyperlinkGroupPane = DesignerContext.getDesignerFrame().getSelectedJTemplate().
getHyperLinkPane(HyperlinkGroupPaneActionImpl.getInstance());
hyperlinkGroupPane.populate(FormElementCasePaneDelegate.this);
// populateHyperLinkGroupPane();
} }
}); });
this.addTargetModifiedListener(new TargetModifiedListener() { this.addTargetModifiedListener(new TargetModifiedListener() {
@ -44,6 +53,12 @@ public class FormElementCasePaneDelegate extends ElementCasePane<FormElementCase
}); });
} }
// private void populateHyperLinkGroupPane() {
// final TemplateElementCase report = this.getEditingElementCase();
// NameJavaScriptGroup nameHyperlinks = ReportHyperlinkGroupPane.getNameJSGroup(this, report);
// HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getHyperLinkPane().populate(nameHyperlinks);
// }
@Override @Override
protected boolean supportRepeatedHeaderFooter() { protected boolean supportRepeatedHeaderFooter() {
return true; return true;

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

@ -1,6 +1,7 @@
package com.fr.design.gui.frpane; package com.fr.design.gui.frpane;
import com.fr.design.ExtraDesignClassManager; import com.fr.design.ExtraDesignClassManager;
import com.fr.design.designer.TargetComponent;
import com.fr.design.fun.HyperlinkProvider; import com.fr.design.fun.HyperlinkProvider;
import com.fr.design.gui.controlpane.JListControlPane; import com.fr.design.gui.controlpane.JListControlPane;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
@ -26,6 +27,12 @@ import java.util.Set;
* @version 创建时间2013-6-25 上午11:17:57 * @version 创建时间2013-6-25 上午11:17:57
*/ */
public abstract class HyperlinkGroupPane extends UIListControlPane { public abstract class HyperlinkGroupPane extends UIListControlPane {
protected HyperlinkGroupPaneActionProvider hyperlinkGroupPaneActionProvider;
public HyperlinkGroupPane(HyperlinkGroupPaneActionProvider hyperlinkGroupPaneActionProvider) {
super();
this.hyperlinkGroupPaneActionProvider = hyperlinkGroupPaneActionProvider;
}
/** /**
* 生成添加按钮的NameableCreator * 生成添加按钮的NameableCreator
* *
@ -70,6 +77,10 @@ public abstract class HyperlinkGroupPane extends UIListControlPane {
this.populate(list.toArray(new NameObject[list.size()])); this.populate(list.toArray(new NameObject[list.size()]));
} }
public void populate(TargetComponent elementCasePane) {
hyperlinkGroupPaneActionProvider.populate(this, elementCasePane);
}
/** /**
* updateJs的Group * updateJs的Group
* *
@ -85,4 +96,9 @@ public abstract class HyperlinkGroupPane extends UIListControlPane {
return new NameJavaScriptGroup(res_array); return new NameJavaScriptGroup(res_array);
} }
@Override
public void saveSettings() {
hyperlinkGroupPaneActionProvider.saveSettings(this);
}
} }

11
designer_base/src/com/fr/design/gui/frpane/HyperlinkGroupPaneActionProvider.java

@ -0,0 +1,11 @@
package com.fr.design.gui.frpane;
import com.fr.design.designer.TargetComponent;
/**
* Created by plough on 2017/7/26.
*/
public interface HyperlinkGroupPaneActionProvider {
void populate(HyperlinkGroupPane hyperlinkGroupPane, TargetComponent elementCasePane);
void saveSettings(HyperlinkGroupPane hyperlinkGroupPane);
}

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

@ -20,6 +20,7 @@ import com.fr.design.fun.DesignerFrameUpButtonProvider;
import com.fr.design.fun.MenuHandler; import com.fr.design.fun.MenuHandler;
import com.fr.design.fun.PreviewProvider; import com.fr.design.fun.PreviewProvider;
import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.itree.filetree.TemplateFileTree; import com.fr.design.gui.itree.filetree.TemplateFileTree;
@ -111,6 +112,8 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
// 刷新右侧属性面板 // 刷新右侧属性面板
public abstract void refreshEastPropertiesPane(); public abstract void refreshEastPropertiesPane();
public abstract TargetComponent getCurrentElementCasePane();
// 为收集模版信息作准备 // 为收集模版信息作准备
private void initForCollect() { private void initForCollect() {
template.initTemplateID(); // 为新模板设置 templateID 属性 template.initTemplateID(); // 为新模板设置 templateID 属性
@ -882,7 +885,7 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
* 返回当前支持的超链界面pane * 返回当前支持的超链界面pane
* @return 超链连接界面 * @return 超链连接界面
*/ */
public abstract HyperlinkGroupPane getHyperLinkPane(); public abstract HyperlinkGroupPane getHyperLinkPane(HyperlinkGroupPaneActionProvider hyperlinkGroupPaneActionProvider);
/** /**
* 是否是图表 * 是否是图表

13
designer_base/src/com/fr/design/mainframe/form/FormECDesignerProvider.java

@ -5,6 +5,7 @@ import java.awt.image.BufferedImage;
import javax.swing.JComponent; import javax.swing.JComponent;
import com.fr.design.designer.TargetComponent;
import com.fr.design.menu.MenuDef; import com.fr.design.menu.MenuDef;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.menu.ToolBarDef; import com.fr.design.menu.ToolBarDef;
@ -61,6 +62,18 @@ public interface FormECDesignerProvider {
*/ */
public JComponent getEastUpPane(); public JComponent getEastUpPane();
/**
* 超级链接面板
* @return 属性面板
*/
public JComponent getHyperlinkPane();
/**
* 超级链接面板
* @return 属性面板
*/
public TargetComponent getEditingElementCasePane();
/** /**
* 获取当前ElementCase的缩略图 * 获取当前ElementCase的缩略图
* @param elementCaseContainerSize 缩略图的大小 * @param elementCaseContainerSize 缩略图的大小

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

@ -4,6 +4,7 @@ import com.fr.design.gui.controlpane.NameObjectCreator;
import com.fr.design.gui.controlpane.NameableCreator; import com.fr.design.gui.controlpane.NameableCreator;
import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.form.javascript.FormEmailPane; import com.fr.design.form.javascript.FormEmailPane;
import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.js.EmailJavaScript; import com.fr.js.EmailJavaScript;
@ -11,13 +12,13 @@ import com.fr.js.EmailJavaScript;
public class FormHyperlinkGroupPane extends HyperlinkGroupPane{ public class FormHyperlinkGroupPane extends HyperlinkGroupPane{
private static FormHyperlinkGroupPane singleton; private static FormHyperlinkGroupPane singleton;
private FormHyperlinkGroupPane() { private FormHyperlinkGroupPane(HyperlinkGroupPaneActionProvider hyperlinkGroupPaneActionProvider) {
super(); super(hyperlinkGroupPaneActionProvider);
} }
public synchronized static FormHyperlinkGroupPane getInstance() { public synchronized static FormHyperlinkGroupPane getInstance(HyperlinkGroupPaneActionProvider hyperlinkGroupPaneActionProvider) {
if (singleton == null) { if (singleton == null) {
singleton = new FormHyperlinkGroupPane(); singleton = new FormHyperlinkGroupPane(hyperlinkGroupPaneActionProvider);
} }
return singleton; return singleton;
} }
@ -38,9 +39,4 @@ public class FormHyperlinkGroupPane extends HyperlinkGroupPane{
} }
return creators; return creators;
} }
@Override
public void saveSettings() {
}
} }

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

@ -6,6 +6,7 @@ import com.fr.design.actions.core.WorkBookSupportable;
import com.fr.design.actions.file.WebPreviewUtils; import com.fr.design.actions.file.WebPreviewUtils;
import com.fr.design.cell.FloatElementsProvider; import com.fr.design.cell.FloatElementsProvider;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.designer.TargetComponent;
import com.fr.design.designer.beans.actions.CopyAction; import com.fr.design.designer.beans.actions.CopyAction;
import com.fr.design.designer.beans.actions.CutAction; import com.fr.design.designer.beans.actions.CutAction;
import com.fr.design.designer.beans.actions.FormDeleteAction; import com.fr.design.designer.beans.actions.FormDeleteAction;
@ -17,6 +18,7 @@ import com.fr.design.designer.properties.FormWidgetAuthorityEditPane;
import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedEvent;
import com.fr.design.event.TargetModifiedListener; import com.fr.design.event.TargetModifiedListener;
import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.gui.frpane.HyperlinkGroupPane;
import com.fr.design.gui.frpane.HyperlinkGroupPaneActionProvider;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.xpane.FormHyperlinkGroupPane; import com.fr.design.gui.xpane.FormHyperlinkGroupPane;
@ -92,6 +94,11 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
public void refreshEastPropertiesPane() { public void refreshEastPropertiesPane() {
} }
@Override
public TargetComponent getCurrentElementCasePane() {
return elementCaseDesign.getEditingElementCasePane();
}
public int getMenuState() { public int getMenuState() {
return DesignState.JFORM; return DesignState.JFORM;
@ -137,8 +144,8 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
* *
* @return 超链连接界面 * @return 超链连接界面
*/ */
public HyperlinkGroupPane getHyperLinkPane() { public HyperlinkGroupPane getHyperLinkPane(HyperlinkGroupPaneActionProvider hyperlinkGroupPaneActionProvider) {
return FormHyperlinkGroupPane.getInstance(); return FormHyperlinkGroupPane.getInstance(hyperlinkGroupPaneActionProvider);
} }
//表单返回 FORM_TAB or ELEMENTCASE_TAB //表单返回 FORM_TAB or ELEMENTCASE_TAB
@ -653,6 +660,7 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
EastRegionContainerPane.getInstance().removeParameterPane(); EastRegionContainerPane.getInstance().removeParameterPane();
EastRegionContainerPane.getInstance().replaceCellAttrPane(elementCaseDesign.getEastDownPane()); EastRegionContainerPane.getInstance().replaceCellAttrPane(elementCaseDesign.getEastDownPane());
EastRegionContainerPane.getInstance().replaceCellElementPane(elementCaseDesign.getEastUpPane()); EastRegionContainerPane.getInstance().replaceCellElementPane(elementCaseDesign.getEastUpPane());
EastRegionContainerPane.getInstance().replaceHyperlinkPane(elementCaseDesign.getHyperlinkPane());
return; return;
} }
} }

Loading…
Cancel
Save