diff --git a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java index bc5447329..8a2773f58 100644 --- a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java @@ -127,7 +127,7 @@ public abstract class AbstractHyperlinkPane extends BasicBe public void updateBean(T link) { updateSubHyperlinkBean(link); - link.setTargetFrame((String) targetFrameComboBox.getSelectedItem()); + link.setTargetFrame(HyperlinkTargetFrame.parse(targetFrameComboBox.getSelectedIndex()).getName()); link.setHeight(Utils.objectToNumber(heightTextFiled.getText(), false).intValue()); link.setWidth(Utils.objectToNumber(widthTextFiled.getText(), false).intValue()); } diff --git a/designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java b/designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java new file mode 100644 index 000000000..80e9f21a0 --- /dev/null +++ b/designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java @@ -0,0 +1,48 @@ +package com.fr.design.hyperlink; + +/** + * Created by ibm on 2016/10/13. + */ +public enum HyperlinkTargetFrame { + BLANK_FRAME("_blank", 0), DIALOG_FRAME("_dialog", 1), SELF_FRAME("_self", 2); + + private String name; + private int index; + private static HyperlinkTargetFrame[] arrayOfValues; + + HyperlinkTargetFrame(String name, int index) { + this.name = name; + this.index = index; + } + + public static HyperlinkTargetFrame parse(int index) { + if (arrayOfValues == null) { + arrayOfValues = HyperlinkTargetFrame.values(); + } + for (HyperlinkTargetFrame hyperlinkTargetFrame : HyperlinkTargetFrame.values()) { + if (hyperlinkTargetFrame.getIndex() == index) { + return hyperlinkTargetFrame; + } + } + return BLANK_FRAME; + } + + + public int getIndex() { + return index; + } + + public void setIndex(int index) { + this.index = index; + } + + public String getName() { + return name; + + } + + public void setName(String name) { + this.name = name; + } +} +