|
|
@ -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(); |
|
|
|
} |
|
|
|
} |
|
|
|