/*******************************************************************************
* Copyright (c) 2006-2013 The RCP Company and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* The RCP Company - initial API and implementation
*******************************************************************************/
package com.rcpcompany.uibindings;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.swt.custom.StyleRange;
import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.Cursor;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
/**
* This interface describes the context for a decoration extender.
*
* @author Tonny Madsen, The RCP Company
*/
public interface IUIBindingDecoratorExtenderContext {
/**
* The binding of this context.
*
* @return the binding
*/
IValueBinding getBinding();
/**
* The observable value as generated by the {@link IUIBindingDecorator} decorator.
*
* @return the value
*/
IObservableValue getDecoratedValue();
/**
* Sets the message format of this context.
*
* @param format the new format
*/
void setMessageFormat(String format);
/**
* Sets the font of this context.
*
* @param font the new font
*/
void setFont(Font font);
/**
* Sets the new minimum value of this context.
*
* @param min the new minimum value
*/
void setMin(int min);
/**
* Sets the new maximum value of this context.
*
* @param max the new maximum value
*/
void setMax(int max);
/**
* Sets to the tool tip value of this context.
*
* @param tooltip the new tool tipo
*/
void setTooltip(String tooltip);
/**
* Appends to the tool tip value of this context.
*
* @param tooltip text to be appended to any existing tool tip
*/
void appendTooltip(String tooltip);
/**
* Sets an image to be included for the control at the specified position.
*
* @param position the position of the image
* @param outside if the decoration should be outside the widget bounds
* @param image the image itself
* @param tooltip a tooltip to be shown for the image
*/
void setDecoratingImage(DecorationPosition position, boolean outside, Image image, String tooltip);
/**
* Returns the image value of this context.
*
* @return the current image of the context
*/
Image getImage();
/**
* Sets the new image value of this context.
*
* @param image the new image
*/
void setImage(Image image);
/**
* Sets the new cursor value of this context.
*
* @param cursor the new cursor
*/
void setCursor(Cursor cursor);
/**
* Returns the foreground value of this context.
*
* @return the current foreground of the context
*/
Color getForeground();
/**
* Sets the new foreground color value of this context.
*
* @param color the new foreground color
*/
void setForegound(Color color);
/**
* Returns the background value of this context.
*
* @return the current background of the context
*/
Color getBackground();
/**
* Sets the new background color value of this context.
*
* @param color the new background color
*/
void setBackgound(Color color);
/**
* Sets the new enabled value of this context.
*
* @param enabled the new enabled
*/
void setEnabled(boolean enabled);
/**
* Adds a new style range to set list of ranges for the context.
* <p>
* Only used, if the {@link IUIAttribute} supports them.
*
* @param range the new style range
*/
void addStyleRange(StyleRange range);
}