title: How to get an Ecore feature disply name without an object instance?
body: <p>I'd like to create a GUI table to display a given list of features of an <code>EObject</code> sub-class. To do this I have to get the display names of the features for the column header.</p>
  
  <p>How do I get the feature display names in the best way?</p>
  
  <h2>One solution that seems a bit like a hack:</h2>
  
  <p>If I have an instance of the class then I can use the adaptor factory to get a <code>IItemPropertySource</code> that can do this:</p>
  
  <pre class="lang-java prettyprint-override"><code>SomeEntity e = ...
  String displayName = adaptorFactory.adapt(e, IItemPropertySource.class)
      .getPropertyDescriptor(null, feature).getDisplayName(null));
  </code></pre>
  
  <p>But when the table is empty there is no <code>SomeEntity</code> object handy to use to get the <code>IItemPropertySource</code>.</p>
  
  <p>I can create a dummy object using the <code>EFactory</code> in this way:</p>
  
  <pre class="lang-java prettyprint-override"><code>EClass containingClass = feature.getEContainingClass();
  SomeEntity dummy = containingClass.getEPackage().getEFactoryInstance()
      .create(containingClass));
  </code></pre>
  
  <p>... and then use that object the get the <code>IItemPropertySource</code>. But this seem a bit like a hack. Is there no better solution?</p>