Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: virginia.cid on February 26, 2018, 06:39:14 pm

Title: Quick Linker open the EA property window
Post by: virginia.cid on February 26, 2018, 06:39:14 pm
We have developed a plugin for EA, and we have redefined the EA_OnPostNewElement method
to open our own properties window when the user drags an item from
the toolbox. This method works perfectly.

In addition, we have modified quicklinker to make the diagramming easier. When
we use the Quick Linker opens our properties window and when closing it opens the
EA's standard property window.

We have tried to hide the EA property window by redefining the EA_OnPostNewConnector method, but it does not work. The EA properties window continues to open when I close my own window. Any ideas?

   public bool EA_OnPostNewConnector (EA.Repository repository, EA.EventProperties info)
         {
             repository.SuppressEADialogs = true;
             return true;
         }
Title: Re: Quick Linker open the EA property window
Post by: Arshad on February 26, 2018, 06:57:05 pm
Hi Virginia

I dont think SuppressEADialogs property will work on EA_OnPostNewConnector .
It will only work on EA_OnPostNewElement .


But by using EA_OnContextItemDoubleClicked event

You can open your custom property window and as return true to suppress the EA property window.If you return false  it will open the EA property window.

Below is sample C# code
Code: [Select]
public bool EA_OnContextItemDoubleClicked(EA.Repository Repository, string GUID, EA.ObjectType ot)
        {
            if (ot == EA.ObjectType.otConnector)
            {
                    CustomProperty = new CustomProperty ();
                    CustomProperty .ShowDialog();
                    return true; // Show Custom Property Dialog

            }
            return false; // Show EA Property Dialog
         

        }


HTH
Arshad
Title: Re: Quick Linker open the EA property window
Post by: virginia.cid on February 26, 2018, 10:51:26 pm
I have tried your solution but the EA properties window continues to open. In addition, debugging the code I have checked the following:

When I create an element using Quick Linker, the onpostnewelement method is opened, where I put that EA properties window can´t be opened and my own window is opened.

public bool EA_OnPostNewElement(EA.Repository Repository, EA.EventProperties Info){
           
            EA.Element element = Repository.GetElementByID(id);

            if (null != element)
            {
                switch(element.Stereotype)
                {
                    case Constant.STEREOTYPE_ACTIVIDAD_HUMANA:
                        FormActividadHumana actHumana = new FormActividadHumana(element, Repository);
                        actHumana.ShowDialog();
                        res = true;
                        break;

             Repository.SuppressEADialogs = true;
             return res;
}

Therefore, my window opens. Afterwards, the EA properties window opens without jumping the break point in the onpostnewelement method or in EA_OnContextItemDoubleClicked, or in EA_OnPostNewConnector. So, I don´t know what is the method that launch this default property window of the EA. In addition, I suspect that the properties window of the EA is not the connector, since the data of the new created element appear in this window.

¿Any idea?

Thanks
Title: Re: Quick Linker open the EA property window
Post by: Geert Bellekens on February 26, 2018, 11:02:12 pm
Pretty much sounds like a bug to me.

The behavior should be exactly the same, regardless of the method (toolbox or quicklink) used to create an element.

Please report it to Sparx (http://www.sparxsystems.com/support/forms/bug_report.html)

Geert
Title: Re: Quick Linker open the EA property window
Post by: VKN on February 27, 2018, 10:29:23 am
Not sure if this could be the case but do you have Edit Connector on New option checked? If yes, un-check it and try again.
http://www.sparxsystems.com/enterprise_architect_user_guide/14.0/user_interface/links.html