Home » Eclipse Projects » Requirements Modeling Framework » Color Requirements
Color Requirements [message #1097362] |
Thu, 29 August 2013 11:51  |
Eclipse User |
|
|
|
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 #1219911 is a reply to message #1219615] |
Fri, 06 December 2013 11:27   |
Eclipse User |
|
|
|
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 #1220919 is a reply to message #1220413] |
Mon, 16 December 2013 02:45   |
Eclipse User |
|
|
|
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 #1230876 is a reply to message #1229538] |
Mon, 13 January 2014 04:37   |
Eclipse User |
|
|
|
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 #1236212 is a reply to message #1232014] |
Sun, 26 January 2014 10:40   |
Eclipse User |
|
|
|
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 11:00   |
Eclipse User |
|
|
|
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 #1250943 is a reply to message #1250820] |
Wed, 19 February 2014 14:06  |
Eclipse User |
|
|
|
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))
|
|
|
Goto Forum:
Current Time: Mon Mar 10 19:59:34 EDT 2025
Powered by FUDForum. Page generated in 0.07272 seconds
|