001: /*******************************************************************************
002: * Copyright (c) 2000, 2006 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.jface.viewers;
011:
012: import org.eclipse.jface.resource.ImageDescriptor;
013: import org.eclipse.swt.graphics.Color;
014: import org.eclipse.swt.graphics.Font;
015:
016: /**
017: * Defines the result of decorating an element.
018: *
019: * This interface is not meant to be implemented and will be provided to
020: * instances of <code>ILightweightLabelDecorator</code>.
021: */
022: public interface IDecoration {
023:
024: /**
025: * Constants for placement of image decorations.
026: */
027: public static final int TOP_LEFT = 0;
028:
029: /**
030: * Constant for the top right quadrant.
031: */
032: public static final int TOP_RIGHT = 1;
033:
034: /**
035: * Constant for the bottom left quadrant.
036: */
037: public static final int BOTTOM_LEFT = 2;
038:
039: /**
040: * Constant for the bottom right quadrant.
041: */
042: public static final int BOTTOM_RIGHT = 3;
043:
044: /**
045: * Constant for the underlay.
046: */
047: public static final int UNDERLAY = 4;
048:
049: /**
050: * Adds a prefix to the element's label.
051: *
052: * @param prefix
053: * the prefix
054: */
055: public void addPrefix(String prefix);
056:
057: /**
058: * Adds a suffix to the element's label.
059: *
060: * @param suffix
061: * the suffix
062: */
063: public void addSuffix(String suffix);
064:
065: /**
066: * Adds an overlay to the element's image.
067: *
068: * @param overlay
069: * the overlay image descriptor
070: */
071: public void addOverlay(ImageDescriptor overlay);
072:
073: /**
074: * Adds an overlay to the element's image.
075: *
076: * @param overlay
077: * the overlay image descriptor
078: * @param quadrant
079: * The constant for the quadrant to draw the image on.
080: */
081: public void addOverlay(ImageDescriptor overlay, int quadrant);
082:
083: /**
084: * Set the foreground color for this decoration.
085: * @param color the color to be set for the foreground
086: *
087: * @since 3.1
088: */
089: public void setForegroundColor(Color color);
090:
091: /**
092: * Set the background color for this decoration.
093: * @param color the color to be set for the background
094: *
095: * @since 3.1
096: */
097: public void setBackgroundColor(Color color);
098:
099: /**
100: * Set the font for this decoration.
101: * @param font the font to use in this decoration
102: *
103: * @since 3.1
104: */
105: public void setFont(Font font);
106:
107: /**
108: * Return the decoration context in which this decoration
109: * will be applied.
110: * @return the decoration context
111: *
112: * @since 3.2
113: */
114: public IDecorationContext getDecorationContext();
115: }
|