private Control createMessageArea(Composite composite) { // create composite // create image Image image = getSWTImage(SWT.ICON_INFORMATION); if (image != null) { imageLabel = new Label(composite, SWT.NULL); image.setBackground(imageLabel.getBackground()); imageLabel.setImage(image); imageLabel.setLayoutData(new GridData( GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_BEGINNING)); } // create message if (message != null) { messageLabel = new Label(composite, SWT.WRAP); messageLabel.setText(message); GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING); data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); messageLabel.setLayoutData(data); } return composite; }
private Control createMessageArea(Composite composite) { // create composite // create image Image image = getSWTImage(SWT.ICON_INFORMATION); if (image != null) { imageLabel = new Label(composite, SWT.NULL); image.setBackground(imageLabel.getBackground()); imageLabel.setImage(image); imageLabel.setLayoutData(new GridData( GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_BEGINNING)); } // create message if (message != null) { messageLabel = new Label(composite, SWT.WRAP); messageLabel.setText(message); GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_BEGINNING); data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH); messageLabel.setLayoutData(data); } return composite; }
public void setImage( Image i ) { if (i != null) i.setBackground(item.getParent().getBackground()); item.setImage(i); }
if (image != null) { Label label= new Label(result, SWT.NULL); image.setBackground(label.getBackground()); label.setImage(image); label.setLayoutData(new GridData(
if (image != null) { Label label= new Label(result, SWT.NULL); image.setBackground(label.getBackground()); label.setImage(image); label.setLayoutData(new GridData(
if (image != null) { Label label = new Label(composite, 0); image.setBackground(label.getBackground()); label.setImage(image); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_BEGINNING));
if (image != null) { Label label = new Label(composite, 0); image.setBackground(label.getBackground()); label.setImage(image); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER | GridData.VERTICAL_ALIGN_BEGINNING));
if (image != null) { Label label= new Label(result, SWT.NULL); image.setBackground(label.getBackground()); label.setImage(image); label.setLayoutData(new GridData(
if (image != null) { imageLabel = new Label(composite, SWT.NULL); image.setBackground(imageLabel.getBackground()); imageLabel.setImage(image); imageLabel.setLayoutData(new GridData(
img.setBackground(shell.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); imgLabel.setImage(img);
if (image != null) { imageLabel = new Label(composite, SWT.NULL); image.setBackground(imageLabel.getBackground()); imageLabel.setImage(image); addAccessibleListeners(imageLabel, image);
private void updateGradientImage() { Rectangle rect = getBounds(); if (gradientImage != null) { FormImages.getInstance().markFinished(gradientImage, getDisplay()); gradientImage = null; } if (gradientInfo != null) { gradientImage = FormImages.getInstance().getGradient(gradientInfo.gradientColors, gradientInfo.percents, gradientInfo.vertical ? rect.height : rect.width, gradientInfo.vertical, getColor(COLOR_BASE_BG), getDisplay()); } else if (backgroundImage != null && !isBackgroundImageTiled()) { gradientImage = new Image(getDisplay(), Math.max(rect.width, 1), Math.max(rect.height, 1)); gradientImage.setBackground(getBackground()); GC gc = new GC(gradientImage); gc.drawImage(backgroundImage, 0, 0); gc.dispose(); } setBackgroundImage(gradientImage); }
private void updateGradientImage() { Rectangle rect = getBounds(); Image oldGradientImage = gradientImage; gradientImage = null; if (gradientInfo != null) { gradientImage = FormImages.getInstance().getGradient(gradientInfo.gradientColors, gradientInfo.percents, gradientInfo.vertical ? rect.height : rect.width, gradientInfo.vertical, getColor(COLOR_BASE_BG), getDisplay()); } else if (backgroundImage != null && !isBackgroundImageTiled()) { gradientImage = new Image(getDisplay(), Math.max(rect.width, 1), Math.max(rect.height, 1)); gradientImage.setBackground(getBackground()); GC gc = new GC(gradientImage); gc.drawImage(backgroundImage, 0, 0); gc.dispose(); } if (oldGradientImage != null) { FormImages.getInstance().markFinished(oldGradientImage, getDisplay()); } setBackgroundImage(gradientImage); }
@Override public Image createImage(boolean returnMissingImageOnError, Device device) { Image image = new Image(device, 1, fLength); Color color1 = new Color(device, fRGBs[0]); Color color2 = new Color(device, fRGBs[1]); image.setBackground(color1); GC gc = new GC(image); gc.setBackground(color1); gc.fillRectangle(0, 0, 1, fLength); gc.setForeground(color2); gc.setBackground(color1); gc.fillGradientRectangle(0, fMarginHeight + 2, 1, fTheight - 2, true); gc.dispose(); color1.dispose(); color2.dispose(); return image; }
@Override public Image createImage(boolean returnMissingImageOnError, Device device) { Image image = new Image(device, 1, fLength); Color originalBgColor = new Color(device, fRGBs[0]); Color color1 = new Color(device, fRGBs[1]); image.setBackground(originalBgColor); GC gc = new GC(image); gc.setBackground(color1); gc.fillRectangle(0, fMarginHeight + 2, 1, fTheight - fMarginHeight - 3); gc.setBackground(originalBgColor); gc.fillRectangle(0, fTheight - fMarginHeight - 4, 1, 4); gc.dispose(); color1.dispose(); originalBgColor.dispose(); return image; } }
@Override public Image createImage(boolean returnMissingImageOnError, Device device) { Image image = new Image(device, 1, fLength); Color originalBgColor = new Color(device, fRGBs[0]); Color color1 = new Color(device, fRGBs[1]); image.setBackground(originalBgColor); GC gc = new GC(image); gc.setBackground(color1); gc.fillRectangle(0, fMarginHeight + 2, 1, fTheight - fMarginHeight - 3); gc.setBackground(originalBgColor); gc.fillRectangle(0, fTheight - fMarginHeight - 4, 1, 4); gc.dispose(); color1.dispose(); originalBgColor.dispose(); return image; } }
@Override public Image createImage(boolean returnMissingImageOnError, Device device) { Image image = new Image(device, 1, fLength); Color color1 = new Color(device, fRGBs[0]); Color color2 = new Color(device, fRGBs[1]); image.setBackground(color1); GC gc = new GC(image); gc.setBackground(color1); gc.fillRectangle(0, 0, 1, fLength); gc.setForeground(color2); gc.setBackground(color1); gc.fillGradientRectangle(0, fMarginHeight + 2, 1, fTheight - 2, true); gc.dispose(); color1.dispose(); color2.dispose(); return image; } }
@Override public Image createImage(boolean returnMissingImageOnError, Device device) { Image image = new Image(device, 1, fLength); Color color1 = new Color(device, fRGBs[0]); Color color2 = new Color(device, fRGBs[1]); image.setBackground(color1); GC gc = new GC(image); gc.setBackground(color1); gc.fillRectangle(0, 0, 1, fLength); gc.setForeground(color2); gc.setBackground(color1); gc.fillGradientRectangle(0, fMarginHeight + 2, 1, fTheight - 2, true); gc.dispose(); color1.dispose(); color2.dispose(); return image; }
@Override public Image createImage(boolean returnMissingImageOnError, Device device) { Image image = new Image(device, 1, fLength); Color color1 = new Color(device, fRGBs[0]); Color color2 = new Color(device, fRGBs[1]); image.setBackground(color1); GC gc = new GC(image); gc.setBackground(color1); gc.fillRectangle(0, 0, 1, fLength); gc.setForeground(color2); gc.setBackground(color1); gc.fillGradientRectangle(0, fMarginHeight + 2, 1, fTheight - 2, true); gc.dispose(); color1.dispose(); color2.dispose(); return image; } }
normal.setBackground(transparent); GC gc = new GC(normal); gc.setBackground(background); hover.setBackground(transparent); gc = new GC(hover); gc.setBackground(backgroundHot);