예제 #1
0
 private void configure(Object value) {
   this.separator = (SeparatorList.Separator<Issue>) value;
   Issue issue = separator.first();
   if (issue == null) return; // handle 'late' rendering calls after this separator is invalid
   expandButton.setIcon(separator.getLimit() == 0 ? EXPANDED_ICON : COLLAPSED_ICON);
   nameLabel.setText(
       nameFormat.format(new Object[] {issue.getSubcomponent(), new Integer(separator.size())}));
 }
예제 #2
0
 public void actionPerformed(ActionEvent e) {
   final Lock writeLock = separatorList.getReadWriteLock().writeLock();
   writeLock.lock();
   boolean collapsed;
   try {
     collapsed = separator.getLimit() == 0;
     separator.setLimit(collapsed ? Integer.MAX_VALUE : 0);
   } finally {
     writeLock.unlock();
   }
   expandButton.setIcon(collapsed ? COLLAPSED_ICON : EXPANDED_ICON);
 }