From b07d610c66248eb73f0b60ea9509cb41160e4c8f Mon Sep 17 00:00:00 2001 From: plough Date: Thu, 17 Aug 2017 14:05:05 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E5=85=A5=E5=8F=A3?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=3D>=E8=B6=85=E7=BA=A7=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/actions/edit/HyperlinkAction.java | 29 +++++++++++++++++++ .../cell/editor/AbstractCellEditor.java | 2 ++ .../mainframe/ElementCasePaneDelegate.java | 3 +- .../com/fr/grid/selection/CellSelection.java | 2 ++ .../com/fr/grid/selection/FloatSelection.java | 7 ++--- .../src/com/fr/poly/creator/ECBlockPane.java | 2 ++ 6 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 designer/src/com/fr/design/actions/edit/HyperlinkAction.java diff --git a/designer/src/com/fr/design/actions/edit/HyperlinkAction.java b/designer/src/com/fr/design/actions/edit/HyperlinkAction.java new file mode 100644 index 0000000000..2fcc46901f --- /dev/null +++ b/designer/src/com/fr/design/actions/edit/HyperlinkAction.java @@ -0,0 +1,29 @@ +/* + * Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved. + */ +package com.fr.design.actions.edit; + +import com.fr.base.BaseUtils; +import com.fr.design.actions.UpdateAction; +import com.fr.design.mainframe.EastRegionContainerPane; +import com.fr.design.menu.KeySetUtils; + +import java.awt.event.ActionEvent; + +/** + * HyperlinkAction. + */ +public class HyperlinkAction extends UpdateAction { + + public HyperlinkAction() { + this.setMenuKeySet(KeySetUtils.HYPER_LINK); + this.setName(getMenuKeySet().getMenuKeySetName() + "..."); + this.setMnemonic(getMenuKeySet().getMnemonic()); + this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_insert/hyperLink.png")); + } + + @Override + public void actionPerformed(ActionEvent e) { + EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_HYPERLINK); + } +} \ No newline at end of file diff --git a/designer/src/com/fr/design/cell/editor/AbstractCellEditor.java b/designer/src/com/fr/design/cell/editor/AbstractCellEditor.java index cc9c43564a..33e29c1f65 100644 --- a/designer/src/com/fr/design/cell/editor/AbstractCellEditor.java +++ b/designer/src/com/fr/design/cell/editor/AbstractCellEditor.java @@ -7,6 +7,7 @@ import java.awt.Point; import javax.swing.event.EventListenerList; +import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.grid.event.CellEditorEvent; import com.fr.grid.event.CellEditorListener; @@ -114,6 +115,7 @@ public abstract class AbstractCellEditor implements CellEditor { } if(ePane != null) { ePane.fireSelectionChangeListener(); + EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_CELL_ELEMENT); } } diff --git a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java index 283425f6bc..b50505c987 100644 --- a/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java +++ b/designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe; import com.fr.base.BaseUtils; +import com.fr.design.actions.edit.HyperlinkAction; import com.fr.design.fun.MenuHandler; import com.fr.design.gui.frpane.HyperlinkGroupPane; import com.fr.design.menu.KeySetUtils; @@ -174,7 +175,7 @@ public class ElementCasePaneDelegate extends ElementCasePane { // 单元格形态 menuDef.addShortCut(DeprecatedActionManager.getPresentMenu(this)); - + menuDef.addShortCut(new HyperlinkAction()); menuDef.addShortCut(SeparatorDef.DEFAULT); menuDef.addShortCut(new MergeCellAction(this)); menuDef.addShortCut(new UnmergeCellAction(this)); diff --git a/designer/src/com/fr/grid/selection/CellSelection.java b/designer/src/com/fr/grid/selection/CellSelection.java index 634dab7041..02c40e11fc 100644 --- a/designer/src/com/fr/grid/selection/CellSelection.java +++ b/designer/src/com/fr/grid/selection/CellSelection.java @@ -8,6 +8,7 @@ import com.fr.design.actions.cell.GlobalStyleMenuDef.GlobalStyleSelection; import com.fr.design.actions.core.ActionFactory; import com.fr.design.actions.edit.CopyAction; import com.fr.design.actions.edit.CutAction; +import com.fr.design.actions.edit.HyperlinkAction; import com.fr.design.actions.edit.PasteAction; import com.fr.design.actions.utils.DeprecatedActionManager; import com.fr.design.cell.clipboard.CellElementsClip; @@ -461,6 +462,7 @@ public class CellSelection extends Selection { popup.add(new CellExpandAttrAction().createMenuItem()); popup.add(DeprecatedActionManager.getPresentMenu(ePane).createJMenu()); popup.add(new CellAttributeAction().createMenuItem()); + popup.add(new HyperlinkAction().createMenuItem()); // cut, copy and paste popup.addSeparator(); popup.add(new CutAction(ePane).createMenuItem()); diff --git a/designer/src/com/fr/grid/selection/FloatSelection.java b/designer/src/com/fr/grid/selection/FloatSelection.java index 214e82e09f..de44152f77 100644 --- a/designer/src/com/fr/grid/selection/FloatSelection.java +++ b/designer/src/com/fr/grid/selection/FloatSelection.java @@ -9,11 +9,7 @@ import com.fr.base.FRContext; import com.fr.design.actions.cell.CleanAuthorityAction; import com.fr.design.actions.cell.FloatStyleAction; import com.fr.design.actions.core.ActionFactory; -import com.fr.design.actions.edit.CopyAction; -import com.fr.design.actions.edit.CutAction; -import com.fr.design.actions.edit.DeleteAction; -import com.fr.design.actions.edit.EditFloatElementNameAction; -import com.fr.design.actions.edit.PasteAction; +import com.fr.design.actions.edit.*; import com.fr.design.actions.utils.DeprecatedActionManager; import com.fr.design.cell.clipboard.CellElementsClip; import com.fr.design.cell.clipboard.ElementsTransferable; @@ -125,6 +121,7 @@ public class FloatSelection extends Selection { } popup.add(DeprecatedActionManager.getCellMenu(ePane).createJMenu()); popup.add(new FloatStyleAction(ePane).createMenuItem()); + popup.add(new HyperlinkAction().createMenuItem()); // cut, copy and paste popup.addSeparator(); diff --git a/designer/src/com/fr/poly/creator/ECBlockPane.java b/designer/src/com/fr/poly/creator/ECBlockPane.java index 78f9b31995..65e7d01343 100644 --- a/designer/src/com/fr/poly/creator/ECBlockPane.java +++ b/designer/src/com/fr/poly/creator/ECBlockPane.java @@ -4,6 +4,7 @@ package com.fr.poly.creator; import com.fr.base.BaseUtils; +import com.fr.design.actions.edit.HyperlinkAction; import com.fr.design.menu.KeySetUtils; import com.fr.general.Inter; import com.fr.page.ReportSettingsProvider; @@ -148,6 +149,7 @@ public class ECBlockPane extends PolyElementCasePane { // 单元格形态 menuDef.addShortCut(DeprecatedActionManager.getPresentMenu(this)); + menuDef.addShortCut(new HyperlinkAction()); menuDef.addShortCut(SeparatorDef.DEFAULT); menuDef.addShortCut(new MergeCellAction(this)); menuDef.addShortCut(new UnmergeCellAction(this));