Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Hiding file extension in CNF(Hiding file extension in CNF)
Hiding file extension in CNF [message #552411] Thu, 12 August 2010 03:07 Go to next message
Eclipse UserFriend
Is there any quick way of hiding file's extension displayed by Common Navigator Framework, without implementing both content provider and label provider.
What I would like to do is to cut off the extension of the file when displayed by CommonViewer - fro example I would like to CV display "file" instead of file.exe.
Re: Hiding file extension in CNF [message #552426 is a reply to message #552411] Thu, 12 August 2010 04:18 Go to previous messageGo to next message
Eclipse UserFriend
You will need to implement a label provider to actually hide the labels and then you can delegate the rest of the work to the existing label provider. You can use the existing content provider.

You will need a new Navigator Content Extension that overrides the existing one.
Re: Hiding file extension in CNF [message #552466 is a reply to message #552411] Thu, 12 August 2010 06:14 Go to previous messageGo to next message
Eclipse UserFriend
Thanks for the reply,
When you say I should provide new 'Navigator Content Extension' you mean define new extension 'org.eclipse.ui.navigator.navigatorContent' and its child 'navigatorContent' and then define new content provider and label provider plus all the other stuff (name, priority...)?.
Well, CNF is using as its content provider the 'org.eclipse.ui.internal.navigator.resources.workbench.Resou rceExtensionContentProvider' class and as label provider it is using a 'org.eclipse.ui.internal.navigator.resources.workbench.Resou rceExtensionLabelProvider'.
My dilemma now is that if I define new 'org.eclipse.ui.navigator.navigatorContent' with 'navigatorContent' I will have to specify as a content provider the internal Eclipse class 'org.eclipse.ui.internal.navigator.resources.workbench.Resou rceExtensionContentProvider' to use it as a default implementation for content provider which to me sounds a bit like a hack.
Providing new label provider is not a problem all I need to do is to derive my label provider from 'WorkbenchLabelProvider' and specify it in 'labelProvider' in 'navigatorContent'.
Is there any cleaner way of providing default content provider without specifying the 'org.eclipse.ui.internal.navigator.resources.workbench.Resou rceExtensionContentProvider'?
Sorry if I did not understand your answer,
Cheers,
Janusz
Re: Hiding file extension in CNF [message #552569 is a reply to message #552466] Thu, 12 August 2010 12:14 Go to previous message
Eclipse UserFriend
You understood the answer perfectly correctly and you are right it's a bit of a hack since you are referencing an internal class.

That's the way you have to do it for now, but it brings up an interesting point for which I invite you to file an enhancement request.

I think it would be interesting to be able to override an NCE but to use that' NCE's content provider rather than provider your own.

Can you file an enhancement request against Platform, UI, Common Navigator?
Previous Topic:Helios update site looks different from two clients
Next Topic:Disable/Enable 'Save As...'
Goto Forum:
  


Current Time: Tue Jul 15 01:07:59 EDT 2025

Powered by FUDForum. Page generated in 0.48205 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top