org.eclipse.gmf.runtime.lite.edit.parts.labels
Class PrintfLabelTextDisplayer

java.lang.Object
  extended by org.eclipse.gmf.runtime.lite.edit.parts.labels.AbstractLabelTextDisplayer
      extended by org.eclipse.gmf.runtime.lite.edit.parts.labels.AbstractFeatureBasedLabelTextDisplayer
          extended by org.eclipse.gmf.runtime.lite.edit.parts.labels.PrintfLabelTextDisplayer
All Implemented Interfaces:
ILabelTextDisplayer, org.eclipse.jface.viewers.ICellEditorValidator

public class PrintfLabelTextDisplayer
extends AbstractFeatureBasedLabelTextDisplayer

An implementation of ILabelTextDisplayer that prints a number of structural features of the source object using printf notation. No editing is supported.


Field Summary
 
Fields inherited from class org.eclipse.gmf.runtime.lite.edit.parts.labels.AbstractFeatureBasedLabelTextDisplayer
EMPTY_STRING
 
Constructor Summary
PrintfLabelTextDisplayer(String viewPattern, org.eclipse.emf.ecore.EStructuralFeature... features)
           
PrintfLabelTextDisplayer(String viewPattern, String editorPattern, org.eclipse.emf.ecore.EStructuralFeature... features)
           
 
Method Summary
protected  String adjustPattern(String pattern)
           
protected  String buildDisplayText(Object[] featureValues)
          Returns the text to be displayed by this label processor for the given values.
protected  String buildEditText(Object[] featureValues)
          Returns the initial edit text to be displayed by this label processor for the given values.
protected  String buildText(Object[] featureValues, String pattern)
           
protected  Object[] parseEditedValues(String newString)
          Returns the values that should be set to the corresponding features.
 
Methods inherited from class org.eclipse.gmf.runtime.lite.edit.parts.labels.AbstractFeatureBasedLabelTextDisplayer
getApplyCommand, getDisplayText, getEditText, getFeatures, getValidator, getValidNewValue, getValidValue, getValues, isAffectingEvent, isValid, shouldReplaceEmptyStringsWithNulls
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrintfLabelTextDisplayer

public PrintfLabelTextDisplayer(String viewPattern,
                                org.eclipse.emf.ecore.EStructuralFeature... features)

PrintfLabelTextDisplayer

public PrintfLabelTextDisplayer(String viewPattern,
                                String editorPattern,
                                org.eclipse.emf.ecore.EStructuralFeature... features)
Method Detail

parseEditedValues

protected Object[] parseEditedValues(String newString)
                              throws IllegalArgumentException
Description copied from class: AbstractFeatureBasedLabelTextDisplayer
Returns the values that should be set to the corresponding features.

Specified by:
parseEditedValues in class AbstractFeatureBasedLabelTextDisplayer
Throws:
IllegalArgumentException - If the given string is invalid.

buildDisplayText

protected String buildDisplayText(Object[] featureValues)
Description copied from class: AbstractFeatureBasedLabelTextDisplayer
Returns the text to be displayed by this label processor for the given values.

Specified by:
buildDisplayText in class AbstractFeatureBasedLabelTextDisplayer

buildEditText

protected String buildEditText(Object[] featureValues)
Description copied from class: AbstractFeatureBasedLabelTextDisplayer
Returns the initial edit text to be displayed by this label processor for the given values.

Specified by:
buildEditText in class AbstractFeatureBasedLabelTextDisplayer

adjustPattern

protected String adjustPattern(String pattern)

buildText

protected String buildText(Object[] featureValues,
                           String pattern)


Copyright © 2012. All Rights Reserved.