Browse Source

REPORT-83302 设置项弹窗打开后再次编辑的内容无法实时显示在可选项里

release/11.0
Destiny.Lin 2 years ago
parent
commit
35a6960a47
  1. 41
      designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java

41
designer-realize/src/main/java/com/fr/design/actions/replace/ui/ITReplaceNorthPanel.java

@ -20,6 +20,8 @@ import javax.swing.Icon;
import javax.swing.JCheckBox;
import javax.swing.JPanel;
import javax.swing.ScrollPaneConstants;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import java.awt.CardLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
@ -317,6 +319,45 @@ public class ITReplaceNorthPanel {
refreshExtraComboBox(replaceSettingInputComboBox, replaceExtraSettingComboBox);
}
});
initInputComboBoxPopupListener(findSettingInputComboBox);
initInputComboBoxPopupListener(replaceSettingInputComboBox);
}
private void initInputComboBoxPopupListener(UIComboBox box) {
box.addPopupMenuListener(new PopupMenuListener() {
@Override
public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
String str = GeneralUtils.objectToString(findSettingComboBox.getSelectedItem());
int findExtraIndex = findExtraSettingComboBox.getSelectedIndex();
int replaceExtraIndex = replaceExtraSettingComboBox.getSelectedIndex();
box.refreshBoxItems(SettingController.getSettingRefreshItems(str));
dealExtraItemSelect(findExtraSettingComboBox, findExtraIndex);
dealExtraItemSelect(replaceExtraSettingComboBox, replaceExtraIndex);
}
@Override
public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
}
@Override
public void popupMenuCanceled(PopupMenuEvent e) {
}
});
}
/**
* 重新设置额外下拉框的选中索引
* @param comboBox 额外下拉框
* @param index 索引
*/
private void dealExtraItemSelect(UIComboBox comboBox, int index) {
if (comboBox.getItemCount() > index) {
comboBox.setSelectedIndex(index);
}
}
/**

Loading…
Cancel
Save