Search in sources :

Example 46 with ID

use of org.eclipse.ecf.core.identity.ID in project ecf by eclipse.

the class ScreenCaptureShareRosterEntryContributionItem 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 ScreenCaptureShare tmp = ScreenCaptureShare.getScreenCaptureShare(c.getID());
            // If there is an URL share associated with this container
            if (tmp != null) {
                final ScreenCaptureShare screencaptureshare = tmp;
                final IAction action = new Action() {

                    public void run() {
                        MessageDialog dialog = new MessageDialog(null, Messages.ScreenCaptureShareRosterEntryContributionItem_SCREEN_CAPTURE_MESSAGEBOX_TITLE, Window.getDefaultImage(), Messages.ScreenCaptureShareRosterEntryContributionItem_SCREEN_CAPTURE_MESSAGEBOX_MESSAGE, MessageDialog.QUESTION, new String[] { NLS.bind(Messages.ScreenCaptureShareRosterEntryContributionItem_VERIFY_SEND_BUTTON_TEXT, entry.getName()), Messages.ScreenCaptureShareRosterEntryContributionItem_VERIFY_CANCEL_BUTTON_TEXT }, 0);
                        if (dialog.open() == Window.OK) {
                            ScreenCaptureJob screenCaptureJob = new ScreenCaptureJob(Display.getCurrent(), entry.getUser().getID(), entry.getUser().getName(), new IImageSender() {

                                public void sendImage(ID targetID, ImageData imageData) {
                                    screencaptureshare.sendImage(entry.getRoster().getUser().getID(), entry.getRoster().getUser().getName(), targetID, imageData);
                                }
                            });
                            screenCaptureJob.schedule(SCREEN_CAPTURE_DELAY);
                        }
                    }
                };
                action.setText(Messages.ScreenCaptureShareRosterEntryContributionItem_SCREEN_CAPTURE_MENU);
                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) IImageSender(org.eclipse.ecf.ui.screencapture.IImageSender) IAction(org.eclipse.jface.action.IAction) ImageData(org.eclipse.swt.graphics.ImageData) IChannelContainerAdapter(org.eclipse.ecf.datashare.IChannelContainerAdapter) IRosterEntry(org.eclipse.ecf.presence.roster.IRosterEntry) MessageDialog(org.eclipse.jface.dialogs.MessageDialog) ID(org.eclipse.ecf.core.identity.ID) IContainer(org.eclipse.ecf.core.IContainer) ScreenCaptureJob(org.eclipse.ecf.ui.screencapture.ScreenCaptureJob)

Example 47 with ID

use of org.eclipse.ecf.core.identity.ID in project ecf by eclipse.

the class SSLSimpleConcatClient method start.

public void start(int port) throws Exception {
    IContainer client = ContainerFactory.getDefault().createContainer(CLIENT_TYPE);
    // Get adapter for accessing remote services
    IRemoteServiceContainerAdapter adapter = (IRemoteServiceContainerAdapter) client.getAdapter(IRemoteServiceContainerAdapter.class);
    rsContainer = new RemoteServiceContainer(client, adapter);
    System.out.println("Client created with ID=" + client.getID());
    ID connectTargetID = IDFactory.getDefault().createStringID(NLS.bind(SERVER_ID, new Integer(port)));
    System.out.println("Attempting connect to id=" + connectTargetID);
    client.connect(connectTargetID, null);
    System.out.println("Client connected to connectTargetID=" + connectTargetID);
    Thread.sleep(1000);
    // Get remote service reference
    IRemoteServiceReference[] refs = adapter.getRemoteServiceReferences((ID[]) null, IConcatService.class.getName(), null);
    rsReference = refs[0];
    System.out.println("Remote service with ref=" + refs[0]);
}
Also used : IRemoteServiceReference(org.eclipse.ecf.remoteservice.IRemoteServiceReference) IConcatService(org.eclipse.ecf.tests.remoteservice.IConcatService) RemoteServiceContainer(org.eclipse.ecf.remoteservice.RemoteServiceContainer) IRemoteServiceContainer(org.eclipse.ecf.remoteservice.IRemoteServiceContainer) IRemoteServiceContainerAdapter(org.eclipse.ecf.remoteservice.IRemoteServiceContainerAdapter) ID(org.eclipse.ecf.core.identity.ID) IContainer(org.eclipse.ecf.core.IContainer)

Example 48 with ID

use of org.eclipse.ecf.core.identity.ID in project ecf by eclipse.

the class IDCreateTest method testXMPPCreateID.

public void testXMPPCreateID() throws Exception {
    final ID xmppID = IDFactory.getDefault().createID(namespace, "foobar@ecf.eclipse.org");
    assertNotNull(xmppID);
}
Also used : ID(org.eclipse.ecf.core.identity.ID)

Example 49 with ID

use of org.eclipse.ecf.core.identity.ID in project ecf by eclipse.

the class IDCreateTest method testXMPPCreateID3.

public void testXMPPCreateID3() throws Exception {
    final ID xmppID = IDFactory.getDefault().createID(namespace, "foobar@ecf.eclipse.org:5333/myresource");
    assertNotNull(xmppID);
}
Also used : ID(org.eclipse.ecf.core.identity.ID)

Example 50 with ID

use of org.eclipse.ecf.core.identity.ID in project ecf by eclipse.

the class ChannelTest method testBiSendMessage.

public void testBiSendMessage() throws Exception {
    final IChannel ch0 = getChannelContainer(0).getChannel(channelID);
    final IChannel ch1 = getChannelContainer(1).getChannel(channelID);
    ID target1 = getClient(1).getConnectedID();
    ID target0 = getClient(0).getConnectedID();
    ch0.sendMessage(target1, new String("hello").getBytes());
    ch1.sendMessage(target0, new String("hello").getBytes());
    sleep(SLEEPTIME);
}
Also used : IChannel(org.eclipse.ecf.datashare.IChannel) ID(org.eclipse.ecf.core.identity.ID)

Aggregations

ID (org.eclipse.ecf.core.identity.ID)256 IContainer (org.eclipse.ecf.core.IContainer)29 IOException (java.io.IOException)19 IDCreateException (org.eclipse.ecf.core.identity.IDCreateException)18 UUID (java.util.UUID)17 HashMap (java.util.HashMap)12 ArrayList (java.util.ArrayList)11 ContainerConnectException (org.eclipse.ecf.core.ContainerConnectException)11 GUID (org.eclipse.ecf.core.identity.GUID)11 ISharedObjectManager (org.eclipse.ecf.core.sharedobject.ISharedObjectManager)11 XMPPRoomID (org.eclipse.ecf.provider.xmpp.identity.XMPPRoomID)11 Namespace (org.eclipse.ecf.core.identity.Namespace)10 XMPPID (org.eclipse.ecf.provider.xmpp.identity.XMPPID)10 Map (java.util.Map)9 Matcher (java.util.regex.Matcher)9 ECFException (org.eclipse.ecf.core.util.ECFException)9 List (java.util.List)8 ISharedObject (org.eclipse.ecf.core.sharedobject.ISharedObject)8 IChannel (org.eclipse.ecf.datashare.IChannel)8 Iterator (java.util.Iterator)7