Package com._1c.g5.lwt
Class AbstractLightControl
- java.lang.Object
-
- com._1c.g5.lwt.AbstractLightControl
-
- All Implemented Interfaces:
ILightControl
- Direct Known Subclasses:
AbstractScrollableControl
,LightCheckbox
,LightColorBox
,LightComposite
,LightImage
,LightImageCombo
,LightLabel
,LightSeparator
,LightText
public abstract class AbstractLightControl extends Object implements ILightControl
Base class for all of the light controls.
-
-
Constructor Summary
Constructors Constructor Description AbstractLightControl()
-
Method Summary
All Methods Instance Methods Concrete 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.SwtLightControl
getOverlay()
Gets the overlay associated with 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.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
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.protected void
setFocusable(boolean value)
Sets the focusable flag for this control.void
setLayoutData(ILightLayoutData layoutData)
Sets the layout data of this control.void
setOverlay(SwtLightControl overlay)
Sets the overlay for 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.-
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, paint
-
-
-
-
Method Detail
-
getOverlay
public SwtLightControl getOverlay()
Gets the overlay associated with this control.- Returns:
- the overlay or
null
if this control has no overlay. - See Also:
SwtLightControl.getOverlaySource()
-
setOverlay
public void setOverlay(SwtLightControl overlay)
Sets the overlay for this control.- Parameters:
overlay
- the new overlay ornull
to clear the overlay association.- See Also:
SwtLightControl.getOverlaySource()
-
getParent
public ILightComposite getParent()
Description copied from interface:ILightControl
Gets the parent of this control.- Specified by:
getParent
in interfaceILightControl
- Returns:
- the parent composite control or
null
if this control is not contained in any composite.
-
setParent
public void setParent(ILightComposite parent)
Description copied from interface:ILightControl
Sets the parent of this control.- Specified by:
setParent
in interfaceILightControl
- Parameters:
parent
- the new parent.
-
getBounds
public org.eclipse.swt.graphics.Rectangle getBounds()
Description copied from interface:ILightControl
Gets the bounds of this control.- Specified by:
getBounds
in interfaceILightControl
- Returns:
- the bounds.
-
setBounds
public void setBounds(org.eclipse.swt.graphics.Rectangle bounds)
Description copied from interface:ILightControl
Sets the bounds of this control.- Specified by:
setBounds
in interfaceILightControl
- Parameters:
bounds
- the new bounds.
-
getVisibleBounds
public org.eclipse.swt.graphics.Rectangle getVisibleBounds()
- Specified by:
getVisibleBounds
in interfaceILightControl
-
invalidate
public void invalidate()
Description copied from interface:ILightControl
Invalidates the bounds of this control.- Specified by:
invalidate
in interfaceILightControl
-
invalidate
public void invalidate(org.eclipse.swt.graphics.Rectangle rectangle)
Description copied from interface:ILightControl
Invalidates the given rectangle of this control.- Specified by:
invalidate
in interfaceILightControl
- Parameters:
rectangle
- the rectangle to invalidate.
-
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
- 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
public void setLayoutData(ILightLayoutData layoutData)
Description copied from interface:ILightControl
Sets the layout data of this control.- Specified by:
setLayoutData
in interfaceILightControl
- Parameters:
layoutData
- the new layout data.
-
getLayoutData
public ILightLayoutData getLayoutData()
Description copied from interface:ILightControl
Gets the layout data of this control.- Specified by:
getLayoutData
in interfaceILightControl
- Returns:
- the layout data.
-
handleEvent
public void handleEvent(org.eclipse.swt.widgets.Event event)
Description copied from interface:ILightControl
Handles the SWT event, SWT events are pumped to this method if this control is active.- Specified by:
handleEvent
in interfaceILightControl
- Parameters:
event
- the event to handle.- See Also:
ILightComposite.setActiveControl(ILightControl)
-
isVisible
public boolean isVisible()
Description copied from interface:ILightControl
Checks if this control is visible.- Specified by:
isVisible
in interfaceILightControl
- Returns:
true
if this control is visible,false
if not.
-
setVisible
public void setVisible(boolean value)
Description copied from interface:ILightControl
Sets this control visibility.- Specified by:
setVisible
in interfaceILightControl
- Parameters:
value
- the new visibility value.
-
isEnabled
public boolean isEnabled()
Description copied from interface:ILightControl
Checks if this is enabled.- Specified by:
isEnabled
in interfaceILightControl
- Returns:
true
if this control is enabled,false
if not.
-
setEnabled
public void setEnabled(boolean enabled)
Description copied from interface:ILightControl
Sets this control enablement.- Specified by:
setEnabled
in interfaceILightControl
-
setFocus
public boolean setFocus(FocusSource focusSource)
Description copied from interface:ILightControl
Sets the focus to this control.- Specified by:
setFocus
in interfaceILightControl
- Parameters:
focusSource
- the focus request source.- Returns:
true
if focus was set,false
otherwise.
-
isFocused
public boolean isFocused()
Description copied from interface:ILightControl
Checks if this control is focused.- Specified by:
isFocused
in interfaceILightControl
- Returns:
true
if this control is focused,false
otherwise.
-
isDisposed
public boolean isDisposed()
Description copied from interface:ILightControl
Checks if control this is disposed.- Specified by:
isDisposed
in interfaceILightControl
- Returns:
true
if this control is disposed,false
otherwise.
-
dispose
public void dispose()
Description copied from interface:ILightControl
Disposes this control.- Specified by:
dispose
in interfaceILightControl
-
getData
public Object getData(String key)
Description copied from interface:ILightControl
Gets the user defined data associated with this control.- Specified by:
getData
in interfaceILightControl
- Parameters:
key
- the key.- Returns:
- the data or
null
if no data was set for the given key.
-
setData
public void setData(String key, Object data)
Description copied from interface:ILightControl
Sets the user-defined data associated with this control.- Specified by:
setData
in interfaceILightControl
- Parameters:
key
- the key.data
- the data.
-
getCursor
public org.eclipse.swt.graphics.Cursor getCursor()
Description copied from interface:ILightControl
Gets the cursor of this control.- Specified by:
getCursor
in interfaceILightControl
- Returns:
- the cursor or
null
if no cursor was set.
-
setCursor
public void setCursor(org.eclipse.swt.graphics.Cursor cursor)
Description copied from interface:ILightControl
Sets the cursor of this control.- Specified by:
setCursor
in interfaceILightControl
- Parameters:
cursor
- the new cursor ornull
to reset to default cursor.
-
getTooltip
public String getTooltip()
Description copied from interface:ILightControl
Gets the tooltip of this control.- Specified by:
getTooltip
in interfaceILightControl
- Returns:
- the tooltip or
null
if no tooltip was set.
-
setTooltip
public void setTooltip(String tooltip)
Description copied from interface:ILightControl
Sets the tooltip of this control.- Specified by:
setTooltip
in interfaceILightControl
- Parameters:
tooltip
- the new tooltip ornull
to clear the tooltip.
-
addControlListener
public void addControlListener(ILightControlListener listener)
Description copied from interface:ILightControl
Adds the control listener.- Specified by:
addControlListener
in interfaceILightControl
- Parameters:
listener
- the listener.
-
removeControlListener
public void removeControlListener(ILightControlListener listener)
Description copied from interface:ILightControl
Removes the control listener.- Specified by:
removeControlListener
in interfaceILightControl
- Parameters:
listener
- the listener.
-
setFocusable
protected void setFocusable(boolean value)
Sets the focusable flag for this control. If control is focusable it may receive focus on mouse and keyboard activity.- Parameters:
value
- the new focusable.
-
-