Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Implementing features on which level?
Implementing features on which level? [message #721600] Fri, 02 September 2011 05:03 Go to next message
Christian B is currently offline Christian B
Messages: 68
Registered: August 2011
Member
Hi,

I need some best practice advice on which level to implement features.

An easy example model:
<dialog title="someTitle" message="someMessage">
	<buttons>
		<button label="Ok" value="0" />
		<button label="Cancel" value="1" />
	<buttons>
</dialog>

So lets say i Have an Add and a Create feature for a Dialog and the same for buttons. (The graphical representation is just some simple square with text fields for title, message and a List of the button labels)

Some questions to other standard features:

  • Direct Edit:
    Lets say i want direct editing for both title and message. Do i need a feature for each text field? Or do i have one feature for the dialog and this feature decides which text field is selected for direct editing?
  • Update:
    One Update feature for dialog and one for button?
    The dialog update feature checks for changes on title, message and then delegates the update check to the update feature of each button?

Thx for your help!

[Updated on: Fri, 02 September 2011 10:00]

Report message to a moderator

Re: Implementing features on which level? [message #722240 is a reply to message #721600] Mon, 05 September 2011 02:48 Go to previous message
Matthias Gorning is currently offline Matthias Gorning
Messages: 80
Registered: April 2010
Location: Germany
Member
Direct Edit:

You can do this with one direct edit feature. The feature provider should know which text label is affected. You should put this value in the constructor of your feature.

The feature itself must differentiate this text labels. E.g. provide different validation handling.


Update:

Your idea is the right one. You should do this via delegation. In the class AbstractFeatureProvider is method which you can use for that purpose:

public IReason updateIfPossible(IUpdateContext context)


Previous Topic:DiagrammEditor with XML Domain Model
Next Topic:Editor marked dirty after loading default diagramm on startup
Goto Forum:
  


Current Time: Fri Apr 18 06:54:25 EDT 2014

Powered by FUDForum. Page generated in 0.03454 seconds