Package com._1c.g5.lwt.controls
Class LightEditorBar<C extends ILightControl>
- java.lang.Object
-
- com._1c.g5.lwt.AbstractLightControl
-
- com._1c.g5.lwt.LightComposite
-
- com._1c.g5.lwt.AbstractLightContentComposite<C>
-
- com._1c.g5.lwt.controls.LightEditorBar<C>
-
- All Implemented Interfaces:
IEditable
,ILightComposite
,ILightContentComposite<C>
,ILightControl
- Direct Known Subclasses:
LightColorBoxEditorBar
,LightTextEditorBar
public class LightEditorBar<C extends ILightControl> extends AbstractLightContentComposite<C> implements IEditable
Base class for constructing editor-like controls. Editor bar consists of three areas: left side, center content area and right side. Left and right sides may contain arbitrary number of controls, for example buttons. Center content area may contain, for example, a textbox-like control and it is stretched horizontally to fill all available space.
-
-
Constructor Summary
Constructors Constructor Description LightEditorBar()
Instantiates a new light editor bar.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
contentSet(C content)
protected void
contentUnset(C content)
org.eclipse.swt.graphics.Color
getBackgroundColor()
Gets the background color.org.eclipse.swt.graphics.Color
getBorderColor()
Gets the border color.org.eclipse.swt.graphics.Image
getImage()
Gets the image assigned to the left side area.ILightComposite
getLeftSide()
Gets the left side area.ILightComposite
getRightSide()
Gets the right side area.boolean
isEditable()
Returns control editable state.void
paint(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle)
Paints the given rectangle of this control.void
setBackgroundColor(org.eclipse.swt.graphics.Color backgroundColor)
Sets the background color.void
setBorderColor(org.eclipse.swt.graphics.Color borderColor)
Sets the border color.void
setEditable(boolean isEditable)
Sets control editable state.void
setEnabled(boolean value)
Sets this control enablement.void
setImage(org.eclipse.swt.graphics.Image image)
Assigns the image to the left side area.void
setVisible(boolean value)
Sets this control visibility.-
Methods inherited from class com._1c.g5.lwt.AbstractLightContentComposite
getContent, setContent
-
Methods inherited from class com._1c.g5.lwt.LightComposite
addChild, addChild, addChildAfter, addLayerAbove, addLayerBehind, computeSize, controlFromPoint, dispose, getActiveControl, getChildCount, getChildren, getLayers, getLayout, layout, layout, removeChild, removeChild, revealRectangle, setActiveControl, setBounds, setFocus, setLayout, translatePointFromControl, translatePointToControl, translateRectangleFromControl, translateRectangleToControl, traverse, traverse
-
Methods inherited from class com._1c.g5.lwt.AbstractLightControl
addControlListener, getBounds, getCursor, getData, getLayoutData, getOverlay, getParent, getTooltip, getVisibleBounds, handleEvent, invalidate, invalidate, isDisposed, isEnabled, isFocused, isVisible, removeControlListener, setCursor, setData, setFocusable, setLayoutData, setOverlay, setParent, setTooltip
-
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.ILightComposite
getMainLayer
-
Methods inherited from interface com._1c.g5.lwt.ILightControl
addControlListener, getBounds, getCursor, getData, getLayoutData, getParent, getTooltip, getVisibleBounds, handleEvent, initialize, invalidate, invalidate, isDisposed, isEnabled, isFocused, isVisible, removeControlListener, setCursor, setData, setLayoutData, setParent, setTooltip
-
-
-
-
Method Detail
-
getLeftSide
public ILightComposite getLeftSide()
Gets the left side area.- Returns:
- the left side area.
-
getRightSide
public ILightComposite getRightSide()
Gets the right side area.- Returns:
- the right side area.
-
getBackgroundColor
public org.eclipse.swt.graphics.Color getBackgroundColor()
Gets the background color.- Returns:
- the background color.
-
setBackgroundColor
public void setBackgroundColor(org.eclipse.swt.graphics.Color backgroundColor)
Sets the background color.- Parameters:
backgroundColor
- the new background color.
-
getBorderColor
public org.eclipse.swt.graphics.Color getBorderColor()
Gets the border color.- Returns:
- the border color.
-
setBorderColor
public void setBorderColor(org.eclipse.swt.graphics.Color borderColor)
Sets the border color.- Parameters:
borderColor
- the new border color.
-
getImage
public org.eclipse.swt.graphics.Image getImage()
Gets the image assigned to the left side area.- Returns:
- the image or
null
if no image assigned.
-
setImage
public void setImage(org.eclipse.swt.graphics.Image image)
Assigns the image to the left side area.- Parameters:
image
- the new image,null
to hide the image.
-
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.- Specified by:
paint
in interfaceILightControl
- Overrides:
paint
in classLightComposite
- Parameters:
gc
- theGC
to paint on.rectangle
- the rectangle to paint.
-
setVisible
public void setVisible(boolean value)
Description copied from interface:ILightControl
Sets this control visibility.- Specified by:
setVisible
in interfaceILightControl
- Overrides:
setVisible
in classAbstractLightControl
- Parameters:
value
- the new visibility value.
-
setEnabled
public void setEnabled(boolean value)
Description copied from interface:ILightControl
Sets this control enablement.- Specified by:
setEnabled
in interfaceILightControl
- Overrides:
setEnabled
in classAbstractLightControl
-
setEditable
public void setEditable(boolean isEditable)
Description copied from interface:IEditable
Sets control editable state.- Specified by:
setEditable
in interfaceIEditable
- Parameters:
isEditable
- -true
if control can be edited.
-
isEditable
public boolean isEditable()
Description copied from interface:IEditable
Returns control editable state.- Specified by:
isEditable
in interfaceIEditable
- Returns:
true
if control can be edited.
-
contentSet
protected void contentSet(C content)
- Specified by:
contentSet
in classAbstractLightContentComposite<C extends ILightControl>
-
contentUnset
protected void contentUnset(C content)
- Specified by:
contentUnset
in classAbstractLightContentComposite<C extends ILightControl>
-
-