public IconButton(Icon[] icons) { this.icons = icons; super.setBorder(emptyBorder); setState(UP); setContentAreaFilled(false); addMouseListener(this); }
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())})); }
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); }
private void setState(int state) { this.state = state; super.setIcon(icons[state]); }
public void setIcons(Icon[] icons) { this.icons = icons; super.setIcon(this.icons[state]); }