|
|
|
@ -20,6 +20,7 @@ import com.fr.form.ui.*;
|
|
|
|
|
import com.fr.general.ComparatorUtils; |
|
|
|
|
|
|
|
|
|
import com.fr.stable.ArrayUtils; |
|
|
|
|
import com.fr.stable.AssistUtils; |
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
|
import javax.swing.event.PopupMenuEvent; |
|
|
|
@ -274,9 +275,12 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
|
|
|
|
|
@Override |
|
|
|
|
public void popupMenuWillBecomeVisible(PopupMenuEvent e) { |
|
|
|
|
// 下拉刷新下列表
|
|
|
|
|
Object selectedItem = getSelectedItem(); |
|
|
|
|
setModel(new DefaultComboBoxModel(getWidgetsName(userDefined))); |
|
|
|
|
setSelectedItem(selectedItem); |
|
|
|
|
Vector<Item> widgetsName = getWidgetsName(userDefined); |
|
|
|
|
if (modelChanged(widgetsName)) { |
|
|
|
|
Object selectedItem = getSelectedItem(); |
|
|
|
|
setModel(new DefaultComboBoxModel<>(widgetsName)); |
|
|
|
|
setSelectedItem(selectedItem); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -290,6 +294,20 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener
|
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean modelChanged(Vector<Item> widgetsName) { |
|
|
|
|
DefaultComboBoxModel model = (DefaultComboBoxModel) getModel(); |
|
|
|
|
int modelSize = model.getSize(); |
|
|
|
|
if (modelSize != widgetsName.size()) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
for (int i = 0; i < modelSize; i++) { |
|
|
|
|
if (!AssistUtils.equals(model.getElementAt(i), widgetsName.elementAt(i))) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|