Example usage for org.eclipse.jface.dialogs Dialog DLG_IMG_MESSAGE_INFO

List of usage examples for org.eclipse.jface.dialogs Dialog DLG_IMG_MESSAGE_INFO

Introduction

In this page you can find the example usage for org.eclipse.jface.dialogs Dialog DLG_IMG_MESSAGE_INFO.

Prototype

String DLG_IMG_MESSAGE_INFO

To view the source code for org.eclipse.jface.dialogs Dialog DLG_IMG_MESSAGE_INFO.

Click Source Link

Document

Image registry key for info message image (value "dialog_messasge_info_image").

Usage

From source file:bndtools.utils.MessagesPopupDialog.java

License:Open Source License

static Image getMessageImage(int messageType) {
    switch (messageType) {
    case IMessageProvider.INFORMATION:
        return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_INFO);
    case IMessageProvider.WARNING:
        return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
    case IMessageProvider.ERROR:
        return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR);
    default://  www.j  a v a  2 s .  c o m
        return null;
    }
}

From source file:com.htmlhifive.tools.wizard.download.DownloadModule.java

License:Apache License

/**
 * 1????./*  www  . j av a2s  . co  m*/
 * 
 * @param monitor 
 * @param totalWork 
 * @param iFile 
 * @param fileContentsHandler ?
 * @throws IOException IO
 * @return ?
 */
private boolean updateFile(IProgressMonitor monitor, int totalWork, ResultStatus logger, IFile iFile,
        IFileContentsHandler fileContentsHandler) throws IOException {

    // PI0112=INFO,[{0}]...
    monitor.subTask(Messages.PI0112.format(iFile.getFullPath()));

    int ret = 0;
    InputStream is = null;
    try {
        if (iFile.exists()) {
            // ????.
            if (defaultOverwriteMode != 0) {
                ret = defaultOverwriteMode;
            } else {
                MessageDialog dialog = new MessageDialog(null, Messages.SE0113.format(),
                        Dialog.getImage(Dialog.DLG_IMG_MESSAGE_INFO),
                        Messages.SE0114.format(iFile.getRawLocation().toString()), MessageDialog.QUESTION,
                        new String[] { UIMessages.Dialog_OVERWRITE, UIMessages.Dialog_ALL_OVERWRITE,
                                UIMessages.Dialog_IGNORE, UIMessages.Dialog_ALL_IGNORE },
                        0);
                ret = dialog.open();
            }
            switch (ret) {
            case 1:
                defaultOverwriteMode = ret;
            case 0:
                // ???.
                logger.log(Messages.SE0097, iFile.getFullPath());
                is = fileContentsHandler.getInputStream();
                iFile.setContents(is, true, true, null);
                logger.log(Messages.SE0098, iFile.getFullPath());
                break;
            case 3:
                defaultOverwriteMode = ret;
            case 2:
                // ?.
                break;
            }
        } else {
            if (!iFile.getParent().exists()) {
                // ??.
                H5IOUtils.createParentFolder(iFile.getParent(), null);
            }

            is = fileContentsHandler.getInputStream();
            logger.log(Messages.SE0091, iFile.getFullPath());
            iFile.create(is, true, null);
            logger.log(Messages.SE0092, iFile.getFullPath());
        }
        return true;
    } catch (CoreException e) {
        // SE0024=ERROR,({0})???????
        logger.log(e, Messages.SE0024, iFile.getFullPath().toString());
    } finally {
        IOUtils.closeQuietly(is);
    }
    return false;
}

From source file:com.sap.dirigible.ide.common.status.DefaultProgressMonitor.java

License:Open Source License

/**
 * Sets the message, along with a image corresponding to error/warning/info
 * severity. If another argument is provided in severity, the method
 * returns./*w  ww .  jav  a  2 s  .com*/
 */
public void setMessage(final String message, final int severity) {
    String imageCode = null;
    switch (severity) {
    case (IStatus.INFO):
        imageCode = Dialog.DLG_IMG_MESSAGE_INFO;
        break;
    case (IStatus.WARNING):
        imageCode = Dialog.DLG_IMG_MESSAGE_WARNING;
        break;
    case (IStatus.ERROR):
        imageCode = Dialog.DLG_IMG_MESSAGE_ERROR;
        break;
    }
    if (imageCode == null) {
        return;
    } else {
        this.statusLineManager.setMessage(JFaceResources.getImage(imageCode), message);
    }
}

From source file:com.sap.dirigible.ide.common.status.StatusLineManagerUtil.java

License:Open Source License

public static void setInfoMessage(String message) {
    getDefaultStatusLineManager().removeAll();
    getDefaultStatusLineManager().setMessage(JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_INFO), message);
}

