|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.gmf.runtime.lite.edit.parts.labels.AbstractLabelTextDisplayer
org.eclipse.gmf.runtime.lite.edit.parts.labels.AbstractFeatureBasedLabelTextDisplayer
public abstract class AbstractFeatureBasedLabelTextDisplayer
An implementation of ILabelTextDisplayer that is based on a
number of structural features of the source object.
| Field Summary | |
|---|---|
protected static String |
EMPTY_STRING
|
| Constructor Summary | |
|---|---|
AbstractFeatureBasedLabelTextDisplayer(org.eclipse.emf.ecore.EStructuralFeature... features)
|
|
| Method Summary | |
|---|---|
protected abstract String |
buildDisplayText(Object[] featureValues)
Returns the text to be displayed by this label processor for the given values. |
protected abstract String |
buildEditText(Object[] featureValues)
Returns the initial edit text to be displayed by this label processor for the given values. |
org.eclipse.emf.common.command.Command |
getApplyCommand(org.eclipse.emf.ecore.EObject source,
String newValue)
By default, labels are not editable. |
String |
getDisplayText(org.eclipse.emf.ecore.EObject source)
Returns the text a label for the given source object should display. |
String |
getEditText(org.eclipse.emf.ecore.EObject source)
By default, the edit text is the same as the display text. |
protected org.eclipse.emf.ecore.EStructuralFeature[] |
getFeatures()
Returns the features used by this displayer. |
org.eclipse.jface.viewers.ICellEditorValidator |
getValidator()
By default, no validation is performed. |
protected Object |
getValidNewValue(org.eclipse.emf.ecore.EStructuralFeature structuralFeature,
Object value)
Allows the parsed value to be replaced (e.g., to match the type of the structural feature). |
protected Object |
getValidValue(org.eclipse.emf.ecore.EStructuralFeature feature,
Object value)
Allows the given value to be replaced. |
protected Object[] |
getValues(org.eclipse.emf.ecore.EObject source)
|
boolean |
isAffectingEvent(org.eclipse.emf.common.notify.Notification notification)
Returns whether the given notification may cause a source to require update of the label. |
String |
isValid(Object value)
|
protected abstract Object[] |
parseEditedValues(String newString)
Returns the values that should be set to the corresponding features. |
protected boolean |
shouldReplaceEmptyStringsWithNulls(org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
Returns whether empty strings should be replaced with nulls when applied. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected static final String EMPTY_STRING
| Constructor Detail |
|---|
public AbstractFeatureBasedLabelTextDisplayer(org.eclipse.emf.ecore.EStructuralFeature... features)
| Method Detail |
|---|
public String getDisplayText(org.eclipse.emf.ecore.EObject source)
ILabelTextDisplayer
getDisplayText in interface ILabelTextDisplayerpublic String getEditText(org.eclipse.emf.ecore.EObject source)
AbstractLabelTextDisplayer
getEditText in interface ILabelTextDisplayergetEditText in class AbstractLabelTextDisplayerprotected Object[] getValues(org.eclipse.emf.ecore.EObject source)
protected Object getValidValue(org.eclipse.emf.ecore.EStructuralFeature feature,
Object value)
null strings are converted to empty strings,
no other replacements are performed. Subclasses may extend or reimplement.
public boolean isAffectingEvent(org.eclipse.emf.common.notify.Notification notification)
ILabelTextDisplayer
isAffectingEvent in interface ILabelTextDisplayer
public org.eclipse.emf.common.command.Command getApplyCommand(org.eclipse.emf.ecore.EObject source,
String newValue)
AbstractLabelTextDisplayer
getApplyCommand in interface ILabelTextDisplayergetApplyCommand in class AbstractLabelTextDisplayerpublic org.eclipse.jface.viewers.ICellEditorValidator getValidator()
AbstractLabelTextDisplayer
getValidator in interface ILabelTextDisplayergetValidator in class AbstractLabelTextDisplayerpublic String isValid(Object value)
isValid in interface org.eclipse.jface.viewers.ICellEditorValidator
protected Object getValidNewValue(org.eclipse.emf.ecore.EStructuralFeature structuralFeature,
Object value)
throws IllegalArgumentException
IllegalArgumentException - if the value cannot be parsed for the type of the given structural feature.protected boolean shouldReplaceEmptyStringsWithNulls(org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
nulls when applied.
protected org.eclipse.emf.ecore.EStructuralFeature[] getFeatures()
protected abstract String buildDisplayText(Object[] featureValues)
protected abstract String buildEditText(Object[] featureValues)
protected abstract Object[] parseEditedValues(String newString)
throws IllegalArgumentException
IllegalArgumentException - If the given string is invalid.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||