Browse Source

REPORT-11394 二次选择某些场景下可能删除失败

final/10.0
yaoh.wu 6 years ago
parent
commit
28b56fd047
  1. 22
      designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java

22
designer-base/src/main/java/com/fr/design/remote/ui/AuthorityListControlPane.java

@ -253,23 +253,17 @@ public class AuthorityListControlPane extends BasicPane {
* @param authorities authority * @param authorities authority
*/ */
public void setAuthority(List<DesignAuthority> authorities) { public void setAuthority(List<DesignAuthority> authorities) {
if (authorities == null || authorities.isEmpty()) {
return;
}
DefaultListModel<DesignAuthority> model = (DefaultListModel<DesignAuthority>) authorityList.getModel(); DefaultListModel<DesignAuthority> model = (DefaultListModel<DesignAuthority>) authorityList.getModel();
model.clear(); model.clear();
if (authorities != null && !authorities.isEmpty()) {
for (DesignAuthority authority : authorities) { model.clear();
model.addElement(authority); for (DesignAuthority authority : authorities) {
model.addElement(authority);
}
int size = model.getSize() - 1;
authorityList.setSelectedIndex(size);
authorityList.ensureIndexIsVisible(size);
} }
int size = model.getSize() - 1;
authorityList.setSelectedIndex(size);
authorityList.ensureIndexIsVisible(size);
authorityList.revalidate(); authorityList.revalidate();
authorityList.repaint(); authorityList.repaint();
} }

Loading…
Cancel
Save