Package com._1c.g5.lwt.controls
Class LightColorBox
- java.lang.Object
-
- com._1c.g5.lwt.AbstractLightControl
-
- com._1c.g5.lwt.controls.LightColorBox
-
- All Implemented Interfaces:
ILightControl
public class LightColorBox extends AbstractLightControl
Light color box control that allows to display the givenColor
as a box with filled background color.
-
-
Constructor Summary
Constructors Constructor Description LightColorBox()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.swt.graphics.Point
computeSize(org.eclipse.swt.graphics.GC gc, int width, int height, boolean flushCache)
Computes the size of this control.org.eclipse.swt.graphics.Color
getColor()
Gets the displayed color.org.eclipse.swt.graphics.Color
getDisabledColor()
Returns disabled color.int[]
getPaddings()
Returns the array of integers (paddings) with lenght equal to 4 and values correspond to top, right, bottom, and left side of the control in direct order iteration.void
paint(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle)
Paints the given rectangle of this control.void
setColor(org.eclipse.swt.graphics.Color color)
Sets the color to display.void
setDisabledColor(org.eclipse.swt.graphics.Color disabledColor)
Sets the disabled color.void
setPaddings(int[] paddings)
Sets padding for control.-
Methods inherited from class com._1c.g5.lwt.AbstractLightControl
addControlListener, dispose, getBounds, getCursor, getData, getLayoutData, getOverlay, getParent, getTooltip, getVisibleBounds, handleEvent, invalidate, invalidate, isDisposed, isEnabled, isFocused, isVisible, removeControlListener, setBounds, setCursor, setData, setEnabled, setFocus, setFocusable, setLayoutData, setOverlay, setParent, setTooltip, setVisible
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com._1c.g5.lwt.ILightControl
initialize
-
-
-
-
Method Detail
-
setPaddings
public void setPaddings(int[] paddings)
Sets padding for control.- Parameters:
paddings
- - the array of integers with lenght equal to 4 and values correspond to top, right, bottom, and left side of the control in direct order iteration.
-
getPaddings
public int[] getPaddings()
Returns the array of integers (paddings) with lenght equal to 4 and values correspond to top, right, bottom, and left side of the control in direct order iteration.- Returns:
- paddings
-
getColor
public org.eclipse.swt.graphics.Color getColor()
Gets the displayed color.- Returns:
- the color or
null
if no color assigned.
-
setColor
public void setColor(org.eclipse.swt.graphics.Color color)
Sets the color to display.- Parameters:
color
- the new color.
-
setDisabledColor
public void setDisabledColor(org.eclipse.swt.graphics.Color disabledColor)
Sets the disabled color.- Parameters:
disabledColor
- the new disabled color.
-
getDisabledColor
public org.eclipse.swt.graphics.Color getDisabledColor()
Returns disabled color.- Returns:
- disabled color, can return
null
.
-
computeSize
public org.eclipse.swt.graphics.Point computeSize(org.eclipse.swt.graphics.GC gc, int width, int height, boolean flushCache)
Description copied from interface:ILightControl
Computes the size of this control.- Specified by:
computeSize
in interfaceILightControl
- Overrides:
computeSize
in classAbstractLightControl
- Parameters:
gc
- the GC to do measurements with.width
- the width hint,SWT.DEFAULT
to compute the preferred width.height
- the height hint,SWT.DEFAULT
to compute the preferred height.flushCache
- the flush cache flag, instructs the associated layout to reset all its caches, if any.- Returns:
- the computed size.
-
paint
public void paint(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle)
Description copied from interface:ILightControl
Paints the given rectangle of this control.- Parameters:
gc
- theGC
to paint on.rectangle
- the rectangle to paint.
-
-