Changes the way action is performed on custom actions for source contacts. Fixes displaying notification source contacts.

cusax-fix
Damian Minkov 14 years ago
parent 9931f4b800
commit 505be00d1d

@ -225,33 +225,11 @@ private void initCustomActionButtons()
actionButton.addActionListener(new ActionListener()
{
public void actionPerformed(ActionEvent e)
public void actionPerformed(ActionEvent event)
{
List<UIContactDetail> contactDetails
= SourceUIContact.getContactDetails(
customActionContact);
contactDetails.add(
new SourceUIContact.SourceContactDetail(
customActionContact.getDisplayName(),
customActionContact));
UIContactDetailCustomAction contactAction
= new UIContactDetailCustomAction(ca);
if (contactDetails.size() > 1)
try
{
ChooseUIContactDetailPopupMenu
detailsPopupMenu
= new ChooseUIContactDetailPopupMenu(
(JButton) e.getSource(),
contactDetails,
contactAction);
detailsPopupMenu.showPopupMenu();
}
else if (contactDetails.size() == 1)
{
JButton button = (JButton) e.getSource();
JButton button = (JButton)event.getSource();
Point location = new Point(button.getX(),
button.getY() + button.getHeight());
@ -266,11 +244,18 @@ else if (contactDetails.size() == 1)
+ contactListTree.getPathBounds(
selectionPath).y;
contactAction.actionPerformed(
contactDetails.get(0),
ca.actionPerformed(
customActionContact,
location.x,
location.y);
}
catch (OperationFailedException e)
{
new ErrorDialog(null,
GuiActivator.getResources()
.getI18NString("service.gui.ERROR"),
e.getMessage());
}
}
});
@ -465,44 +450,4 @@ public JPopupMenu getRightButtonMenu()
return null;
}
}
/**
* An implementation of <tt>UIContactDetail</tt> for a custom action.
*/
private static class UIContactDetailCustomAction
implements UIContactDetailAction
{
/**
* The contact action.
*/
private final ContactAction<SourceContact> contactAction;
/**
* Creates an instance of <tt>UIContactDetailCustomAction</tt>.
*/
public UIContactDetailCustomAction(
ContactAction<SourceContact> contactAction)
{
this.contactAction = contactAction;
}
/**
* Performs the action on button click.
*/
public void actionPerformed(UIContactDetail contactDetail, int x, int y)
{
try
{
contactAction.actionPerformed(
(SourceContact) contactDetail.getDescriptor(), x, y);
}
catch (OperationFailedException e)
{
new ErrorDialog(null,
GuiActivator.getResources()
.getI18NString("service.gui.ERROR"),
e.getMessage());
}
}
}
}

@ -32,7 +32,7 @@
* @author Yana Stamcheva
*/
public class NotificationContact
extends UIContact
extends UIContactImpl
implements RegistrationStateChangeListener,
ProviderPresenceStatusListener
{

@ -25,7 +25,7 @@
* @author Yana Stamcheva
*/
public class NotificationGroup
extends UIGroup
extends UIGroupImpl
{
/**
* The type of the notification message, identifying this group.

Loading…
Cancel
Save