IRoster roster = rosterEntry.getRoster();
IContainer container = (IContainer) roster.getPresenceContainerAdapter().getAdapter(IContainer.class);
if (container.getConnectedID() == null)
showErrorMessage("not connected.");
SelectionShare sender = ECFContribution.getDefault().getStringShare(container.getID());
if (sender == null)
showErrorMessage("no sender.");
// currently share anyway to be able do do better debugging
// if (sender.isSharing())
// showErrorMessage("sharing already started.");
// final ITextEditor textEditor = getTextEditor();
// if (textEditor == null)
// showErrorMessage(Messages.DocShareRosterMenuHandler_EXCEPTION_EDITOR_NOT_TEXT);
// final String inputName = getInputName(textEditor);
// if (inputName == null)
// showErrorMessage(Messages.DocShareRosterMenuHandler_NO_FILENAME_WITH_CONTENT);
final IUser user = roster.getUser();
sender.startShare(user.getID(), rosterEntry.getUser().getID());
return null;
}