Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 325517 - [QualifiedNameProvider] local name function should be configurable
Summary: [QualifiedNameProvider] local name function should be configurable
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 1.0.1   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 enhancement (vote)
Target Milestone: M2   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-09-16 15:38 EDT by Michael Clay CLA
Modified: 2017-09-19 16:12 EDT (History)
2 users (show)

See Also:
sven.efftinge: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Clay CLA 2010-09-16 15:38:20 EDT
currently its not possible to compute a local name based on a different strategy inside #getQualifiedName()
besides overiding the complete getQualifiedName() method. therefore i suggest to either inject the local name function or call the protected #getResolver() method from within getQualifiedName(). additionally the getResolver method should return interface Function<EObject,String> instead of SimpleAttributeResolver.
Comment 1 Sven Efftinge CLA 2010-09-17 05:58:02 EDT
Not sure I understood the enhancement request.

The qualified name provider is used to compute a global (i.e. without any context) name for an EObject.
Local names make use of local context, in order to shorten global names or introduce aliases. In other words it is not the duty of an IQualifiedNameProvider to compute a local name. 

Could you please try to explain what you want to do?
Comment 2 Michael Clay CLA 2010-09-17 09:18:12 EDT
(In reply to comment #1)
> Not sure I understood the enhancement request.
> 
> The qualified name provider is used to compute a global (i.e. without any
> context) name for an EObject.
> Local names make use of local context, in order to shorten global names or
> introduce aliases. In other words it is not the duty of an
> IQualifiedNameProvider to compute a local name. 
> 
> Could you please try to explain what you want to do?

integration with external models (non-xtext) which do not contain a 'name' feature to compute local name from. since the IQNP concatenates 'local' (SimpleAttributeResolver) names to build up a global/qualified name i need the possibility to change the 'local' name function
Comment 3 Sven Efftinge CLA 2010-09-20 02:38:00 EDT
Sorry I didn't understand you were talking about DefaultDeclarativeQualifiedNameProvider.

Overriding the protected method should be sufficient, isn't it?
Agreed that the return type should be Function instead of SimpleAttributeResolver.
Comment 4 Sebastian Zarnekow CLA 2010-09-20 02:59:40 EDT
IIRC, the method is never used. That seems to be the problem.
Comment 5 Sven Efftinge CLA 2010-09-20 03:17:57 EDT
:-) Yes, that might be problematic
Comment 6 Michael Clay CLA 2010-09-20 15:14:49 EDT
done
Comment 7 Karsten Thoms CLA 2017-09-19 16:12:28 EDT
Closing bug which were set to RESOLVED before Eclipse Neon.0.