Search in sources :

Example 6 with IImage

use of org.talend.commons.ui.runtime.image.IImage in project tdi-studio-se by Talend.

the class StatusBar method setValues.

public void setValues(STATUS status, String text) {
    Image image = null;
    //$NON-NLS-1$
    String content = "";
    if (status != STATUS.EMPTY) {
        //            if (status != STATUS.INFO) {
        //$NON-NLS-1$
        content = " : " + text;
        IImage iimage = status.getImage();
        if (iimage == null) {
            image = null;
        } else {
            image = org.talend.commons.ui.runtime.image.ImageProvider.getImage(org.talend.commons.ui.runtime.image.ImageProvider.getImageDesc(iimage));
        }
    //            } else {
    //                content = text;
    //            }
    }
    statusBarLabel.setText(content);
    statusBarImage.setImage(image);
    setSize(computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
Also used : IImage(org.talend.commons.ui.runtime.image.IImage) EImage(org.talend.commons.ui.runtime.image.EImage) IImage(org.talend.commons.ui.runtime.image.IImage) Image(org.eclipse.swt.graphics.Image)

Example 7 with IImage

use of org.talend.commons.ui.runtime.image.IImage in project tdi-studio-se by Talend.

the class StatusManagerSettingPage method getItemsImage.

private Image getItemsImage(IImage iImage) {
    if (iImage == null) {
        iImage = EImage.DEFAULT_IMAGE;
    }
    Image image = cacheItemImages.get(iImage);
    if (image == null) {
        Image oImage = ImageProvider.getImage(iImage);
        ImageData imageData = oImage.getImageData();
        // enlarge image
        final int larger = 4;
        ImageData newData = imageData.scaledTo(imageData.width + larger, imageData.height + larger);
        image = new Image(oImage.getDevice(), newData);
        cacheItemImages.put(iImage, image);
    }
    return image;
}
Also used : ImageData(org.eclipse.swt.graphics.ImageData) IImage(org.talend.commons.ui.runtime.image.IImage) Image(org.eclipse.swt.graphics.Image) EImage(org.talend.commons.ui.runtime.image.EImage)

Aggregations

Image (org.eclipse.swt.graphics.Image)7 IImage (org.talend.commons.ui.runtime.image.IImage)7 EImage (org.talend.commons.ui.runtime.image.EImage)5 ImageData (org.eclipse.swt.graphics.ImageData)3 ECoreImage (org.talend.commons.ui.runtime.image.ECoreImage)1 EPosition (org.talend.commons.ui.runtime.image.OverlayImage.EPosition)1 ERepositoryObjectType (org.talend.core.model.repository.ERepositoryObjectType)1 IRepositoryContentHandler (org.talend.core.model.repository.IRepositoryContentHandler)1 EUpdateItemType (org.talend.core.model.update.EUpdateItemType)1 IUpdateItemType (org.talend.core.model.update.IUpdateItemType)1