From source file:de.walware.ecommons.ui.util.StatusLineMessageManager.java

License:Open Source License

private Image getIcon(final int severity) {
    if (!this.showIcons) {
        return null;
    }/*ww w .  j a  va  2 s.  c  om*/
    switch (severity) {
    case IStatus.INFO:
        return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_INFO);
    case IStatus.WARNING:
        return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
    case IStatus.ERROR:
        return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR);
    default:
        return null;
    }
}

From source file:de.walware.statet.r.internal.ui.pkgmanager.StatusLabelProvider.java

License:Open Source License

public Image getImage(final IStatus status) {
    switch (status.getSeverity()) {
    case IStatus.ERROR:
        return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR);
    case IStatus.WARNING:
        return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
    default://  www .  j  a  v a2  s  . co  m
        return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_INFO);
    }
}

From source file:es.axios.udig.spatialoperations.ui.view.Message.java

License:LGPL

/**
 * @return Returns the image/*from w  ww .  j a  v a2s. c o  m*/
 */
public final Image getImage() {

    Image image = null;

    switch (type) {
    case FAIL:
        image = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR);
        break;
    case INFORMATION:
    case IMPORTANT_INFO:
        image = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_INFO);
        break;
    case WARNING:
        image = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
        break;
    case ERROR:
        image = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR);
        break;

    case NULL:
        image = null;
        break;

    default:
        assert false; // imposible!
        break;
    }

    return image;
}

From source file:es.axios.udig.ui.commons.message.InfoMessage.java

License:LGPL

/**
 * @return Returns the image//from   ww w .  j a v  a2  s .c o m
 */
public final Image getImage() {

    Image image = null;

    switch (type) {
    case FAIL:
        image = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR);
        break;
    case INFORMATION:
    case IMPORTANT_INFO:
        image = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_INFO);
        break;
    case WARNING:
        image = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
        break;
    case ERROR:
        image = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR);
        break;

    case NULL:
        image = null;
        break;

    default:
        assert false; // impossible!
        break;
    }

    return image;
}

From source file:fr.imag.adele.cadse.si.workspace.uiplatform.swt.SWTUIPlatform.java

License:Apache License

public void setMessage(String newMessage, int newType) {
    if (_pageSite != null) {
        IStatusLineManager statusLine = _pageSite.getActionBars().getStatusLineManager();
        if (statusLine != null) {
            Image newImage = null;
            if (newMessage != null) {
                switch (newType) {
                case IMessageProvider.NONE:
                    break;
                case IMessageProvider.INFORMATION:
                    newImage = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_INFO);
                    break;
                case IMessageProvider.WARNING:
                    newImage = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
                    break;
                case IMessageProvider.ERROR:
                    newImage = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR);
                    break;
                }/*from  w w w  .  j  a v a  2 s .c o m*/
                if (newType == UIPlatform.ERROR) {
                    statusLine.setErrorMessage(newImage, newMessage);

                } else {
                    statusLine.setMessage(newImage, newMessage);
                }
            } else {
                statusLine.setErrorMessage(null);
                statusLine.setMessage(null);
            }
        }
    } else if (dialog != null) {
        if (newMessage != null) {
            if (newType == UIPlatform.ERROR) {
                dialog.setErrorMessage(newMessage);
                IWizardPage page = dialog.getCurrentPage();
                if (page instanceof WizardPage)
                    ((WizardPage) page).setPageComplete(false);
            } else {
                dialog.setMessage(newMessage, newType);
                IWizardPage page = dialog.getCurrentPage();
                if (page instanceof WizardPage)
                    ((WizardPage) page).setPageComplete(true);
            }
        } else {
            dialog.setErrorMessage(null);
            dialog.setMessage(null);

            IWizardPage page = dialog.getCurrentPage();
            if (page instanceof WizardPage)
                ((WizardPage) page).setPageComplete(true);

        }
    }
}

From source file:gov.redhawk.ide.sdr.internal.ui.navigator.SdrNavigatorLabelProvider.java

License:Open Source License

@Override
public Image getToolTipImage(final Object object) {
    if (object instanceof SdrRoot) {
        final SdrRoot root = (SdrRoot) object;
        final IStatus status = root.getLoadStatus();
        if (status != null && !status.isOK()) {
            switch (status.getSeverity()) {
            case IStatus.INFO:
                return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_INFO);
            case IStatus.WARNING:
                return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
            case IStatus.ERROR:
                return JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR);
            default:
                return null;
            }/*from   w  w w.  j  a v  a  2s .co m*/
        }
    }
    return null;
}