public class TextWrapperForIElement extends Object implements IPickingClient, IEditorDropClient
| Modifier and Type | Field and Description |
|---|---|
protected static org.eclipse.swt.graphics.Image |
indicatorImage |
protected org.eclipse.swt.widgets.Text |
textField |
| Constructor and Description |
|---|
TextWrapperForIElement(org.eclipse.swt.widgets.Composite parent,
IElement initialElement,
boolean acceptNullValue,
List<Class<? extends IElement>> allowedMetaclasses)
C'tor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
acceptDroppedElements(IElement[] target)
Returns whether the field accepts the element as a value.
|
boolean |
acceptElement(IElement target)
Returns whether the field accepts the element as a value.
|
void |
addAllowedMetaclass(Class<? extends IElement> allowedMetaclass) |
void |
addAllowedMetaclasses(List<Class<? extends IElement>> metaclasses) |
void |
addListener(IElementChangeListener listener) |
void |
createContent(org.eclipse.swt.widgets.Composite parent) |
protected void |
endPickingSession() |
List<IElement> |
findByName(List<Class<? extends IElement>> metaclasses,
String nameValue,
IElementFilter filter)
Search model elements by their name.
|
List<Class<? extends IElement>> |
getAllowedMetaclasses() |
org.eclipse.swt.widgets.Text |
getTextField() |
boolean |
isAcceptNullValue() |
protected void |
onKeyPressed(org.eclipse.swt.events.KeyEvent e) |
void |
pickingAborted()
Called when another picking client calls beginPicking() on the picking service.
|
boolean |
removeAllowedMetaclass(Class<? extends IElement> allowedMetaclass) |
boolean |
removeAllowedMetaclasses(List<Class<? extends IElement>> metaclasses) |
void |
removeListener(IElementChangeListener listener) |
void |
setAcceptNullValue(boolean acceptNullValue) |
void |
setDroppedElements(IElement[] dropedElement)
Set the field value to the given element and end the picking session
if the given element is valid.
|
boolean |
setElement(IElement target)
Set the field value to the given element and end the picking session
if the given element is valid.
|
void |
setElementFilter(IElementFilter elementFilter) |
protected void |
startPickingSession() |
protected org.eclipse.swt.widgets.Text textField
protected static final org.eclipse.swt.graphics.Image indicatorImage
public TextWrapperForIElement(org.eclipse.swt.widgets.Composite parent,
IElement initialElement,
boolean acceptNullValue,
List<Class<? extends IElement>> allowedMetaclasses)
parent - parent control.initialElement - initial value.acceptNullValue - whether the null value should be accepted or not.public boolean isAcceptNullValue()
public void setAcceptNullValue(boolean acceptNullValue)
public boolean removeAllowedMetaclass(Class<? extends IElement> allowedMetaclass)
public void addAllowedMetaclasses(List<Class<? extends IElement>> metaclasses)
public boolean removeAllowedMetaclasses(List<Class<? extends IElement>> metaclasses)
public List<IElement> findByName(List<Class<? extends IElement>> metaclasses, String nameValue, IElementFilter filter)
metaclasses - metaclasses of the searched elementsnameValue - name of the searched elementsfilter - a filter that allow to restrict the result scope. can be null.protected void onKeyPressed(org.eclipse.swt.events.KeyEvent e)
protected void startPickingSession()
public void createContent(org.eclipse.swt.widgets.Composite parent)
public boolean acceptElement(IElement target)
IPickingClientacceptElement in interface IPickingClienttarget - the new value candidate.public boolean setElement(IElement target)
IPickingClientsetElement in interface IPickingClienttarget - The new represented element in the fieldpublic boolean acceptDroppedElements(IElement[] target)
IEditorDropClientacceptDroppedElements in interface IEditorDropClienttarget - the new value candidate.public void setDroppedElements(IElement[] dropedElement)
IEditorDropClientsetDroppedElements in interface IEditorDropClientdropedElement - The new represented elements in the fieldpublic void pickingAborted()
IPickingClientpickingAborted in interface IPickingClientpublic void setElementFilter(IElementFilter elementFilter)
elementFilter - public void addListener(IElementChangeListener listener)
public void removeListener(IElementChangeListener listener)
public org.eclipse.swt.widgets.Text getTextField()
protected void endPickingSession()