Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Requirements Modeling Framework  » Color Requirements
Color Requirements [message #1097362] Thu, 29 August 2013 15:51 Go to next message
Daniel Acki is currently offline Daniel AckiFriend
Messages: 19
Registered: August 2013
Junior Member
Hello, is it possible to color the Requirements? For Example if a Requirement is done, i want to color the background of the Requrement in green. If the Test was negative in Red.

Das ganze noch in Deutsch: Ich würde gerne wissen, ob es möglich ist die Hintergrundfarbe der Tabelleneinträge der Requirements zu ändern. Ich würde die Hintergrundfarbe gerne in Grün haben, wenn der Test zu dem Requirements positiv war, und in Rot, wenn er negativ war.
Re: Color Requirements [message #1097497 is a reply to message #1097362] Thu, 29 August 2013 20:23 Go to previous messageGo to next message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Hello Daniel,

What you are requesting does not exist yet, but could be implemented fairly easily using a Presentation. There is a (slightly outdated) tutorial:

http://wiki.eclipse.org/RMF/Contributor_Guide/Presentations

Hope this helps!

Best,

- Michael
Re: Color Requirements [message #1098073 is a reply to message #1097497] Fri, 30 August 2013 15:20 Go to previous messageGo to next message
Daniel Acki is currently offline Daniel AckiFriend
Messages: 19
Registered: August 2013
Junior Member
When i follow the steps i need the org.eclipse.rmf.reqif10.pror project. Can i find this anywhere or do i have to create it myself?

And later when i try to generate the Headline.genmodel i can't load the Headline.ecore, it says: The default value literal" must be a valid literal of the attributes type.

What do i have to write in it?

[Updated on: Fri, 30 August 2013 15:29]

Report message to a moderator

Re: Color Requirements [message #1099446 is a reply to message #1098073] Sun, 01 September 2013 18:43 Go to previous messageGo to next message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Hi Daniel,

Did you set up a development environment, as described here:

http://wiki.eclipse.org/RMF/Contributor_Guide/Development_Process

This should provide you with the project in your Eclipse workspace.

Best,

- Michael
Re: Color Requirements [message #1108185 is a reply to message #1099446] Fri, 13 September 2013 13:13 Go to previous messageGo to next message
Daniel Acki is currently offline Daniel AckiFriend
Messages: 19
Registered: August 2013
Junior Member
Hello,

Now I'm at Extending the Extension Point
At your Guide i should add org.eclipse.rmf.pror.reqif10.editor, but i only find org.eclipse.rmf.reqif10.pror.editor.presentation.
Is this the same, or have i forgotten something.
Thanks, Daniel
Re: Color Requirements [message #1109632 is a reply to message #1108185] Sun, 15 September 2013 18:55 Go to previous messageGo to next message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Hi Daniel,

Yes, it's the same. Long story - we changed the name because we had complications with the EMF code generation from the model. If you have an Eclipse account, it would be great if you could fix the tutorial, as you go along. Smile If not, let me know, and I'll fix it.

Thanks for bringing it up.

- Michael
Re: Color Requirements [message #1110161 is a reply to message #1109632] Mon, 16 September 2013 13:15 Go to previous messageGo to next message
Daniel Acki is currently offline Daniel AckiFriend
Messages: 19
Registered: August 2013
Junior Member
Ok, i think i have an Eclipse account, if not i let you know

Now if i click on service it opens a class with the Methods public ProrPresentationConfiguration getConfigurationInstance() and public Class<? extends ProrPresentationConfiguration> getConfigurationInterface(). Are these the Methods getCellEditor() and getCellRenderer(), which are needed in the Guide?

Daniel
Re: Color Requirements [message #1115028 is a reply to message #1110161] Mon, 23 September 2013 14:48 Go to previous messageGo to next message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Hi Daniel,

Quote:
Now if i click on service it opens a class with the Methods public ProrPresentationConfiguration getConfigurationInstance() and public Class<? extends ProrPresentationConfiguration> getConfigurationInterface(). Are these the Methods getCellEditor() and getCellRenderer(), which are needed in the Guide?


It opens or creates a class? You should configure the extension point to return a class that inherits from AbstractPresentationService - check out org.eclipse.rmf.reqif10.pror.presentation.ui.IdPresentationService to see how this should work. But this is just "administration" of the extension point.

The actual work is done by the ItemProvider of the configuration element (subclassing ProrPresentationConfigurationItemProvider). By default, it implements PresentationEditInterface and may also implement PresentationEditorInterface. That's where getCellEditor() and getCellRenderer() are implemented.

I hope this helps!

- Michael
Re: Color Requirements [message #1115716 is a reply to message #1115028] Tue, 24 September 2013 13:21 Go to previous messageGo to next message
Daniel Acki is currently offline Daniel AckiFriend
Messages: 19
Registered: August 2013
Junior Member
Hi

I click on service in the Extension view and then following class is created

package org.eclipse.rmf.pror.presentation.headline.ui;

import org.eclipse.rmf.reqif10.pror.configuration.ProrPresentationConfiguration;
import org.eclipse.rmf.reqif10.pror.edit.presentation.service.PresentationInterface;

public class HeadlinePresentationService implements PresentationInterface {

public HeadlinePresentationService() {
// TODO Auto-generated constructor stub
}

@Override
public ProrPresentationConfiguration getConfigurationInstance() {
// TODO Auto-generated method stub
return null;
}

@Override
public Class<? extends ProrPresentationConfiguration> getConfigurationInterface() {
// TODO Auto-generated method stub
return null;
}

}
Re: Color Requirements [message #1129414 is a reply to message #1115716] Tue, 08 October 2013 15:57 Go to previous messageGo to next message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Hi Daniel,

Sorry, I missed this one.

Quote:
I click on service in the Extension view and then following class is created


You can use org.eclipse.rmf.reqif10.pror.editor.presentation.service.AbstractPresentationService to create an implementation where you have to write just one line of code. Just have a look at org.eclipse.rmf.reqif10.pror.presentation.headline.ui.HeadlinePresentationService

Best,

- Michael
Re: Color Requirements [message #1132941 is a reply to message #1097362] Fri, 11 October 2013 13:50 Go to previous messageGo to next message
Daniel Acki is currently offline Daniel AckiFriend
Messages: 19
Registered: August 2013
Junior Member
OK, Thanks

And with the AbstractPresentationService i don't need the getCallEditor and getCallRenderer methods, the getConfigurationInstance Method is enough?

Daniel
Re: Color Requirements [message #1142323 is a reply to message #1132941] Thu, 17 October 2013 14:50 Go to previous messageGo to next message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Hi Daniel,

Quote:
And with the AbstractPresentationService i don't need the getCallEditor and getCallRenderer methods, the getConfigurationInstance Method is enough?


The PresentationService is just the entry point, the work will be done by the ItemProvider of the Configuration Element (which should be stateful).

If you want to set Renderer and Editor, then the ItemProvider must implement PresentationEditorInterface - that's where getCellRenderer and getCellEditor are defined.

Best,

- Michael
Re: Color Requirements [message #1150000 is a reply to message #1097362] Tue, 22 October 2013 13:07 Go to previous messageGo to next message
Daniel Acki is currently offline Daniel AckiFriend
Messages: 19
Registered: August 2013
Junior Member
Ok, so the HeadlineConfigurationItemProvider ahs to implement PresentationEditorInterface. The HeadlineConfigurationItemProvider is in the Projekt where the generated Classes are.
Re: Color Requirements [message #1159528 is a reply to message #1097362] Mon, 28 October 2013 15:54 Go to previous messageGo to next message
Daniel Acki is currently offline Daniel AckiFriend
Messages: 19
Registered: August 2013
Junior Member
I have done everything, and now have 3 Presentations in the Presentation Configuration.
Is one of these the new one, or was the HeadlineConfigurationItemProvider the wrong class for the Presentation Interface?
Re: Color Requirements [message #1162216 is a reply to message #1159528] Wed, 30 October 2013 08:26 Go to previous messageGo to next message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Hi Daniel,

To be honest, I don't understand your question. Can you please elaborate?

Best,

- Michael
Re: Color Requirements [message #1162554 is a reply to message #1162216] Wed, 30 October 2013 13:06 Go to previous messageGo to next message
Daniel Acki is currently offline Daniel AckiFriend
Messages: 19
Registered: August 2013
Junior Member
Hello, sorry i was in a hurry, when i wrote the post and didn't check if its easy to understand.

In the Presentation Configuration i now have: ID Generator, Linewrapping and Headline as choosable action. I wanted to know if one of these is the new Presentation.

And the second task was: The only ItemProvider i found was the HeadlineConfigurationItemProvider and there i implemented PresentationEditorInterface.
And i wanted to know if the HeadlineConfigurationItemProvider was the right class to implement the PresentationEditorInterface.

And another Question: I have an EMF Modell with Tests and i want to link these models with the requirement model, for example to color the requirements or to set the requirement to true. Can this be done with the Presentation or what is the best way to handle this?

Thanks

[Updated on: Thu, 31 October 2013 18:17]

Report message to a moderator

Re: Color Requirements [message #1171778 is a reply to message #1162554] Tue, 05 November 2013 13:26 Go to previous messageGo to next message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Hello Daniel,

Quote:
I wanted to know if one of these is the new Presentation.


The name shown is derived from the name of the configuration element. Therefore, the entry for Headline could be yours, or it could be the original one. I suspect that you did not disable the Headlinepresentation that ships with RMF, therefore it's probably not yours. For testing, I recommend you to use a name that cannot be confused with an existing one.

Quote:
And i wanted to know if the HeadlineConfigurationItemProvider was the right class to implement the PresentationEditorInterface.


Yes.

Quote:
Can this be done with the Presentation or what is the best way to handle this?


Yes, that is exactly what Presentations are good for.

Best,

- Michael
Re: Color Requirements [message #1194602 is a reply to message #1171778] Mon, 18 November 2013 15:50 Go to previous messageGo to next message
Daniel Acki is currently offline Daniel AckiFriend
Messages: 19
Registered: August 2013
Junior Member
I think the Presentation works, i have tried different things, but now i want to change the name, is it enough to change the name in the ecore Modell?
In the Properties-View of Headline.ecore.
Re: Color Requirements [message #1209259 is a reply to message #1194602] Mon, 25 November 2013 12:18 Go to previous messageGo to next message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Hi Daniel,

Quote:
is it enough to change the name in the ecore Modell? In the Properties-View of Headline.ecore.


No, you also need to regenerate the code (will lead to compile errors), and there may be some other loose ends. But this is a great exercise to get familiar with the way how EMF and Plug-Ins work. It's really not that complicated.

Best,

- Michael
Re: Color Requirements [message #1219615 is a reply to message #1209259] Wed, 04 December 2013 22:46 Go to previous messageGo to next message
Daniel Acki is currently offline Daniel AckiFriend
Messages: 19
Registered: August 2013
Junior Member
Now i have changed the Name in the ecore Modell, regenerated the Code and did the same as told in the Guide, just instaed of headline i used the new name, but the new Presentation isn't shown in the Presentation Configuration. In the Guide i started at Implementing PresentationEditInterface after the new Code Generation. Was this wrong or do you have any ideas, why the Presentation isn't shown?

And another Question: When the Presentation works, i want to edit one row of the Requirement table. Can i do this using the Id Name in the code, or have i to use eachs field identifier?

[Updated on: Thu, 05 December 2013 20:52]

Report message to a moderator

Re: Color Requirements [message #1219911 is a reply to message #1219615] Fri, 06 December 2013 16:27 Go to previous messageGo to next message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Daniel,

> Was this wrong or do you have any ideas, why the Presentation isn't shown?

To be honest, this is just not enough information to debug why things are not working properly. If I had that problem, I'd set a breakpoint in the code where the presentation are being enumerated. As Eclipse resolves extensions at runtime by name, debugging is the best way of finding the problem. But this has nothing to do with RMF any more, this is a general Eclipse issue, and how it deals with extensions and extension points.

> When the Presentation works, i want to edit one row of the Requirement table. Can i do this using the Id Name in the code,

I am not sure what you mean. A Presentation can manage the editing of a cell, not the row. Do you mean that? I also have no idea what you mean by "Id Name" or "field identifier".

If you provide your own editor, you have to implement PresentationEditorInterface.getCellEditor(), which will give you the AttributeValue to be edited as an argument. Just make sure you use commands to update the value.

Hope this helps.

- Michael
Re: Color Requirements [message #1220413 is a reply to message #1219911] Wed, 11 December 2013 15:30 Go to previous messageGo to next message
Daniel Acki is currently offline Daniel AckiFriend
Messages: 19
Registered: August 2013
Junior Member
Hello, the first Question was only to check if you have an idea, why the presentation isn't shown.
With the second Question i wanted to check if it is possible to edit a complete row or just fields.
With Id name i meant the name in the Id column, for example REQ-1. With field identifier is when you choose edit in table view, the model view of the field is opened and in this model view is a field called identifier.
Re: Color Requirements [message #1220919 is a reply to message #1220413] Mon, 16 December 2013 07:45 Go to previous messageGo to next message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Hi Daniel,

> With the second Question i wanted to check if it is possible to edit a complete row or just fields.

Keep in mind that the table view is merely one visual representation of the ReqIF Model. In the model, the concept of "row" does not exist at all. Thererfore, editing a row is not possible in principle.

> With Id name i meant the name in the Id column, for example REQ-1

As far as the model is concerned, this is just an AttributeValue as any other, there is nothing special about it. It is also not well-suited for uniquely identifying SpecObjects. Better use the ID property of the SpecObject, which will never ever change. In the GUI, you can inspect that property by using the advanced property tab, but of course it is read-only.

Best,

- Michael

Re: Color Requirements [message #1221381 is a reply to message #1220919] Tue, 17 December 2013 15:13 Go to previous messageGo to next message
Daniel Acki is currently offline Daniel AckiFriend
Messages: 19
Registered: August 2013
Junior Member
Do you mean the identifier in the property?

In the property view under All Attribute I have

Spec Object
Desc
Identifier
Last Change

and so on

is this the identifier you ment?
Re: Color Requirements [message #1221705 is a reply to message #1221381] Wed, 18 December 2013 09:11 Go to previous messageGo to next message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Yes, that's the one.
Re: Color Requirements [message #1229538 is a reply to message #1097362] Thu, 09 January 2014 17:01 Go to previous messageGo to next message
Daniel Acki is currently offline Daniel AckiFriend
Messages: 19
Registered: August 2013
Junior Member
Hello

I'm impementing the getCellEditor() Method and wanted to know if there is a small example to see how the needed Parameters are used and how i can use the SpecObject Identifier to adress the Cell.

Following Method with Parameters i need to implement:
CellEditor getCellEditor(AgileGrid agileGrid, EditingDomain editingDomain,
AttributeValue av, SpecElementWithAttributes parent,
Object affectedObject);

I would be nice if someone could explain, how the Parameters are used and for what they are needed.
Re: Color Requirements [message #1230876 is a reply to message #1229538] Mon, 13 January 2014 09:37 Go to previous messageGo to next message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Daniel,

Daniel Acki wrote on Thu, 09 January 2014 18:01

I would be nice if someone could explain, how the Parameters are used and for what they are needed.


I just improved the JavaDoc of PresentationEditorInterface a little. Also, you may want to look at org.eclipse.rmf.reqif10.pror.presentation.ui.LinewrapCellEditor to see how the interface is used.

Briefly, the parameters are needed to construct a proper Command that changes the element. In particular, setting the affectedObject properly is crucial for the EMF selection management to function correctly.

For your reference, here is the new JavaDoc:

	 * The cell editor must use EMF commands to set the new value.  That's the reason why the other
	 * parameters are provided.  Briefly, the easiest is to do the setting via 
	 * {@link ProrUtil#setTheValue(AttributeValue, Object, Object, Object, EditingDomain)}, which
	 * allows you to just and the parameters through.


Best,

- Michael
Re: Color Requirements [message #1232014 is a reply to message #1230876] Thu, 16 January 2014 02:01 Go to previous messageGo to next message
Daniel Acki is currently offline Daniel AckiFriend
Messages: 19
Registered: August 2013
Junior Member
Hello, let's see if I got this correct

In the getCellEditor Method I call setTheValue with the parameters needt for the getCellEditor Method.
The AttributeValue is the change I want to make, affectedObject is Cell I want to edit?
Then what are EditingDomain, parent, Object value and AgileGrid?

[Updated on: Tue, 21 January 2014 14:48]

Report message to a moderator

Re: Color Requirements [message #1234253 is a reply to message #1232014] Tue, 21 January 2014 14:48 Go to previous messageGo to next message
Daniel Acki is currently offline Daniel AckiFriend
Messages: 19
Registered: August 2013
Junior Member
Hello, i would like to know, how i can achive following task:
I want to set the Enumeration Field with SpecObject identifier
rmf-17d2cd15-8cfd-4cdo-a339-16789998bef7 to true
What do I use as parameters to call
getCellEditor(AgileGrid agileGrid, EditingDomain editingDomain, AttributeValue av, SpecElementWithAttributes parent, Object affectedObject)?
Re: Color Requirements [message #1236212 is a reply to message #1232014] Sun, 26 January 2014 15:40 Go to previous messageGo to next message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Daniel,

Quote:
In the getCellEditor Method I call setTheValue with the parameters needt for the getCellEditor Method.


The getCellEditor simply returns a properly configured CellEditor, For instance:

return new LinewrapCellEditor(agileGrid, editingDomain, parent,
    affectedObject);


No need to call setTheValue() there. That's done in the Editor. Again, some sample code:

protected Object doGetValue() {
    String newText = (String) super.doGetValue();
    ProrUtil.setTheValue(attributeValue, text.getText(), parent,
        affectedObject, editingDomain);
    return attributeValue;
}


The AttributeValue is the change I want to make, affectedObject is Cell I want to edit?

affectedObject is just handed through - it is required by ProrUtil.setTheValue(), to make sure that the Command sets the correct selection. No need to worry about it.

Quote:
Then what are EditingDomain, parent, Object value and AgileGrid?


This is basic EMF stuff. Have you read the EMF-Book from Ed Merks?

Good Luck!

- Michael
Re: Color Requirements [message #1236218 is a reply to message #1234253] Sun, 26 January 2014 16:00 Go to previous messageGo to next message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Daniel,

Quote:
I would like to know, how i can achive following task:
I want to set the Enumeration Field with SpecObject identifier
rmf-17d2cd15-8cfd-4cdo-a339-16789998bef7 to true
What do I use as parameters to call
getCellEditor(AgileGrid agileGrid, EditingDomain editingDomain, AttributeValue av, SpecElementWithAttributes parent, Object affectedObject)?


Well, if you want to set the value, you don't need a CellEditor. You just have to create the correct command. For what you're trying to do, something like:

AddCommand.create(editngDomain, parent, ReqIF10Package.Literals.ATTRIBUTE_VALUE_ENUMERATION__VALUES, enumValue);


You then have to execute the resulting Command using the EditingDomain.

Good Luck!

- Michael
Re: Color Requirements [message #1249712 is a reply to message #1236218] Tue, 18 February 2014 14:46 Go to previous messageGo to next message
Daniel Acki is currently offline Daniel AckiFriend
Messages: 19
Registered: August 2013
Junior Member
Hello, to call the Cell I need the Idetifier of the Spec Object, not of the Spec Hierarchy?
Do I write the Identifier with or without the " - "?

Thanks Daniel
Re: Color Requirements [message #1250688 is a reply to message #1249712] Wed, 19 February 2014 13:42 Go to previous messageGo to next message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Hello Daniel,

Daniel Acki wrote on Tue, 18 February 2014 15:46
Hello, to call the Cell I need the Idetifier of the Spec Object, not of the Spec Hierarchy?


That depends, as the cell editor is used in the Specification View (SpecHierarchy) and the Properties View (SpecObject). But there should not be a need to do anything with the Identifier.

Daniel Acki wrote on Tue, 18 February 2014 15:46
Do I write the Identifier with or without the " - "?


You mean the internal identifier? This can be anything, as long as it's unique within the ReqIF File.

Best,

- Michael
Re: Color Requirements [message #1250820 is a reply to message #1250688] Wed, 19 February 2014 16:32 Go to previous messageGo to next message
Daniel Acki is currently offline Daniel AckiFriend
Messages: 19
Registered: August 2013
Junior Member
Hello, do I understand it right, that if I use the AddCommand.create Method to change the enumeration value of the cell I don't need the identifier to call the cell?
Re: Color Requirements [message #1250943 is a reply to message #1250820] Wed, 19 February 2014 19:06 Go to previous message
Michael Jastram is currently offline Michael JastramFriend
Messages: 235
Registered: April 2010
Location: Düsseldorf, Germany
Senior Member
Daniel, the create method works with references, not IDs. Therefore, you need a reference to the AttributeValueEnumeration, but not its ID. For instance, check out org.eclipse.rmf.reqif10.pror.editor.agilegrid.CellEditor#doGetValue():

                            AddCommand
					.create(
					editingDomain,
					attributeValue,
					ReqIF10Package.Literals.ATTRIBUTE_VALUE_ENUMERATION__VALUES,
					itemList.get(selectedIndex))
Previous Topic:Presentation Question
Next Topic:XSLT for converting into LaTeX/PDF
Goto Forum:
  


Current Time: Wed Dec 11 01:14:24 GMT 2024

Powered by FUDForum. Page generated in 0.06607 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top