This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 88942 - Should Find Usages have a Go To Diagram action option?
Summary: Should Find Usages have a Go To Diagram action option?
Status: RESOLVED FIXED
Alias: None
Product: soa
Classification: Unclassified
Component: Refactoring (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker (vote)
Assignee: Vladimir Yaroslavskiy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-08 14:54 UTC by Michael Frisino
Modified: 2008-05-14 16:02 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Frisino 2006-11-08 14:54:42 UTC
Use case - user runs Find Usages in BPEL project. Some usages are reported in
BPEL  process. Results show up in usages window. If user double clicks on the
item in the usages window, the default action is to open BPEL source view, give
this window focus, and place current position at the line of source code that
has the usage.  But what if user wants to see where this sis used in the Design
view instead of the source view?

Recommendation - add a context menu action "Go To Diagram" on the Find Usages node.

Counter argument - is this really worth it? Most of the find usage cases involve
variable, correlation sets, properties, operations. Things which are not visible
on diagram anyway. This is why we decided to default to source code int he first
place. Also, as user selects node in Find Usages view, the corresponding node in
 the Navigator view is indicated automatically. This may be sufficient for this
use case.

Opinions? I am not sure this is worth pursuing unless more compelling arguments
are forthcoming.
Comment 1 Vladimir Yaroslavskiy 2007-04-27 14:02:19 UTC
UI issue
Comment 2 Sergey Lunegov 2008-05-05 10:38:08 UTC
Alexey, need reevaluate this.
Comment 3 Vladimir Yaroslavskiy 2008-05-07 13:08:40 UTC
Items in the usages view is extension of SimpleRefactoringElementImplementation (default implementation of
RefactoringElementImplementation, package org.netbeans.modules.refactoring.spi). It has only one method for navigation:
openInEditor(), there are no API to add custom actions.

Request: please provide API to add custom actions which will be shown in popup menu.
Comment 4 Sergey Lunegov 2008-05-08 09:16:31 UTC
Vladimir, please provide more detailed explanation what is needed from API/refactoring team.
Comment 5 Vladimir Yaroslavskiy 2008-05-08 11:02:13 UTC
More details:

Interface RefactoringElementImplementation should have method

Action [] getCustomActions()

Element in find usags tree should have popup menu with default action
"Open In Editor" + custom actions.
Comment 6 Jan Becicka 2008-05-13 09:53:49 UTC
Adding methods to interface is not backward compatible, but we can use probably getLookup() to hold actions.
Comment 7 Jan Becicka 2008-05-14 09:55:03 UTC
Fixed.
http://hg.netbeans.org/main/rev/92c9988ffd54

in your Refactoring Element Implementation do:

getLookup() {
   return Lookups.fixed(new OpenInEditor(), new WhateverAction());
}

class OpenInEditor extends AbstractAction {
    public OpenInEditor() {
       super("Open In Editor");
    }

    public actionPerformed(..) {
       openInEditor();
    }
}

etc...
Comment 8 Vladimir Yaroslavskiy 2008-05-14 10:28:27 UTC
thank you for fixing refactoring api.
reopen and reassign for fixing in bpel.
Comment 9 Vladimir Yaroslavskiy 2008-05-14 11:08:44 UTC
fixed: 41d223fc0a94
Comment 10 Quality Engineering 2008-05-14 16:02:24 UTC
Integrated into 'main-golden', available in NB_Trunk_Production #195 build
Changeset: http://hg.netbeans.org/main/rev/92c9988ffd54
User: Jan Becicka <jbecicka@netbeans.org>
Log: #88942: Should Find Usages have a Go To Diagram action option?