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,
MObject initialElement,
boolean acceptNullValue,
List<Class<? extends MObject>> allowedMetaclasses)
C'tor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptDroppedElements(MObject[] target)
Returns whether the field accepts the element as a value.
|
boolean |
acceptElement(MObject target)
Returns whether the field accepts the element as a value.
|
void |
addAllowedMetaclass(Class<? extends MObject> allowedMetaclass) |
void |
addAllowedMetaclasses(List<Class<? extends MObject>> metaclasses) |
void |
addListener(IElementChangeListener listener) |
void |
createContent(org.eclipse.swt.widgets.Composite parent) |
protected void |
endPickingSession() |
List<MObject> |
findByName(List<Class<? extends MObject>> metaclasses,
String nameValue,
IElementFilter filter)
Search model elements by their name.
|
List<Class<? extends MObject>> |
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 MObject> allowedMetaclass) |
boolean |
removeAllowedMetaclasses(List<Class<? extends MObject>> metaclasses) |
void |
removeListener(IElementChangeListener listener) |
void |
setAcceptNullValue(boolean acceptNullValue) |
void |
setDroppedElements(MObject[] dropedElement)
Set the field value to the given element and end the picking session
if the given element is valid.
|
boolean |
setElement(MObject 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, MObject initialElement, boolean acceptNullValue, List<Class<? extends MObject>> 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 MObject> allowedMetaclass)
public boolean removeAllowedMetaclasses(List<Class<? extends MObject>> metaclasses)
public List<MObject> findByName(List<Class<? extends MObject>> 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(MObject target)
IPickingClient
acceptElement
in interface IPickingClient
target
- the new value candidate.public boolean setElement(MObject target)
IPickingClient
setElement
in interface IPickingClient
target
- The new represented element in the fieldpublic boolean acceptDroppedElements(MObject[] target)
IEditorDropClient
acceptDroppedElements
in interface IEditorDropClient
target
- the new value candidate.public void setDroppedElements(MObject[] dropedElement)
IEditorDropClient
setDroppedElements
in interface IEditorDropClient
dropedElement
- The new represented elements in the fieldpublic void pickingAborted()
IPickingClient
pickingAborted
in interface IPickingClient
public 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()