use of org.eclipse.ecf.datashare.IChannelContainerAdapter in project ecf by eclipse.
the class ChannelTest method testGetChannelContainerAdapter.
public void testGetChannelContainerAdapter() throws Exception {
final IChannelContainerAdapter channelContainer = getChannelContainer(0);
assertNotNull(channelContainer);
}
use of org.eclipse.ecf.datashare.IChannelContainerAdapter in project ecf by eclipse.
the class URLShareRosterEntryContributionItem method makeActions.
protected IAction[] makeActions() {
// Else check for Roster entry
final IRosterEntry entry = getSelectedRosterEntry();
final IContainer c = getContainerForRosterEntry(entry);
// If roster entry is selected and it has a container
if (entry != null && c != null) {
final IChannelContainerAdapter channelAdapter = (IChannelContainerAdapter) c.getAdapter(IChannelContainerAdapter.class);
// If the container has channel container adapter and is online/available
if (channelAdapter != null && isAvailable(entry)) {
final URLShare tmp = URLShare.getURLShare(c.getID());
// If there is an URL share associated with this container
if (tmp != null) {
final URLShare urlshare = tmp;
final IAction action = new Action() {
public void run() {
urlshare.showDialogAndSendURL(entry.getRoster().getUser().getName(), entry.getUser().getID());
}
};
action.setText(Messages.URLShareRosterEntryContributionItem_SEND_URL_MENU_TEXT);
action.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, Messages.URLShareRosterContributionItem_BROWSER_ICON));
return new IAction[] { action };
}
}
}
return null;
}
use of org.eclipse.ecf.datashare.IChannelContainerAdapter in project ecf by eclipse.
the class ViewShareRosterEntryContributionItem method makeActions.
protected IAction[] makeActions() {
// Else check for Roster entry
final IRosterEntry entry = getSelectedRosterEntry();
final IContainer c = getContainerForRosterEntry(entry);
// If roster entry is selected and it has a container
if (entry != null && c != null) {
final IChannelContainerAdapter channelAdapter = (IChannelContainerAdapter) c.getAdapter(IChannelContainerAdapter.class);
// If the container has channel container adapter and is online/available
if (channelAdapter != null && isAvailable(entry)) {
final ViewShare tmp = ViewShare.getViewShare(c.getID());
// If there is an URL share associated with this container
if (tmp != null) {
final ViewShare viewshare = tmp;
final IAction action = new Action() {
public void run() {
viewshare.sendOpenViewRequest(entry.getRoster().getUser().getName(), entry.getUser().getID());
}
};
action.setText(Messages.ViewShareRosterEntryContributionItem_VIEWSHARE_MENU_TEXT);
action.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(ISharedImages.IMG_DEF_VIEW));
return new IAction[] { action };
}
}
}
return null;
}
use of org.eclipse.ecf.datashare.IChannelContainerAdapter in project ecf by eclipse.
the class ConsoleShareRosterEntryContributionItem method makeActions.
protected IAction[] makeActions() {
final TextSelection selection = ConsoleShare.getSelection();
if (selection == null)
return null;
// Else check for Roster entry
final IRosterEntry entry = getSelectedRosterEntry();
final IContainer c = getContainerForRosterEntry(entry);
// If roster entry is selected and it has a container
if (entry != null && c != null) {
final IChannelContainerAdapter channelAdapter = (IChannelContainerAdapter) c.getAdapter(IChannelContainerAdapter.class);
// If the container has channel container adapter and is online/available
if (channelAdapter != null && isAvailable(entry)) {
final ConsoleShare tmp = ConsoleShare.getStackShare(c.getID());
// If there is an URL share associated with this container
if (tmp != null) {
final ConsoleShare stackshare = tmp;
final IAction action = new Action() {
public void run() {
stackshare.sendShareConsoleSelection(entry.getRoster().getUser().getName(), entry.getUser().getID(), selection.getText());
}
};
action.setText(Messages.ConsoleShare_RosterEntryMenu);
action.setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(Activator.PLUGIN_ID, Messages.ConsoleShare_RosterContributionItem_CONSOLE_ICON));
return new IAction[] { action };
}
}
}
return null;
}
Aggregations