Package com._1c.g5.lwt
Interface ILightControl
-
- All Known Subinterfaces:
ILightComposite
- All Known Implementing Classes:
AbstractLightContentComposite
,AbstractLightControl
,AbstractLightScrollbar
,AbstractLightSpinner
,AbstractScrollableControl
,BigDecimalLightSpinner
,DoubleLightSpinner
,LightCheckbox
,LightColorBox
,LightColorBoxEditorBar
,LightCombo
,LightComposite
,LightEditorBar
,LightFormattedText
,LightImage
,LightImageButton
,LightImageCombo
,LightLabel
,LightList
,LightScrolledContentComposite
,LightSeparator
,LightSpinner
,LightText
,LightTextEditorBar
,LightUpDownButton
,LongLightSpinner
,SwtLightComposite
,SwtLightControl
,SwtLightScrolledComposite
public interface ILightControl
Public contract of light controls.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addControlListener(ILightControlListener listener)
Adds the control listener.org.eclipse.swt.graphics.Point
computeSize(org.eclipse.swt.graphics.GC gc, int width, int height, boolean flushCache)
Computes the size of this control.void
dispose()
Disposes this control.org.eclipse.swt.graphics.Rectangle
getBounds()
Gets the bounds of this control.org.eclipse.swt.graphics.Cursor
getCursor()
Gets the cursor of this control.Object
getData(String key)
Gets the user defined data associated with this control.ILightLayoutData
getLayoutData()
Gets the layout data of this control.ILightComposite
getParent()
Gets the parent of this control.String
getTooltip()
Gets the tooltip of this control.org.eclipse.swt.graphics.Rectangle
getVisibleBounds()
void
handleEvent(org.eclipse.swt.widgets.Event event)
Handles the SWT event, SWT events are pumped to this method if this control is active.default void
initialize(Object context)
Called to initialize the control.void
invalidate()
Invalidates the bounds of this control.void
invalidate(org.eclipse.swt.graphics.Rectangle rectangle)
Invalidates the given rectangle of this control.boolean
isDisposed()
Checks if control this is disposed.boolean
isEnabled()
Checks if this is enabled.boolean
isFocused()
Checks if this control is focused.boolean
isVisible()
Checks if this control is visible.void
paint(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle)
Paints the given rectangle of this control.void
removeControlListener(ILightControlListener listener)
Removes the control listener.void
setBounds(org.eclipse.swt.graphics.Rectangle bounds)
Sets the bounds of this control.void
setCursor(org.eclipse.swt.graphics.Cursor cursor)
Sets the cursor of this control.void
setData(String key, Object data)
Sets the user-defined data associated with this control.void
setEnabled(boolean enabled)
Sets this control enablement.boolean
setFocus(FocusSource focusSource)
Sets the focus to this control.void
setLayoutData(ILightLayoutData layoutData)
Sets the layout data of this control.void
setParent(ILightComposite parent)
Sets the parent of this control.void
setTooltip(String tooltip)
Sets the tooltip of this control.void
setVisible(boolean value)
Sets this control visibility.
-
-
-
Method Detail
-
initialize
default void initialize(Object context)
Called to initialize the control.- Parameters:
context
- the initialization context which depends on the specific control- Since:
- 2.1
-
getParent
ILightComposite getParent()
Gets the parent of this control.- Returns:
- the parent composite control or
null
if this control is not contained in any composite.
-
setParent
void setParent(ILightComposite parent)
Sets the parent of this control.- Parameters:
parent
- the new parent.
-
getBounds
org.eclipse.swt.graphics.Rectangle getBounds()
Gets the bounds of this control.- Returns:
- the bounds.
-
setBounds
void setBounds(org.eclipse.swt.graphics.Rectangle bounds)
Sets the bounds of this control.- Parameters:
bounds
- the new bounds.
-
getVisibleBounds
org.eclipse.swt.graphics.Rectangle getVisibleBounds()
-
invalidate
void invalidate()
Invalidates the bounds of this control.
-
invalidate
void invalidate(org.eclipse.swt.graphics.Rectangle rectangle)
Invalidates the given rectangle of this control.- Parameters:
rectangle
- the rectangle to invalidate.
-
paint
void paint(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle rectangle)
Paints the given rectangle of this control.- Parameters:
gc
- theGC
to paint on.rectangle
- the rectangle to paint.
-
computeSize
org.eclipse.swt.graphics.Point computeSize(org.eclipse.swt.graphics.GC gc, int width, int height, boolean flushCache)
Computes the size of this control.- 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.
-
setLayoutData
void setLayoutData(ILightLayoutData layoutData)
Sets the layout data of this control.- Parameters:
layoutData
- the new layout data.
-
getLayoutData
ILightLayoutData getLayoutData()
Gets the layout data of this control.- Returns:
- the layout data.
-
handleEvent
void handleEvent(org.eclipse.swt.widgets.Event event)
Handles the SWT event, SWT events are pumped to this method if this control is active.- Parameters:
event
- the event to handle.- See Also:
ILightComposite.setActiveControl(ILightControl)
-
addControlListener
void addControlListener(ILightControlListener listener)
Adds the control listener.- Parameters:
listener
- the listener.
-
removeControlListener
void removeControlListener(ILightControlListener listener)
Removes the control listener.- Parameters:
listener
- the listener.
-
isVisible
boolean isVisible()
Checks if this control is visible.- Returns:
true
if this control is visible,false
if not.
-
setVisible
void setVisible(boolean value)
Sets this control visibility.- Parameters:
value
- the new visibility value.
-
isEnabled
boolean isEnabled()
Checks if this is enabled.- Returns:
true
if this control is enabled,false
if not.
-
setEnabled
void setEnabled(boolean enabled)
Sets this control enablement.- Parameters:
value
- the new enablement value.
-
setFocus
boolean setFocus(FocusSource focusSource)
Sets the focus to this control.- Parameters:
focusSource
- the focus request source.- Returns:
true
if focus was set,false
otherwise.
-
isFocused
boolean isFocused()
Checks if this control is focused.- Returns:
true
if this control is focused,false
otherwise.
-
isDisposed
boolean isDisposed()
Checks if control this is disposed.- Returns:
true
if this control is disposed,false
otherwise.
-
dispose
void dispose()
Disposes this control.
-
setData
void setData(String key, Object data)
Sets the user-defined data associated with this control.- Parameters:
key
- the key.data
- the data.
-
getData
Object getData(String key)
Gets the user defined data associated with this control.- Parameters:
key
- the key.- Returns:
- the data or
null
if no data was set for the given key.
-
getCursor
org.eclipse.swt.graphics.Cursor getCursor()
Gets the cursor of this control.- Returns:
- the cursor or
null
if no cursor was set.
-
setCursor
void setCursor(org.eclipse.swt.graphics.Cursor cursor)
Sets the cursor of this control.- Parameters:
cursor
- the new cursor ornull
to reset to default cursor.
-
getTooltip
String getTooltip()
Gets the tooltip of this control.- Returns:
- the tooltip or
null
if no tooltip was set.
-
setTooltip
void setTooltip(String tooltip)
Sets the tooltip of this control.- Parameters:
tooltip
- the new tooltip ornull
to clear the tooltip.
-
-