|
|
|
|
@ -81,6 +81,11 @@ public class ContactList
|
|
|
|
|
private final java.util.List<MetaContact> activeContacts
|
|
|
|
|
= new Vector<MetaContact>();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* If set to true prevents groups to be closed or opened using the mouse.
|
|
|
|
|
*/
|
|
|
|
|
private boolean disableOpenClose = false;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Creates an instance of the <tt>ContactList</tt>.
|
|
|
|
|
*
|
|
|
|
|
@ -545,40 +550,46 @@ public void mouseClicked(MouseEvent e)
|
|
|
|
|
}
|
|
|
|
|
else if ((e.getModifiers() & InputEvent.BUTTON1_MASK) != 0)
|
|
|
|
|
{
|
|
|
|
|
if (listModel.isGroupClosed(group))
|
|
|
|
|
listModel.openGroup(group);
|
|
|
|
|
else
|
|
|
|
|
listModel.closeGroup(group);
|
|
|
|
|
if(!disableOpenClose)
|
|
|
|
|
{
|
|
|
|
|
if (listModel.isGroupClosed(group))
|
|
|
|
|
listModel.openGroup(group);
|
|
|
|
|
else
|
|
|
|
|
listModel.closeGroup(group);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fireContactListEvent( group,
|
|
|
|
|
ContactListEvent.GROUP_SELECTED,
|
|
|
|
|
e.getClickCount());
|
|
|
|
|
|
|
|
|
|
// get the component under the mouse
|
|
|
|
|
Component component = this.getHorizontalComponent(renderer,
|
|
|
|
|
translatedX);
|
|
|
|
|
|
|
|
|
|
if (component instanceof JPanel)
|
|
|
|
|
if(!disableOpenClose)
|
|
|
|
|
{
|
|
|
|
|
if (component.getName() != null
|
|
|
|
|
&& component.getName().equals("buttonsPanel"))
|
|
|
|
|
// get the component under the mouse
|
|
|
|
|
Component component = this.getHorizontalComponent(renderer,
|
|
|
|
|
translatedX);
|
|
|
|
|
|
|
|
|
|
if (component instanceof JPanel)
|
|
|
|
|
{
|
|
|
|
|
JPanel panel = (JPanel) component;
|
|
|
|
|
if (component.getName() != null
|
|
|
|
|
&& component.getName().equals("buttonsPanel"))
|
|
|
|
|
{
|
|
|
|
|
JPanel panel = (JPanel) component;
|
|
|
|
|
|
|
|
|
|
int internalX = translatedX
|
|
|
|
|
- (renderer.getWidth() - panel.getWidth() - 2);
|
|
|
|
|
int internalX = translatedX
|
|
|
|
|
- (renderer.getWidth() - panel.getWidth() - 2);
|
|
|
|
|
|
|
|
|
|
Component c = getHorizontalComponent(panel, internalX);
|
|
|
|
|
Component c = getHorizontalComponent(panel, internalX);
|
|
|
|
|
|
|
|
|
|
if (c instanceof JLabel)
|
|
|
|
|
{
|
|
|
|
|
if (listModel.isGroupClosed(group))
|
|
|
|
|
{
|
|
|
|
|
listModel.openGroup(group);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (c instanceof JLabel)
|
|
|
|
|
{
|
|
|
|
|
listModel.closeGroup(group);
|
|
|
|
|
if (listModel.isGroupClosed(group))
|
|
|
|
|
{
|
|
|
|
|
listModel.openGroup(group);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
listModel.closeGroup(group);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -900,6 +911,15 @@ private Component getHorizontalComponent(Container c, int x)
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* If set to true prevents groups to be closed or opened using the mouse.
|
|
|
|
|
* @param disableOpenClose the disableOpenClose to set
|
|
|
|
|
*/
|
|
|
|
|
public void setDisableOpenClose(boolean disableOpenClose)
|
|
|
|
|
{
|
|
|
|
|
this.disableOpenClose = disableOpenClose;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Runs the info window for the specified contact at the appropriate
|
|
|
|
|
* position.
|
|
|
|
|
|