Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 07:07 Go to next message
Janusz Dalecki is currently offline Janusz DaleckiFriend
Messages: 63
Registered: January 2010
Location: Sydney
Member
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 08:18 Go to previous messageGo to next message
Francis Upton IV is currently offline Francis Upton IVFriend
Messages: 472
Registered: July 2009
Location: Oakland, CA
Senior Member
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 10:14 Go to previous messageGo to next message
Janusz Dalecki is currently offline Janusz DaleckiFriend
Messages: 63
Registered: January 2010
Location: Sydney
Member
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 16:14 Go to previous message
Francis Upton IV is currently offline Francis Upton IVFriend
Messages: 472
Registered: July 2009
Location: Oakland, CA
Senior Member
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: Wed Jan 20 20:45:12 GMT 2021

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

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

Back to the top