Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Why does getElement() always return null in PropertyPage?
Why does getElement() always return null in PropertyPage? [message #874621] Mon, 21 May 2012 09:09 Go to next message
David BY Chan is currently offline David BY ChanFriend
Messages: 40
Registered: July 2009
Member
Hi, I created a PropertyPage contributor for workspace project as below:

<extension
point="org.eclipse.ui.propertyPages">
<page
class="org.taobao.ibatiside.ui.pref.BatisProjectSettingPage"
id="org.taobao.ibatiside.ui.prop.main"
name="IBATIS IDE"
selectionFilter="single">
<enabledWhen>
<adapt
type="org.eclipse.core.resources.IProject">
<test
property="org.taobao.ibatiside.ui.project"
value="true">
</test>
</adapt>
</enabledWhen>
</page>
</extension>

In the test node above, I can see the selected project when debugging,
the control of PropertyPage can be built, but I found method setElement
never be called, so getElement returns null.

Thank for you great help!
Re: Why does getElement() always return null in PropertyPage? [message #874628 is a reply to message #874621] Mon, 21 May 2012 09:12 Go to previous message
David BY Chan is currently offline David BY ChanFriend
Messages: 40
Registered: July 2009
Member
On 2012/5/21 17:09, David BY Chan wrote:
> Hi, I created a PropertyPage contributor for workspace project as below:
>
> <extension
> point="org.eclipse.ui.propertyPages">
> <page
> class="org.taobao.ibatiside.ui.pref.BatisProjectSettingPage"
> id="org.taobao.ibatiside.ui.prop.main"
> name="IBATIS IDE"
> selectionFilter="single">
> <enabledWhen>
> <adapt
> type="org.eclipse.core.resources.IProject">
> <test
> property="org.taobao.ibatiside.ui.project"
> value="true">
> </test>
> </adapt>
> </enabledWhen>
> </page>
> </extension>
>
> In the test node above, I can see the selected project when debugging,
> the control of PropertyPage can be built, but I found method setElement
> never be called, so getElement returns null.
>
> Thank for you great help!
I solved it, because I call getElement in constructor, but the Framework
didn't setElement in that time. It must wait util PropertyPage instance
was created.

Thank for your attention.
Previous Topic:How to override Eclipse "File > Save" Action
Next Topic:how to show tooltip description off-line(without the internet) in eclipse
Goto Forum:
  


Current Time: Wed Sep 23 11:03:09 GMT 2020

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

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

Back to the top