X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/ui/MessageLine.java b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/ui/MessageLine.java index b724f3b..12189a1 100644 --- a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/ui/MessageLine.java +++ b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/ui/MessageLine.java @@ -1,11 +1,11 @@ package net.sourceforge.phpdt.externaltools.internal.ui; /********************************************************************** -Copyright (c) 2000, 2002 IBM Corp. All rights reserved. -This file is made available under the terms of the Common Public License v1.0 -which accompanies this distribution, and is available at -http://www.eclipse.org/legal/cpl-v10.html -**********************************************************************/ + Copyright (c) 2000, 2002 IBM Corp. All rights reserved. + This file is made available under the terms of the Common Public License v1.0 + which accompanies this distribution, and is available at + http://www.eclipse.org/legal/cpl-v10.html + **********************************************************************/ import org.eclipse.core.runtime.IStatus; import org.eclipse.swt.SWT; @@ -25,6 +25,7 @@ public class MessageLine extends CLabel { private static final RGB ERROR_BACKGROUND_RGB = new RGB(230, 226, 221); private Color fNormalMsgAreaBackground; + private Color fErrorMsgAreaBackground; /** @@ -35,40 +36,44 @@ public class MessageLine extends CLabel { } /** - * Creates a new message line as a child of the parent and with the given SWT stylebits. + * Creates a new message line as a child of the parent and with the given + * SWT stylebits. */ public MessageLine(Composite parent, int style) { super(parent, style); - fNormalMsgAreaBackground= getBackground(); - fErrorMsgAreaBackground= null; + fNormalMsgAreaBackground = getBackground(); + fErrorMsgAreaBackground = null; } - private Image findImage(IStatus status) { if (status.isOK()) { return null; } else if (status.matches(IStatus.ERROR)) { - return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK); + return PlatformUI.getWorkbench().getSharedImages().getImage( + ISharedImages.IMG_OBJS_ERROR_TSK); } else if (status.matches(IStatus.WARNING)) { - return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK); + return PlatformUI.getWorkbench().getSharedImages().getImage( + ISharedImages.IMG_OBJS_WARN_TSK); } else if (status.matches(IStatus.INFO)) { - return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK); + return PlatformUI.getWorkbench().getSharedImages().getImage( + ISharedImages.IMG_OBJS_INFO_TSK); } return null; } /** - * Sets the message and image to the given status. - * null is a valid argument and will set the empty text and no image + * Sets the message and image to the given status. null is a + * valid argument and will set the empty text and no image */ public void setErrorStatus(IStatus status) { if (status != null) { - String message= status.getMessage(); + String message = status.getMessage(); if (message != null && message.length() > 0) { setText(message); setImage(findImage(status)); if (fErrorMsgAreaBackground == null) { - fErrorMsgAreaBackground= new Color(getDisplay(), ERROR_BACKGROUND_RGB); + fErrorMsgAreaBackground = new Color(getDisplay(), + ERROR_BACKGROUND_RGB); } setBackground(fErrorMsgAreaBackground); return; @@ -85,7 +90,7 @@ public class MessageLine extends CLabel { public void dispose() { if (fErrorMsgAreaBackground != null) { fErrorMsgAreaBackground.dispose(); - fErrorMsgAreaBackground= null; + fErrorMsgAreaBackground = null; } super.dispose(); }