Browse Source

Merge pull request #600 in BA/design from ~ZACK/design:dev to dev

* commit '48ce7996135896ae8965a82065b32512ac3e04cc':
  REPORT-1095 超链平台内打开插件卸载后设计这边会看到fs_self这样的字符串,打开方式是枚举的,不需要最后的else的。修改一下
master
superman 8 years ago
parent
commit
fdfef6ef0a
  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
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);

14
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;

Loading…
Cancel
Save