Author Topic: Deactivate Properties and Buttons  (Read 1781 times)

TheTwo

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Deactivate Properties and Buttons
« on: May 20, 2008, 12:44:29 am »
Hi,

is it possible to deactivate some functionality in EA?

My task is to customize EA GUI for MOF Metamodelling. So it would be nice if I could deactivate some buttons and some Options in the Property menus.

TheTwo

Simon M

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 6445
  • Karma: +55/-6
    • View Profile
Re: Deactivate Properties and Buttons
« Reply #1 on: May 20, 2008, 08:11:38 am »
You can customize the main menu using Tools | Customize.  The context menus aren't customizable though.
Simon

support@sparxsystems.com

TheTwo

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Deactivate Properties and Buttons
« Reply #2 on: May 20, 2008, 05:50:37 pm »
Is it possible to change the property window of a class or an other element? (In the context Menu "Properties...".)

Thanks

TheTwo

mrf

  • EA User
  • **
  • Posts: 312
  • Karma: +0/-0
    • View Profile
Re: Deactivate Properties and Buttons
« Reply #3 on: May 21, 2008, 12:35:13 pm »
If you are looking into preventing users from changing properties of elements etc, then it may be worth investigating User Security:

http://www.sparxsystems.com.au/EAUserGuide/index.html?usersecurity2.htm

For example: To prevent users from updating elements you can revoke their "UpdateElement" permission.
Best Regards,

Michael

support@sparxsystems.com
"It is more complicated than you think." - RFC 1925, Section 2.8

TheTwo

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Deactivate Properties and Buttons
« Reply #4 on: May 21, 2008, 06:31:11 pm »
Thanks.

My intention is for example to prevent that the user can select in the properties of a Class-Element the "Visibility" Protected.

The User should only select Private or Public.

Is it possible to do this?

thomas.kilian

  • Guest
Re: Deactivate Properties and Buttons
« Reply #5 on: May 21, 2008, 06:41:29 pm »
can't delete my post
« Last Edit: May 26, 2008, 09:58:43 pm by thomas.kilian »

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2529
  • Karma: +33/-2
    • View Profile
Re: Deactivate Properties and Buttons
« Reply #6 on: May 23, 2008, 09:16:53 am »
Quote
Thanks.

My intention is for example to prevent that the user can select in the properties of a Class-Element the "Visibility" Protected.

The User should only select Private or Public.

Is it possible to do this?
Have a look at the possibility of writing a model validation add-in. You can define a rule to check the value of the visibility field. There is example model validation code in the help file.
The Sparx Team
support@sparxsystems.com

TheTwo

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Deactivate Properties and Buttons
« Reply #7 on: May 26, 2008, 06:37:48 pm »
Hi,

is it possible to supress the "EA Properties Dialog" and add an own one?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Deactivate Properties and Buttons
« Reply #8 on: May 26, 2008, 08:27:42 pm »
Yes it is.

Look at the MDG add-in model. You need to trap some events and cancel the default EA behavior. It is all mentioned in the help file. I think the section you want is the one before the 'usual' API object model.

David
No, you can't have it!

TheTwo

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Deactivate Properties and Buttons
« Reply #9 on: May 26, 2008, 09:08:14 pm »
Thanks,

I've allready tried to deactivate the Properties Dialog on double click. Therefore I've set the variable Repository.SupressEADialogs to true, but this only works for the Methods EA_OnNewElement(),... when an Element is created.

How can I cancel the default EA behavior e.g. double click on an Class in the project view?

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Deactivate Properties and Buttons
« Reply #10 on: May 26, 2008, 11:39:02 pm »
You should be able to do that as well, the process is (supposed to be) the same.

Some time ago I reported a problem where deactivate did not work when an element was first created from a profile. That turned out to be a bug, which Sparx corrected.

I suggest you create a small project where your problem occurs, then file a bug report with Sparx. Compress your project (and the automation source code) and attach it to the bug report. [Use the Registered Users bug report; I'm not sure if you can attach files to the 'public' version.]

David
No, you can't have it!

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2529
  • Karma: +33/-2
    • View Profile
Re: Deactivate Properties and Buttons
« Reply #11 on: May 27, 2008, 08:43:36 am »
Quote
How can I cancel the default EA behavior e.g. double click on an Class in the project view?
Search the help file for EA_OnContextItemDoubleClicked...
The Sparx Team
support@sparxsystems.com

TheTwo

  • EA User
  • **
  • Posts: 39
  • Karma: +0/-0
    • View Profile
Re: Deactivate Properties and Buttons
« Reply #12 on: May 29, 2008, 05:46:19 pm »
Thanks,

I've allready looked at EA_OnContextItemDoubleClicked() but doesn't see the return value. In the Syntax of the method the return value is missing. Something as "As Boolean". Only in the "Return value" section it is described to return true or false.

TheTwo


«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Deactivate Properties and Buttons
« Reply #13 on: May 29, 2008, 09:49:25 pm »
[I am doing this from (addled) memory, so look it up to be sure, but...]

Set the cancel property of the passed value - or something like that. Since you're responding to an event the return value is unlikely to be used.
No, you can't have it!