Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » ViewPart State & Customize label
ViewPart State & Customize label [message #333285] Wed, 03 December 2008 12:30 Go to next message
dorian_dinh is currently offline dorian_dinhFriend
Messages: 31
Registered: July 2009
Member
Hello,

I got 2 questions :


1. IPartListener notifies different lifecycle events of a listened view
part. But there is no event representing the "visible state". Why eclipse
API made this choice ? How to be sure of a visible state of a view part ?
Because a viewpart could be visible and deactivated. My purpose is to
register a command and launch it as soon as my viewpart is visible. Any
point of reference ?

2. I made a custom viewpart, containing a set of treeviewers. I insist on
fact that my treeviewers don't inherit from navigator. For each of my
treeviewers i set a ITreeContentProvider & ILabelProvider implementations.
I would like to change the font or, the color of the font, or the style of
the font of some label for some specific model element types. I want to
customized this change once & for all at compile time, don't need to load
DecoratorManager stuff... Any point of reference ? I read on a post from
2003, at this time, Eclipse seemed to be really limited on this feature,
any new features ? Do i really need an engineer degree for changing the
font of my view ?

Target platform : eclipse 3.3.2.

Thanks in advance,

Dorian.
Re: ViewPart State & Customize label [message #333287 is a reply to message #333285] Wed, 03 December 2008 12:37 Go to previous messageGo to next message
dorian_dinh is currently offline dorian_dinhFriend
Messages: 31
Registered: July 2009
Member
I moved my question on Eclipse.platform.swt
Re: ViewPart State & Customize label [message #333288 is a reply to message #333285] Wed, 03 December 2008 12:38 Go to previous messageGo to next message
Thomas Schindl is currently offline Thomas SchindlFriend
Messages: 6651
Registered: July 2009
Senior Member
ddinh schrieb:
> Hello,
>
> I got 2 questions :
>
>
> 1. IPartListener notifies different lifecycle events of a listened view
> part. But there is no event representing the "visible state". Why
> eclipse API made this choice ? How to be sure of a visible state of a
> view part ? Because a viewpart could be visible and deactivated. My
> purpose is to register a command and launch it as soon as my viewpart is
> visible. Any point of reference ?
>
> 2. I made a custom viewpart, containing a set of treeviewers. I insist
> on fact that my treeviewers don't inherit from navigator. For each of my
> treeviewers i set a ITreeContentProvider & ILabelProvider
> implementations. I would like to change the font or, the color of the
> font, or the style of the font of some label for some specific model
> element types. I want to customized this change once & for all at
> compile time, don't need to load DecoratorManager stuff... Any point of
> reference ? I read on a post from 2003, at this time, Eclipse seemed to
> be really limited on this feature, any new features ? Do i really need
> an engineer degree for changing the font of my view ?
>

I don't have one myself :-)

Implemementing the none mandatory IColorProvider and IFontProvider
interfaces in your LabelProvider should give you want you are looking for.

Tom
Re: ViewPart State & Customize label [message #333301 is a reply to message #333285] Wed, 03 December 2008 15:48 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

ddinh wrote:
> Hello,
>
> I got 2 questions :
>
>
> 1. IPartListener notifies different lifecycle events of a listened view
> part. But there is no event representing the "visible state". Why
> eclipse API made this choice ? How to be sure of a visible state of a
> view part ? Because a viewpart could be visible and deactivated. My
> purpose is to register a command and launch it as soon as my viewpart is
> visible. Any point of reference ?

IPartListener2 has info about views visible and hidden, and
org.eclipse.ui.IWorkbenchPage.isPartVisible(IWorkbenchPart)

PW



--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Previous Topic:Platform Command Framework suggestions
Next Topic:Custom Editor Saving File causes cursor position to be reset
Goto Forum:
  


Current Time: Sat Oct 19 10:23:22 GMT 2024

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

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

Back to the top