From 48ce7996135896ae8965a82065b32512ac3e04cc Mon Sep 17 00:00:00 2001 From: zack Date: Fri, 16 Dec 2016 16:02:19 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-1095=20=E8=B6=85=E9=93=BE=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E5=86=85=E6=89=93=E5=BC=80=E6=8F=92=E4=BB=B6=E5=8D=B8?= =?UTF-8?q?=E8=BD=BD=E5=90=8E=E8=AE=BE=E8=AE=A1=E8=BF=99=E8=BE=B9=E4=BC=9A?= =?UTF-8?q?=E7=9C=8B=E5=88=B0fs=5Fself=E8=BF=99=E6=A0=B7=E7=9A=84=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=EF=BC=8C=E6=89=93=E5=BC=80=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E6=98=AF=E6=9E=9A=E4=B8=BE=E7=9A=84,=E4=B8=8D=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E6=9C=80=E5=90=8E=E7=9A=84else=E7=9A=84=E3=80=82?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=B8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/hyperlink/AbstractHyperlinkPane.java | 12 +----------- .../fr/design/hyperlink/HyperlinkTargetFrame.java | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java index 311eaf7d94..43f73b870a 100644 --- a/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java +++ b/designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java @@ -115,17 +115,7 @@ public abstract class AbstractHyperlinkPane extends BasicBe @Override public void populateBean(T link) { String name = link.getTargetFrame(); - if ("_self".equals(name)) { - targetFrameComboBox.setSelectedIndex(SELF); - } else if ("_dialog".equals(name)) { - targetFrameComboBox.setSelectedIndex(DIALOG); - } else if ("_blank".equals(name)) { - targetFrameComboBox.setSelectedIndex(NEW_WINDOW); - } else { - DefaultComboBoxModel model = (DefaultComboBoxModel) targetFrameComboBox.getModel(); - model.addElement(name); - targetFrameComboBox.setSelectedItem(name); - } + targetFrameComboBox.setSelectedIndex(HyperlinkTargetFrame.convert(name)); heightTextFiled.setText(String.valueOf(link.getHeight() == 0 ? DEFAULT_H_VALUE : link.getHeight())); widthTextFiled.setText(String.valueOf(link.getWidth() == 0 ? DEFAULT_V_VALUE : link.getWidth())); populateSubHyperlinkBean(link); diff --git a/designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java b/designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java index 80e9f21a0a..f0b0543a46 100644 --- a/designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java +++ b/designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java @@ -1,5 +1,7 @@ package com.fr.design.hyperlink; +import com.fr.general.ComparatorUtils; + /** * Created by ibm on 2016/10/13. */ @@ -27,6 +29,18 @@ public enum HyperlinkTargetFrame { return BLANK_FRAME; } + public static int convert(String name) { + if (arrayOfValues == null) { + arrayOfValues = HyperlinkTargetFrame.values(); + } + for (HyperlinkTargetFrame hyperlinkTargetFrame : HyperlinkTargetFrame.values()) { + if (ComparatorUtils.equals(hyperlinkTargetFrame.getName(), name)) { + return hyperlinkTargetFrame.getIndex(); + } + } + return BLANK_FRAME.getIndex(); + } + public int getIndex() { return index;