Browse Source

REPORT-1095 超链平台内打开插件卸载后设计这边会看到fs_self这样的字符串,打开方式是枚举的,不需要最后的else的。修改一下

master
zack 8 years ago
parent
commit
48ce799613
  1. 12
      designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java
  2. 14
      designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java

12
designer_base/src/com/fr/design/hyperlink/AbstractHyperlinkPane.java

@ -115,17 +115,7 @@ public abstract class AbstractHyperlinkPane<T extends Hyperlink> extends BasicBe
@Override @Override
public void populateBean(T link) { public void populateBean(T link) {
String name = link.getTargetFrame(); String name = link.getTargetFrame();
if ("_self".equals(name)) { targetFrameComboBox.setSelectedIndex(HyperlinkTargetFrame.convert(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);
}
heightTextFiled.setText(String.valueOf(link.getHeight() == 0 ? DEFAULT_H_VALUE : link.getHeight())); heightTextFiled.setText(String.valueOf(link.getHeight() == 0 ? DEFAULT_H_VALUE : link.getHeight()));
widthTextFiled.setText(String.valueOf(link.getWidth() == 0 ? DEFAULT_V_VALUE : link.getWidth())); widthTextFiled.setText(String.valueOf(link.getWidth() == 0 ? DEFAULT_V_VALUE : link.getWidth()));
populateSubHyperlinkBean(link); populateSubHyperlinkBean(link);

14
designer_base/src/com/fr/design/hyperlink/HyperlinkTargetFrame.java

@ -1,5 +1,7 @@
package com.fr.design.hyperlink; package com.fr.design.hyperlink;
import com.fr.general.ComparatorUtils;
/** /**
* Created by ibm on 2016/10/13. * Created by ibm on 2016/10/13.
*/ */
@ -27,6 +29,18 @@ public enum HyperlinkTargetFrame {
return BLANK_FRAME; 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() { public int getIndex() {
return index; return index;

Loading…
Cancel
Save