Example usage for org.eclipse.jface.window Window getDefaultImage

List of usage examples for org.eclipse.jface.window Window getDefaultImage

Introduction

In this page you can find the example usage for org.eclipse.jface.window Window getDefaultImage.

Prototype

public static Image getDefaultImage() 

Source Link

Document

Returns the default image.

Usage

From source file:org.eclipse.ecf.presence.collab.ui.screencapture.ScreenCaptureShareRosterEntryContributionItem.java

License:Open Source License

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);//  ww  w.ja  v a 2s . com
                        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;
}