[RFH] A trivial question about Nodes

View: New views
3 Messages — Rating Filter:   Alert me  

[RFH] A trivial question about Nodes

by Imran M Yousuf-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I am a newbie to NetBeans RCP and have been working with the Nodes
API. In this regard I am facing a issue which I am not sure whether is
expected or not, I would be grateful if someone would please help me
:). The problem is - I am using a bean tree view and I have
NodeActions'. When I double click it (after setting it as preferred)
it throws the event with the selected nodes but if I right click the
node and then invoke the action it does not throw the event with the
selected nodes :(. Is this normal? If not please provide me some
pointers and please dont hesitate to ask questions :).

A quick response would be extremely appreciated and benevolent.

Best regards,

--
Imran M Yousuf
Email: imran@...
Blog: http://imyousuf-tech.blogs.smartitengineering.com/
Mobile: +880-1711402557

Parent Message unknown Re: [RFH] A trivial question about Nodes

by Wade Chandler :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It isn't normal if you have any action showing up on the popup when clicked does not perform its function unless it is showing as disabled. Have you debugged and stepped through your code? Which version of the IDE and platform are you using (NB 6.0, 6.1, 6.5 (dev or milestone))? If you set break points in different methods of your action class does the debugger stop any where? For instance, watch enabled and the different actionPerformed methods you may have depending on your super class.

Wade

 ==================
Wade Chandler, CCE
Software Engineer and Developer, Certified Forensic Computer Examiner, NetBeans Dream Team Member, and NetBeans Board Member
http://www.certified-computer-examiner.com
http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
http://www.netbeans.org



----- Original Message ----

> From: Imran M Yousuf <imran@...>
> To: dev@...
> Sent: Saturday, July 12, 2008 9:42:19 AM
> Subject: [openide-dev] [RFH] A trivial question about Nodes
>
> Hi,
>
> I am a newbie to NetBeans RCP and have been working with the Nodes
> API. In this regard I am facing a issue which I am not sure whether is
> expected or not, I would be grateful if someone would please help me
> :). The problem is - I am using a bean tree view and I have
> NodeActions'. When I double click it (after setting it as preferred)
> it throws the event with the selected nodes but if I right click the
> node and then invoke the action it does not throw the event with the
> selected nodes :(. Is this normal? If not please provide me some
> pointers and please dont hesitate to ask questions :).
>
> A quick response would be extremely appreciated and benevolent.
>
> Best regards,
>
> --
> Imran M Yousuf
> Email: imran@...
> Blog: http://imyousuf-tech.blogs.smartitengineering.com/
> Mobile: +880-1711402557


Re: [RFH] A trivial question about Nodes

by Imran M Yousuf-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Wade,

Thanks for the reply :), I actually found the solution to my problem
by digging more deeper into Lookup and NodeAction code. I was missing
getLookup method from my topcomponent thus not exposing my Nodes what
so ever. The reason for double click or preferred action wondering
lies in the implementation of NodeAction.actionPerformed
implementation where it first looks whether the source is either a
node or node[] if yes calls the performAction(Node[]) else goes the
lookup way. BTW I am using NB 6.1.

I hope this answer is logical.

Best regards,

Imran

Code I was missing from TopComponent was:
    @Override
    public Lookup getLookup() {
        if(lookup == null) {
            lookup = ExplorerUtils.createLookup(em, getActionMap());
        }
        return lookup;
    }


On Sat, Jul 12, 2008 at 8:34 PM, Wade Chandler
<hwadechandler-nb@...> wrote:

> It isn't normal if you have any action showing up on the popup when clicked does not perform its function unless it is showing as disabled. Have you debugged and stepped through your code? Which version of the IDE and platform are you using (NB 6.0, 6.1, 6.5 (dev or milestone))? If you set break points in different methods of your action class does the debugger stop any where? For instance, watch enabled and the different actionPerformed methods you may have depending on your super class.
>
> Wade
>
>  ==================
> Wade Chandler, CCE
> Software Engineer and Developer, Certified Forensic Computer Examiner, NetBeans Dream Team Member, and NetBeans Board Member
> http://www.certified-computer-examiner.com
> http://wiki.netbeans.org/wiki/view/NetBeansDreamTeam
> http://www.netbeans.org
>
>
>
> ----- Original Message ----
>> From: Imran M Yousuf <imran@...>
>> To: dev@...
>> Sent: Saturday, July 12, 2008 9:42:19 AM
>> Subject: [openide-dev] [RFH] A trivial question about Nodes
>>
>> Hi,
>>
>> I am a newbie to NetBeans RCP and have been working with the Nodes
>> API. In this regard I am facing a issue which I am not sure whether is
>> expected or not, I would be grateful if someone would please help me
>> :). The problem is - I am using a bean tree view and I have
>> NodeActions'. When I double click it (after setting it as preferred)
>> it throws the event with the selected nodes but if I right click the
>> node and then invoke the action it does not throw the event with the
>> selected nodes :(. Is this normal? If not please provide me some
>> pointers and please dont hesitate to ask questions :).
>>
>> A quick response would be extremely appreciated and benevolent.
>>
>> Best regards,
>>
>> --
>> Imran M Yousuf
>> Email: imran@...
>> Blog: http://imyousuf-tech.blogs.smartitengineering.com/
>> Mobile: +880-1711402557
>
>



--
Imran M Yousuf
Entrepreneur & Software Engineer
Smart IT Engineering
Dhaka, Bangladesh
Email: imran@...
Blog: http://imyousuf-tech.blogs.smartitengineering.com/
Mobile: +880-1711402557
LightInTheBox - Buy quality products at wholesale price