Search in sources :

Example 16 with IChannelContainerAdapter

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);
}
Also used : IChannelContainerAdapter(org.eclipse.ecf.datashare.IChannelContainerAdapter)

Example 17 with IChannelContainerAdapter

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;
}
Also used : IAction(org.eclipse.jface.action.IAction) Action(org.eclipse.jface.action.Action) IAction(org.eclipse.jface.action.IAction) IChannelContainerAdapter(org.eclipse.ecf.datashare.IChannelContainerAdapter) IRosterEntry(org.eclipse.ecf.presence.roster.IRosterEntry) IContainer(org.eclipse.ecf.core.IContainer)

Example 18 with IChannelContainerAdapter

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;
}
Also used : IAction(org.eclipse.jface.action.IAction) Action(org.eclipse.jface.action.Action) IAction(org.eclipse.jface.action.IAction) IChannelContainerAdapter(org.eclipse.ecf.datashare.IChannelContainerAdapter) IRosterEntry(org.eclipse.ecf.presence.roster.IRosterEntry) IContainer(org.eclipse.ecf.core.IContainer)

Example 19 with IChannelContainerAdapter

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;
}
Also used : IAction(org.eclipse.jface.action.IAction) Action(org.eclipse.jface.action.Action) IAction(org.eclipse.jface.action.IAction) TextSelection(org.eclipse.jface.text.TextSelection) IChannelContainerAdapter(org.eclipse.ecf.datashare.IChannelContainerAdapter) IRosterEntry(org.eclipse.ecf.presence.roster.IRosterEntry) IContainer(org.eclipse.ecf.core.IContainer)

Aggregations

IChannelContainerAdapter (org.eclipse.ecf.datashare.IChannelContainerAdapter)19 IContainer (org.eclipse.ecf.core.IContainer)7 ID (org.eclipse.ecf.core.identity.ID)6 IChannel (org.eclipse.ecf.datashare.IChannel)5 IRosterEntry (org.eclipse.ecf.presence.roster.IRosterEntry)4 Action (org.eclipse.jface.action.Action)4 IAction (org.eclipse.jface.action.IAction)4 HashMap (java.util.HashMap)3 IChannelListener (org.eclipse.ecf.datashare.IChannelListener)3 IChannelEvent (org.eclipse.ecf.datashare.events.IChannelEvent)3 IRoster (org.eclipse.ecf.presence.roster.IRoster)3 IChannelMessageEvent (org.eclipse.ecf.datashare.events.IChannelMessageEvent)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 ExecutionEvent (org.eclipse.core.commands.ExecutionEvent)1 ExecutionException (org.eclipse.core.commands.ExecutionException)1 Job (org.eclipse.core.runtime.jobs.Job)1 IDCreateException (org.eclipse.ecf.core.identity.IDCreateException)1 BaseChannelConfig (org.eclipse.ecf.datashare.BaseChannelConfig)1 IChannelConfig (org.eclipse.ecf.datashare.IChannelConfig)1 AbstractRosterMenuHandler (org.eclipse.ecf.presence.ui.menu.AbstractRosterMenuHandler)1