Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: mateiacd on February 15, 2019, 10:52:50 pm

Title: When a selected element has the "Find-In project browser" context menu option ?
Post by: mateiacd on February 15, 2019, 10:52:50 pm
Hi,

In a diagram, I select an element, then I right-click that element, showing its context menu

I notice that for some elements, the "Find-In project browser" context menu exists,
while for other elements, the Find context menu does not exist at all.

Please see the below image as an example.

Can please someone indicate an SQL query or an API function that allows me to
detect in advance if the "Find-In project browser" context option is available for the selected element?

(https://4.bp.blogspot.com/-rDc-aCjDc28/XGatFLjR8iI/AAAAAAAADG0/qPJoM1U6YDEHdweKJ4SmsBpaGg2fxPy2gCLcBGAs/s1600/FindContextMenuOption2.png)

Title: Re: When a selected element has the "Find-In project browser" context menu option ?
Post by: Geert Bellekens on February 15, 2019, 11:18:08 pm
Whether or the menu option is depends on whether or not the element is visible in the project browser.
Element who are not visible are typically "diagram owned" elements such as notes, boundaries, legends,...

There is no list available I'm afraid.
You'll have to figure it out by trial and error.

Geert
Title: Re: When a selected element has the "Find-In project browser" context menu option ?
Post by: mateiacd on February 15, 2019, 11:23:12 pm
Whether or the menu option is depends on whether or not the element is visible in the project browser.
Element who are not visible are typically "diagram owned" elements such as notes, boundaries, legends,...
There is no list available I'm afraid.
You'll have to figure it out by trial and error.

Ok thank you, but how Enterprise Architect seems to just "know" if the element is "diagram owned"
and it does not display the "Find" context menu option ?
Title: Re: When a selected element has the "Find-In project browser" context menu option ?
Post by: qwerty on February 15, 2019, 11:43:29 pm
As Geert said: it's hard coded in EA. So EA knows well about it. But not us users...

q.
Title: Re: When a selected element has the "Find-In project browser" context menu option ?
Post by: Geert Bellekens on February 15, 2019, 11:52:39 pm
Whether or the menu option is depends on whether or not the element is visible in the project browser.
Element who are not visible are typically "diagram owned" elements such as notes, boundaries, legends,...
There is no list available I'm afraid.
You'll have to figure it out by trial and error.

Ok thank you, but how Enterprise Architect seems to just "know" if the element is "diagram owned"
and it does not display the "Find" context menu option ?
Yes. I'm pretty sure there's a hardcoded list of element types somewhere in the EA application code.

Geert
Title: Re: When a selected element has the "Find-In project browser" context menu option ?
Post by: Mauricio Moya (Arquesoft) on February 19, 2019, 08:39:11 am
Just something to add to the discussion: the Diagram Legend in previous versions of EA (< 14) was a diagram element, which means that only was visible in a diagram but not in the project browser. But since version 14, diagram legend nows appears in the project browser (with empty name), so this type of element has a weird behavior and it is possible that Sparx has forgotten to include in the contextual menu to list the option to find in project browser. Just try Alt + G command to find it.
Title: Re: When a selected element has the "Find-In project browser" context menu option ?
Post by: JayHollingsworth on February 21, 2019, 04:59:17 am
Just something to add to the discussion: the Diagram Legend in previous versions of EA (< 14) was a diagram element, which means that only was visible in a diagram but not in the project browser. But since version 14, diagram legend nows appears in the project browser (with empty name), so this type of element has a weird behavior and it is possible that Sparx has forgotten to include in the contextual menu to list the option to find in project browser. Just try Alt + G command to find it.

That actually sounds like a bug to me (I'm not yet on 14 so I can't play with it myself). I wouldn't want to see the legend listed as an object in the Browser window.