Merge branch 'snapshot-release-0.4.0'
diff --git a/dump/reqif/Integration-Release-Checklist.reqif b/dump/reqif/Integration-Release-Checklist.reqif
new file mode 100644
index 0000000..6c011c4
--- /dev/null
+++ b/dump/reqif/Integration-Release-Checklist.reqif
@@ -0,0 +1,364 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<REQ-IF xmlns="http://www.omg.org/spec/ReqIF/20110401/reqif.xsd" xmlns:configuration="http://eclipse.org/rmf/pror/toolextensions/1.0" xmlns:headline="http://pror.org/presentation/headline" xmlns:linewrap="http://pror.org/presentation/linewrap">
+ <THE-HEADER>
+ <REQ-IF-HEADER IDENTIFIER="rmf-240bfbc5-6290-42f8-aba9-96cfa34ad97f">
+ <COMMENT>Created by: jastram</COMMENT>
+ <CREATION-TIME>2012-08-06T17:08:55.434+02:00</CREATION-TIME>
+ <REQ-IF-TOOL-ID>ProR (http://pror.org)</REQ-IF-TOOL-ID>
+ <REQ-IF-VERSION>1.0.1</REQ-IF-VERSION>
+ <SOURCE-TOOL-ID>ProR (http://pror.org)</SOURCE-TOOL-ID>
+ </REQ-IF-HEADER>
+ </THE-HEADER>
+ <CORE-CONTENT>
+ <REQ-IF-CONTENT>
+ <DATATYPES>
+ <DATATYPE-DEFINITION-STRING IDENTIFIER="rmf-b2fdc05d-1cf8-42aa-bbd5-78f664726c95" LONG-NAME="T_String32k" MAX-LENGTH="32000"/>
+ <DATATYPE-DEFINITION-ENUMERATION IDENTIFIER="rmf-a1c346fa-0377-498e-98aa-a0b7baa67a12" LONG-NAME="Status">
+ <SPECIFIED-VALUES>
+ <ENUM-VALUE IDENTIFIER="rmf-dc9bab13-2da3-4357-9198-59d89722305e" LONG-NAME="done"/>
+ <ENUM-VALUE IDENTIFIER="rmf-7919d127-f7c7-4ee8-981e-520384983b69" LONG-NAME="flag"/>
+ </SPECIFIED-VALUES>
+ </DATATYPE-DEFINITION-ENUMERATION>
+ <DATATYPE-DEFINITION-STRING IDENTIFIER="rmf-6ae5da0f-4ee8-4159-98f5-d6bde49c6fb0" LONG-NAME="T_Headline"/>
+ </DATATYPES>
+ <SPEC-TYPES>
+ <SPEC-OBJECT-TYPE IDENTIFIER="rmf-27e7042d-1f4d-4dd2-a9ad-dbe13895c09e" LONG-NAME="Requirement Type">
+ <SPEC-ATTRIBUTES>
+ <ATTRIBUTE-DEFINITION-STRING IDENTIFIER="rmf-c8c315ae-71d8-45f0-a177-0f77ea5204fa" LONG-NAME="Description">
+ <TYPE>
+ <DATATYPE-DEFINITION-STRING-REF>rmf-b2fdc05d-1cf8-42aa-bbd5-78f664726c95</DATATYPE-DEFINITION-STRING-REF>
+ </TYPE>
+ </ATTRIBUTE-DEFINITION-STRING>
+ <ATTRIBUTE-DEFINITION-STRING IDENTIFIER="rmf-c34db4fe-b265-4878-9eb9-8d2b346f45e9" LONG-NAME="Note">
+ <TYPE>
+ <DATATYPE-DEFINITION-STRING-REF>rmf-b2fdc05d-1cf8-42aa-bbd5-78f664726c95</DATATYPE-DEFINITION-STRING-REF>
+ </TYPE>
+ </ATTRIBUTE-DEFINITION-STRING>
+ <ATTRIBUTE-DEFINITION-ENUMERATION IDENTIFIER="rmf-de873a9a-eb74-4f97-bcd8-1a90e72d44ed" LONG-NAME="0.4.0">
+ <TYPE>
+ <DATATYPE-DEFINITION-ENUMERATION-REF>rmf-a1c346fa-0377-498e-98aa-a0b7baa67a12</DATATYPE-DEFINITION-ENUMERATION-REF>
+ </TYPE>
+ </ATTRIBUTE-DEFINITION-ENUMERATION>
+ </SPEC-ATTRIBUTES>
+ </SPEC-OBJECT-TYPE>
+ <SPECIFICATION-TYPE IDENTIFIER="rmf-ab7a82eb-1879-4d38-971c-bf692718d0b7" LONG-NAME="Specification Type">
+ <SPEC-ATTRIBUTES>
+ <ATTRIBUTE-DEFINITION-STRING IDENTIFIER="rmf-a5eae5b7-674a-4045-b0ad-dcec218ed833" LONG-NAME="Description">
+ <TYPE>
+ <DATATYPE-DEFINITION-STRING-REF>rmf-b2fdc05d-1cf8-42aa-bbd5-78f664726c95</DATATYPE-DEFINITION-STRING-REF>
+ </TYPE>
+ </ATTRIBUTE-DEFINITION-STRING>
+ </SPEC-ATTRIBUTES>
+ </SPECIFICATION-TYPE>
+ <SPEC-OBJECT-TYPE IDENTIFIER="rmf-1d596c7e-c9fd-45de-b641-d1a85db78e59" LONG-NAME="Information">
+ <SPEC-ATTRIBUTES>
+ <ATTRIBUTE-DEFINITION-STRING IDENTIFIER="rmf-0c2a78f2-7314-48ee-b20a-b1223a5ad87d" LONG-NAME="Description">
+ <TYPE>
+ <DATATYPE-DEFINITION-STRING-REF>rmf-b2fdc05d-1cf8-42aa-bbd5-78f664726c95</DATATYPE-DEFINITION-STRING-REF>
+ </TYPE>
+ </ATTRIBUTE-DEFINITION-STRING>
+ </SPEC-ATTRIBUTES>
+ </SPEC-OBJECT-TYPE>
+ <SPEC-OBJECT-TYPE IDENTIFIER="rmf-7a80cefb-37a2-4543-a681-03b8a463e595" LONG-NAME="Headline">
+ <SPEC-ATTRIBUTES>
+ <ATTRIBUTE-DEFINITION-STRING IDENTIFIER="rmf-39360a38-9f59-4b2f-8944-eb247d3d11d3" LONG-NAME="Description">
+ <TYPE>
+ <DATATYPE-DEFINITION-STRING-REF>rmf-6ae5da0f-4ee8-4159-98f5-d6bde49c6fb0</DATATYPE-DEFINITION-STRING-REF>
+ </TYPE>
+ </ATTRIBUTE-DEFINITION-STRING>
+ </SPEC-ATTRIBUTES>
+ </SPEC-OBJECT-TYPE>
+ </SPEC-TYPES>
+ <SPEC-OBJECTS>
+ <SPEC-OBJECT IDENTIFIER="rmf-9051a0aa-7b3b-490c-a9da-0c1766939873">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="All plug-ins have the correct version number">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-c8c315ae-71d8-45f0-a177-0f77ea5204fa</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ <ATTRIBUTE-VALUE-STRING>
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-c34db4fe-b265-4878-9eb9-8d2b346f45e9</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ <ATTRIBUTE-VALUE-ENUMERATION>
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-ENUMERATION-REF>rmf-de873a9a-eb74-4f97-bcd8-1a90e72d44ed</ATTRIBUTE-DEFINITION-ENUMERATION-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-ENUMERATION>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-27e7042d-1f4d-4dd2-a9ad-dbe13895c09e</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ <SPEC-OBJECT IDENTIFIER="rmf-0ba5a59c-be1a-48a7-bf71-8948120670bc">
+ <VALUES>
+ <ATTRIBUTE-VALUE-ENUMERATION>
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-ENUMERATION-REF>rmf-de873a9a-eb74-4f97-bcd8-1a90e72d44ed</ATTRIBUTE-DEFINITION-ENUMERATION-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-ENUMERATION>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="The About... dialog has the correct version number">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-c8c315ae-71d8-45f0-a177-0f77ea5204fa</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ <ATTRIBUTE-VALUE-STRING>
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-c34db4fe-b265-4878-9eb9-8d2b346f45e9</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-27e7042d-1f4d-4dd2-a9ad-dbe13895c09e</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ <SPEC-OBJECT IDENTIFIER="rmf-140d2082-44a4-4b63-948e-d258c5193af7">
+ <VALUES>
+ <ATTRIBUTE-VALUE-ENUMERATION>
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-ENUMERATION-REF>rmf-de873a9a-eb74-4f97-bcd8-1a90e72d44ed</ATTRIBUTE-DEFINITION-ENUMERATION-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-ENUMERATION>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="The wizard creates a model with the correct version number">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-c8c315ae-71d8-45f0-a177-0f77ea5204fa</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ <ATTRIBUTE-VALUE-STRING>
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-c34db4fe-b265-4878-9eb9-8d2b346f45e9</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-27e7042d-1f4d-4dd2-a9ad-dbe13895c09e</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ <SPEC-OBJECT IDENTIFIER="rmf-fa26b50a-22d3-404b-89d6-176bbce2e8bf">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="Integration-Release Checklist">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-39360a38-9f59-4b2f-8944-eb247d3d11d3</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-7a80cefb-37a2-4543-a681-03b8a463e595</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ <SPEC-OBJECT IDENTIFIER="rmf-cdf4dbb9-c78b-46d5-b4ee-3a0385ada071">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="This document lists all tasks that need to be done upon creating a new integration release.">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-0c2a78f2-7314-48ee-b20a-b1223a5ad87d</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-1d596c7e-c9fd-45de-b641-d1a85db78e59</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ <SPEC-OBJECT IDENTIFIER="rmf-14eec57c-4c3e-4a41-8a60-c016442b8ad6">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="When preparing a new release, all items for the given release must be set to "done".">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-0c2a78f2-7314-48ee-b20a-b1223a5ad87d</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-1d596c7e-c9fd-45de-b641-d1a85db78e59</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ <SPEC-OBJECT IDENTIFIER="rmf-6def4005-73f9-4776-b644-414c08a30677">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="Preparing an Integration-Release">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-39360a38-9f59-4b2f-8944-eb247d3d11d3</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-7a80cefb-37a2-4543-a681-03b8a463e595</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ <SPEC-OBJECT IDENTIFIER="rmf-6bcc9b65-8404-498a-96cc-0c74f8a83a92">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="To prepare a release, perform the following steps:">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-0c2a78f2-7314-48ee-b20a-b1223a5ad87d</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-1d596c7e-c9fd-45de-b641-d1a85db78e59</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ <SPEC-OBJECT IDENTIFIER="rmf-b9e4f090-b833-4846-a487-ebdf03d61bac">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="Edit the Datatype and add a new attribute, named after the build (e.g. 0.4.0). Give it the status type.">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-0c2a78f2-7314-48ee-b20a-b1223a5ad87d</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-1d596c7e-c9fd-45de-b641-d1a85db78e59</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ <SPEC-OBJECT IDENTIFIER="rmf-c18d943d-3980-4570-baad-d39c68b922bb">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="Remove older releases from the specification editor (they will still be visible through the properties view)">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-0c2a78f2-7314-48ee-b20a-b1223a5ad87d</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-1d596c7e-c9fd-45de-b641-d1a85db78e59</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ <SPEC-OBJECT IDENTIFIER="rmf-76febab0-b6cc-467f-8e21-00c5aa68abdf">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="Add the current release to the specification view.">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-0c2a78f2-7314-48ee-b20a-b1223a5ad87d</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-1d596c7e-c9fd-45de-b641-d1a85db78e59</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ <SPEC-OBJECT IDENTIFIER="rmf-6eae45be-8d52-4f31-a12c-cceff5c6d7e9">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="Checklist">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-39360a38-9f59-4b2f-8944-eb247d3d11d3</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-7a80cefb-37a2-4543-a681-03b8a463e595</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ </SPEC-OBJECTS>
+ <SPECIFICATIONS>
+ <SPECIFICATION IDENTIFIER="rmf-b76ce2dc-9eb5-4750-bf44-28f034647045" LONG-NAME="Specification Document">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="Integration Release Checklist">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-a5eae5b7-674a-4045-b0ad-dcec218ed833</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPECIFICATION-TYPE-REF>rmf-ab7a82eb-1879-4d38-971c-bf692718d0b7</SPECIFICATION-TYPE-REF>
+ </TYPE>
+ <CHILDREN>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-0d91cba3-14ae-42e0-bda6-c76da8c58f56">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-fa26b50a-22d3-404b-89d6-176bbce2e8bf</SPEC-OBJECT-REF>
+ </OBJECT>
+ </SPEC-HIERARCHY>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-b90f419f-fd76-4a7d-a0ef-4f92e9f3358f">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-cdf4dbb9-c78b-46d5-b4ee-3a0385ada071</SPEC-OBJECT-REF>
+ </OBJECT>
+ </SPEC-HIERARCHY>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-78d8ae9c-6540-4616-8b83-09ae7ae3b6a4">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-14eec57c-4c3e-4a41-8a60-c016442b8ad6</SPEC-OBJECT-REF>
+ </OBJECT>
+ </SPEC-HIERARCHY>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-b5664944-2e56-4e60-9ae5-54446c3a3706">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-6def4005-73f9-4776-b644-414c08a30677</SPEC-OBJECT-REF>
+ </OBJECT>
+ </SPEC-HIERARCHY>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-12b9f9fe-553d-4c53-81c8-cb923d2a9e15">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-6bcc9b65-8404-498a-96cc-0c74f8a83a92</SPEC-OBJECT-REF>
+ </OBJECT>
+ <CHILDREN>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-c0829eb2-71a6-4639-8f53-f97c81ed495b">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-b9e4f090-b833-4846-a487-ebdf03d61bac</SPEC-OBJECT-REF>
+ </OBJECT>
+ </SPEC-HIERARCHY>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-93d5b16b-84a2-4928-848e-99036adc0924">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-c18d943d-3980-4570-baad-d39c68b922bb</SPEC-OBJECT-REF>
+ </OBJECT>
+ </SPEC-HIERARCHY>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-06a6b8d1-1652-410a-b361-0a78fdcf1eaf">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-76febab0-b6cc-467f-8e21-00c5aa68abdf</SPEC-OBJECT-REF>
+ </OBJECT>
+ </SPEC-HIERARCHY>
+ </CHILDREN>
+ </SPEC-HIERARCHY>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-e225ba6b-b07f-4e98-8199-2005f09eb0db">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-6eae45be-8d52-4f31-a12c-cceff5c6d7e9</SPEC-OBJECT-REF>
+ </OBJECT>
+ <CHILDREN>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-00f7bfbc-bccc-4d72-aa02-54f594536ea8">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-9051a0aa-7b3b-490c-a9da-0c1766939873</SPEC-OBJECT-REF>
+ </OBJECT>
+ </SPEC-HIERARCHY>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-67db2787-3aa6-44e5-9e6f-007ef42fd277">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-0ba5a59c-be1a-48a7-bf71-8948120670bc</SPEC-OBJECT-REF>
+ </OBJECT>
+ </SPEC-HIERARCHY>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-038f1fa5-c481-4459-b50b-5b0953192b67">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-140d2082-44a4-4b63-948e-d258c5193af7</SPEC-OBJECT-REF>
+ </OBJECT>
+ </SPEC-HIERARCHY>
+ </CHILDREN>
+ </SPEC-HIERARCHY>
+ </CHILDREN>
+ </SPECIFICATION>
+ </SPECIFICATIONS>
+ </REQ-IF-CONTENT>
+ </CORE-CONTENT>
+ <TOOL-EXTENSIONS>
+ <REQ-IF-TOOL-EXTENSION>
+ <configuration:ProrToolExtension>
+ <configuration:specViewConfigurations>
+ <configuration:ProrSpecViewConfiguration configuration:specification="rmf-b76ce2dc-9eb5-4750-bf44-28f034647045">
+ <configuration:columns>
+ <configuration:Column configuration:label="Description" configuration:width="416"/>
+ <configuration:Column configuration:label="0.4.0"/>
+ </configuration:columns>
+ <configuration:leftHeaderColumn>
+ <configuration:Column configuration:label="Lead Header Column" configuration:width="30"/>
+ </configuration:leftHeaderColumn>
+ </configuration:ProrSpecViewConfiguration>
+ </configuration:specViewConfigurations>
+ <configuration:generalConfiguration>
+ <configuration:ProrGeneralConfiguration>
+ <configuration:labelConfiguration>
+ <configuration:LabelConfiguration>
+ <configuration:defaultLabel>Description</configuration:defaultLabel>
+ </configuration:LabelConfiguration>
+ </configuration:labelConfiguration>
+ </configuration:ProrGeneralConfiguration>
+ </configuration:generalConfiguration>
+ <configuration:presentationConfigurations>
+ <configuration:ProrPresentationConfigurations>
+ <configuration:presentationConfigurations>
+ <linewrap:LinewrapConfiguration configuration:datatype="rmf-b2fdc05d-1cf8-42aa-bbd5-78f664726c95"/>
+ <headline:HeadlineConfiguration configuration:datatype="rmf-6ae5da0f-4ee8-4159-98f5-d6bde49c6fb0"/>
+ </configuration:presentationConfigurations>
+ </configuration:ProrPresentationConfigurations>
+ </configuration:presentationConfigurations>
+ </configuration:ProrToolExtension>
+ </REQ-IF-TOOL-EXTENSION>
+ </TOOL-EXTENSIONS>
+</REQ-IF>
diff --git a/dump/reqif/presentations.reqif b/dump/reqif/presentations.reqif
index 2e2ed77..b1a4352 100644
--- a/dump/reqif/presentations.reqif
+++ b/dump/reqif/presentations.reqif
@@ -1,127 +1,324 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<REQ-IF xmlns="http://www.omg.org/spec/ReqIF/20110401/reqif.xsd" xmlns:configuration="http://eclipse.org/rmf/pror/toolextensions/1.0" xmlns:headline="http://pror.org/presentation/headline" xmlns:id="http://pror.org/presentation/id" xmlns:linewrap="http://pror.org/presentation/linewrap">
- <THE-HEADER>
- <REQ-IF-HEADER IDENTIFIER="rmf-8cc4b895-7c6a-44e0-870e-03afaaf3b08f">
- <CREATION-TIME>2012-06-11T15:57:20.388+02:00</CREATION-TIME>
- <SOURCE-TOOL-ID>ProR (http://pror.org)</SOURCE-TOOL-ID>
- </REQ-IF-HEADER>
- </THE-HEADER>
- <CORE-CONTENT>
- <REQ-IF-CONTENT>
- <DATATYPES>
- <DATATYPE-DEFINITION-STRING IDENTIFIER="rmf-5ae236cc-664e-4041-8c9c-ffdd996fb759" LONG-NAME="T_String32k" MAX-LENGTH="32000"/>
- <DATATYPE-DEFINITION-STRING IDENTIFIER="rmf-1fe85126-6dde-40cc-8987-b7a55af8ee29" LAST-CHANGE="2012-06-11T15:58:05.989+02:00" LONG-NAME="T_Headline"/>
- <DATATYPE-DEFINITION-STRING IDENTIFIER="rmf-3eca2d2f-9dcf-429d-b9f5-4b4ff7b81f2f" LAST-CHANGE="2012-06-11T15:59:47.182+02:00" LONG-NAME="T_ID"/>
- </DATATYPES>
- <SPEC-TYPES>
- <SPEC-OBJECT-TYPE IDENTIFIER="rmf-79d9783b-c04c-4f4a-96d0-292b0cd48462" LONG-NAME="Requirement Type">
- <SPEC-ATTRIBUTES>
- <ATTRIBUTE-DEFINITION-STRING IDENTIFIER="rmf-caa612e5-a3db-4092-8bbe-8a086c353878" LAST-CHANGE="2012-06-11T15:59:58.294+02:00" LONG-NAME="Description">
- <TYPE>
- <DATATYPE-DEFINITION-STRING-REF>rmf-5ae236cc-664e-4041-8c9c-ffdd996fb759</DATATYPE-DEFINITION-STRING-REF>
- </TYPE>
- </ATTRIBUTE-DEFINITION-STRING>
- <ATTRIBUTE-DEFINITION-STRING IDENTIFIER="rmf-3dbba3f0-a6bd-4748-87cd-4746fc4f2cca" LAST-CHANGE="2012-06-11T16:00:13.519+02:00" LONG-NAME="ID">
- <TYPE>
- <DATATYPE-DEFINITION-STRING-REF>rmf-3eca2d2f-9dcf-429d-b9f5-4b4ff7b81f2f</DATATYPE-DEFINITION-STRING-REF>
- </TYPE>
- </ATTRIBUTE-DEFINITION-STRING>
- </SPEC-ATTRIBUTES>
- </SPEC-OBJECT-TYPE>
- <SPEC-OBJECT-TYPE IDENTIFIER="rmf-bbf83294-a973-4308-be12-cab82c0d0d29" LAST-CHANGE="2012-06-11T16:01:08.563+02:00" LONG-NAME="Headline Type">
- <SPEC-ATTRIBUTES>
- <ATTRIBUTE-DEFINITION-STRING IDENTIFIER="rmf-591d0fcf-e140-4a97-8c21-81c41d633703" LAST-CHANGE="2012-06-11T15:58:37.839+02:00" LONG-NAME="Description">
- <TYPE>
- <DATATYPE-DEFINITION-STRING-REF>rmf-1fe85126-6dde-40cc-8987-b7a55af8ee29</DATATYPE-DEFINITION-STRING-REF>
- </TYPE>
- </ATTRIBUTE-DEFINITION-STRING>
- </SPEC-ATTRIBUTES>
- </SPEC-OBJECT-TYPE>
- </SPEC-TYPES>
- <SPEC-OBJECTS>
- <SPEC-OBJECT IDENTIFIER="rmf-4bfe7a70-b512-4785-920c-537599048227">
- <VALUES>
- <ATTRIBUTE-VALUE-STRING THE-VALUE="Headline">
- <DEFINITION>
- <ATTRIBUTE-DEFINITION-STRING-REF>rmf-591d0fcf-e140-4a97-8c21-81c41d633703</ATTRIBUTE-DEFINITION-STRING-REF>
- </DEFINITION>
- </ATTRIBUTE-VALUE-STRING>
- </VALUES>
- <TYPE>
- <SPEC-OBJECT-TYPE-REF>rmf-bbf83294-a973-4308-be12-cab82c0d0d29</SPEC-OBJECT-TYPE-REF>
- </TYPE>
- </SPEC-OBJECT>
- <SPEC-OBJECT IDENTIFIER="rmf-94b086b7-b6f9-4534-9b0e-500af1f9712f">
- <VALUES>
- <ATTRIBUTE-VALUE-STRING THE-VALUE="REQ-1">
- <DEFINITION>
- <ATTRIBUTE-DEFINITION-STRING-REF>rmf-3dbba3f0-a6bd-4748-87cd-4746fc4f2cca</ATTRIBUTE-DEFINITION-STRING-REF>
- </DEFINITION>
- </ATTRIBUTE-VALUE-STRING>
- <ATTRIBUTE-VALUE-STRING THE-VALUE="Start editing here. With LineWrap plugin! Some more Text!">
- <DEFINITION>
- <ATTRIBUTE-DEFINITION-STRING-REF>rmf-caa612e5-a3db-4092-8bbe-8a086c353878</ATTRIBUTE-DEFINITION-STRING-REF>
- </DEFINITION>
- </ATTRIBUTE-VALUE-STRING>
- </VALUES>
- <TYPE>
- <SPEC-OBJECT-TYPE-REF>rmf-79d9783b-c04c-4f4a-96d0-292b0cd48462</SPEC-OBJECT-TYPE-REF>
- </TYPE>
- </SPEC-OBJECT>
- </SPEC-OBJECTS>
- <SPECIFICATIONS>
- <SPECIFICATION IDENTIFIER="rmf-64f7ef16-ef94-4004-b267-cfc6c7d5f184" LONG-NAME="Specification Document">
- <CHILDREN>
- <SPEC-HIERARCHY IDENTIFIER="rmf-fae96bfa-f0f6-443e-8593-a6ab1db7a144" LAST-CHANGE="2012-06-11T16:01:22.466+02:00">
- <OBJECT>
- <SPEC-OBJECT-REF>rmf-4bfe7a70-b512-4785-920c-537599048227</SPEC-OBJECT-REF>
- </OBJECT>
- <CHILDREN>
- <SPEC-HIERARCHY IDENTIFIER="rmf-e762e7d6-0a2f-4ed7-8fac-1250a8c1fd69" LAST-CHANGE="2012-06-11T16:03:27.416+02:00">
- <OBJECT>
- <SPEC-OBJECT-REF>rmf-94b086b7-b6f9-4534-9b0e-500af1f9712f</SPEC-OBJECT-REF>
- </OBJECT>
- </SPEC-HIERARCHY>
- </CHILDREN>
- </SPEC-HIERARCHY>
- </CHILDREN>
- </SPECIFICATION>
- </SPECIFICATIONS>
- </REQ-IF-CONTENT>
- </CORE-CONTENT>
- <TOOL-EXTENSIONS>
- <REQ-IF-TOOL-EXTENSION>
- <configuration:ProrToolExtension>
- <configuration:specViewConfigurations>
- <configuration:ProrSpecViewConfiguration configuration:specification="rmf-64f7ef16-ef94-4004-b267-cfc6c7d5f184">
- <configuration:columns>
- <configuration:Column configuration:label="ID"/>
- <configuration:Column configuration:label="Description" configuration:width="282"/>
- </configuration:columns>
- <configuration:leftHeaderColumn>
- <configuration:Column configuration:label="Lead Header Column" configuration:width="30"/>
- </configuration:leftHeaderColumn>
- </configuration:ProrSpecViewConfiguration>
- </configuration:specViewConfigurations>
- <configuration:generalConfiguration>
- <configuration:ProrGeneralConfiguration>
- <configuration:labelConfiguration>
- <configuration:LabelConfiguration>
- <configuration:defaultLabel>Description</configuration:defaultLabel>
- </configuration:LabelConfiguration>
- </configuration:labelConfiguration>
- </configuration:ProrGeneralConfiguration>
- </configuration:generalConfiguration>
- <configuration:presentationConfigurations>
- <configuration:ProrPresentationConfigurations>
- <configuration:presentationConfigurations>
- <linewrap:LinewrapConfiguration configuration:datatype="rmf-5ae236cc-664e-4041-8c9c-ffdd996fb759"/>
- <headline:HeadlineConfiguration configuration:datatype="rmf-1fe85126-6dde-40cc-8987-b7a55af8ee29"/>
- <id:IdConfiguration configuration:datatype="rmf-3eca2d2f-9dcf-429d-b9f5-4b4ff7b81f2f" id:count="3"/>
- </configuration:presentationConfigurations>
- </configuration:ProrPresentationConfigurations>
- </configuration:presentationConfigurations>
- </configuration:ProrToolExtension>
- </REQ-IF-TOOL-EXTENSION>
- </TOOL-EXTENSIONS>
-</REQ-IF>
+<?xml version="1.0" encoding="UTF-8"?>
+<REQ-IF xmlns="http://www.omg.org/spec/ReqIF/20110401/reqif.xsd" xmlns:configuration="http://eclipse.org/rmf/pror/toolextensions/1.0" xmlns:headline="http://pror.org/presentation/headline" xmlns:id="http://pror.org/presentation/id" xmlns:linewrap="http://pror.org/presentation/linewrap">
+ <THE-HEADER>
+ <REQ-IF-HEADER IDENTIFIER="rmf-8cc4b895-7c6a-44e0-870e-03afaaf3b08f">
+ <CREATION-TIME>2012-06-11T15:57:20.388+02:00</CREATION-TIME>
+ <SOURCE-TOOL-ID>ProR (http://pror.org)</SOURCE-TOOL-ID>
+ </REQ-IF-HEADER>
+ </THE-HEADER>
+ <CORE-CONTENT>
+ <REQ-IF-CONTENT>
+ <DATATYPES>
+ <DATATYPE-DEFINITION-STRING IDENTIFIER="rmf-5ae236cc-664e-4041-8c9c-ffdd996fb759" LONG-NAME="T_String32k" MAX-LENGTH="32000"/>
+ <DATATYPE-DEFINITION-STRING IDENTIFIER="rmf-1fe85126-6dde-40cc-8987-b7a55af8ee29" LAST-CHANGE="2012-06-11T15:58:05.989+02:00" LONG-NAME="T_Headline"/>
+ <DATATYPE-DEFINITION-STRING IDENTIFIER="rmf-3eca2d2f-9dcf-429d-b9f5-4b4ff7b81f2f" LAST-CHANGE="2012-06-11T15:59:47.182+02:00" LONG-NAME="T_ID"/>
+ </DATATYPES>
+ <SPEC-TYPES>
+ <SPEC-OBJECT-TYPE IDENTIFIER="rmf-79d9783b-c04c-4f4a-96d0-292b0cd48462" LONG-NAME="Requirement Type">
+ <SPEC-ATTRIBUTES>
+ <ATTRIBUTE-DEFINITION-STRING IDENTIFIER="rmf-caa612e5-a3db-4092-8bbe-8a086c353878" LAST-CHANGE="2012-06-11T15:59:58.294+02:00" LONG-NAME="Description">
+ <TYPE>
+ <DATATYPE-DEFINITION-STRING-REF>rmf-5ae236cc-664e-4041-8c9c-ffdd996fb759</DATATYPE-DEFINITION-STRING-REF>
+ </TYPE>
+ </ATTRIBUTE-DEFINITION-STRING>
+ <ATTRIBUTE-DEFINITION-STRING IDENTIFIER="rmf-3dbba3f0-a6bd-4748-87cd-4746fc4f2cca" LAST-CHANGE="2012-06-11T16:00:13.519+02:00" LONG-NAME="ID">
+ <TYPE>
+ <DATATYPE-DEFINITION-STRING-REF>rmf-3eca2d2f-9dcf-429d-b9f5-4b4ff7b81f2f</DATATYPE-DEFINITION-STRING-REF>
+ </TYPE>
+ </ATTRIBUTE-DEFINITION-STRING>
+ <ATTRIBUTE-DEFINITION-STRING IDENTIFIER="rmf-77bd5a0f-ddfd-464d-bdfc-ed989e9d26df" LONG-NAME="Implementation Status">
+ <TYPE>
+ <DATATYPE-DEFINITION-STRING-REF>rmf-5ae236cc-664e-4041-8c9c-ffdd996fb759</DATATYPE-DEFINITION-STRING-REF>
+ </TYPE>
+ </ATTRIBUTE-DEFINITION-STRING>
+ </SPEC-ATTRIBUTES>
+ </SPEC-OBJECT-TYPE>
+ <SPEC-OBJECT-TYPE IDENTIFIER="rmf-bbf83294-a973-4308-be12-cab82c0d0d29" LAST-CHANGE="2012-06-11T16:01:08.563+02:00" LONG-NAME="Headline Type">
+ <SPEC-ATTRIBUTES>
+ <ATTRIBUTE-DEFINITION-STRING IDENTIFIER="rmf-591d0fcf-e140-4a97-8c21-81c41d633703" LAST-CHANGE="2012-06-11T15:58:37.839+02:00" LONG-NAME="Description">
+ <TYPE>
+ <DATATYPE-DEFINITION-STRING-REF>rmf-1fe85126-6dde-40cc-8987-b7a55af8ee29</DATATYPE-DEFINITION-STRING-REF>
+ </TYPE>
+ </ATTRIBUTE-DEFINITION-STRING>
+ </SPEC-ATTRIBUTES>
+ </SPEC-OBJECT-TYPE>
+ <SPECIFICATION-TYPE IDENTIFIER="rmf-84d0c6a5-8e84-4920-8c10-0b653383b1ca" LONG-NAME="Specification Type">
+ <SPEC-ATTRIBUTES>
+ <ATTRIBUTE-DEFINITION-STRING IDENTIFIER="rmf-679b3c7f-fad7-4016-8156-2e2d18d582df" LONG-NAME="Description">
+ <TYPE>
+ <DATATYPE-DEFINITION-STRING-REF>rmf-1fe85126-6dde-40cc-8987-b7a55af8ee29</DATATYPE-DEFINITION-STRING-REF>
+ </TYPE>
+ </ATTRIBUTE-DEFINITION-STRING>
+ </SPEC-ATTRIBUTES>
+ </SPECIFICATION-TYPE>
+ </SPEC-TYPES>
+ <SPEC-OBJECTS>
+ <SPEC-OBJECT IDENTIFIER="rmf-4bfe7a70-b512-4785-920c-537599048227">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="Current Situation">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-591d0fcf-e140-4a97-8c21-81c41d633703</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-bbf83294-a973-4308-be12-cab82c0d0d29</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ <SPEC-OBJECT IDENTIFIER="rmf-94b086b7-b6f9-4534-9b0e-500af1f9712f">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="REQ-1">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-3dbba3f0-a6bd-4748-87cd-4746fc4f2cca</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="While the presentation subsystem works, it is not very clean and contains a number of inconsistencies. In the following, we'll describe how we would design it from scratch (if we could).">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-caa612e5-a3db-4092-8bbe-8a086c353878</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ <ATTRIBUTE-VALUE-STRING>
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-77bd5a0f-ddfd-464d-bdfc-ed989e9d26df</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-79d9783b-c04c-4f4a-96d0-292b0cd48462</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ <SPEC-OBJECT IDENTIFIER="rmf-e993455a-b1c3-43fe-894e-ae005a44acf7">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="Concepts">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-591d0fcf-e140-4a97-8c21-81c41d633703</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-bbf83294-a973-4308-be12-cab82c0d0d29</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ <SPEC-OBJECT IDENTIFIER="rmf-8720766f-b211-4d54-aff2-7af54628b328">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="For every Presentation, there is one class that manages it (across Projects and ReqIF models). This is the PresentationService.">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-caa612e5-a3db-4092-8bbe-8a086c353878</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="REQ-4">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-3dbba3f0-a6bd-4748-87cd-4746fc4f2cca</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="Implemented">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-77bd5a0f-ddfd-464d-bdfc-ed989e9d26df</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-79d9783b-c04c-4f4a-96d0-292b0cd48462</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ <SPEC-OBJECT IDENTIFIER="rmf-0a0b7e88-ff2f-4e25-89b8-3fd9f107a9f4">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="The PresentationService is instantiated upon Eclipse Startup">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-caa612e5-a3db-4092-8bbe-8a086c353878</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="REQ-5">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-3dbba3f0-a6bd-4748-87cd-4746fc4f2cca</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="lazy by PresentationManager.getPresentationServiceMap()">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-77bd5a0f-ddfd-464d-bdfc-ed989e9d26df</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-79d9783b-c04c-4f4a-96d0-292b0cd48462</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ <SPEC-OBJECT IDENTIFIER="rmf-fd80896b-1cc3-42c6-b081-dacf3479e6e0">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="Currently, the PresentationService is notified upon opening and closing. This does not make sense. This should move to the Configuration Element">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-caa612e5-a3db-4092-8bbe-8a086c353878</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="REQ-6">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-3dbba3f0-a6bd-4748-87cd-4746fc4f2cca</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ <ATTRIBUTE-VALUE-STRING>
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-77bd5a0f-ddfd-464d-bdfc-ed989e9d26df</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-79d9783b-c04c-4f4a-96d0-292b0cd48462</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ <SPEC-OBJECT IDENTIFIER="rmf-9d2d73a0-b419-4916-8f6e-eddf6c27b145">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="PresentationService and -Manager">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-591d0fcf-e140-4a97-8c21-81c41d633703</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-bbf83294-a973-4308-be12-cab82c0d0d29</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ <SPEC-OBJECT IDENTIFIER="rmf-5bdf09ac-1673-485b-8db0-7dd639410970">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="ProrPresentationConfiguration and -Manager">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-591d0fcf-e140-4a97-8c21-81c41d633703</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-bbf83294-a973-4308-be12-cab82c0d0d29</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ <SPEC-OBJECT IDENTIFIER="rmf-4d94fa5d-e00c-4180-9c21-ce425015e1ee">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="Upon creating a configuration object, it should get a chance to register with the ReqIF object.">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-caa612e5-a3db-4092-8bbe-8a086c353878</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="REQ-7">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-3dbba3f0-a6bd-4748-87cd-4746fc4f2cca</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ <ATTRIBUTE-VALUE-STRING>
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-77bd5a0f-ddfd-464d-bdfc-ed989e9d26df</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPEC-OBJECT-TYPE-REF>rmf-79d9783b-c04c-4f4a-96d0-292b0cd48462</SPEC-OBJECT-TYPE-REF>
+ </TYPE>
+ </SPEC-OBJECT>
+ </SPEC-OBJECTS>
+ <SPECIFICATIONS>
+ <SPECIFICATION IDENTIFIER="rmf-64f7ef16-ef94-4004-b267-cfc6c7d5f184" LONG-NAME="Specification Document">
+ <VALUES>
+ <ATTRIBUTE-VALUE-STRING THE-VALUE="Refactoring / Cleanup of Presentations">
+ <DEFINITION>
+ <ATTRIBUTE-DEFINITION-STRING-REF>rmf-679b3c7f-fad7-4016-8156-2e2d18d582df</ATTRIBUTE-DEFINITION-STRING-REF>
+ </DEFINITION>
+ </ATTRIBUTE-VALUE-STRING>
+ </VALUES>
+ <TYPE>
+ <SPECIFICATION-TYPE-REF>rmf-84d0c6a5-8e84-4920-8c10-0b653383b1ca</SPECIFICATION-TYPE-REF>
+ </TYPE>
+ <CHILDREN>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-fae96bfa-f0f6-443e-8593-a6ab1db7a144" LAST-CHANGE="2012-06-11T16:01:22.466+02:00">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-4bfe7a70-b512-4785-920c-537599048227</SPEC-OBJECT-REF>
+ </OBJECT>
+ <CHILDREN>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-e762e7d6-0a2f-4ed7-8fac-1250a8c1fd69" LAST-CHANGE="2012-06-11T16:03:27.416+02:00">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-94b086b7-b6f9-4534-9b0e-500af1f9712f</SPEC-OBJECT-REF>
+ </OBJECT>
+ </SPEC-HIERARCHY>
+ </CHILDREN>
+ </SPEC-HIERARCHY>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-9dfa4496-938d-40e4-b4bf-02060039a9eb">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-e993455a-b1c3-43fe-894e-ae005a44acf7</SPEC-OBJECT-REF>
+ </OBJECT>
+ <CHILDREN>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-df373331-0fdd-465f-a2e8-222b1afe8436">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-9d2d73a0-b419-4916-8f6e-eddf6c27b145</SPEC-OBJECT-REF>
+ </OBJECT>
+ <CHILDREN>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-1a19457c-6b4a-402c-8e88-fd3a16394023">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-8720766f-b211-4d54-aff2-7af54628b328</SPEC-OBJECT-REF>
+ </OBJECT>
+ <CHILDREN/>
+ </SPEC-HIERARCHY>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-3ef0de5b-2742-4d95-98f1-ff9a7b28f965">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-0a0b7e88-ff2f-4e25-89b8-3fd9f107a9f4</SPEC-OBJECT-REF>
+ </OBJECT>
+ <CHILDREN/>
+ </SPEC-HIERARCHY>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-75435f71-b1ee-4fc8-93ad-ac735164c4ad">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-fd80896b-1cc3-42c6-b081-dacf3479e6e0</SPEC-OBJECT-REF>
+ </OBJECT>
+ </SPEC-HIERARCHY>
+ </CHILDREN>
+ </SPEC-HIERARCHY>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-3aeda872-b3a5-4f94-9034-61455a4ca394">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-5bdf09ac-1673-485b-8db0-7dd639410970</SPEC-OBJECT-REF>
+ </OBJECT>
+ <CHILDREN>
+ <SPEC-HIERARCHY IDENTIFIER="rmf-6fe796eb-1566-43db-bd15-6b779a6a682e">
+ <OBJECT>
+ <SPEC-OBJECT-REF>rmf-4d94fa5d-e00c-4180-9c21-ce425015e1ee</SPEC-OBJECT-REF>
+ </OBJECT>
+ </SPEC-HIERARCHY>
+ </CHILDREN>
+ </SPEC-HIERARCHY>
+ </CHILDREN>
+ </SPEC-HIERARCHY>
+ </CHILDREN>
+ </SPECIFICATION>
+ </SPECIFICATIONS>
+ </REQ-IF-CONTENT>
+ </CORE-CONTENT>
+ <TOOL-EXTENSIONS>
+ <REQ-IF-TOOL-EXTENSION>
+ <configuration:ProrToolExtension>
+ <configuration:specViewConfigurations>
+ <configuration:ProrSpecViewConfiguration configuration:specification="rmf-64f7ef16-ef94-4004-b267-cfc6c7d5f184">
+ <configuration:columns>
+ <configuration:Column configuration:label="ID" configuration:width="113"/>
+ <configuration:Column configuration:label="Description" configuration:width="383"/>
+ <configuration:Column configuration:label="Implementation Status" configuration:width="346"/>
+ </configuration:columns>
+ <configuration:leftHeaderColumn>
+ <configuration:Column configuration:label="Lead Header Column" configuration:width="30"/>
+ </configuration:leftHeaderColumn>
+ </configuration:ProrSpecViewConfiguration>
+ </configuration:specViewConfigurations>
+ <configuration:generalConfiguration>
+ <configuration:ProrGeneralConfiguration>
+ <configuration:labelConfiguration>
+ <configuration:LabelConfiguration>
+ <configuration:defaultLabel>Description</configuration:defaultLabel>
+ </configuration:LabelConfiguration>
+ </configuration:labelConfiguration>
+ </configuration:ProrGeneralConfiguration>
+ </configuration:generalConfiguration>
+ <configuration:presentationConfigurations>
+ <configuration:ProrPresentationConfigurations>
+ <configuration:presentationConfigurations>
+ <linewrap:LinewrapConfiguration configuration:datatype="rmf-5ae236cc-664e-4041-8c9c-ffdd996fb759"/>
+ <headline:HeadlineConfiguration configuration:datatype="rmf-1fe85126-6dde-40cc-8987-b7a55af8ee29"/>
+ <id:IdConfiguration configuration:datatype="rmf-3eca2d2f-9dcf-429d-b9f5-4b4ff7b81f2f" id:count="7" id:verticalAlign="Center"/>
+ </configuration:presentationConfigurations>
+ </configuration:ProrPresentationConfigurations>
+ </configuration:presentationConfigurations>
+ </configuration:ProrToolExtension>
+ </REQ-IF-TOOL-EXTENSION>
+ </TOOL-EXTENSIONS>
+</REQ-IF>
diff --git a/org.eclipse.rmf.pror.reqif10.edit/META-INF/MANIFEST.MF b/org.eclipse.rmf.pror.reqif10.edit/META-INF/MANIFEST.MF
index 5c82b50..7ffddd9 100644
--- a/org.eclipse.rmf.pror.reqif10.edit/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.pror.reqif10.edit/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.pror.reqif10.edit;singleton:=true
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.rmf.pror.reqif10.provider.Reqif10EditPlugin$Implementation
Bundle-Vendor: %providerName
@@ -16,5 +16,5 @@
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.edit;visibility:=reexport,
org.eclipse.emf.ecore;visibility:=reexport,
- org.eclipse.rmf.pror.reqif10;bundle-version="0.3.2";visibility:=reexport
+ org.eclipse.rmf.pror.reqif10;bundle-version="0.4.0";visibility:=reexport
Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.rmf.pror.reqif10.edit/pom.xml b/org.eclipse.rmf.pror.reqif10.edit/pom.xml
index e3553a6..9c1726e 100644
--- a/org.eclipse.rmf.pror.reqif10.edit/pom.xml
+++ b/org.eclipse.rmf.pror.reqif10.edit/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.pror.reqif10.edit</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<groupId>org.eclipse.rmf.plugins</groupId>
<build>
diff --git a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/configuration/provider/ConfigurationItemProviderAdapterFactory.java b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/configuration/provider/ConfigurationItemProviderAdapterFactory.java
index 8f3f659..698b458 100644
--- a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/configuration/provider/ConfigurationItemProviderAdapterFactory.java
+++ b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/configuration/provider/ConfigurationItemProviderAdapterFactory.java
@@ -20,6 +20,7 @@
import org.eclipse.emf.edit.provider.ChangeNotifier;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.Disposable;
import org.eclipse.emf.edit.provider.IChangeNotifier;
import org.eclipse.emf.edit.provider.IDisposable;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
@@ -57,6 +58,14 @@
protected IChangeNotifier changeNotifier = new ChangeNotifier();
/**
+ * This keeps track of all the item providers created, so that they can be {@link #dispose disposed}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Disposable disposable = new Disposable();
+
+ /**
* This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -148,14 +157,6 @@
}
/**
- * This keeps track of the one adapter used for all {@link org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfigurations} instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected ProrPresentationConfigurationsItemProvider prorPresentationConfigurationsItemProvider;
-
- /**
* This creates an adapter for a {@link org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfigurations}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -163,11 +164,7 @@
*/
@Override
public Adapter createProrPresentationConfigurationsAdapter() {
- if (prorPresentationConfigurationsItemProvider == null) {
- prorPresentationConfigurationsItemProvider = new ProrPresentationConfigurationsItemProvider(this);
- }
-
- return prorPresentationConfigurationsItemProvider;
+ return new ProrPresentationConfigurationsItemProvider(this);
}
/**
@@ -275,6 +272,20 @@
}
/**
+ * Associates an adapter with a notifier via the base implementation, then records it to ensure it will be disposed.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void associate(Adapter adapter, Notifier target) {
+ super.associate(adapter, target);
+ if (adapter != null) {
+ disposable.add(adapter);
+ }
+ }
+
+ /**
* This adds a listener.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -315,12 +326,7 @@
* @generated
*/
public void dispose() {
- if (prorToolExtensionItemProvider != null) prorToolExtensionItemProvider.dispose();
- if (prorSpecViewConfigurationItemProvider != null) prorSpecViewConfigurationItemProvider.dispose();
- if (columnItemProvider != null) columnItemProvider.dispose();
- if (prorPresentationConfigurationsItemProvider != null) prorPresentationConfigurationsItemProvider.dispose();
- if (prorGeneralConfigurationItemProvider != null) prorGeneralConfigurationItemProvider.dispose();
- if (labelConfigurationItemProvider != null) labelConfigurationItemProvider.dispose();
+ disposable.dispose();
}
}
diff --git a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/configuration/provider/ProrPresentationConfigurationItemProvider.java b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/configuration/provider/ProrPresentationConfigurationItemProvider.java
index 883be5b..c26e160 100644
--- a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/configuration/provider/ProrPresentationConfigurationItemProvider.java
+++ b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/configuration/provider/ProrPresentationConfigurationItemProvider.java
@@ -28,22 +28,28 @@
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.rmf.pror.reqif10.configuration.ConfigurationPackage;
import org.eclipse.rmf.pror.reqif10.provider.Reqif10EditPlugin;
+import org.eclipse.rmf.pror.reqif10.util.PresentationEditInterface;
/**
- * This is the item provider adapter for a {@link org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration} object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
+ * This is the item provider adapter for a
+ * {@link org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration}
+ * object. <!-- begin-user-doc --> This class also implements
+ * {@link PresentationEditInterface} that serves as a hook into the Presentation
+ * Framework. To provide services with respect to the editor, also implement
+ * PresentationEditorInterface. <!-- end-user-doc -->
+ *
+ * @generated NOT
*/
-public class ProrPresentationConfigurationItemProvider
+public abstract class ProrPresentationConfigurationItemProvider
extends ItemProviderAdapter
implements
IEditingDomainItemProvider,
IStructuredItemContentProvider,
ITreeItemContentProvider,
IItemLabelProvider,
- IItemPropertySource {
+ IItemPropertySource,
+ PresentationEditInterface {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
@@ -143,5 +149,4 @@
public ResourceLocator getResourceLocator() {
return Reqif10EditPlugin.INSTANCE;
}
-
}
diff --git a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/configuration/provider/ProrPresentationConfigurationsItemProvider.java b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/configuration/provider/ProrPresentationConfigurationsItemProvider.java
index ca81c69..b98205d 100644
--- a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/configuration/provider/ProrPresentationConfigurationsItemProvider.java
+++ b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/configuration/provider/ProrPresentationConfigurationsItemProvider.java
@@ -19,23 +19,32 @@
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
+import org.eclipse.emf.edit.provider.ItemProvider;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
import org.eclipse.rmf.pror.reqif10.configuration.ConfigurationPackage;
+import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfigurations;
import org.eclipse.rmf.pror.reqif10.provider.Reqif10EditPlugin;
+import org.eclipse.rmf.pror.reqif10.util.ProrUtil;
/**
- * This is the item provider adapter for a {@link org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfigurations} object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
+ * This is the item provider adapter for a
+ * {@link org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfigurations}
+ * object. <!-- begin-user-doc -->
+ * <p>
+ * This adapter is stateful, as it keeps track of an associated
+ * {@link EditingDomain}. This is necessary, as presentations may need to react
+ * to model changes by modifying the model. <!-- end-user-doc -->
+ *
* @generated
*/
public class ProrPresentationConfigurationsItemProvider
@@ -118,20 +127,23 @@
}
/**
- * This handles model notifications by calling {@link #updateChildren} to update any cached
- * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
+ * This handles model notifications by calling {@link #updateChildren} to
+ * update any cached children and by creating a viewer notification, which
+ * it passes to {@link #fireNotifyChanged}. <!-- begin-user-doc --> Handles
+ * calls to PresentationServiceManager <!-- end-user-doc -->
+ *
+ * @generated NOT
*/
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(ProrPresentationConfigurations.class)) {
- case ConfigurationPackage.PROR_PRESENTATION_CONFIGURATIONS__PRESENTATION_CONFIGURATIONS:
- fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false));
- return;
+ case ConfigurationPackage.PROR_PRESENTATION_CONFIGURATIONS__PRESENTATION_CONFIGURATIONS:
+ fireNotifyChanged(new ViewerNotification(notification,
+ notification.getNotifier(), true, false));
+ handlePresentationRegistration(notification);
+ return;
}
super.notifyChanged(notification);
}
@@ -159,4 +171,44 @@
return Reqif10EditPlugin.INSTANCE;
}
+ private EditingDomain editingDomain;
+
+ /**
+ * Allows setting the editing domain, as it is required for
+ * {@link ProrPresentationConfiguration} to modify the model. This method
+ * must be called only once.
+ * <p>
+ * This {@link ItemProvider} is stateful, therefore it is possible to have
+ * multiple models open with multiple {@link EditingDomain}s.
+ */
+ public void setEditingDomain(EditingDomain editingDomain) {
+ if (editingDomain == null) {
+ throw new NullPointerException();
+ } else if (this.editingDomain != null) {
+ throw new IllegalStateException("EditingDomain is already set: "
+ + this.editingDomain);
+ }
+ this.editingDomain = editingDomain;
+ }
+
+ private void handlePresentationRegistration(Notification notification) {
+ if (editingDomain == null) {
+ throw new NullPointerException(
+ "Presentation registration, but editingDomain not yet set!");
+ }
+ if (notification.getEventType() == Notification.ADD) {
+ ProrPresentationConfiguration config = (ProrPresentationConfiguration) notification
+ .getNewValue();
+ System.out.println("Registering: " + config);
+ ProrUtil.getConfigItemProvider(config, getRootAdapterFactory())
+ .registerPresentationConfiguration(config, editingDomain);
+ } else if (notification.getEventType() == Notification.REMOVE) {
+ ProrPresentationConfiguration config = (ProrPresentationConfiguration) notification
+ .getOldValue();
+ System.out.println("Unregistering: " + config);
+ ProrUtil.getConfigItemProvider(config, getRootAdapterFactory())
+ .unregisterPresentationConfiguration(config);
+ }
+ }
+
}
diff --git a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/edit/presentation/service/PresentationEditManager.java b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/edit/presentation/service/PresentationEditManager.java
deleted file mode 100644
index 49815d2..0000000
--- a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/edit/presentation/service/PresentationEditManager.java
+++ /dev/null
@@ -1,73 +0,0 @@
-package org.eclipse.rmf.pror.reqif10.edit.presentation.service;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
-import org.eclipse.rmf.pror.reqif10.util.ConfigurationUtil;
-import org.eclipse.rmf.reqif10.AttributeValue;
-import org.eclipse.rmf.reqif10.DatatypeDefinition;
-import org.eclipse.rmf.reqif10.common.util.ReqIF10Util;
-
-public class PresentationEditManager {
-
- private static Map<Class<? extends ProrPresentationConfiguration>, PresentationEditService> presentationEditServiceRegistry;
-
- /**
- * Returns the cached {@link PresentationService} representing all installed
- * Presentation Extensions.
- *
- * @return A set of {@link PresentationService}s.
- *
- * FIXME: the map may not yet be populated
- */
- public static Map<Class<? extends ProrPresentationConfiguration>, PresentationEditService> getPresentationEditServiceMap() {
- if (presentationEditServiceRegistry == null)
- presentationEditServiceRegistry = new HashMap<Class<? extends ProrPresentationConfiguration>, PresentationEditService>();
- return presentationEditServiceRegistry;
- }
-
- /**
- *
- * This method is meant for exclusive use by the PresentationEditorManager
- * (editor plugin). Do not use otherwise!
- *
- * @param configurationInterface
- * @param service
- */
- public static void addService(
- Class<? extends ProrPresentationConfiguration> configurationInterface,
- PresentationEditService service) {
- getPresentationEditServiceMap().put(configurationInterface, service);
- }
-
- public static PresentationEditService getPresentationEditService(
- ProrPresentationConfiguration configuration) {
- for (Class<? extends ProrPresentationConfiguration> clazz : getPresentationEditServiceMap()
- .keySet()) {
- if (clazz.isInstance(configuration)) {
- return getPresentationEditServiceMap().get(clazz);
- }
- }
- return null;
- }
-
- public static String getCustomLabel(AttributeValue value) {
- // See whether we have a custom label renderer
- DatatypeDefinition dd = ReqIF10Util.getDatatypeDefinition(value);
- ProrPresentationConfiguration presentationConfiguration = ConfigurationUtil
- .getConfiguration(dd);
- if (presentationConfiguration != null) {
- PresentationEditService service = PresentationEditManager
- .getPresentationEditService(presentationConfiguration);
- if (service != null) {
- String customLabel = service.getLabel(value);
- if (customLabel != null) {
- return customLabel;
- }
- }
- }
- return null;
- }
-
-}
diff --git a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/edit/presentation/service/PresentationEditService.java b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/edit/presentation/service/PresentationEditService.java
deleted file mode 100644
index a41a284..0000000
--- a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/edit/presentation/service/PresentationEditService.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package org.eclipse.rmf.pror.reqif10.edit.presentation.service;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.command.Command;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.rmf.reqif10.AttributeValue;
-import org.eclipse.rmf.reqif10.SpecHierarchy;
-
-public interface PresentationEditService {
-
- /**
- * Will be called when the system can't handle a drag and drop operation by
- * default. Typically, source contains or target is a {@link SpecHierarchy}.
- * <p>
- *
- * Most presentations will return null here, unless they integrate with
- * another data model (e.g. Rodin-ProR-Integration).
- * <p>
- *
- * @param source
- * The drag source
- * @param target
- * The drop target
- * @param editingDomain
- * The {@link EditingDomain}, to manipulate the model
- * @param operation
- * The relevant {@link DND} operation
- * @return the Command that will perform the drop operation if this
- * Presentation will handle the request, otherwise null.
- */
- public Command handleDragAndDrop(Collection<?> source, Object target,
- EditingDomain editingDomain, int operation);
-
- /**
- * Returns a label for the given AttributeValue.
- *
- * @param av
- * @return
- */
- String getLabel(AttributeValue av);
-
-}
diff --git a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/edit/presentation/service/PresentationInterface.java b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/edit/presentation/service/PresentationInterface.java
new file mode 100644
index 0000000..f61e607
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/edit/presentation/service/PresentationInterface.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Formal Mind GmbH and University of Dusseldorf.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Michael Jastram - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.rmf.pror.reqif10.edit.presentation.service;
+
+import java.util.Collection;
+
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
+import org.eclipse.rmf.reqif10.DatatypeDefinition;
+import org.eclipse.rmf.reqif10.ReqIF;
+
+/**
+ * Interface that Presentation-Plugins must implement to provide relevant
+ * information to the System. The application will instantiate exactly one
+ * PresentationService per Presentation Plugin.
+ * <p>
+ *
+ * For your convenience, you can extend {@link AbstractPresentationService},
+ * which provides default implementations for most methods.
+ * <p>
+ *
+ * Upon opening a ReqIF document, {@link #openReqif(ReqIF)} is called which
+ * allows the Presentation to do stuff (e.g. check the model, hook in listeners,
+ * etc.).
+ * <p>
+ *
+ * Each {@link ReqIF} may contain any number of configuration elements that are
+ * typically associated with {@link DatatypeDefinition}s. This class acts as a
+ * factory for those through {@link #getConfigurationInstance()}.
+ * <p>
+ *
+ * Presentations may support Drag & Drop (into the ReqIF Model). The system will
+ * ask all Presentations to handle drag & drop until it finds one that returns
+ * true on {@link #handleDragAndDrop(Collection, Object, EditingDomain)}.
+ * <p>
+ *
+ * The service provides some stateless information about the Presentation,
+ * specifically:
+ * <ul>
+ * <li> {@link #getConfigurationInterface()} returns the Interface for the class
+ * that holds the configuration of this Presentation.
+ * <li> {@link #isReadOnly()} indicates whether the control for rendering should
+ * allow editing as well.
+ * </ul>
+ * <p>
+ *
+ * Note that this interface simply aggregates {@link PresentationEditInterface}
+ * and {@link PresentationEditInterface}, which are separated as the reside in
+ * two different plugins (the former does not require andy GUI libraries, the
+ * later does).
+ *
+ * @author jastram
+ *
+ */
+public interface PresentationInterface {
+
+ /**
+ * Returns a new instance of the {@link ProRPresentationConfiguration}. This
+ * can be implemented simply by using the EMF-Factory as follows:
+ *
+ * <pre>
+ * return ####Factory.eINSTANCE.create####Configuration();
+ * </pre>
+ *
+ * Substitute the proper names in Factory and method.
+ */
+ public ProrPresentationConfiguration getConfigurationInstance();
+
+ /**
+ * Returns the {@link Class} for the subclass of
+ * {@link ProRPresentationConfiguration} that is used to configure this
+ * Presentation.
+ * <p>
+ *
+ * This can simply be implemented as:
+ *
+ * <pre>
+ * return IdConfiguration.class;
+ * </pre>
+ */
+ public Class<? extends ProrPresentationConfiguration> getConfigurationInterface();
+
+}
diff --git a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/edit/presentation/service/PresentationManager.java b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/edit/presentation/service/PresentationManager.java
new file mode 100644
index 0000000..d8e838a
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/edit/presentation/service/PresentationManager.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Formal Mind GmbH and University of Dusseldorf.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Michael Jastram - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.rmf.pror.reqif10.edit.presentation.service;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
+
+public class PresentationManager {
+
+ private static Map<Class<? extends ProrPresentationConfiguration>, PresentationInterface> presentationEditServiceRegistry;
+
+ /**
+ * Returns the cached {@link PresentationService} representing all installed
+ * Presentation Extensions.
+ *
+ * @return A set of {@link PresentationService}s.
+ */
+ private static Map<Class<? extends ProrPresentationConfiguration>, PresentationInterface> getPresentationEditServiceMap() {
+ if (presentationEditServiceRegistry == null)
+ presentationEditServiceRegistry = new HashMap<Class<? extends ProrPresentationConfiguration>, PresentationInterface>();
+ return presentationEditServiceRegistry;
+ }
+
+ /**
+ * This method is meant for exclusive use by the PresentationEditorManager
+ * (editor plugin). Do not use otherwise!
+ *
+ * @param configurationInterface
+ * @param service
+ */
+ public static void addService(
+ Class<? extends ProrPresentationConfiguration> configurationInterface,
+ PresentationInterface service) {
+ getPresentationEditServiceMap().put(configurationInterface, service);
+ }
+
+ public static PresentationInterface getPresentationEditService(
+ ProrPresentationConfiguration configuration) {
+ for (Class<? extends ProrPresentationConfiguration> clazz : getPresentationEditServiceMap()
+ .keySet()) {
+ if (clazz.isInstance(configuration)) {
+ return getPresentationEditServiceMap().get(clazz);
+ }
+ }
+ return null;
+ }
+
+ public static Collection<PresentationInterface> getPresentationServices() {
+ return Collections.unmodifiableCollection((presentationEditServiceRegistry
+ .values()));
+ }
+
+}
diff --git a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/AttributeDefinitionItemProvider.java b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/AttributeDefinitionItemProvider.java
index 44151d3..5cddc7f 100644
--- a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/AttributeDefinitionItemProvider.java
+++ b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/AttributeDefinitionItemProvider.java
@@ -29,6 +29,7 @@
import org.eclipse.rmf.pror.reqif10.util.ProrUtil;
import org.eclipse.rmf.reqif10.AttributeDefinition;
import org.eclipse.rmf.reqif10.ReqIF10Package;
+import org.eclipse.rmf.reqif10.SpecType;
/**
* This is the item provider adapter for a
@@ -89,12 +90,19 @@
*/
@Override
public String getText(Object object) {
+
+ String parentName = "";
+
+ EObject parent = ((EObject) object).eContainer();
+ if (parent instanceof SpecType)
+ parentName = " : " + ((SpecType) parent).getLongName();
+
String typeName = ProrUtil.substractPrefixPostfix(object, "AttributeDefinition", "Impl");
String label = ((AttributeDefinition)object).getLongName();
label = label == null || label.length() == 0 ?
getString("_UI_Unnamed_Element") :
label;
- return label + " (" + typeName + ")";
+ return label + " (" + typeName + ")" + parentName;
}
/**
diff --git a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/RelationGroupItemProvider.java b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/RelationGroupItemProvider.java
index 7ca721b..07eaf6f 100644
--- a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/RelationGroupItemProvider.java
+++ b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/RelationGroupItemProvider.java
@@ -26,7 +26,6 @@
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.rmf.pror.reqif10.util.ProrUtil;
-import org.eclipse.rmf.reqif10.RelationGroup;
import org.eclipse.rmf.reqif10.ReqIF10Package;
import org.eclipse.rmf.reqif10.ReqIFContent;
@@ -169,17 +168,14 @@
}
/**
- * This returns the label text for the adapted class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
+ * This returns the label text for the adapted class. <!-- begin-user-doc
+ * --> <!-- end-user-doc -->
+ *
+ * @generated NOT
*/
@Override
public String getText(Object object) {
- String label = ((RelationGroup)object).getLongName();
- return label == null || label.length() == 0 ?
- getString("_UI_RelationGroup_type") :
- getString("_UI_RelationGroup_type") + " " + label;
+ return super.getText(object);
}
/**
diff --git a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/ReqIFItemProvider.java b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/ReqIFItemProvider.java
index ef39c39..ba7691e 100644
--- a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/ReqIFItemProvider.java
+++ b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/ReqIFItemProvider.java
@@ -15,10 +15,15 @@
import java.util.Collection;
import java.util.List;
+import org.eclipse.emf.common.command.AbstractCommand;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
@@ -30,9 +35,11 @@
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.provider.ViewerNotification;
import org.eclipse.rmf.pror.reqif10.configuration.ConfigurationFactory;
+import org.eclipse.rmf.pror.reqif10.configuration.ProrToolExtension;
import org.eclipse.rmf.reqif10.ReqIF;
import org.eclipse.rmf.reqif10.ReqIF10Factory;
import org.eclipse.rmf.reqif10.ReqIF10Package;
+import org.eclipse.rmf.reqif10.common.util.ReqIFToolExtensionUtil;
/**
* This is the item provider adapter for a {@link org.eclipse.rmf.pror.reqif10.ReqIF} object.
@@ -214,4 +221,43 @@
return Reqif10EditPlugin.INSTANCE;
}
+ /**
+ * Handle {@link ProrToolExtension} in a special way.
+ */
+ @Override
+ protected Command createAddCommand(EditingDomain domain,
+ final EObject owner,
+ EStructuralFeature feature, Collection<?> collection, int index) {
+
+ if (feature == ReqIF10Package.Literals.REQ_IF__TOOL_EXTENSIONS) {
+ CompoundCommand compound = new CompoundCommand();
+ for (final Object obj : collection) {
+ Command cmd = new AbstractCommand() {
+ public void execute() {
+ ReqIFToolExtensionUtil.addToolExtension((ReqIF) owner,
+ (EObject) obj);
+ }
+
+ public void redo() {
+ }
+
+ @Override
+ public boolean canUndo() {
+ return false;
+ }
+
+ @Override
+ protected boolean prepare() {
+ return true;
+ }
+ };
+ compound.append(cmd);
+ }
+ return compound;
+ }
+
+ return super
+ .createAddCommand(domain, owner, feature, collection, index);
+ }
+
}
diff --git a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/SpecElementWithAttributesItemProvider.java b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/SpecElementWithAttributesItemProvider.java
index 291e9ba..86efa6a 100644
--- a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/SpecElementWithAttributesItemProvider.java
+++ b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/SpecElementWithAttributesItemProvider.java
@@ -36,6 +36,8 @@
import org.eclipse.rmf.pror.reqif10.util.ConfigurationUtil;
import org.eclipse.rmf.pror.reqif10.util.ProrUtil;
import org.eclipse.rmf.reqif10.AttributeDefinition;
+import org.eclipse.rmf.reqif10.Identifiable;
+import org.eclipse.rmf.reqif10.RelationGroup;
import org.eclipse.rmf.reqif10.ReqIF10Package;
import org.eclipse.rmf.reqif10.SpecElementWithAttributes;
import org.eclipse.rmf.reqif10.SpecObject;
@@ -43,11 +45,15 @@
/**
* This is the item provider adapter for a
- * {@link org.eclipse.rmf.reqif10.SpecElementWithAttributes} object.
- * <!-- begin-user-doc -->
- * Made class abstract, as we want to make common behavior available
- * through concrete implementations.
- * <!-- end-user-doc -->
+ * {@link org.eclipse.rmf.reqif10.SpecElementWithAttributes} object. <!--
+ * begin-user-doc --> Made class abstract, as we want to make common behavior
+ * available through concrete implementations.
+ * <p>
+ *
+ * There are a few places where via instancof it is checked whether objects are
+ * {@link SpecElementWithAttributes}. This is due to a bug in the ReqIF schema,
+ * where {@link RelationGroup} does not inherit from
+ * {@link SpecElementWithAttributes}. <!-- end-user-doc -->
*
* @generated NOT
*/
@@ -83,9 +89,11 @@
public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) {
itemPropertyDescriptors = null;
super.getPropertyDescriptors(object);
- ProrUtil.addAttributePropertyDescriptor(
- (SpecElementWithAttributes) object, this,
- itemPropertyDescriptors);
+ if (object instanceof SpecElementWithAttributes) {
+ ProrUtil.addAttributePropertyDescriptor(
+ (SpecElementWithAttributes) object, this,
+ itemPropertyDescriptors);
+ }
return itemPropertyDescriptors;
}
@@ -96,7 +104,8 @@
* {@link SpecObject} to present properties like "Identifiable" in the
* Category "Spec Object", instead of "Identifiable".
*/
- public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object, final String categoryForStandardProps) {
+ protected List<IItemPropertyDescriptor> getPropertyDescriptors(
+ Object object, final String categoryForStandardProps) {
itemPropertyDescriptors = null;
super.getPropertyDescriptors(object);
@@ -111,9 +120,11 @@
}
itemPropertyDescriptors = newDescriptors;
- ProrUtil.addAttributePropertyDescriptor(
- (SpecElementWithAttributes) object, this,
- itemPropertyDescriptors);
+ if (object instanceof SpecElementWithAttributes) {
+ ProrUtil.addAttributePropertyDescriptor(
+ (SpecElementWithAttributes) object, this,
+ itemPropertyDescriptors);
+ }
return itemPropertyDescriptors;
}
@@ -127,9 +138,16 @@
*/
@Override
public String getText(Object object) {
- SpecElementWithAttributes specElement = (SpecElementWithAttributes) object;
-
- return ConfigurationUtil.getSpecElementLabel(specElement);
+ if (object instanceof SpecElementWithAttributes) {
+ SpecElementWithAttributes specElement = (SpecElementWithAttributes) object;
+
+ return ConfigurationUtil.getSpecElementLabel(specElement,
+ adapterFactory);
+ } else if (object instanceof Identifiable) {
+ return ((Identifiable) object).getIdentifier();
+ } else {
+ return super.getText(object);
+ }
}
/**
@@ -183,15 +201,18 @@
specAttributes = Collections.emptyList();
}
- CompoundCommand createValueAdjustCommand = ProrUtil
- .createValueAdjustCommand(domain,
- (SpecElementWithAttributes) owner, specAttributes);
+ if (owner instanceof SpecElementWithAttributes) {
+ CompoundCommand createValueAdjustCommand = ProrUtil
+ .createValueAdjustCommand(domain,
+ (SpecElementWithAttributes) owner,
+ specAttributes);
- // We need to check if the adjust command is executable,
- // since the next command (set command) would not be executed
- // whenever it is disabled
- if (createValueAdjustCommand.canExecute())
- cmd.append(createValueAdjustCommand);
+ // We need to check if the adjust command is executable,
+ // since the next command (set command) would not be executed
+ // whenever it is disabled
+ if (createValueAdjustCommand.canExecute())
+ cmd.append(createValueAdjustCommand);
+ }
cmd.append(super.createSetCommand(domain, owner, feature, value,
index));
@@ -216,12 +237,18 @@
SpecType specType = (SpecType) value;
CompoundCommand cmd = new CompoundCommand();
- Collection<AttributeDefinition> specAttributes = specType.getSpecAttributes();
+ Collection<AttributeDefinition> specAttributes = specType
+ .getSpecAttributes();
- CompoundCommand adjustValuesCommand = ProrUtil.createValueAdjustCommand(domain,
- (SpecElementWithAttributes) owner, specAttributes);
- if (!adjustValuesCommand.isEmpty()) {
- cmd.append(adjustValuesCommand);
+ if (owner instanceof SpecElementWithAttributes) {
+ CompoundCommand adjustValuesCommand = ProrUtil
+ .createValueAdjustCommand(domain,
+ (SpecElementWithAttributes) owner,
+ specAttributes);
+
+ if (!adjustValuesCommand.isEmpty()) {
+ cmd.append(adjustValuesCommand);
+ }
}
cmd.append(super.createSetCommand(domain, owner, feature,
specType, index));
@@ -231,6 +258,7 @@
return super
.createAddCommand(domain, owner, feature, collection, index);
}
+
/**
* Simply returns the appropriate feature from {@link ReqIF10Package.Literals}.
*/
diff --git a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/SpecHierarchyItemProvider.java b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/SpecHierarchyItemProvider.java
index 3aa9bdf..53722d6 100644
--- a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/SpecHierarchyItemProvider.java
+++ b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/provider/SpecHierarchyItemProvider.java
@@ -28,6 +28,8 @@
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.CommandParameter;
+import org.eclipse.emf.edit.command.DragAndDropCommand;
import org.eclipse.emf.edit.command.DragAndDropFeedback;
import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
@@ -237,7 +239,8 @@
public String getText(Object object) {
SpecObject specObject = ((SpecHierarchy) object).getObject();
if (specObject != null) {
- return ConfigurationUtil.getSpecElementLabel(specObject);
+ return ConfigurationUtil.getSpecElementLabel(specObject,
+ adapterFactory);
}
return getString("_UI_SpecHierarchy_type");
}
@@ -297,6 +300,21 @@
}
+ @Override
+ public Command createCommand(Object object, EditingDomain domain,
+ Class<? extends Command> commandClass,
+ CommandParameter commandParameter) {
+
+
+ Command createCommand = super.createCommand(object, domain, commandClass,
+ commandParameter);
+
+ // System.out.println(" ===> " + createCommand.getClass());
+
+ return createCommand;
+
+ }
+
/**
* <p>
* In addition to the regular functionality (creating a SpecHierarchy child
@@ -320,6 +338,7 @@
protected Command createCreateChildCommand(EditingDomain domain,
EObject owner, EStructuralFeature feature, Object value, int index,
Collection<?> collection) {
+
if (value instanceof SpecType) {
ReqIFContent content = ReqIF10Util.getReqIF(owner).getCoreContent();
SpecObject specObject = ReqIF10Factory.eINSTANCE.createSpecObject();
@@ -369,29 +388,51 @@
for (Object obj : collection) {
if (obj instanceof SpecHierarchy) {
SpecHierarchy specHierarchy = (SpecHierarchy) obj;
-
- if (!ProrUtil.isValidDrop(specHierarchy, owner)){
+
+ boolean validDrop = ProrUtil.isValidDrop(specHierarchy, owner);
+ if (!validDrop) {
return UnexecutableCommand.INSTANCE;
}
-
+
}
}
-
-
- Command cmd = ProrUtil.getPresentationHandleDragAndDropCommand(domain, owner, location,
- operations, operation, collection);
+
+ Command cmd = ProrUtil.getPresentationHandleDragAndDropCommand(domain,
+ owner, location, operations, operation, collection,
+ getRootAdapterFactory());
if (cmd != null)
return cmd;
// Create a SpecRelation on Linking
if (operation == DragAndDropFeedback.DROP_LINK) {
- return ProrUtil.createCreateSpecRelationsCommand(domain,
- collection, owner);
+
+ // This is a bugfix for Bug 375519: We have to override the
+ // prepareDropLinOn method of the DragAndDropCommand, since we do
+ // not add SpecRelations as child of the owner. Instead we use the
+ // specific feature for SpecRelations.
+ DragAndDropCommand dragAndDropCommand = new DragAndDropCommand(
+ domain, owner, location, operations, operation, collection) {
+
+ @Override
+ protected boolean prepareDropLinkOn() {
+ dropCommand = ProrUtil.createCreateSpecRelationsCommand(
+ domain, collection, owner);
+ boolean result = dropCommand.canExecute();
+ return result;
+ }
+
+ };
+
+ return dragAndDropCommand;
+
}
// Otherwise default behavior
- return super.createDragAndDropCommand(domain, owner, location,
+ Command createDragAndDropCommand = super.createDragAndDropCommand(domain, owner, location,
operations, operation, collection);
+
+ return createDragAndDropCommand;
+
}
}
diff --git a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/util/ConfigurationUtil.java b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/util/ConfigurationUtil.java
index cf4ef47..79e24f5 100644
--- a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/util/ConfigurationUtil.java
+++ b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/util/ConfigurationUtil.java
@@ -10,18 +10,19 @@
******************************************************************************/
package org.eclipse.rmf.pror.reqif10.util;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.edit.command.AddCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.rmf.pror.reqif10.configuration.Column;
import org.eclipse.rmf.pror.reqif10.configuration.ConfigurationFactory;
import org.eclipse.rmf.pror.reqif10.configuration.ConfigurationPackage;
@@ -31,7 +32,6 @@
import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfigurations;
import org.eclipse.rmf.pror.reqif10.configuration.ProrSpecViewConfiguration;
import org.eclipse.rmf.pror.reqif10.configuration.ProrToolExtension;
-import org.eclipse.rmf.pror.reqif10.edit.presentation.service.PresentationEditManager;
import org.eclipse.rmf.reqif10.AttributeDefinition;
import org.eclipse.rmf.reqif10.AttributeValue;
import org.eclipse.rmf.reqif10.AttributeValueEnumeration;
@@ -47,7 +47,7 @@
import org.eclipse.rmf.reqif10.util.ReqIF10Switch;
public class ConfigurationUtil {
-
+
public static final String DEFAULT_LEFT_HEADER_COLUMN_NAME = "Lead Header Column";
public static final int DEFAULT_LEFT_HEADER_COLUMN_WIDTH = 30;
@@ -55,38 +55,12 @@
* @return The Configuration element for the given
* {@link DatatypeDefinition} or null if none is configured.
*/
- public static ProrPresentationConfiguration getConfiguration(
- DatatypeDefinition datatypeDefinition, EditingDomain domain) {
- ReqIF reqif = ReqIF10Util.getReqIF(datatypeDefinition);
- if (reqif == null)
- return null;
- ProrPresentationConfigurations extensions = ConfigurationUtil
- .getProrToolExtension(reqif, domain)
- .getPresentationConfigurations();
- if (extensions == null)
- return null;
- for (ProrPresentationConfiguration config : extensions
- .getPresentationConfigurations()) {
- if (datatypeDefinition.equals(config.getDatatype()))
- return config;
- }
- return null;
- }
-
- /**
- * @return The Configuration element for the given
- * {@link DatatypeDefinition} or null if none is configured.
- *
- * FIXME: We have two version of this method (with and without an
- * editing domain as parameter)
- */
- public static ProrPresentationConfiguration getConfiguration(
+ public static ProrPresentationConfiguration getPresentationConfiguration(
DatatypeDefinition dd) {
ReqIF reqif = ReqIF10Util.getReqIF(dd);
if (reqif == null)
return null;
- ProrToolExtension prorToolExtension = ConfigurationUtil
- .getProrToolExtension(reqif);
+ ProrToolExtension prorToolExtension = getProrToolExtension(reqif);
if (prorToolExtension == null)
return null;
ProrPresentationConfigurations extensions = prorToolExtension
@@ -102,24 +76,17 @@
}
/**
- * This method returns a list of {@link HighlightConfiguration}s for the
- * given {@link ReqIf} and {@link ProrPresentationConfiguration} instance.
+ * Returns the {@link ProrPresentationConfiguration} that is associated with
+ * the {@link DatatypeDefinition} of the given {@link AttributeValue}. If
+ * either intermediate element is null, null is returned.
*/
- public static List<DatatypeDefinition> getDatatypeDefinitions(ReqIF reqif,
- EditingDomain domain, ProrPresentationConfiguration configuration) {
- List<DatatypeDefinition> datatypes = new ArrayList<DatatypeDefinition>();
- ProrPresentationConfigurations configsElement = ConfigurationUtil
- .getPresentationConfigurations(reqif, domain);
- if (configsElement == null)
- return datatypes;
- EList<ProrPresentationConfiguration> configs = configsElement
- .getPresentationConfigurations();
- for (ProrPresentationConfiguration config : configs) {
- if (configuration.getClass().equals(config.getClass()))
- datatypes.add(((ProrPresentationConfiguration) config)
- .getDatatype());
+ public static ProrPresentationConfiguration getPresentationConfiguration(
+ AttributeValue av) {
+ DatatypeDefinition dd = ReqIF10Util.getDatatypeDefinition(av);
+ if (av != null) {
+ return getPresentationConfiguration(dd);
}
- return datatypes;
+ return null;
}
/**
@@ -127,9 +94,12 @@
* If it doesn't exist yet, null is returned.
* <p>
*/
- private static ProrToolExtension getProrToolExtension(ReqIF reqif) {
+ public static ProrToolExtension getProrToolExtension(ReqIF reqif) {
if (reqif != null) {
- List<ProrToolExtension> extensions = ReqIFToolExtensionUtil.getToolExtensionsByType(reqif, ConfigurationPackage.eINSTANCE.getProrToolExtension());
+ List<ProrToolExtension> extensions = ReqIFToolExtensionUtil
+ .getToolExtensionsByType(reqif,
+ ConfigurationPackage.eINSTANCE
+ .getProrToolExtension());
if (0 < extensions.size()) {
return extensions.get(0);
}
@@ -138,15 +108,18 @@
}
/**
- * Returns the {@link ProrToolExtension} associated with this
- * {@link ReqIF}. If it doesn't exist yet, it is created.
+ * Returns the {@link ProrToolExtension} associated with this {@link ReqIF}.
+ * If it doesn't exist yet, it is created.
* <p>
*/
- public static ProrToolExtension getProrToolExtension(ReqIF reqif, EditingDomain domain) {
+ public static ProrToolExtension createProrToolExtension(ReqIF reqif, EditingDomain domain) {
ProrToolExtension extension = getProrToolExtension(reqif);
- if (extension != null) return extension;
+ if (extension != null)
+ return extension;
extension = ConfigurationFactory.eINSTANCE.createProrToolExtension();
- domain.getCommandStack().execute(ReqIFToolExtensionUtil.getAddToolExtensionCommand(reqif, extension));
+ domain.getCommandStack().execute(
+ ReqIFToolExtensionUtil.getAddToolExtensionCommand(reqif,
+ extension));
return extension;
}
@@ -158,7 +131,7 @@
public static Column getLeftHeaderColumn(Specification specification,
EditingDomain domain) {
- ProrSpecViewConfiguration specViewConfiguration = getSpecViewConfiguration(
+ ProrSpecViewConfiguration specViewConfiguration = createSpecViewConfiguration(
specification, domain);
Column leftHeaderColumn = specViewConfiguration.getLeftHeaderColumn();
@@ -175,31 +148,60 @@
}
/**
+ * Retrieves all active {@link PresentationEditInterface} instances for the
+ * given object (which assumes to be part of a ReqIF model). If none is
+ * found, an empty set is returned.
+ */
+ public static Set<PresentationEditInterface> getPresentationEditInterfaces(
+ Object obj, AdapterFactory adapterFactory) {
+ ReqIF reqif = ReqIF10Util.getReqIF(obj);
+ ProrPresentationConfigurations configs = getPresentationConfigurations(reqif);
+ if (configs != null) {
+ Set<PresentationEditInterface> result = new HashSet<PresentationEditInterface>();
+ for (ProrPresentationConfiguration config : configs
+ .getPresentationConfigurations()) {
+ ItemProviderAdapter ip = ProrUtil.getItemProvider(
+ adapterFactory, config);
+ if (ip instanceof PresentationEditInterface) {
+ result.add((PresentationEditInterface) ip);
+ }
+ }
+ return result;
+ }
+ return Collections.emptySet();
+ }
+
+ /**
* Finds the best labels, according to what is set in the preferences.
*
* @param specElement
+ * @param adapterFactory
* @return
*/
public static String getSpecElementLabel(
- SpecElementWithAttributes specElement) {
-
- List<String> labels = getDefaultLabels(ReqIF10Util.getReqIF(specElement));
+ SpecElementWithAttributes specElement, AdapterFactory adapterFactory) {
+
+ List<String> labels = getDefaultLabels(ReqIF10Util
+ .getReqIF(specElement));
// Iterate over the list of labels requested
for (String label : labels) {
-
+
for (AttributeValue value : specElement.getValues()) {
- // TODO eventually should also work for non-simple attributes
- AttributeDefinition ad = ReqIF10Util.getAttributeDefinition(value);
+ AttributeDefinition ad = ReqIF10Util
+ .getAttributeDefinition(value);
if (ad == null)
continue;
if (label.equals(ad.getLongName())) {
-
- String customLabel = PresentationEditManager
- .getCustomLabel(value);
- if (customLabel != null) {
- return customLabel;
+ ProrPresentationConfiguration config = getPresentationConfig(value);
+ ItemProviderAdapter ip = ProrUtil.getItemProvider(
+ adapterFactory, config);
+ if (ip instanceof PresentationEditInterface) {
+ String customLabel = ((PresentationEditInterface) ip)
+ .getLabel(value);
+ if (customLabel != null)
+ return customLabel;
}
Object result = ReqIF10Util.getTheValue(value);
@@ -228,13 +230,13 @@
*
* @return always a list, sometimes empty.
*/
- public static List<String> getDefaultLabels(
- ReqIF reqif) {
+ public static List<String> getDefaultLabels(ReqIF reqif) {
ProrToolExtension extension = getProrToolExtension(reqif);
if (extension == null) {
return Collections.emptyList();
}
- ProrGeneralConfiguration generalConfig = extension.getGeneralConfiguration();
+ ProrGeneralConfiguration generalConfig = extension
+ .getGeneralConfiguration();
if (generalConfig == null) {
return Collections.emptyList();
}
@@ -243,7 +245,7 @@
if (labelConfig == null) {
return Collections.emptyList();
}
-
+
return labelConfig.getDefaultLabel();
}
@@ -252,39 +254,42 @@
* {@link Specification}. If none exists, it is built. The builder collects
* all attribute names of all SpecObjects and creates corresponding columns.
*/
- public static ProrSpecViewConfiguration getSpecViewConfiguration(
+ public static ProrSpecViewConfiguration createSpecViewConfiguration(
Specification specification, EditingDomain domain) {
- ProrToolExtension extension = getProrToolExtension(ReqIF10Util.getReqIF(specification), domain);
+ ProrToolExtension extension = createProrToolExtension(ReqIF10Util.getReqIF(specification), domain);
EList<ProrSpecViewConfiguration> configs = extension
.getSpecViewConfigurations();
for (ProrSpecViewConfiguration config : configs) {
- if (config.getSpecification() != null && config.getSpecification().equals(specification)) {
+ if (config.getSpecification() != null
+ && config.getSpecification().equals(specification)) {
return config;
}
}
-
+
// None found, let's build a new one that includes all attribute names.
ProrSpecViewConfiguration specViewConfig = ConfigurationFactory.eINSTANCE
.createProrSpecViewConfiguration();
specViewConfig.setSpecification(specification);
-
+
// Collect all Types
final Set<SpecType> types = new HashSet<SpecType>();
ReqIF10Switch<SpecHierarchy> visitor = new ReqIF10Switch<SpecHierarchy>() {
@Override
public SpecHierarchy caseSpecHierarchy(SpecHierarchy specHierarchy) {
- if (specHierarchy.getObject() != null && specHierarchy.getObject().getType() != null) {
+ if (specHierarchy.getObject() != null
+ && specHierarchy.getObject().getType() != null) {
// Duplicates will disappear due to HashSet
types.add(specHierarchy.getObject().getType());
}
return specHierarchy;
}
};
- for (Iterator<EObject> i = EcoreUtil.getAllContents(specification, true); i.hasNext();) {
+ for (Iterator<EObject> i = EcoreUtil
+ .getAllContents(specification, true); i.hasNext();) {
visitor.doSwitch(i.next());
}
-
+
// Collect all names from the types
final Set<String> colnames = new HashSet<String>();
for (SpecType type : types) {
@@ -293,7 +298,7 @@
colnames.add(ad.getLongName());
}
}
-
+
// Build all Columns from the names
for (String colname : colnames) {
Column column = ConfigurationFactory.eINSTANCE.createColumn();
@@ -313,9 +318,10 @@
}
- public static ProrPresentationConfiguration getPresentationConfig(AttributeValue value, EditingDomain domain) {
+ public static ProrPresentationConfiguration getPresentationConfig(
+ AttributeValue value) {
DatatypeDefinition dd = ReqIF10Util.getDatatypeDefinition(value);
- ProrPresentationConfiguration config = getConfiguration(dd, domain);
+ ProrPresentationConfiguration config = getPresentationConfiguration(dd);
return config;
}
@@ -324,12 +330,11 @@
* {@link ReqIf} and {@link EditingDomain}.
*/
public static ProrPresentationConfigurations getPresentationConfigurations(
- ReqIF reqif, EditingDomain domain) {
- ProrToolExtension uiExtension = ConfigurationUtil.getProrToolExtension(
- reqif, domain);
- ProrPresentationConfigurations configs = uiExtension
+ ReqIF reqif) {
+ ProrToolExtension uiExtension = ConfigurationUtil
+ .getProrToolExtension(reqif);
+ return uiExtension == null ? null : uiExtension
.getPresentationConfigurations();
- return configs;
}
}
diff --git a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/util/PresentationEditInterface.java b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/util/PresentationEditInterface.java
new file mode 100644
index 0000000..0351f6e
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/util/PresentationEditInterface.java
@@ -0,0 +1,123 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Formal Mind GmbH and University of Dusseldorf.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Michael Jastram - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.rmf.pror.reqif10.util;
+
+import java.util.Collection;
+
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
+import org.eclipse.rmf.reqif10.AttributeDefinition;
+import org.eclipse.rmf.reqif10.AttributeValue;
+import org.eclipse.rmf.reqif10.DatatypeDefinition;
+import org.eclipse.rmf.reqif10.ReqIF;
+import org.eclipse.rmf.reqif10.SpecHierarchy;
+
+/**
+ * Interface that Presentation-Plugins must implement to provide relevant
+ * information to the System. The application will instantiate exactly one
+ * PresentationService per Presentation Plugin.
+ * <p>
+ *
+ * For your convenience, you can extend {@link AbstractPresentationService},
+ * which provides default implementations for most methods.
+ * <p>
+ *
+ * Upon opening a ReqIF document, {@link #openReqif(ReqIF)} is called which
+ * allows the Presentation to do stuff (e.g. check the model, hook in listeners,
+ * etc.).
+ * <p>
+ *
+ * Each {@link ReqIF} may contain any number of configuration elements that are
+ * typically associated with {@link DatatypeDefinition}s. This class acts as a
+ * factory for those through {@link #getConfigurationInstance()}.
+ * <p>
+ *
+ * Presentations may support Drag & Drop (into the ReqIF Model). The system will
+ * ask all Presentations to handle drag & drop until it finds one that returns
+ * true on {@link #handleDragAndDrop(Collection, Object, EditingDomain)}.
+ * <p>
+ *
+ * The service provides some stateless information about the Presentation,
+ * specifically:
+ * <ul>
+ * <li> {@link #getConfigurationInterface()} returns the Interface for the class
+ * that holds the configuration of this Presentation.
+ * <li> {@link #isReadOnly()} indicates whether the control for rendering should
+ * allow editing as well.
+ * </ul>
+ * <p>
+ *
+ * Note that this interface simply aggregates {@link PresentationEditInterface}
+ * and {@link PresentationEditInterface}, which are separated as the reside in
+ * two different plugins (the former does not require andy GUI libraries, the
+ * later does).
+ *
+ * @author jastram
+ *
+ */
+public interface PresentationEditInterface {
+
+ /**
+ * Will be called when the system can't handle a drag and drop operation by
+ * default. Typically, source contains or target is a {@link SpecHierarchy}.
+ * <p>
+ *
+ * Most presentations will return null here, unless they integrate with
+ * another data model (e.g. Rodin-ProR-Integration).
+ * <p>
+ *
+ * @param source
+ * The drag source
+ * @param target
+ * The drop target
+ * @param editingDomain
+ * The {@link EditingDomain}, to manipulate the model
+ * @param operation
+ * The relevant {@link DND} operation
+ * @return the Command that will perform the drop operation if this
+ * Presentation will handle the request, otherwise null.
+ */
+ public Command handleDragAndDrop(Collection<?> source, Object target,
+ EditingDomain editingDomain, int operation);
+
+ /**
+ * Returns a label for the given AttributeValue.
+ *
+ * @param av
+ * @return
+ */
+ String getLabel(AttributeValue av);
+
+ /**
+ * Whether the managed {@link AttributeDefinition}s may be modified.
+ */
+ boolean canEdit();
+
+ /**
+ * This method is triggered when a this configuration element is added to a
+ * {@link ReqIF} model, either because it is created and added, or because
+ * the {@link ReqIF} was opened. This gives the Presentation a chance to
+ * interact, e.g. by registering adapters, etc.
+ */
+ void registerPresentationConfiguration(
+ ProrPresentationConfiguration config, EditingDomain editingDomain);
+
+ /**
+ * This method is triggered when a this configuration element is removed
+ * from a {@link ReqIF} model, either because it is got removed, or because
+ * the {@link ReqIF} was closed. This gives the Presentation a chance to
+ * interact, e.g. by unregistering adapters, etc.
+ */
+ void unregisterPresentationConfiguration(
+ ProrPresentationConfiguration config);
+
+}
diff --git a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/util/ProrUtil.java b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/util/ProrUtil.java
index 7355523..65e2aa8 100644
--- a/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/util/ProrUtil.java
+++ b/org.eclipse.rmf.pror.reqif10.edit/src/org/eclipse/rmf/pror/reqif10/util/ProrUtil.java
@@ -42,8 +42,8 @@
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptorDecorator;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
-import org.eclipse.rmf.pror.reqif10.edit.presentation.service.PresentationEditManager;
-import org.eclipse.rmf.pror.reqif10.edit.presentation.service.PresentationEditService;
+import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
+import org.eclipse.rmf.pror.reqif10.configuration.provider.ProrPresentationConfigurationItemProvider;
import org.eclipse.rmf.pror.reqif10.provider.SpecElementWithAttributesItemProvider;
import org.eclipse.rmf.reqif10.AttributeDefinition;
import org.eclipse.rmf.reqif10.AttributeDefinitionBoolean;
@@ -379,17 +379,20 @@
}
/**
+ * @param adapterFactory
* @return the handle drag and drop command from presentation plugin or null
* if no plugin can handle the operation.
*/
public static Command getPresentationHandleDragAndDropCommand(
EditingDomain domain, Object owner, float location, int operations,
- int operation, java.util.Collection<?> collection) {
+ int operation, java.util.Collection<?> collection,
+ AdapterFactory adapterFactory) {
// See whether a Presentation feels responsible.
- Collection<PresentationEditService> services = PresentationEditManager
- .getPresentationEditServiceMap().values();
- for (PresentationEditService service : services) {
- Command cmd = service.handleDragAndDrop(collection, owner, domain,
+ Set<PresentationEditInterface> ips = ConfigurationUtil
+ .getPresentationEditInterfaces(owner, adapterFactory);
+
+ for (PresentationEditInterface ip : ips) {
+ Command cmd = ip.handleDragAndDrop(collection, owner, domain,
operation);
if (cmd != null) {
return cmd;
@@ -716,4 +719,14 @@
return true;
}
+ /**
+ * Retrieves the {@link ProrPresentationConfigurationItemProvider} for the
+ * given {@link ProrPresentationConfiguration} element.
+ */
+ public static ProrPresentationConfigurationItemProvider getConfigItemProvider(
+ ProrPresentationConfiguration config, AdapterFactory adapterFactory) {
+ ProrPresentationConfigurationItemProvider itemprovider = (ProrPresentationConfigurationItemProvider) getItemProvider(adapterFactory, config);
+ return itemprovider;
+ }
+
}
diff --git a/org.eclipse.rmf.pror.reqif10.editor.tests/.classpath b/org.eclipse.rmf.pror.reqif10.editor.tests/.classpath
new file mode 100644
index 0000000..a7d4b62
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.editor.tests/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.rmf.pror.reqif10.editor.tests/.gitignore b/org.eclipse.rmf.pror.reqif10.editor.tests/.gitignore
new file mode 100644
index 0000000..5e56e04
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.editor.tests/.gitignore
@@ -0,0 +1 @@
+/bin
diff --git a/org.eclipse.rmf.pror.reqif10.editor.tests/.project b/org.eclipse.rmf.pror.reqif10.editor.tests/.project
new file mode 100644
index 0000000..f1532e9
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.editor.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.rmf.pror.reqif10.editor.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.rmf.pror.reqif10.editor.tests/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.rmf.pror.reqif10.editor.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..af0f20f
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.editor.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/org.eclipse.rmf.pror.reqif10.editor.tests/META-INF/MANIFEST.MF b/org.eclipse.rmf.pror.reqif10.editor.tests/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..cb1b410
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.editor.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: EditorTests
+Bundle-SymbolicName: org.eclipse.rmf.pror.reqif10.editor.tests
+Bundle-Version: 0.3.2.qualifier
+Fragment-Host: org.eclipse.rmf.pror.reqif10.editor;bundle-version="0.3.2"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.eclipse.rmf.pror.reqif10.tests;bundle-version="0.3.2"
diff --git a/org.eclipse.rmf.pror.reqif10.editor.tests/build.properties b/org.eclipse.rmf.pror.reqif10.editor.tests/build.properties
new file mode 100644
index 0000000..34d2e4d
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.editor.tests/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/pror/reqif10/editor/agilegrid/TestProrAgileGridContentProvider.java b/org.eclipse.rmf.pror.reqif10.editor.tests/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/AbstractContentProviderTests.java
similarity index 76%
rename from org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/pror/reqif10/editor/agilegrid/TestProrAgileGridContentProvider.java
rename to org.eclipse.rmf.pror.reqif10.editor.tests/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/AbstractContentProviderTests.java
index 203a26e..c55e03a 100644
--- a/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/pror/reqif10/editor/agilegrid/TestProrAgileGridContentProvider.java
+++ b/org.eclipse.rmf.pror.reqif10.editor.tests/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/AbstractContentProviderTests.java
@@ -10,8 +10,7 @@
******************************************************************************/
package org.eclipse.rmf.pror.reqif10.editor.agilegrid;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
+import static org.junit.Assert.*;
import java.net.URISyntaxException;
@@ -20,6 +19,8 @@
import org.eclipse.rmf.pror.reqif10.configuration.ProrToolExtension;
import org.eclipse.rmf.pror.reqif10.testframework.AbstractItemProviderTest;
import org.eclipse.rmf.reqif10.ReqIF;
+import org.eclipse.rmf.reqif10.SpecHierarchy;
+import org.eclipse.rmf.reqif10.SpecObject;
import org.eclipse.rmf.reqif10.Specification;
import org.eclipse.rmf.reqif10.common.util.ReqIFToolExtensionUtil;
import org.junit.After;
@@ -28,20 +29,27 @@
/**
* Tests {@link ProrAgileGridContentProvider}
+ *
* @author jastram
*/
-public class TestProrAgileGridContentProvider extends AbstractItemProviderTest {
+public abstract class AbstractContentProviderTests extends AbstractItemProviderTest {
protected ProrAgileGridContentProvider contentProvider;
protected Specification specification;
protected ProrSpecViewConfiguration specViewConfig;
protected ReqIF reqif;
+ protected SpecObject specObject;
+ protected SpecHierarchy specHierarchy;
@Before
- public void setup() throws URISyntaxException {
+ public void setupTestProrAgileGridContentProvider()
+ throws URISyntaxException {
reqif = this.getTestReqif("simple.reqif");
specification = reqif.getCoreContent().getSpecifications().get(0);
-
+ specObject = reqif.getCoreContent().getSpecObjects().get(0);
+ specHierarchy = specification.getChildren().get(0);
+
+
// Build up the data structures that hold specViewConfig
ProrToolExtension prorToolExtension = ConfigurationFactory.eINSTANCE.createProrToolExtension();
specViewConfig = ConfigurationFactory.eINSTANCE.createProrSpecViewConfiguration();
@@ -52,24 +60,24 @@
}
@After
- public void teardownAbstractItemProviderTest() {
+ public void teardownTestProrAgileGridContentProvidert() {
reqif = null;
specification = null;
specViewConfig = null;
contentProvider = null;
}
-
+
+
@Test
public void testInitialRowCount() {
assertEquals(1, contentProvider.getRowCount());
}
- @Test(expected=IndexOutOfBoundsException.class)
+ @Test(expected = IndexOutOfBoundsException.class)
public void testNonexistingRow() {
contentProvider.getContentAt(1, 0);
}
-
@Test
public void testSpecViewConfigContent() {
assertEquals(0, specViewConfig.getColumns().size());
@@ -77,7 +85,8 @@
@Test
public void testInitialCellValue() {
- assertNull(contentProvider.getContentAt(0, 0));
+ assertEquals(specification.getChildren().get(0).getObject(),
+ contentProvider.getContentAt(0, 0));
}
}
diff --git a/org.eclipse.rmf.pror.reqif10.editor.tests/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/CachingTests.java b/org.eclipse.rmf.pror.reqif10.editor.tests/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/CachingTests.java
new file mode 100644
index 0000000..0a10626
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.editor.tests/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/CachingTests.java
@@ -0,0 +1,201 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Formal Mind GmbH and University of Dusseldorf.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Said Salem - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.rmf.pror.reqif10.editor.agilegrid;
+
+import static org.junit.Assert.assertEquals;
+
+import java.math.BigInteger;
+
+import org.eclipse.rmf.pror.reqif10.configuration.Column;
+import org.eclipse.rmf.pror.reqif10.configuration.ConfigurationFactory;
+import org.eclipse.rmf.pror.reqif10.configuration.ProrSpecViewConfiguration;
+import org.eclipse.rmf.pror.reqif10.util.ConfigurationUtil;
+import org.eclipse.rmf.reqif10.AttributeDefinitionString;
+import org.eclipse.rmf.reqif10.AttributeValueString;
+import org.eclipse.rmf.reqif10.DatatypeDefinitionString;
+import org.eclipse.rmf.reqif10.ReqIF;
+import org.eclipse.rmf.reqif10.ReqIF10Factory;
+import org.eclipse.rmf.reqif10.ReqIFContent;
+import org.eclipse.rmf.reqif10.SpecHierarchy;
+import org.eclipse.rmf.reqif10.SpecObject;
+import org.eclipse.rmf.reqif10.SpecObjectType;
+import org.eclipse.rmf.reqif10.SpecRelation;
+import org.eclipse.rmf.reqif10.Specification;
+import org.junit.Test;
+
+/**
+ * Tests {@link ProrRow}
+ *
+ * @author salem
+ */
+public class CachingTests extends AbstractContentProviderTests {
+
+
+ @Test
+ public void testPerformance() {
+ int row = 100000;
+ long startTime = System.currentTimeMillis();
+ createReqIF(row);
+ long endTime = System.currentTimeMillis();
+
+ long duration = endTime - startTime;
+ System.out.println("Duration for createReqIF(" + row + "): " + duration + " ms");
+
+// no caching
+// Duration for createReqIF(100000): 1617 ms
+// Duration for getContentAt(9999): 180 ms
+// simple caching
+// Duration for createReqIF(100000): 1581 ms
+// First call: Duration for getContentAt(99999): 186 ms
+// Second call: Duration for getContentAt(99999): 0 ms
+
+ }
+
+ @Test
+ public void testPerformanceCP() {
+ int row = 100000;
+ ReqIF reqif = createReqIF(row);
+ Specification spec = reqif.getCoreContent().getSpecifications().get(0);
+ ProrAgileGridContentProvider cp = new ProrAgileGridContentProvider(
+ spec, ConfigurationUtil.createSpecViewConfiguration(spec,
+ editingDomain));
+ long startTime = System.currentTimeMillis();
+ cp.getContentAt((row - 1), 0);
+ long endTime = System.currentTimeMillis();
+
+ long duration = endTime - startTime;
+ System.out.println("First call: Duration for getContentAt(" + (row - 1) + "): "
+ + duration + " ms");
+
+ startTime = System.currentTimeMillis();
+ cp.getContentAt((row - 1), 0);
+ endTime = System.currentTimeMillis();
+
+ duration = endTime - startTime;
+ System.out.println("Second call: Duration for getContentAt(" + (row - 1) + "): "
+ + duration + " ms");
+ }
+
+ @Test
+ public void testAssignSpecHierarchy() {
+ SpecHierarchy specH = ReqIF10Factory.eINSTANCE.createSpecHierarchy();
+ SpecObject specObj = ReqIF10Factory.eINSTANCE.createSpecObject();
+ specH.setObject(specObj);
+
+ contentProvider.getContentAt(0, 0);
+ specification.getChildren().set(0, specH);
+
+ assertEquals(specObj, contentProvider.getContentAt(0, 0));
+ }
+
+ @Test
+ public void testAssignSpecObject() {
+ SpecObject specObj = ReqIF10Factory.eINSTANCE.createSpecObject();
+
+ contentProvider.getContentAt(0, 0);
+ specHierarchy.setObject(specObj);
+ assertEquals(specObj, contentProvider.getContentAt(0, 0));
+ }
+
+ @Test
+ public void testSetShowSpecRelations() {
+ SpecObject specObj = ReqIF10Factory.eINSTANCE.createSpecObject();
+ SpecHierarchy specH1 = ReqIF10Factory.eINSTANCE.createSpecHierarchy();
+ SpecHierarchy specH2 = ReqIF10Factory.eINSTANCE.createSpecHierarchy();
+ SpecHierarchy specH3 = ReqIF10Factory.eINSTANCE.createSpecHierarchy();
+
+ specH1.setObject(specObject);
+ specH2.setObject(specObj);
+ specH3.setObject(specObject);
+
+ SpecRelation specRelation = ReqIF10Factory.eINSTANCE.createSpecRelation();
+
+ reqif.getCoreContent().getSpecObjects().add(specObj);
+
+
+ specification.getChildren().add(specH1);
+ specification.getChildren().add(specH2);
+ specification.getChildren().add(specH3);
+
+
+ specRelation.setSource(specObj);
+ specRelation.setTarget(specObject);
+ reqif.getCoreContent().getSpecRelations().add(specRelation);
+
+ assertEquals(specH3.getObject(), contentProvider.getContentAt(3, 0));
+ contentProvider.setShowSpecRelations(true);
+ assertEquals(specRelation, contentProvider.getContentAt(3, 0));
+ }
+
+
+
+ private ReqIF createReqIF(int numRows) {
+
+ ReqIF root = ReqIF10Factory.eINSTANCE.createReqIF();
+
+ ReqIFContent content = ReqIF10Factory.eINSTANCE.createReqIFContent();
+ root.setCoreContent(content);
+
+ // Add a DatatypeDefinition
+ DatatypeDefinitionString ddString = ReqIF10Factory.eINSTANCE
+ .createDatatypeDefinitionString();
+ ddString.setLongName("T_String32k");
+ ddString.setMaxLength(new BigInteger("32000"));
+ content.getDatatypes().add(ddString);
+
+ // Add a SpecObjectType
+ SpecObjectType specObjectType = ReqIF10Factory.eINSTANCE
+ .createSpecObjectType();
+ specObjectType.setLongName("Requirement Type");
+ content.getSpecTypes().add(specObjectType);
+
+ // Add an AttributeDefinition
+ AttributeDefinitionString ad1 = ReqIF10Factory.eINSTANCE
+ .createAttributeDefinitionString();
+ ad1.setType(ddString);
+ ad1.setLongName("Description");
+ specObjectType.getSpecAttributes().add(ad1);
+
+ // Add a Specification
+ Specification spec = ReqIF10Factory.eINSTANCE.createSpecification();
+ spec.setLongName("Specification Document");
+ content.getSpecifications().add(spec);
+ ProrSpecViewConfiguration config = ConfigurationUtil
+ .createSpecViewConfiguration(spec, editingDomain);
+ Column column = ConfigurationFactory.eINSTANCE.createColumn();
+ column.setLabel("Description");
+ config.getColumns().add(column);
+
+ for (int i = 0; i < numRows; i++) {
+ SpecHierarchy specH = ReqIF10Factory.eINSTANCE
+ .createSpecHierarchy();
+ SpecObject specObj = ReqIF10Factory.eINSTANCE.createSpecObject();
+ specObj.setType(specObjectType);
+ content.getSpecObjects().add(specObj);
+
+ AttributeValueString value2 = ReqIF10Factory.eINSTANCE
+ .createAttributeValueString();
+ value2.setTheValue("Value-" + i);
+ value2.setDefinition(ad1);
+ specObj.getValues().add(value2);
+
+ specH.setObject(specObj);
+ spec.getChildren().add(specH);
+
+ // ProrUtil.createAddTypedElementCommand(parent, childFeature,
+ // newSpecElement, typeFeature, specType, index, resultIndex,
+ // domain, adapterFactory);
+ }
+ return root;
+ }
+
+}
diff --git a/org.eclipse.rmf.pror.reqif10.editor.tests/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ContentProviderBasicTests.java b/org.eclipse.rmf.pror.reqif10.editor.tests/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ContentProviderBasicTests.java
new file mode 100644
index 0000000..a9a9bff
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.editor.tests/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ContentProviderBasicTests.java
@@ -0,0 +1,289 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Formal Mind GmbH and University of Dusseldorf.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Said Salem - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.rmf.pror.reqif10.editor.agilegrid;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import org.eclipse.rmf.pror.reqif10.configuration.Column;
+import org.eclipse.rmf.pror.reqif10.configuration.ConfigurationFactory;
+import org.eclipse.rmf.pror.reqif10.configuration.ConfigurationPackage;
+import org.eclipse.rmf.pror.reqif10.editor.agilegrid.ProrRow.ProrRowSpecHierarchy;
+import org.eclipse.rmf.reqif10.AttributeValueString;
+import org.eclipse.rmf.reqif10.ReqIF10Factory;
+import org.eclipse.rmf.reqif10.SpecHierarchy;
+import org.eclipse.rmf.reqif10.SpecObject;
+import org.eclipse.rmf.reqif10.SpecRelation;
+import org.junit.Test;
+
+/**
+ * Tests {@link ProrAgileGridContentProvider}
+ *
+ *
+ * @author salem
+ *
+ */
+public class ContentProviderBasicTests extends AbstractContentProviderTests {
+
+
+ @Test(expected = IndexOutOfBoundsException.class)
+ public void testGetProrNonExistingRow() {
+ contentProvider.getProrRow(1);
+ }
+
+ @Test(expected = IndexOutOfBoundsException.class)
+ public void testGetContentNonExistingRow() {
+ contentProvider.getContentAt(2, 0);
+ }
+
+ @Test(expected = IndexOutOfBoundsException.class)
+ public void testGetContentNonExistingColumn() {
+ contentProvider.getContentAt(0, 2);
+ }
+
+ @Test
+ public void testGetContentOfEmptyColumn() {
+ addColumn("NonExistingAttribute");
+ assertNull(contentProvider.getContentAt(0, 0));
+
+ }
+
+ /**
+ * Tests for getProrRow()
+ */
+ @Test
+ public void testGetProrRow0() {
+ SpecHierarchy[] sh = createSpecHierarchies();
+ assertEquals(sh[0],
+ ((ProrRowSpecHierarchy) contentProvider.getProrRow(0))
+ .getSpecHierarchy());
+ }
+
+ @Test
+ public void testGetProrRow1() {
+ SpecHierarchy[] sh = createSpecHierarchies();
+ assertEquals(specification.getChildren().get(1), sh[1]);
+ ProrRowSpecHierarchy prorRowSpecHierarchy = (ProrRowSpecHierarchy) contentProvider
+ .getProrRow(1);
+ assertEquals(sh[1], prorRowSpecHierarchy.getSpecHierarchy());
+
+ }
+
+ @Test
+ public void testGetProrRow2() {
+ SpecHierarchy[] sh = createSpecHierarchies();
+ assertEquals(sh[2],
+ ((ProrRowSpecHierarchy) contentProvider.getProrRow(2))
+ .getSpecHierarchy());
+ }
+
+ @Test
+ public void testGetProrRow3() {
+ SpecHierarchy[] sh = createSpecHierarchies();
+ assertEquals(sh[3],
+ ((ProrRowSpecHierarchy) contentProvider.getProrRow(3))
+ .getSpecHierarchy());
+ }
+
+ @Test
+ public void testGetProrRow4() {
+ SpecHierarchy[] sh = createSpecHierarchies();
+ assertEquals(sh[4],
+ ((ProrRowSpecHierarchy) contentProvider.getProrRow(4))
+ .getSpecHierarchy());
+ }
+
+ @Test
+ public void testGetProrRowSpecRelationRow0() {
+ SpecRelation[] sr = createSpecRelations();
+
+ assertEquals(sr[0], (contentProvider.getProrRow(1)).getSpecElement());
+ }
+
+ @Test
+ public void testGetProrRowSpecRelationRow1() {
+ SpecRelation[] sr = createSpecRelations();
+
+ assertEquals(sr[1], contentProvider.getProrRow(3).getSpecElement());
+ }
+
+ @Test
+ public void testGetProrRowSpecRelationRow2() {
+ SpecRelation[] sr = createSpecRelations();
+
+ assertEquals(sr[2], contentProvider.getProrRow(4).getSpecElement());
+ }
+
+ /**
+ *
+ * The link column is always the last column
+ *
+ * */
+ @Test
+ public void testGetContentOfLinkColumnSpecObject() {
+ addColumn("First Column");
+ addColumn("Second Column");
+ addColumn("Third Column");
+
+ assertEquals(specObject, contentProvider.getContentAt(0, 3));
+ }
+
+ /**
+ * The link column is always the last column
+ * */
+
+ @Test
+ public void testGetContentOfLinkColumnEmptySpecHierarchy() {
+ addColumn("First Column");
+ addColumn("Second Column");
+ addColumn("Third Column");
+
+ createSpecHierarchies();
+
+ assertNull(contentProvider.getContentAt(3, 3));
+ assertNull(contentProvider.getContentAt(4, 3));
+ }
+
+ /**
+ * The link column is always the last column
+ * */
+
+ @Test
+ public void testGetContentOfLinkColumnSpecRelation() {
+ addColumn("First Column");
+ addColumn("Second Column");
+ addColumn("Third Column");
+
+ SpecRelation[] sr = createSpecRelations();
+
+ assertEquals(sr[0], contentProvider.getContentAt(1, 3));
+ assertEquals(sr[1], contentProvider.getContentAt(3, 3));
+ assertEquals(sr[2], contentProvider.getContentAt(4, 3));
+ }
+
+ @Test
+ public void testInitialCellValueWithColumn() {
+ addColumn("Description");
+ assertEquals(1, specViewConfig.getColumns().size());
+ assertTrue(contentProvider.getContentAt(0, 0) instanceof AttributeValueString);
+ }
+
+ /**
+ * Adds another label config element to the column configurations
+ */
+ private void addColumn(String label) {
+ Column column = ConfigurationFactory.eINSTANCE.createColumn();
+ column.setLabel(label);
+ column.setWidth(100);
+ setViaCommand(
+ specViewConfig,
+ ConfigurationPackage.Literals.PROR_SPEC_VIEW_CONFIGURATION__COLUMNS,
+ column);
+ }
+
+ /**
+ * Creates the following test structure:
+ *
+ * <pre>
+ * +-------------+
+ * |specification|
+ * +--+----------+
+ * |
+ * | +------------+ +---------+
+ * +--+ specH 0 +---+SpecObj 0|
+ * | +------------+ +---------+
+ * |
+ * | +------------+ +---------+
+ * +--+ specH 1 +---+SpecObj 1|
+ * | +------------+ +---------+
+ * |
+ * | +------------+ +---------+
+ * +--+ specH 2 +---+SpecObj 1|
+ * | +-+----------+ +---------+
+ * | |
+ * | | +------------+
+ * | +-+ specH 3 |
+ * | +------------+
+ * |
+ * | +------------+
+ * +---+ specH 4 |
+ * +------------+
+ *
+ *
+ * </pre>
+ *
+ * @param sh
+ */
+
+ private SpecHierarchy[] createSpecHierarchies() {
+ SpecHierarchy[] sh = new SpecHierarchy[5];
+
+ sh[0] = specHierarchy;
+ sh[1] = ReqIF10Factory.eINSTANCE.createSpecHierarchy();
+ sh[2] = ReqIF10Factory.eINSTANCE.createSpecHierarchy();
+ sh[3] = ReqIF10Factory.eINSTANCE.createSpecHierarchy();
+
+ sh[4] = ReqIF10Factory.eINSTANCE.createSpecHierarchy();
+
+ sh[0].setDesc("specH 0");
+ sh[1].setDesc("specH 1");
+ sh[2].setDesc("specH 2");
+ sh[3].setDesc("specH 3");
+ sh[4].setDesc("specH 4");
+
+ SpecObject specObj = ReqIF10Factory.eINSTANCE.createSpecObject();
+
+ specObject.setDesc("specObj 0");
+ specObj.setDesc("specObj 1");
+
+ sh[1].setObject(specObj);
+ sh[2].setObject(specObj);
+
+ reqif.getCoreContent().getSpecObjects().add(specObj);
+
+ specification.getChildren().add(sh[1]);
+ specification.getChildren().add(sh[2]);
+
+ specification.getChildren().get(2).getChildren().add(sh[3]);
+ specification.getChildren().add(sh[4]);
+
+ return sh;
+ }
+
+ private SpecRelation[] createSpecRelations() {
+ SpecRelation[] sr = new SpecRelation[3];
+
+ sr[0] = ReqIF10Factory.eINSTANCE.createSpecRelation();
+ sr[1] = ReqIF10Factory.eINSTANCE.createSpecRelation();
+ sr[2] = ReqIF10Factory.eINSTANCE.createSpecRelation();
+
+ sr[0].setDesc("SpecRel 0");
+ sr[1].setDesc("SpecRel 1");
+ sr[2].setDesc("SpecRel 2");
+
+ SpecHierarchy[] sh = createSpecHierarchies();
+
+ sr[0].setSource(sh[0].getObject());
+ sr[0].setTarget(sh[0].getObject());
+ sr[1].setSource(sh[1].getObject());
+ sr[2].setSource(sh[2].getObject());
+
+ reqif.getCoreContent().getSpecRelations().add(sr[0]);
+ reqif.getCoreContent().getSpecRelations().add(sr[1]);
+ reqif.getCoreContent().getSpecRelations().add(sr[2]);
+
+ contentProvider.setShowSpecRelations(true);
+ assertTrue(contentProvider.getShowSpecRelations());
+ return sr;
+ }
+
+}
diff --git a/org.eclipse.rmf.pror.reqif10.editor.tests/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrRowTests.java b/org.eclipse.rmf.pror.reqif10.editor.tests/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrRowTests.java
new file mode 100644
index 0000000..0a45681
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.editor.tests/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrRowTests.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Formal Mind GmbH and University of Dusseldorf.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Said Salem - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.rmf.pror.reqif10.editor.agilegrid;
+
+import static org.junit.Assert.assertSame;
+
+import org.eclipse.rmf.reqif10.SpecRelation;
+import org.junit.Test;
+
+/**
+ * Tests {@link ProrRow}
+ *
+ * @author salem
+ */
+public class ProrRowTests extends AbstractContentProviderTests {
+
+ @Test
+ public void testCreateProrRowSpecHierarchy() {
+ ProrRow prorRow = ProrRow.createProrRow(specHierarchy, 0, 0);
+
+ assertSame(specHierarchy,
+ ((ProrRow.ProrRowSpecHierarchy) prorRow).getSpecHierarchy());
+
+ }
+
+ @Test
+ public void testProrRowObject() {
+ ProrRow prorRow = ProrRow.createProrRow(specHierarchy, 0, 0);
+ assertSame(specObject,
+ ((ProrRow.ProrRowSpecHierarchy) prorRow).getSpecElement());
+ }
+
+ @Test
+ public void testCreateProrRowSpecRelation() {
+ SpecRelation specRelation = reqif.getCoreContent().getSpecRelations().get(0);
+ ProrRow prorRow = ProrRow.createProrRow(specRelation, 0, 0);
+
+ assertSame(specRelation, prorRow.getSpecElement());
+ }
+
+ @Test(expected = IllegalArgumentException.class)
+ public void testCreateProrRowIllegalArgument() {
+ ProrRow.createProrRow(new String("ProrRowIllegalArgument"), 0, 0);
+ }
+
+ @Test(expected = NullPointerException.class)
+ public void testCreateProrRowNull() {
+ ProrRow.createProrRow(null, 0, 0);
+ }
+
+ @Test(expected = IndexOutOfBoundsException.class)
+ public void testParameterValues() {
+ int negativValue = -1;
+ ProrRow.createProrRow(null, negativValue, negativValue);
+ }
+
+}
diff --git a/org.eclipse.rmf.pror.reqif10.editor/META-INF/MANIFEST.MF b/org.eclipse.rmf.pror.reqif10.editor/META-INF/MANIFEST.MF
index 0986610..e1cb50b 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.pror.reqif10.editor/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.pror.reqif10.editor;singleton:=true
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-Activator: org.eclipse.rmf.pror.reqif10.editor.presentation.Reqif10EditorPlugin$Implementation
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -15,11 +15,12 @@
Require-Bundle: org.eclipse.core.runtime;visibility:=reexport,
org.eclipse.ui.ide;visibility:=reexport,
org.eclipse.ui.forms,
- org.eclipse.rmf.pror.reqif10.edit;bundle-version="0.3.2";visibility:=reexport,
+ org.eclipse.rmf.pror.reqif10.edit;bundle-version="0.4.0";visibility:=reexport,
org.eclipse.core.resources;visibility:=reexport,
org.eclipse.emf.edit.ui;visibility:=reexport,
org.agilemore.agilegrid;bundle-version="1.2.3";visibility:=reexport,
- org.eclipse.rmf.serialization;bundle-version="0.3.2",
+ org.eclipse.rmf.serialization;bundle-version="0.4.0",
org.eclipse.ui.navigator,
- com.google.guava
+ com.google.guava,
+ org.eclipse.core.filesystem;bundle-version="1.3.100"
Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.rmf.pror.reqif10.editor/build.properties b/org.eclipse.rmf.pror.reqif10.editor/build.properties
index 0f8a265..4dabd64 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/build.properties
+++ b/org.eclipse.rmf.pror.reqif10.editor/build.properties
@@ -7,10 +7,12 @@
# Contributors:
# Michael Jastram - initial API and implementation
bin.includes = .,\
- icons/,\
+ icons/,\
META-INF/,\
plugin.xml,\
- plugin.properties
+ plugin.properties,\
+ pror-mime.xml,\
+ pror.desktop
output.. = bin/
jars.compile.order = .
source.. = src/
diff --git a/org.eclipse.rmf.pror.reqif10.editor/plugin.properties b/org.eclipse.rmf.pror.reqif10.editor/plugin.properties
index bc30245..c4fcd7d 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/plugin.properties
+++ b/org.eclipse.rmf.pror.reqif10.editor/plugin.properties
@@ -101,11 +101,11 @@
_UI_Perspective_label = ProR
_Action_Website = Visit ProR Website (http://pror.org)
-_Action_General_Config = General Configuration
-_Action_Datatype_Config = Datatype Configuration
-_Action_Column_Config = Column Configuration
+_Action_General_Config = General Configuration ...
+_Action_Datatype_Config = Datatype Configuration ...
+_Action_Column_Config = Column Configuration ...
_Action_Toggle_Links = Toggle SpecRelations (Links)
-_Action_Presentation_Config = Presentation Configuration
+_Action_Presentation_Config = Presentation Configuration ...
_UI_NoProblems_message = Cool
_UI_DefaultProblem_message = Problems encountered. The recovered content can be accessed by clicking on the tab 'Selection' below.\n\nClicking on 'Details' will show further information.\n\nCAUTION: By saving the ReqIF model in its current state, the objecting elements will be removed. This may be desired (e.g. if the problem stem from tool extensions that ProR cannot process).
diff --git a/org.eclipse.rmf.pror.reqif10.editor/plugin.xml b/org.eclipse.rmf.pror.reqif10.editor/plugin.xml
index 44ee9f0..c8c8775 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/plugin.xml
+++ b/org.eclipse.rmf.pror.reqif10.editor/plugin.xml
@@ -232,5 +232,11 @@
class="org.eclipse.rmf.pror.reqif10.editor.preferences.PreferenceInitializer">
</initializer>
</extension>
+ <extension
+ point="org.eclipse.ui.startup">
+ <startup
+ class="org.eclipse.rmf.pror.reqif10.editor.presentation.OpenFilesOnStartup">
+ </startup>
+ </extension>
</plugin>
diff --git a/org.eclipse.rmf.pror.reqif10.editor/pom.xml b/org.eclipse.rmf.pror.reqif10.editor/pom.xml
index b89f146..0a1cac5 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/pom.xml
+++ b/org.eclipse.rmf.pror.reqif10.editor/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.pror.reqif10.editor</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<groupId>org.eclipse.rmf.plugins</groupId>
<build>
diff --git a/org.eclipse.rmf.pror.reqif10.editor/presentationservice.txt b/org.eclipse.rmf.pror.reqif10.editor/presentationservice.txt
new file mode 100644
index 0000000..58f5919
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.editor/presentationservice.txt
@@ -0,0 +1,23 @@
+Classes involved:
+
+
+PresentationService (AbstractPresentationService)
+- One instance per Presentation-Plugin
+- Consists of:
+ - PresentationEditorService (handles GUI stuff)
+ - PresentationEditService (handles ItemProvider stuff)
+
+PresentationEditorManager
+
+PresentationEditorService
+
+- Es gibt einen PresentationService pro installierter Presentation
+- Diese wird aktiviert mit oeffnen und schliessen vom ReqIF
+
+- Ein ReqIF model kann belibig viele PresentationConfiguration haben
+- Diese werden mit Erstellung / Loeschung aktiviert / deaktiviert
+
+==================================================================
+
+Specification
+- Presentations do not get activated, unless
\ No newline at end of file
diff --git a/org.eclipse.rmf.pror.reqif10.editor/pror-mime.xml b/org.eclipse.rmf.pror.reqif10.editor/pror-mime.xml
new file mode 100644
index 0000000..d000be6
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.editor/pror-mime.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+ <mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
+ <mime-type type="application/reqif">
+ <comment>Requirements Interchange Format (ReqIF) 1.0.1</comment>
+ <glob pattern="*.reqif"/>
+ </mime-type>
+ </mime-info>
+
\ No newline at end of file
diff --git a/org.eclipse.rmf.pror.reqif10.editor/pror.desktop b/org.eclipse.rmf.pror.reqif10.editor/pror.desktop
new file mode 100644
index 0000000..5d0f7d6
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.editor/pror.desktop
@@ -0,0 +1,9 @@
+#!/usr/bin/env xdg-open
+[Desktop Entry]
+Version=1.0
+Name=ProR Requirements Engineering Tool
+Exec=opt/pror/rmf-pror
+Terminal=false
+Type=Application
+Categories=Development;
+Icon=opt/pror/rmf-pror/icon.xpm
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/actions/ColumnConfigurationActionDelegate.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/actions/ColumnConfigurationActionDelegate.java
index c2f25ef..032fe37 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/actions/ColumnConfigurationActionDelegate.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/actions/ColumnConfigurationActionDelegate.java
@@ -66,7 +66,7 @@
Specification spec = ((ReqifSpecificationEditorInput) input)
.getSpec();
ProrToolExtension toolConfig = ConfigurationUtil
- .getProrToolExtension(reqif, editor.getEditingDomain());
+ .createProrToolExtension(reqif, editor.getEditingDomain());
EList<ProrSpecViewConfiguration> configs = toolConfig
.getSpecViewConfigurations();
for (final ProrSpecViewConfiguration config : configs) {
@@ -87,12 +87,11 @@
private void launchColumnDialog(final ProrSpecViewConfiguration config) {
SubtreeDialog dialog = new SubtreeDialog(editor.getReqifEditor(),
config, "Configure columns for "
- + ConfigurationUtil.getSpecElementLabel(config
- .getSpecification()),
+ + ConfigurationUtil.getSpecElementLabel(
+ config.getSpecification(),
+ editor.getAdapterFactory()),
"org.eclipse.rmf.pror.reqif10.editor.columnConfiguration");
- dialog.setActions(
- new IAction[] { buildAddColumnAction(config) },
- false);
+ dialog.setActions(new IAction[] { buildAddColumnAction(config) }, false);
dialog.open();
return;
}
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/actions/GeneralConfigurationActionDelegate.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/actions/GeneralConfigurationActionDelegate.java
index d21b7eb..e97cad1 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/actions/GeneralConfigurationActionDelegate.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/actions/GeneralConfigurationActionDelegate.java
@@ -10,14 +10,18 @@
******************************************************************************/
package org.eclipse.rmf.pror.reqif10.editor.actions;
+import org.eclipse.emf.edit.command.SetCommand;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.rmf.pror.reqif10.configuration.ConfigurationFactory;
+import org.eclipse.rmf.pror.reqif10.configuration.ConfigurationPackage;
+import org.eclipse.rmf.pror.reqif10.configuration.LabelConfiguration;
+import org.eclipse.rmf.pror.reqif10.configuration.ProrGeneralConfiguration;
import org.eclipse.rmf.pror.reqif10.configuration.ProrToolExtension;
import org.eclipse.rmf.pror.reqif10.editor.presentation.Reqif10Editor;
import org.eclipse.rmf.pror.reqif10.editor.presentation.SpecificationEditor;
import org.eclipse.rmf.pror.reqif10.util.ConfigurationUtil;
-import org.eclipse.rmf.reqif10.ReqIF;
import org.eclipse.rmf.reqif10.ReqIFToolExtension;
import org.eclipse.ui.IEditorActionDelegate;
import org.eclipse.ui.IEditorPart;
@@ -47,17 +51,62 @@
public void run(IAction action) {
if (editor == null)
return;
- ReqIF reqif = (ReqIF) editor.getEditingDomain().getResourceSet()
- .getResources().get(0).getContents().get(0);
ProrToolExtension uiToolExtension = ConfigurationUtil
- .getProrToolExtension(reqif, editor.getEditingDomain());
-
- SubtreeDialog dialog = new SubtreeDialog(editor,
- uiToolExtension.getGeneralConfiguration(),
- "General Configuration", "org.eclipse.rmf.pror.reqif10.editor.generalConfiguration");
+ .createProrToolExtension(editor.getReqif(),
+ editor.getEditingDomain());
+ ProrGeneralConfiguration generalConfig = createGeneralConfiguration(uiToolExtension);
+ createLabelConfiguration(generalConfig);
+ SubtreeDialog dialog = new SubtreeDialog(editor, generalConfig,
+ "General Configuration",
+ "org.eclipse.rmf.pror.reqif10.editor.generalConfiguration");
dialog.open();
}
+ /**
+ * Creates the {@link LabelConfiguration}, if necessary.
+ */
+ private void createLabelConfiguration(ProrGeneralConfiguration generalConfig) {
+ if (generalConfig.getLabelConfiguration() != null) {
+ return;
+ }
+
+ LabelConfiguration labelConfig = ConfigurationFactory.eINSTANCE
+ .createLabelConfiguration();
+ editor.getEditingDomain()
+ .getCommandStack()
+ .execute(
+ SetCommand.create(
+ editor.getEditingDomain(),
+ generalConfig,
+ ConfigurationPackage.Literals.PROR_GENERAL_CONFIGURATION__LABEL_CONFIGURATION,
+ labelConfig));
+ }
+
+ /**
+ * Creates the general configuration, if necessary.
+ *
+ * @param uiToolExtension
+ */
+ private ProrGeneralConfiguration createGeneralConfiguration(
+ ProrToolExtension uiToolExtension) {
+ if (uiToolExtension.getGeneralConfiguration() != null) {
+ return uiToolExtension.getGeneralConfiguration();
+ }
+
+ // Does not exist yet - create.
+ ProrGeneralConfiguration generalConfig = ConfigurationFactory.eINSTANCE
+ .createProrGeneralConfiguration();
+ editor.getEditingDomain()
+ .getCommandStack()
+ .execute(
+ SetCommand.create(
+ editor.getEditingDomain(),
+ uiToolExtension,
+ ConfigurationPackage.PROR_TOOL_EXTENSION__GENERAL_CONFIGURATION,
+ generalConfig));
+ return generalConfig;
+ }
+
public void selectionChanged(IAction action, ISelection selection) {
// No action required.
}
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/actions/PresentationConfigurationActionDelegate.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/actions/PresentationConfigurationActionDelegate.java
index d0a2597..e37e60b 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/actions/PresentationConfigurationActionDelegate.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/actions/PresentationConfigurationActionDelegate.java
@@ -24,10 +24,11 @@
import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfigurations;
import org.eclipse.rmf.pror.reqif10.configuration.ProrToolExtension;
+import org.eclipse.rmf.pror.reqif10.configuration.provider.ProrPresentationConfigurationsItemProvider;
+import org.eclipse.rmf.pror.reqif10.edit.presentation.service.PresentationInterface;
import org.eclipse.rmf.pror.reqif10.editor.presentation.Reqif10Editor;
import org.eclipse.rmf.pror.reqif10.editor.presentation.SpecificationEditor;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationEditorManager;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationService;
+import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationServiceManager;
import org.eclipse.rmf.pror.reqif10.util.ConfigurationUtil;
import org.eclipse.rmf.pror.reqif10.util.ProrUtil;
import org.eclipse.rmf.reqif10.ReqIFToolExtension;
@@ -59,6 +60,26 @@
public void run(IAction action) {
if (editor == null)
return;
+
+ // Make sure the data structures exist
+ EditingDomain ed = editor.getEditingDomain();
+ ProrToolExtension toolExtension = ConfigurationUtil
+ .createProrToolExtension(editor.getReqif(), ed);
+ if (toolExtension.getPresentationConfigurations() == null) {
+ ProrPresentationConfigurations configs = ConfigurationFactory.eINSTANCE
+ .createProrPresentationConfigurations();
+ ((ProrPresentationConfigurationsItemProvider) ProrUtil
+ .getItemProvider(editor.getAdapterFactory(), configs))
+ .setEditingDomain(ed);
+ ed.getCommandStack()
+ .execute(
+ SetCommand
+ .create(ed,
+ toolExtension,
+ ConfigurationPackage.Literals.PROR_TOOL_EXTENSION__PRESENTATION_CONFIGURATIONS,
+ configs));
+ }
+
SubtreeDialog dialog = new SubtreeDialog(editor, getProrPresentationConfigurations(), "Presentation Configuration",
"org.eclipse.rmf.pror.reqif10.editor.presentationConfiguration");
dialog.setActions(buildAddPresentationActions(), true);
@@ -67,8 +88,8 @@
private IAction[] buildAddPresentationActions() {
- Set<Class<? extends ProrPresentationConfiguration>> configs = PresentationEditorManager
- .getPresentationServiceMap().keySet();
+ Set<Class<? extends ProrPresentationConfiguration>> configs = PresentationServiceManager
+ .getPresentationInterfaceMap().keySet();
IAction[] actions = new IAction[configs.size()];
int i = 0;
@@ -77,8 +98,8 @@
actions[i++] = new Action(ProrUtil.substractPrefixPostfix(config, "","ConfigurationImpl")) {
@Override
public void run() {
- PresentationService service = PresentationEditorManager
- .getPresentationServiceMap().get(config);
+ PresentationInterface service = PresentationServiceManager
+ .getPresentationInterfaceMap().get(config);
ProrPresentationConfiguration config = service
.getConfigurationInstance();
Command command = AddCommand
@@ -100,7 +121,7 @@
*/
private ProrPresentationConfigurations getProrPresentationConfigurations() {
final ProrToolExtension ext = ConfigurationUtil
- .getProrToolExtension(editor.getReqif(), editor.getEditingDomain());
+ .createProrToolExtension(editor.getReqif(), editor.getEditingDomain());
if (ext.getPresentationConfigurations() == null) {
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/actions/SpecificationWebPrintAction.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/actions/SpecificationWebPrintAction.java
index 7e5ea65..bf3ce40 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/actions/SpecificationWebPrintAction.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/actions/SpecificationWebPrintAction.java
@@ -14,6 +14,7 @@
import java.io.FileWriter;
import java.io.IOException;
+import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -30,12 +31,15 @@
private final Specification spec;
private EditingDomain editingDomain;
+ private AdapterFactory adapterFactory;
/**
*/
- public SpecificationWebPrintAction(Specification spec, EditingDomain editingDomain) {
+ public SpecificationWebPrintAction(Specification spec,
+ EditingDomain editingDomain, AdapterFactory adapterFactory) {
this.spec = spec;
this.editingDomain = editingDomain;
+ this.adapterFactory = adapterFactory;
}
@Override
@@ -47,7 +51,8 @@
folder = new File(folder.getAbsolutePath() + "/");
folder.mkdir();
- String createHtmlContent = ProrEditorUtil.createHtmlContent(spec,editingDomain);
+ String createHtmlContent = ProrEditorUtil.createHtmlContent(spec,
+ editingDomain, adapterFactory);
File htmlFile = new File(folder, "pror.html");
FileWriter writer = new FileWriter(htmlFile);
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/AbstractProrCellEditorProvider.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/AbstractProrCellEditorProvider.java
index 44b8d28..93ebad1 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/AbstractProrCellEditorProvider.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/AbstractProrCellEditorProvider.java
@@ -34,7 +34,7 @@
DefaultCellEditorProvider {
protected final EditingDomain editingDomain;
- private AdapterFactory adapterFactory;
+ protected final AdapterFactory adapterFactory;
public AbstractProrCellEditorProvider(AgileGrid agileGrid,
AdapterFactory adapterFactory, EditingDomain editingDomain) {
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/AbstractProrCellRenderer.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/AbstractProrCellRenderer.java
index a4eb38f..4bca1ab 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/AbstractProrCellRenderer.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/AbstractProrCellRenderer.java
@@ -52,7 +52,7 @@
*/
public class AbstractProrCellRenderer extends TextCellRenderer {
- private final AdapterFactory adapterFactory;
+ protected final AdapterFactory adapterFactory;
private final Image IMG_WARN_FALSE = PlatformUI.getWorkbench()
.getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK);
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrAgileGridContentProvider.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrAgileGridContentProvider.java
index 73014a7..578cc33 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrAgileGridContentProvider.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrAgileGridContentProvider.java
@@ -12,11 +12,12 @@
import java.util.ArrayList;
import java.util.Collections;
-import java.util.HashSet;
import java.util.List;
import org.agilemore.agilegrid.AbstractContentProvider;
import org.agilemore.agilegrid.IContentProvider;
+import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.ecore.util.EContentAdapter;
import org.eclipse.rmf.pror.reqif10.configuration.ProrSpecViewConfiguration;
import org.eclipse.rmf.reqif10.AttributeValue;
import org.eclipse.rmf.reqif10.ReqIF;
@@ -33,13 +34,22 @@
private final Specification root;
private final ProrSpecViewConfiguration specViewConfig;
+ private ArrayList<ProrRow> cache = null;
private boolean showSpecRelations;
- public ProrAgileGridContentProvider(Specification specHierarchyRoot,
+ public ProrAgileGridContentProvider(Specification specification,
ProrSpecViewConfiguration specViewConfig) {
- this.root = specHierarchyRoot;
+ this.root = specification;
this.specViewConfig = specViewConfig;
+
+ specification.eAdapters().add(new EContentAdapter() {
+ @Override
+ public void notifyChanged(Notification notification) {
+ super.notifyChanged(notification);
+ cache = null;
+ }
+ });
}
/**
@@ -47,19 +57,23 @@
* associated with the row. May return null.
*/
@Override
- public Object doGetContentAt(int row, int col) throws IndexOutOfBoundsException {
- if (row >= getRowCount())
+ public Object doGetContentAt(int row, int col)
+ throws IndexOutOfBoundsException {
+ if (row >= getCache().size()) {
throw new IndexOutOfBoundsException("Row does not exist: " + row);
- SpecElementWithAttributes element = getProrRow(row)
- .getSpecElement();
+ }
+
+ SpecElementWithAttributes element = getCache().get(row).getSpecElement();
if (col == specViewConfig.getColumns().size()) {
// For the Link column, we return the linked element.
return element instanceof SpecElementWithAttributes ? element
: null;
- } else {
- // For everything else, we return the AttributeValue.
+ } else if (col <= specViewConfig.getColumns().size()) {
+ // we return the AttributeValue.
return getValueForColumn(element, col);
+ } else {
+ throw new IndexOutOfBoundsException("Column does not exist: " + col);
}
}
@@ -72,27 +86,6 @@
*/
@Override
public void doSetContentAt(int row, int col, Object newValue) {
-
- // ProrRow prorRow = getProrRow(row);
- // AttributeValue oldValue = getValueForColumn(prorRow.getSpecElement(),
- // col);
- // EStructuralFeature feature = null;
- // if (oldValue instanceof AttributeValueSimple) {
- // feature =
- // ExchangeFilePackage.Literals.ATTRIBUTE_VALUE_SIMPLE__THE_VALUE;
- // } else if (oldValue instanceof AttributeValueEnumeration) {
- // feature =
- // ExchangeFilePackage.Literals.ATTRIBUTE_VALUE_ENUMERATION__VALUES;
- // } else {
- // throw new UnsupportedOperationException("Not yet supported: " +
- // oldValue);
- // }
- //
- // if (!newValue.equals(oldValue)) {
- // Command cmd = SetCommand.create(editingDomain, oldValue, feature,
- // newValue);
- // editingDomain.getCommandStack().execute(cmd);
- // }
}
/**
@@ -102,6 +95,7 @@
*/
public void setShowSpecRelations(boolean status) {
this.showSpecRelations = status;
+ cache = null;
}
/**
@@ -120,51 +114,59 @@
* TODO Serious potential for performance tuning.
*/
ProrRow getProrRow(int row) {
- return recurseSpecHierarchyForRow(0, row, 0, root.getChildren());
+ return getCache().get(row);
+ }
+
+
+
+ private ArrayList<ProrRow> getCache() {
+ ArrayList<ProrRow> tmpCache = null;
+ if (cache == null) {
+ tmpCache = new ArrayList<ProrRow>();
+ recurseSpecHierarchyForRow(0, 0, root.getChildren(), tmpCache);
+ cache = tmpCache ;
+ }
+ return cache;
}
/**
- * Recurses over the given children.
*
* @param current
* The current counter
- *
- * @param children
- * The {@link SpecHierarchy}s to traverse
- *
- * @return The {@link SpecHierarchy} where row == current, or null if not
- * found.
+ * @param elements
+ * The {@link SpecHierarchy}s to traverse, Can be SpecHierarchies
+ * or SpecRelations
+ * @param tmpCache
+ * @return either the {@link ProrRow} with the given row, or the new current
+ * row
*/
- @SuppressWarnings({ "rawtypes", "unchecked" })
- private ProrRow recurseSpecHierarchyForRow(int current, int row, int depth,
- List elements) {
- for (Object element : elements) {
- if (current == row) {
- return new ProrRow(element, row, depth);
+ private int recurseSpecHierarchyForRow(int current, int depth,
+ List<SpecHierarchy> elements, ArrayList<ProrRow> tmpCache) {
+ for (SpecHierarchy element : elements) {
+ // We did not find the row, let's check SpecRealtions first
+ tmpCache.add(current, ProrRow.createProrRow(element, current, depth));
+ for (SpecRelation specRelation : getSpecRelationsFor(element)) {
+ ++current;
+ tmpCache.add(current,
+ ProrRow.createProrRow(specRelation, current, depth + 1));
+
+ // return ProrRow.createProrRow(specRelation, row, depth + 1);
+
}
- current++;
- if (element instanceof SpecHierarchy) {
- List children = new ArrayList();
- children.addAll(getSpecRelationsFor((SpecHierarchy) element));
- children.addAll(((SpecHierarchy) element).getChildren());
- ProrRow result = recurseSpecHierarchyForRow(current, row,
- depth + 1,
- children);
- if (result.element != null) {
- return result;
- }
- current = result.row;
- }
+ // We still did not find the row, let's check the children
+
+ int result = recurseSpecHierarchyForRow(++current, depth + 1,
+ element.getChildren(), tmpCache);
+ current = result;
}
- return new ProrRow(null, current, depth);
+ return current;
}
/**
* Returns the actual {@link AttributeValue} for the given Column and the
* given {@link SpecElementWithUserDefinedAttributes}
*/
- AttributeValue getValueForColumn(
- SpecElementWithAttributes element, int col) {
+ AttributeValue getValueForColumn(SpecElementWithAttributes element, int col) {
// Knock-out criteria
if (element == null)
return null;
@@ -198,42 +200,6 @@
return list;
}
- /**
- * Represents the row of a table. A row holds either a SpecHierarchy or a
- * SpecRelation.
- */
- class ProrRow {
- final Object element;
- final int level;
- final int row;
-
- /**
- * @ requires level >= 0 @
- * @ requires row >= 0 @
- */
- public ProrRow(Object element, int row, int level) {
- this.element = element;
- this.row = row;
- this.level = level;
- }
-
- public SpecElementWithAttributes getSpecElement() {
- if (element instanceof SpecRelation)
- return (SpecRelation) element;
- return ((SpecHierarchy) element).getObject();
- }
-
- public SpecHierarchy getSpecHierarchy() {
- return element instanceof SpecHierarchy ? (SpecHierarchy) element
- : null;
- }
-
- @Override
- public String toString() {
- return "Row " + row + " Level " + level + ": " + element;
- }
- }
-
void updateElement(SpecElementWithAttributes element) {
recurseUpdateElement(0, element, root.getChildren());
}
@@ -262,7 +228,8 @@
refresh = true;
}
}
- // Workaround: provide null for "old value" to force a recognition of
+ // Workaround: provide null for "old value" to force a recognition
+ // of
// the change.
if (refresh) {
firePropertyChange(IContentProvider.Content, row, 0, null,
@@ -275,19 +242,7 @@
}
public int getRowCount() {
- HashSet<SpecHierarchy> set = new HashSet<SpecHierarchy>(
- root.getChildren());
- int count = 0;
- while (!set.isEmpty()) {
- SpecHierarchy specHierarchy = set.iterator().next();
- count++;
- set.remove(specHierarchy);
- set.addAll(specHierarchy.getChildren());
- if (showSpecRelations) {
- count += getSpecRelationsFor(specHierarchy).size();
- }
- }
- return count;
+ return getCache().size();
}
}
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrAgileGridViewer.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrAgileGridViewer.java
index 5136c59..f8cccad 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrAgileGridViewer.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrAgileGridViewer.java
@@ -50,7 +50,8 @@
import org.eclipse.rmf.pror.reqif10.configuration.Column;
import org.eclipse.rmf.pror.reqif10.configuration.ConfigurationPackage;
import org.eclipse.rmf.pror.reqif10.configuration.ProrSpecViewConfiguration;
-import org.eclipse.rmf.pror.reqif10.editor.agilegrid.ProrAgileGridContentProvider.ProrRow;
+import org.eclipse.rmf.pror.reqif10.editor.agilegrid.ProrRow.ProrRowSpecHierarchy;
+import org.eclipse.rmf.pror.reqif10.editor.agilegrid.ProrRow.ProrRowSpecRelation;
import org.eclipse.rmf.pror.reqif10.util.ConfigurationUtil;
import org.eclipse.rmf.pror.reqif10.util.ProrUtil;
import org.eclipse.rmf.reqif10.ReqIF10Factory;
@@ -112,7 +113,7 @@
protected SpecHierarchy dragTarget;
private EContentAdapter specRelationContentAdapter;
private AdapterFactory adapterFactory;
-
+
private AgileCellEditorActionHandler agileCellEditorActionHandler;
/**
@@ -142,7 +143,8 @@
@Override
public void keyPressed(KeyEvent e) {
- if (e.stateMask == SWT.CTRL && (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR) ) {
+ if (e.stateMask == SWT.CTRL
+ && (e.keyCode == SWT.CR || e.keyCode == SWT.KEYPAD_CR)) {
e.doit = false;
if (selection.isEmpty()) {
return;
@@ -174,10 +176,11 @@
}
// Create the new elements
- SpecHierarchy newSpecHierarchy = ReqIF10Factory.eINSTANCE.createSpecHierarchy();
+ SpecHierarchy newSpecHierarchy = ReqIF10Factory.eINSTANCE
+ .createSpecHierarchy();
SpecObject newSpecObject = ReqIF10Factory.eINSTANCE.createSpecObject();
newSpecHierarchy.setObject(newSpecObject);
-
+
EReference childFeature;
int pos;
EObject parent = specHierarchy.eContainer();
@@ -187,8 +190,8 @@
.indexOf(specHierarchy) + 1;
} else if (parent instanceof Specification) {
childFeature = ReqIF10Package.Literals.SPECIFICATION__CHILDREN;
- pos = ((Specification) specHierarchy.eContainer())
- .getChildren().indexOf(specHierarchy) + 1;
+ pos = ((Specification) specHierarchy.eContainer()).getChildren()
+ .indexOf(specHierarchy) + 1;
} else {
throw new IllegalStateException("Wrong parent: " + parent);
}
@@ -199,20 +202,25 @@
newSpecObject, ReqIF10Package.Literals.SPEC_OBJECT__TYPE,
specHierarchy.getObject().getType(), -1, -1, editingDomain,
adapterFactory);
-
+
cmd.append(AddCommand.create(editingDomain, specHierarchy.eContainer(),
childFeature, newSpecHierarchy, pos));
-
+
editingDomain.getCommandStack().execute(cmd);
// The row to be edited may be further down due to indenting.
Cell activeCell = agileGrid.getCellSelection()[0];
int row = activeCell.row + 1;
- while (contentProvider.getProrRow(row).getSpecHierarchy() != newSpecHierarchy) {
+
+ ProrRow.ProrRowSpecHierarchy prorRowSpecHierarchy = (ProrRow.ProrRowSpecHierarchy) contentProvider
+ .getProrRow(row);
+
+ while (prorRowSpecHierarchy.getSpecHierarchy() != newSpecHierarchy
+ && row <= contentProvider.getRowCount()) {
row++;
}
agileGrid.editCell(row, activeCell.column);
-
+
}
@Override
@@ -247,7 +255,7 @@
unregisterSpecRelationListener();
this.specification = (Specification) input;
- this.specViewConfig = ConfigurationUtil.getSpecViewConfiguration(
+ this.specViewConfig = ConfigurationUtil.createSpecViewConfiguration(
specification, editingDomain);
this.contentProvider = new ProrAgileGridContentProvider(specification,
specViewConfig);
@@ -313,11 +321,11 @@
// otherwise we resized a normal column
Column column = (col == -1) ? ConfigurationUtil
.getLeftHeaderColumn(specification, editingDomain)
- : specViewConfig.getColumns()
- .get(col);
+ : specViewConfig.getColumns().get(col);
if (column != null) {
Command cmd = SetCommand.create(editingDomain, column,
- ConfigurationPackage.Literals.COLUMN__WIDTH, newWidth);
+ ConfigurationPackage.Literals.COLUMN__WIDTH,
+ newWidth);
editingDomain.getCommandStack().execute(cmd);
}
}
@@ -327,8 +335,7 @@
private void unregisterSpecHierarchyListener() {
if (specHierarchyRootContentAdapter != null) {
- specification.eAdapters().remove(
- specHierarchyRootContentAdapter);
+ specification.eAdapters().remove(specHierarchyRootContentAdapter);
}
}
@@ -396,7 +403,7 @@
}
private void unregisterSelectionChangedListener() {
- if (selectionChangedistener != null && ! agileGrid.isDisposed())
+ if (selectionChangedistener != null && !agileGrid.isDisposed())
agileGrid.removeSelectionChangedListener(selectionChangedistener);
}
@@ -423,17 +430,31 @@
Set<Cell> cells = event.getNewSelections();
List<Object> items = new ArrayList<Object>();
for (Cell cell : cells) {
- Object item = contentProvider.getProrRow(cell.row).element;
+ // Object item =
+ // contentProvider.getProrRow(cell.row).getElement();
+ if (cell.row > -1) {
+ ProrRow row = contentProvider.getProrRow(cell.row);
- // If the item is a SpecRelation and the last column is
- // selected, show the target instead.
- if (item instanceof SpecRelation
- && cell.column == specViewConfig.getColumns()
- .size()) {
- item = ((SpecRelation) item).getTarget();
- }
- if (item != null) {
- items.add(item);
+ // If the item is a SpecRelation and the last column is
+ // selected, show the target instead.
+ if (row instanceof ProrRowSpecRelation
+ && cell.column == specViewConfig.getColumns()
+ .size()) {
+ SpecRelation relation = (SpecRelation) row
+ .getSpecElement();
+ if (relation.getTarget() != null) {
+ items.add(relation.getTarget());
+ }
+ } else if (row instanceof ProrRowSpecRelation
+ && cell.column < specViewConfig.getColumns()
+ .size()) {
+ items.add(row.getSpecElement());
+ } else if (row instanceof ProrRowSpecHierarchy) {
+ items.add(((ProrRowSpecHierarchy) row)
+ .getSpecHierarchy());
+ } else {
+ throw new IllegalArgumentException();
+ }
}
}
selection = new StructuredSelection(items);
@@ -498,12 +519,19 @@
Set<Cell> cells = new HashSet<Cell>();
for (int row = 0; row < contentProvider.getRowCount(); row++) {
ProrRow prorRow = contentProvider.getProrRow(row);
- Object current = prorRow.getSpecHierarchy();
- if (current == null)
+
+ Object current;
+ if (prorRow instanceof ProrRow.ProrRowSpecHierarchy)
+ current = ((ProrRow.ProrRowSpecHierarchy) prorRow)
+ .getSpecHierarchy();
+ else
current = prorRow.getSpecElement();
for (Object item : ((IStructuredSelection) selection).toList()) {
- if (item.equals(current) || ((current instanceof SpecHierarchy) && ((SpecHierarchy)current).getObject() != null && ((SpecHierarchy)current).getObject().equals(item))) {
+ if (item.equals(current)
+ || ((current instanceof SpecHierarchy)
+ && ((SpecHierarchy) current).getObject() != null && ((SpecHierarchy) current)
+ .getObject().equals(item))) {
boolean added = false;
for (int col = 0; col < agileGrid.getLayoutAdvisor()
.getColumnCount(); col++) {
@@ -531,8 +559,8 @@
// to ignore further selection events when we are updating.
if (cellArray.length > 0) {
// We do not want to interrupt editing
- if (! agileGrid.isCellEditorActive()) {
- agileGrid.focusCell(cellArray[0]);
+ if (!agileGrid.isCellEditorActive()) {
+ agileGrid.focusCell(cellArray[0]);
}
agileGrid.selectCells(cellArray);
}
@@ -565,7 +593,7 @@
}
super.dragStart(event);
}
-
+
@Override
public void dragFinished(DragSourceEvent event) {
super.dragFinished(event);
@@ -588,63 +616,79 @@
@Override
public void dragOver(DropTargetEvent e) {
+
Point pos = agileGrid.toControl(e.x, e.y);
Cell cell = agileGrid.getCell(pos.x, pos.y);
- Object target = contentProvider.getProrRow(cell.row).element;
+ ProrRow row = cell.row > 0 ? contentProvider
+ .getProrRow(cell.row) : null;
+ Object target = null;
+ if (row instanceof ProrRowSpecHierarchy) {
+ target = ((ProrRowSpecHierarchy) row)
+ .getSpecHierarchy();
+ } else if (row instanceof ProrRowSpecRelation) {
+ target = row.getSpecElement();
+ }
+
if (target instanceof SpecHierarchy) {
dragTarget = (SpecHierarchy) target;
float location = getLocation(e);
- if (location == 0.5){
+ if (location == 0.5) {
agileGrid.dndHoverCell = cell;
agileGrid.dndHoverDropMode = ProrAgileGrid.DND_DROP_AS_CHILD;
}
- if (location == 0.0){
- Cell prevCell = agileGrid.getNeighbor(cell, AgileGrid.ABOVE, true);
+ if (location == 0.0) {
+ Cell prevCell = agileGrid.getNeighbor(cell,
+ AgileGrid.ABOVE, true);
agileGrid.dndHoverCell = prevCell;
agileGrid.dndHoverDropMode = ProrAgileGrid.DND_DROP_AS_SIBLING;
}
- if (location == 1.0){
+ if (location == 1.0) {
agileGrid.dndHoverCell = cell;
agileGrid.dndHoverDropMode = ProrAgileGrid.DND_DROP_AS_SIBLING;
}
agileGrid.redraw();
}
+
+ super.dragOver(e);
+
}
-
+
@Override
public void drop(DropTargetEvent event) {
super.drop(event);
agileGrid.dndHoverCell = null;
agileGrid.redraw();
}
-
+
@Override
protected float getLocation(DropTargetEvent event) {
Point pos = agileGrid.toControl(event.x, event.y);
Cell cell = agileGrid.getCell(pos.x, pos.y);
-
+
if (agileGrid.getLayoutAdvisor() instanceof ProrLayoutAdvisor) {
- ProrLayoutAdvisor layoutAdvisor = (ProrLayoutAdvisor) agileGrid.getLayoutAdvisor();
-
- int rowHeight = layoutAdvisor.getRowHeight(cell.row);
+ ProrLayoutAdvisor layoutAdvisor = (ProrLayoutAdvisor) agileGrid
+ .getLayoutAdvisor();
+
+ int rowHeight = layoutAdvisor
+ .getRowHeight(cell.row);
int y = agileGrid.getYForRow(cell.row);
int mouseY = pos.y - y;
-
- float location = (float)mouseY / (float)rowHeight;
-
- if (location < 0.3){
+
+ float location = (float) mouseY / (float) rowHeight;
+
+ if (location < 0.3) {
return 0.0F;
- }else if(location <= 0.7){
+ } else if (location <= 0.7) {
return 0.5F;
- }else{
+ } else {
return 1.0F;
}
}
-
+
return 1.0F;
-
+
}
-
+
});
}
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrCellEditorProvider.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrCellEditorProvider.java
index 54a7e93..2e8694b 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrCellEditorProvider.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrCellEditorProvider.java
@@ -14,8 +14,11 @@
import org.agilemore.agilegrid.CellEditor;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationEditorManager;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationService;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
+import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationEditorInterface;
+import org.eclipse.rmf.pror.reqif10.util.ConfigurationUtil;
+import org.eclipse.rmf.pror.reqif10.util.ProrUtil;
import org.eclipse.rmf.reqif10.AttributeValue;
import org.eclipse.rmf.reqif10.Identifiable;
@@ -41,24 +44,32 @@
public Identifiable getAffectedElement(int row, int col) {
ProrAgileGridContentProvider provider = (ProrAgileGridContentProvider) getAgileGrid()
.getContentProvider();
- return (Identifiable) provider.getProrRow(row).element;
+ return (Identifiable) provider.getProrRow(row).getSpecElement();
}
@Override
public CellEditor getCellEditor(int row, int col, Object hint) {
CellEditor cellEditor = null;
- AttributeValue attrValue = getAttributeValue(row, col);
+ AttributeValue av = getAttributeValue(row, col);
- cellEditor = getDefaultCellEditor(attrValue, getAffectedElement(row, col));
-
- PresentationService service = PresentationEditorManager
- .getPresentationService(attrValue, editingDomain);
- if (service != null) {
- CellEditor serviceCellEditor = service.getCellEditor(agileGrid,editingDomain, attrValue, getAffectedElement(row, col));
- cellEditor = serviceCellEditor == null ? cellEditor : serviceCellEditor;
+ // Consult the presentation
+ ProrPresentationConfiguration config = ConfigurationUtil
+ .getPresentationConfiguration(av);
+ if (config != null) {
+ ItemProviderAdapter ip = ProrUtil.getItemProvider(adapterFactory,
+ config);
+ if (ip instanceof PresentationEditorInterface) {
+ cellEditor = ((PresentationEditorInterface) ip).getCellEditor(
+ agileGrid, editingDomain, av,
+ getAffectedElement(row, col));
+ }
}
-
+
+ if (cellEditor == null) {
+ cellEditor = getDefaultCellEditor(av, getAffectedElement(row, col));
+ }
+
if (cellEditor != null)
agileCellEditorActionHandler.setActiveCellEditor(cellEditor);
@@ -72,9 +83,18 @@
if (attrValue == null) {
return false;
}
- PresentationService service = PresentationEditorManager
- .getPresentationService(attrValue, editingDomain);
- return service == null ? true : service.canEdit();
+
+ // Consult the presentation
+ ProrPresentationConfiguration config = ConfigurationUtil
+ .getPresentationConfiguration(attrValue);
+ if (config != null) {
+ ItemProviderAdapter ip = ProrUtil.getItemProvider(adapterFactory,
+ config);
+ if (ip instanceof PresentationEditorInterface) {
+ return ((PresentationEditorInterface) ip).canEdit();
+ }
+ }
+ return true;
}
}
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrCellRenderer.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrCellRenderer.java
index af4f4a8..13d0dc1 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrCellRenderer.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrCellRenderer.java
@@ -13,12 +13,14 @@
import org.agilemore.agilegrid.AgileGrid;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
-import org.eclipse.rmf.pror.reqif10.editor.agilegrid.ProrAgileGridContentProvider.ProrRow;
+import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
import org.eclipse.rmf.pror.reqif10.editor.presentation.service.IProrCellRenderer;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationEditorManager;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationService;
+import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationEditorInterface;
import org.eclipse.rmf.pror.reqif10.provider.Reqif10EditPlugin;
+import org.eclipse.rmf.pror.reqif10.util.ConfigurationUtil;
+import org.eclipse.rmf.pror.reqif10.util.ProrUtil;
import org.eclipse.rmf.reqif10.AttributeValue;
import org.eclipse.rmf.reqif10.SpecObject;
import org.eclipse.rmf.reqif10.SpecRelation;
@@ -77,10 +79,17 @@
AttributeValue attrValue = contentProvider.getValueForColumn(
contentProvider.getProrRow(row).getSpecElement(), col);
- PresentationService service = PresentationEditorManager
- .getPresentationService(attrValue, editingDomain);
- if (service != null)
- renderer = service.getCellRenderer(attrValue);
+ // Consult the presentation
+ ProrPresentationConfiguration config = ConfigurationUtil
+ .getPresentationConfiguration(attrValue);
+ if (config != null) {
+ ItemProviderAdapter ip = ProrUtil.getItemProvider(adapterFactory,
+ config);
+ if (ip instanceof PresentationEditorInterface) {
+ renderer = ((PresentationEditorInterface) ip)
+ .getCellRenderer(attrValue);
+ }
+ }
if (renderer != null) {
rowHeight = renderer.doDrawCellContent(gc, rect, content);
@@ -101,7 +110,7 @@
ProrRow prorRow = contentProvider.getProrRow(row);
- int offset = prorRow.level * 20;
+ int offset = prorRow.getLevel() * 20;
Image icon;
if (prorRow.getSpecElement() instanceof SpecObject) {
icon = specObjectIcon;
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrCellRendererProvider.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrCellRendererProvider.java
index b6ea3dc..deb7a12 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrCellRendererProvider.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrCellRendererProvider.java
@@ -32,8 +32,8 @@
leftHeadRenderer.setAlignment(ICellRenderer.ALIGN_HORIZONTAL_LEFT
| ICellRenderer.ALIGN_VERTICAL_CENTER);
- prorLinkCellRenderer = new ProrLinkCellRenderer(
- agileGrid);
+ prorLinkCellRenderer = new ProrLinkCellRenderer(agileGrid,
+ adapterFactory);
}
@Override
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrLayoutAdvisor.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrLayoutAdvisor.java
index 9c53d61..3848b18 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrLayoutAdvisor.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrLayoutAdvisor.java
@@ -110,12 +110,13 @@
@Override
public String getLeftHeaderLabel(int row) {
StringBuffer sb = new StringBuffer();
- SpecHierarchy specHierarchy = ((ProrAgileGridContentProvider) agileGrid
- .getContentProvider()).getProrRow(row).getSpecHierarchy();
-
- if (specHierarchy == null) {
- return "";
+
+ ProrRow prorRow = ((ProrAgileGridContentProvider) agileGrid
+ .getContentProvider()).getProrRow(row);
+ if (!(prorRow instanceof ProrRow.ProrRowSpecHierarchy)) {
+ return "";
}
+ SpecHierarchy specHierarchy = ((ProrRow.ProrRowSpecHierarchy) prorRow).getSpecHierarchy();
while (specHierarchy.eContainer() instanceof SpecHierarchy) {
SpecHierarchy parent = (SpecHierarchy) specHierarchy.eContainer();
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrLinkCellRenderer.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrLinkCellRenderer.java
index 9ec07f9..e762bed 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrLinkCellRenderer.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrLinkCellRenderer.java
@@ -14,6 +14,7 @@
import java.util.Set;
import org.agilemore.agilegrid.AgileGrid;
+import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
import org.eclipse.rmf.pror.reqif10.editor.presentation.Reqif10EditorPlugin;
@@ -35,8 +36,9 @@
private final Image specRelationConnectorIcon;
- public ProrLinkCellRenderer(AgileGrid agileGrid) {
- super(agileGrid);
+ public ProrLinkCellRenderer(AgileGrid agileGrid,
+ AdapterFactory adapterFactory) {
+ super(agileGrid, adapterFactory);
specRelationConnectorIcon = ExtendedImageRegistry
.getInstance()
.getImage(
@@ -50,7 +52,8 @@
if (content instanceof SpecRelation) {
SpecObject target = ((SpecRelation) content).getTarget();
if (target != null) {
- String label = ConfigurationUtil.getSpecElementLabel(target);
+ String label = ConfigurationUtil.getSpecElementLabel(target,
+ adapterFactory);
drawTextImage(gc, label, alignment, null, alignment,
rect.x + 3, rect.y + 2, rect.width - 6, rect.height - 4);
}
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrRow.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrRow.java
new file mode 100644
index 0000000..7b865d2
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrRow.java
@@ -0,0 +1,106 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Formal Mind GmbH and University of Dusseldorf.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Michael Jastram - initial API and implementation
+ * Said Salem - Refactoring of ProrRow
+ ******************************************************************************/
+package org.eclipse.rmf.pror.reqif10.editor.agilegrid;
+
+import org.eclipse.rmf.reqif10.SpecElementWithAttributes;
+import org.eclipse.rmf.reqif10.SpecHierarchy;
+import org.eclipse.rmf.reqif10.SpecRelation;
+
+/**
+ * Represents the row of a table. A row holds either a SpecHierarchy or a
+ * SpecRelation.
+ *
+ * @author salem
+ *
+ */
+public abstract class ProrRow {
+ final int level;
+ final int row;
+
+ /**
+ * @ requires level >= 0 @ @ requires row >= 0 @
+ */
+ private ProrRow(int row, int level) {
+ this.row = row;
+ this.level = level;
+ }
+
+ abstract public SpecElementWithAttributes getSpecElement();
+
+ @Override
+ public String toString() {
+ return "Row " + row + " Level " + level + " : " + getSpecElement();
+ }
+
+ public int getLevel() {
+ return level;
+ }
+
+ public int getRow() {
+ return row;
+ }
+
+ /**
+ * Factory method, element have to be an instance of SpecHierarchy or
+ * SpecRelation
+ */
+ public static ProrRow createProrRow(Object element, int row, int level) {
+ if (row < 0 || level < 0)
+ throw new IndexOutOfBoundsException("row : " + row + " and level: "
+ + level + " have to be >= 0");
+ if (element instanceof SpecRelation)
+ return (new ProrRowSpecRelation((SpecRelation) element, row, level));
+ else if (element instanceof SpecHierarchy)
+ return (new ProrRowSpecHierarchy((SpecHierarchy) element, row,
+ level));
+
+ else if (element == null)
+ throw new NullPointerException();
+ else
+ throw new IllegalArgumentException(
+ element
+ + " have to be a SpecHierarchy object or a SpecRelation object ");
+ }
+
+ public static class ProrRowSpecHierarchy extends ProrRow {
+ SpecHierarchy element;
+
+ private ProrRowSpecHierarchy(SpecHierarchy element, int row, int level) {
+ super(row, level);
+ this.element = element;
+ }
+
+ public SpecHierarchy getSpecHierarchy() {
+ return element;
+ }
+
+ @Override
+ public SpecElementWithAttributes getSpecElement() {
+ return element.getObject();
+ }
+ }
+
+ public static class ProrRowSpecRelation extends ProrRow {
+ SpecRelation element;
+
+ private ProrRowSpecRelation(SpecRelation element, int row, int level) {
+ super(row, level);
+ this.element = element;
+ }
+
+ @Override
+ public SpecElementWithAttributes getSpecElement() {
+ return element;
+ }
+ }
+
+}
\ No newline at end of file
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/OpenFilesOnStartup.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/OpenFilesOnStartup.java
new file mode 100644
index 0000000..1ec45e7
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/OpenFilesOnStartup.java
@@ -0,0 +1,88 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Formal Mind GmbH and University of Dusseldorf.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Michael Jastram - initial API and implementation
+ ******************************************************************************/
+
+package org.eclipse.rmf.pror.reqif10.editor.presentation;
+
+import java.io.File;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.ui.IStartup;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.ide.IDE;
+
+/**
+ * This class is triggered by an extension points and checks whether an argument
+ * is a .reqif (or .reqifz) file. The idea is that this will ultimately allow
+ * launching a reqif file by double-clicking it.
+ * <p>
+ *
+ * TODO .reqifz is currently not supported yet.
+ *
+ * @author jastram
+ */
+public class OpenFilesOnStartup implements IStartup {
+
+ public void earlyStartup() {
+ final IWorkbench workbench = PlatformUI.getWorkbench();
+ workbench.getDisplay().asyncExec(new Runnable() {
+ public void run() {
+ IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
+ if (window != null) {
+ processCommandLine(window);
+ }
+ }
+ });
+ }
+
+ private void processCommandLine(IWorkbenchWindow window) {
+ String[] args = Platform.getCommandLineArgs();
+ for (String arg : args) {
+ if (arg.toLowerCase().endsWith(".reqif")) {
+ try {
+
+ // First, get the absolute path of the file.
+ File file = new File(arg);
+ if (!file.isAbsolute()) {
+ file = new File(System.getProperty("user.dir"), arg);
+ }
+ if (!file.exists()) {
+ System.out.println("Skipping file, does not exist: "
+ + file);
+ }
+ System.out.println("Trying to open: " + file);
+
+ IFileStore store = EFS.getLocalFileSystem().getStore(
+ new Path(file.getAbsolutePath()));
+
+ IDE.openEditorOnFileStore(window.getActivePage(), store);
+
+ } catch (PartInitException exception) {
+ MessageDialog.openError(window.getShell(),
+ Reqif10EditorPlugin.INSTANCE
+ .getString("_UI_OpenEditorError_label"),
+ exception.getMessage());
+ }
+
+ } else if (arg.toLowerCase().endsWith(".reqifz")) {
+ System.out
+ .println("Not yet supported on command line: .reqifz");
+ }
+ }
+ }
+
+}
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/Reqif10Editor.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/Reqif10Editor.java
index 42fb9f5..9c671ac 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/Reqif10Editor.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/Reqif10Editor.java
@@ -94,7 +94,7 @@
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.rmf.pror.reqif10.configuration.provider.ConfigurationItemProviderAdapterFactory;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationEditorManager;
+import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationServiceManager;
import org.eclipse.rmf.pror.reqif10.editor.propertiesview.ProrPropertySheetPage;
import org.eclipse.rmf.pror.reqif10.provider.ReqIF10ItemProviderAdapterFactory;
import org.eclipse.rmf.pror.reqif10.provider.VirtualDatatypeDefinitionItemProvider;
@@ -1129,7 +1129,8 @@
}
// TODO there must be a better place?
- PresentationEditorManager.notifiyOpenReqif(reqif, editingDomain);
+ PresentationServiceManager.notifiyOpenReqif(reqif, getAdapterFactory(),
+ getEditingDomain());
return reqif;
}
@@ -1797,7 +1798,8 @@
}
// TODO there must be a better place?
- PresentationEditorManager.notifiyCloseReqif(reqif, editingDomain);
+ PresentationServiceManager.notifiyCloseReqif(reqif,
+ getAdapterFactory(), getEditingDomain());
super.dispose();
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/SpecificationEditor.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/SpecificationEditor.java
index 6a6d17a..0cdbd94 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/SpecificationEditor.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/SpecificationEditor.java
@@ -19,6 +19,7 @@
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CommandStack;
import org.eclipse.emf.common.command.CommandStackListener;
+import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.ecore.EObject;
@@ -117,7 +118,8 @@
site.getActionBars().setGlobalActionHandler(
ActionFactory.PRINT.getId(),
- new SpecificationWebPrintAction(specification, reqifEditor.getEditingDomain()));
+ new SpecificationWebPrintAction(specification, reqifEditor
+ .getEditingDomain(), reqifEditor.getAdapterFactory()));
}
/**
@@ -444,4 +446,8 @@
return reqifActionBarContributor;
}
+ public AdapterFactory getAdapterFactory() {
+ return reqifEditor.getAdapterFactory();
+ }
+
}
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/AbstractPresentationService.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/AbstractPresentationService.java
index 43c041c..cbec8e7 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/AbstractPresentationService.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/AbstractPresentationService.java
@@ -10,59 +10,29 @@
******************************************************************************/
package org.eclipse.rmf.pror.reqif10.editor.presentation.service;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.agilemore.agilegrid.AgileGrid;
-import org.agilemore.agilegrid.CellEditor;
-import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
-import org.eclipse.rmf.reqif10.AttributeValue;
-import org.eclipse.rmf.reqif10.ReqIF;
+import org.eclipse.rmf.pror.reqif10.edit.presentation.service.PresentationInterface;
-public abstract class AbstractPresentationService extends AdapterImpl implements PresentationService {
+/**
+ * This abstract class is provided to make life for Presentation creators
+ * easier. Just subclass it and modify where you see fit.
+ *
+ * @author jastram
+ *
+ */
+public abstract class AbstractPresentationService extends AdapterImpl implements PresentationInterface {
- // This map contains all open ReqIF models and the corresponding editing
- // domain. This map is needed for updating changed keywords.
- protected final Map<ReqIF, EditingDomain> openReqIfModels = new HashMap<ReqIF, EditingDomain>();
-
+ private Class<? extends ProrPresentationConfiguration> configInterface;
+
public Class<? extends ProrPresentationConfiguration> getConfigurationInterface() {
- return getConfigurationInstance().getClass();
+ if (configInterface == null) {
+ configInterface = getConfigurationInstance().getClass();
+ }
+ return configInterface;
}
+ /* Override, as indicated by the interface's Javadoc */
public abstract ProrPresentationConfiguration getConfigurationInstance();
- public void openReqif(ReqIF reqif, EditingDomain domain) {
- openReqIfModels.put(reqif, domain);
- }
-
- public void closeReqif(ReqIF reqif, EditingDomain domain) {
- openReqIfModels.remove(reqif);
- }
-
- public Command handleDragAndDrop(Collection<?> source, Object target,
- EditingDomain editingDomain, int operation) {
- return null;
- }
-
- public IProrCellRenderer getCellRenderer(AttributeValue av) {
- return null;
- }
-
- public String getLabel(AttributeValue av) {
- return null;
- }
-
- public CellEditor getCellEditor(AgileGrid agileGrid,
- EditingDomain editingDomain, AttributeValue attrValue, Object affectedObject) {
- return null;
- }
-
- public boolean canEdit() {
- return false;
- }
-
}
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/IProrCellRenderer.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/IProrCellRenderer.java
index 222e9da..a9fb1b4 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/IProrCellRenderer.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/IProrCellRenderer.java
@@ -10,6 +10,7 @@
******************************************************************************/
package org.eclipse.rmf.pror.reqif10.editor.presentation.service;
+import org.eclipse.rmf.reqif10.AttributeValue;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Rectangle;
@@ -35,6 +36,6 @@
*
* @return the HTML representing the value.
*/
- String doDrawHtmlContent(Object value);
+ String doDrawHtmlContent(AttributeValue value);
}
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/PresentationEditorInterface.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/PresentationEditorInterface.java
new file mode 100644
index 0000000..d5a1809
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/PresentationEditorInterface.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2012 Formal Mind GmbH and University of Dusseldorf.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Michael Jastram - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.rmf.pror.reqif10.editor.presentation.service;
+
+import java.util.Collection;
+
+import org.agilemore.agilegrid.AgileGrid;
+import org.agilemore.agilegrid.CellEditor;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.rmf.pror.reqif10.util.PresentationEditInterface;
+import org.eclipse.rmf.reqif10.AttributeDefinition;
+import org.eclipse.rmf.reqif10.AttributeValue;
+import org.eclipse.rmf.reqif10.DatatypeDefinition;
+import org.eclipse.rmf.reqif10.ReqIF;
+
+/**
+ * Interface that Presentation-Plugins must implement to provide relevant
+ * information to the System. The application will instantiate exactly one
+ * PresentationService per Presentation Plugin.
+ * <p>
+ *
+ * For your convenience, you can extend {@link AbstractPresentationService},
+ * which provides default implementations for most methods.
+ * <p>
+ *
+ * Upon opening a ReqIF document, {@link #openReqif(ReqIF)} is called which
+ * allows the Presentation to do stuff (e.g. check the model, hook in listeners,
+ * etc.).
+ * <p>
+ *
+ * Each {@link ReqIF} may contain any number of configuration elements that are
+ * typically associated with {@link DatatypeDefinition}s. This class acts as a
+ * factory for those through {@link #getConfigurationInstance()}.
+ * <p>
+ *
+ * Presentations may support Drag & Drop (into the ReqIF Model). The system will
+ * ask all Presentations to handle drag & drop until it finds one that returns
+ * true on {@link #handleDragAndDrop(Collection, Object, EditingDomain)}.
+ * <p>
+ *
+ * The service provides some stateless information about the Presentation,
+ * specifically:
+ * <ul>
+ * <li> {@link #getConfigurationInterface()} returns the Interface for the class
+ * that holds the configuration of this Presentation.
+ * <li> {@link #isReadOnly()} indicates whether the control for rendering should
+ * allow editing as well.
+ * </ul>
+ * <p>
+ *
+ * Note that this interface simply aggregates {@link PresentationEditInterface}
+ * and {@link PresentationEditorInterface}, which are separated as the reside in
+ * two different plugins (the former does not require andy GUI libraries, the
+ * later does).
+ *
+ * @author jastram
+ *
+ */
+public interface PresentationEditorInterface {
+
+ /**
+ * Returns an {@link IProrCellRenderer} appropriate for the
+ * {@link DatatypeDefinition} associated with this configuration. May return
+ * null (then the default renderer is used).
+ *
+ * @return
+ */
+ IProrCellRenderer getCellRenderer(AttributeValue av);
+
+ /**
+ * Returns the {@link CellEditor} appropriate for the
+ * {@link DatatypeDefinition} associated with this configuration. May return
+ * null (then the default renderer is used).
+ *
+ * @param av
+ *
+ * @return
+ */
+ CellEditor getCellEditor(AgileGrid agileGrid, EditingDomain editingDomain,
+ AttributeValue av, Object affectedObject);
+
+ /**
+ * Whether the managed {@link AttributeDefinition}s may be modified.
+ */
+ boolean canEdit();
+
+}
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/PresentationEditorManager.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/PresentationEditorManager.java
deleted file mode 100644
index 87ef491..0000000
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/PresentationEditorManager.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Formal Mind GmbH and University of Dusseldorf.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Michael Jastram - initial API and implementation
- ******************************************************************************/
-package org.eclipse.rmf.pror.reqif10.editor.presentation.service;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
-import org.eclipse.rmf.pror.reqif10.edit.presentation.service.PresentationEditManager;
-import org.eclipse.rmf.pror.reqif10.util.ConfigurationUtil;
-import org.eclipse.rmf.reqif10.AttributeValue;
-import org.eclipse.rmf.reqif10.ReqIF;
-
-/**
- * This class manages installed Presentations (and is therefore independent of
- * open ReqIF Files).
- */
-public class PresentationEditorManager {
-
- public static final String PRESENTATION_EXTENSION_POINT_NAME = "org.eclipse.rmf.pror.reqif10.editor.presentation";
- private static Map<Class<? extends ProrPresentationConfiguration>, PresentationService> presentationServiceRegistry;
-
- // // There is one entry per Plugin
- // private static Set<PresentationData> presentationTypeRegistry;
-
- /**
- * Returns the cached {@link PresentationService} representing all installed
- * Presentation Extensions.
- *
- * We use this method to initialize the presentation service map in the item
- * provider plugin.
- *
- * @return A set of {@link PresentationService}s.
- */
- public static Map<Class<? extends ProrPresentationConfiguration>, PresentationService> getPresentationServiceMap() {
- if (presentationServiceRegistry != null)
- return presentationServiceRegistry;
-
- presentationServiceRegistry = new HashMap<Class<? extends ProrPresentationConfiguration>, PresentationService>();
-
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint extensionPoint = registry
- .getExtensionPoint(PRESENTATION_EXTENSION_POINT_NAME);
- IExtension[] extensions = extensionPoint.getExtensions();
- for (IExtension extension : extensions) {
- IConfigurationElement[] configElements = extension
- .getConfigurationElements();
- for (IConfigurationElement configElement : configElements) {
- try {
- PresentationService service = (PresentationService) configElement
- .createExecutableExtension("service");
- presentationServiceRegistry.put(
- service.getConfigurationInterface(), service);
- PresentationEditManager.addService(
- service.getConfigurationInterface(), service);
- } catch (CoreException e) {
- e.printStackTrace();
- // TODO Error Logging
- }
- }
- }
- return presentationServiceRegistry;
- }
-
- public static PresentationService getPresentationService(
- ProrPresentationConfiguration configuration) {
- for (Class<? extends ProrPresentationConfiguration> clazz : getPresentationServiceMap()
- .keySet()) {
- if (clazz.isInstance(configuration)) {
- return getPresentationServiceMap().get(clazz);
- }
- }
- return null;
- }
-
- /**
- * Upon opening a ReqIF File, this method notifies each
- * {@link PresentationService}.
- *
- * TODO We call this when the Editor is opened, but there must be a better
- * way to do it (register a notifier somewhere...)
- *
- */
- public static void notifiyOpenReqif(ReqIF reqif, EditingDomain domain) {
-
- for (PresentationService service : PresentationEditorManager
- .getPresentationServiceMap().values()) {
- service.openReqif(reqif, domain);
- }
-
- }
-
- /**
- * Upon closing a ReqIF File, this method notifies each
- * {@link PresentationService}.
- *
- * TODO We call this when the Editor is closed, but there must be a better
- * way to do it (register a notifier somewhere...)
- *
- */
- public static void notifiyCloseReqif(ReqIF reqif, EditingDomain domain) {
-
- for (PresentationService service : PresentationEditorManager
- .getPresentationServiceMap().values()) {
- service.closeReqif(reqif, domain);
- }
-
- }
-
- public static PresentationService getPresentationService(
- AttributeValue value, EditingDomain editingDomain) {
- PresentationService service = null;
- ProrPresentationConfiguration config = ConfigurationUtil
- .getPresentationConfig(value, editingDomain);
- if (config != null) {
- service = PresentationEditorManager.getPresentationService(config);
- }
- return service;
-
- }
-
-}
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/PresentationEditorService.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/PresentationEditorService.java
deleted file mode 100644
index 3a6c91a..0000000
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/PresentationEditorService.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package org.eclipse.rmf.pror.reqif10.editor.presentation.service;
-
-import org.agilemore.agilegrid.AgileGrid;
-import org.agilemore.agilegrid.CellEditor;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
-import org.eclipse.rmf.reqif10.AttributeDefinition;
-import org.eclipse.rmf.reqif10.AttributeValue;
-import org.eclipse.rmf.reqif10.DatatypeDefinition;
-import org.eclipse.rmf.reqif10.ReqIF;
-
-public interface PresentationEditorService {
-
- /**
- * Returns the {@link Class} for the subclass of
- * {@link ProRPresentationConfiguration} that is used to configure this
- * Presentation.
- * <p>
- *
- * This can simply be implemented as:
- *
- * <pre>
- * return IdConfiguration.class;
- * </pre>
- */
- public Class<? extends ProrPresentationConfiguration> getConfigurationInterface();
-
- /**
- * Returns a new instance of the {@link ProRPresentationConfiguration}. This
- * can be implemented simply by using the EMF-Factory as follows:
- *
- * <pre>
- * return ####Factory.eINSTANCE.create####Configuration();
- * </pre>
- *
- * Substitute the proper names in Factory and method.
- */
- public ProrPresentationConfiguration getConfigurationInstance();
-
- /**
- * This method is triggered when a new ReqIF is opened, giving the
- * Presentation a chance to interact, e.g. by registering adapters, etc.
- * <p>
- *
- * Please note that this method may be called multiple times, if the
- * Presentation is associated with multiple {@link DatatypeDefinition}s.
- *
- * TODO still true?
- */
- public void openReqif(ReqIF reqif, EditingDomain domain);
-
- /**
- * This method is triggered when a new ReqIF is closed, giving the
- * Presentation a chance to interact, e.g. by unregistering adapters, etc.
- * <p>
- *
- * Please note that this method may be called multiple times, if the
- * Presentation is associated with multiple {@link DatatypeDefinition}s.
- *
- * TODO still true?
- */
- public void closeReqif(ReqIF reqif, EditingDomain domain);
-
- /**
- * Returns an {@link IProrCellRenderer} appropriate for the
- * {@link DatatypeDefinition} associated with this configuration. May return
- * null (then the default renderer is used).
- *
- * @return
- */
- IProrCellRenderer getCellRenderer(AttributeValue av);
-
- /**
- * Returns the {@link CellEditor} appropriate for the
- * {@link DatatypeDefinition} associated with this configuration. May return
- * null (then the default renderer is used).
- *
- * @param av
- *
- * @return
- */
- CellEditor getCellEditor(AgileGrid agileGrid, EditingDomain editingDomain,
- AttributeValue av, Object affectedObject);
-
- /**
- * Whether the managed {@link AttributeDefinition}s may be modified.
- */
- boolean canEdit();
-
-}
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/PresentationService.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/PresentationService.java
deleted file mode 100644
index f99d0f1..0000000
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/PresentationService.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Formal Mind GmbH and University of Dusseldorf.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Michael Jastram - initial API and implementation
- ******************************************************************************/
-package org.eclipse.rmf.pror.reqif10.editor.presentation.service;
-
-import java.util.Collection;
-
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.rmf.pror.reqif10.edit.presentation.service.PresentationEditService;
-import org.eclipse.rmf.reqif10.DatatypeDefinition;
-import org.eclipse.rmf.reqif10.ReqIF;
-
-/**
- * Interface that Presentation-Plugins must implement to provide relevant
- * information to the System. The application will instantiate one
- * PresentationService per Presentation Plugin.
- * <p>
- *
- * Upon opening a ReqIF document, {@link #openReqif(ReqIF)} is called which
- * allows the Presentation to do stuff (e.g. check the model, hook in listeners,
- * etc.).
- * <p>
- *
- * Each {@link ReqIf} may contain any number of configuration elements that are
- * typically associated with {@link DatatypeDefinition}s. This class acts as a
- * factory for those through {@link #getConfigurationInstance()}.
- * <p>
- *
- * Presentations may support Drag & Drop (in both directions). If the system
- * will ask all Presentations to handle drag & drop until it finds one that
- * returns true on {@link #handleDragAndDrop(Collection, Object, EditingDomain)}.
- * <p>
- *
- * The service provides some stateless information about the Presentation,
- * specifically:
- * <ul>
- * <li> {@link #getConfigurationInterface()} returns the Interface for the class
- * that holds the configuration of this Presentation.
- * <li> {@link #isReadOnly()} indicates whether the control for rendering should
- * allow editing as well.
- * </ul>
- *
- * @author jastram
- *
- */
-public interface PresentationService extends PresentationEditorService,
- PresentationEditService {
-}
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/PresentationServiceManager.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/PresentationServiceManager.java
new file mode 100644
index 0000000..8b23ab0
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/presentation/service/PresentationServiceManager.java
@@ -0,0 +1,179 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Formal Mind GmbH and University of Dusseldorf.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Michael Jastram - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.rmf.pror.reqif10.editor.presentation.service;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
+import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfigurations;
+import org.eclipse.rmf.pror.reqif10.configuration.provider.ProrPresentationConfigurationItemProvider;
+import org.eclipse.rmf.pror.reqif10.configuration.provider.ProrPresentationConfigurationsItemProvider;
+import org.eclipse.rmf.pror.reqif10.edit.presentation.service.PresentationManager;
+import org.eclipse.rmf.pror.reqif10.edit.presentation.service.PresentationInterface;
+import org.eclipse.rmf.pror.reqif10.util.ConfigurationUtil;
+import org.eclipse.rmf.pror.reqif10.util.ProrUtil;
+import org.eclipse.rmf.reqif10.AttributeValue;
+import org.eclipse.rmf.reqif10.ReqIF;
+
+/**
+ * This class manages installed Presentations (and is therefore independent of
+ * open ReqIF Files). It is not meant to be instantiated and consists
+ * exclusively of static methods.
+ * <p>
+ *
+ *
+ */
+public class PresentationServiceManager {
+
+ public static final String PRESENTATION_EXTENSION_POINT_NAME = "org.eclipse.rmf.pror.reqif10.editor.presentation";
+
+ private static Map<Class<? extends ProrPresentationConfiguration>, PresentationInterface> presentationServiceRegistry;
+
+ /*
+ * Private default constructor, to ensure that this class is never
+ * instantiated.
+ */
+ private PresentationServiceManager() {
+ throw new InstantiationError(
+ "This class is not designed to be instantiated.");
+ }
+
+ // // There is one entry per Plugin
+ // private static Set<PresentationData> presentationTypeRegistry;
+
+ /**
+ * Returns the cached {@link PresentationInterface} representing all installed
+ * Presentation Extensions.
+ *
+ * We use this method to initialize the presentation service map in the item
+ * provider plugin.
+ *
+ * @return A an unmodifyable map of {@link ProrPresentationConfiguration}
+ * classes and {@link PresentationInterface}s.
+ */
+ public static Map<Class<? extends ProrPresentationConfiguration>, PresentationInterface> getPresentationInterfaceMap() {
+ if (presentationServiceRegistry == null) {
+
+ HashMap<Class<? extends ProrPresentationConfiguration>, PresentationInterface> tmpRegistry = new HashMap<Class<? extends ProrPresentationConfiguration>, PresentationInterface>();
+
+ IExtensionRegistry registry = Platform.getExtensionRegistry();
+ IExtensionPoint extensionPoint = registry
+ .getExtensionPoint(PRESENTATION_EXTENSION_POINT_NAME);
+ IExtension[] extensions = extensionPoint.getExtensions();
+ for (IExtension extension : extensions) {
+ IConfigurationElement[] configElements = extension
+ .getConfigurationElements();
+ for (IConfigurationElement configElement : configElements) {
+ try {
+ PresentationInterface service = (PresentationInterface) configElement
+ .createExecutableExtension("service");
+ tmpRegistry.put(service.getConfigurationInterface(),
+ service);
+ PresentationManager.addService(
+ service.getConfigurationInterface(), service);
+ } catch (CoreException e) {
+ MessageDialog
+ .openError(
+ null,
+ "Plugin Configuration Error",
+ "When initializing the installed plugins, something went wrong. "
+ + "You can continue working, but Presentations may not be activated:"
+ + e.getMessage());
+ e.printStackTrace();
+ }
+ }
+ }
+ presentationServiceRegistry = Collections
+ .unmodifiableMap(tmpRegistry);
+ }
+ return presentationServiceRegistry;
+ }
+
+ /**
+ * Returns the {@link PresentationInterface} for the given
+ * {@link ProrPresentationConfiguration} instance, or null if none found.
+ */
+ public static PresentationInterface getPresentationService(
+ ProrPresentationConfiguration configuration) {
+ for (Class<? extends ProrPresentationConfiguration> clazz : getPresentationInterfaceMap()
+ .keySet()) {
+ if (clazz.isInstance(configuration)) {
+ return getPresentationInterfaceMap().get(clazz);
+ }
+ }
+ return null;
+ }
+
+ /**
+ * Upon opening a ReqIF File, this method notifies each
+ * {@link ProrPresentationConfigurationItemProvider#registerPresentationConfiguration(ReqIF, EditingDomain)}
+ */
+ public static void notifiyOpenReqif(ReqIF reqif,
+ AdapterFactory adapterFactory, EditingDomain editingDomain) {
+
+ ProrPresentationConfigurations configs = ConfigurationUtil
+ .getPresentationConfigurations(reqif);
+ if (configs == null)
+ return;
+
+ ((ProrPresentationConfigurationsItemProvider) ProrUtil.getItemProvider(
+ adapterFactory, configs)).setEditingDomain(editingDomain);
+
+ for (ProrPresentationConfiguration config : configs
+ .getPresentationConfigurations()) {
+ ProrUtil.getConfigItemProvider(config, adapterFactory)
+ .registerPresentationConfiguration(config, editingDomain);
+ }
+ }
+
+ /**
+ * Upon closing a ReqIF File, this method notifies each
+ * {@link ProrPresentationConfigurationItemProvider#unregisterReqIF(ReqIF, EditingDomain)}
+ */
+ public static void notifiyCloseReqif(ReqIF reqif,
+ AdapterFactory adapterFactory, EditingDomain editingDomain) {
+ ProrPresentationConfigurations configs = ConfigurationUtil
+ .getPresentationConfigurations(reqif);
+ if (configs == null)
+ return;
+
+ for (ProrPresentationConfiguration config : configs
+ .getPresentationConfigurations()) {
+ System.out.println("Unregistering: " + config);
+ ProrUtil.getConfigItemProvider(config, adapterFactory)
+ .unregisterPresentationConfiguration(config);
+ }
+ }
+
+ public static PresentationInterface getPresentationService(
+ AttributeValue value, EditingDomain editingDomain) {
+ PresentationInterface service = null;
+ ProrPresentationConfiguration config = ConfigurationUtil
+ .getPresentationConfig(value);
+ if (config != null) {
+ service = PresentationServiceManager.getPresentationService(config);
+ }
+ return service;
+
+ }
+
+}
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/propertiesview/ProrPropertyCellEditorProvider.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/propertiesview/ProrPropertyCellEditorProvider.java
index 1bc209a..5218b9d 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/propertiesview/ProrPropertyCellEditorProvider.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/propertiesview/ProrPropertyCellEditorProvider.java
@@ -30,6 +30,7 @@
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.ui.EMFEditUIPlugin;
import org.eclipse.emf.edit.ui.celleditor.FeatureEditorDialog;
import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
@@ -40,10 +41,10 @@
import org.eclipse.jface.window.Window;
import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
import org.eclipse.rmf.pror.reqif10.editor.agilegrid.AbstractProrCellEditorProvider;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationEditorManager;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationService;
+import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationEditorInterface;
import org.eclipse.rmf.pror.reqif10.editor.propertiesview.ProrPropertyContentProvider.SortedItemPropertyDescriptor;
import org.eclipse.rmf.pror.reqif10.util.ConfigurationUtil;
+import org.eclipse.rmf.pror.reqif10.util.ProrUtil;
import org.eclipse.rmf.reqif10.AttributeValue;
import org.eclipse.rmf.reqif10.SpecHierarchy;
import org.eclipse.swt.SWT;
@@ -80,24 +81,40 @@
@Override
public boolean canEdit(int row, int col) {
- AttributeValue attrValue = getAttributeValue(row, col);
- if (attrValue != null) {
- PresentationService service = PresentationEditorManager
- .getPresentationService(attrValue, editingDomain);
- return service == null ? true : service.canEdit();
+ AttributeValue av = getAttributeValue(row, col);
+
+ // If we have an attribute value, use default method in extended class
+ if (av != null) {
+
+ // Consult the presentation
+ ProrPresentationConfiguration config = ConfigurationUtil
+ .getPresentationConfiguration(av);
+ if (config != null) {
+ ItemProviderAdapter ip = ProrUtil.getItemProvider(
+ adapterFactory, config);
+ if (ip instanceof PresentationEditorInterface) {
+ return ((PresentationEditorInterface) ip).canEdit();
+ }
+ }
+
} else {
+
+ // Else we have an EMF specific attribute use the corresponding
+ // method of the item property descriptor
SortedItemPropertyDescriptor itemPropertyDescriptor = this.contentProvider
.getItemPropertyDescriptor(row);
if (itemPropertyDescriptor != null) {
IItemPropertyDescriptor descriptor = itemPropertyDescriptor
.getItemPropertyDescriptor();
- if (descriptor != null)
+ if (descriptor != null) {
return descriptor.canSetProperty(this.contentProvider
.getElement());
+ }
}
+
}
- return false;
+ return true;
}
@@ -113,13 +130,17 @@
// when try to get the presentation service
if (attrValue != null) {
+ // Ask Presentation
ProrPresentationConfiguration config = ConfigurationUtil
- .getPresentationConfig(attrValue, editingDomain);
+ .getPresentationConfiguration(attrValue);
if (config != null) {
- PresentationService service = PresentationEditorManager.getPresentationService(config);
- if (service != null)
- cellEditor = service.getCellEditor(agileGrid,
- editingDomain, attrValue, getAffectedElement(row, col));
+ ItemProviderAdapter ip = ProrUtil.getItemProvider(
+ adapterFactory, config);
+ if (ip instanceof PresentationEditorInterface) {
+ cellEditor = ((PresentationEditorInterface) ip)
+ .getCellEditor(agileGrid, editingDomain, attrValue,
+ getAffectedElement(row, col));
+ }
}
if (cellEditor == null)
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/propertiesview/ProrPropertyCellRenderer.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/propertiesview/ProrPropertyCellRenderer.java
index 6a1e9f4..f3fbc3d 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/propertiesview/ProrPropertyCellRenderer.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/propertiesview/ProrPropertyCellRenderer.java
@@ -14,15 +14,15 @@
import org.agilemore.agilegrid.AgileGrid;
import org.agilemore.agilegrid.DefaultLayoutAdvisor;
import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
import org.eclipse.rmf.pror.reqif10.editor.agilegrid.AbstractProrCellRenderer;
import org.eclipse.rmf.pror.reqif10.editor.presentation.service.IProrCellRenderer;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationEditorManager;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationService;
+import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationEditorInterface;
import org.eclipse.rmf.pror.reqif10.util.ConfigurationUtil;
+import org.eclipse.rmf.pror.reqif10.util.ProrUtil;
import org.eclipse.rmf.reqif10.AttributeValue;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Image;
@@ -30,12 +30,9 @@
public class ProrPropertyCellRenderer extends AbstractProrCellRenderer {
- private EditingDomain editingDomain;
-
public ProrPropertyCellRenderer(AgileGrid agileGrid,
- AdapterFactory adapterFactory, EditingDomain editingDomain) {
+ AdapterFactory adapterFactory) {
super(agileGrid, adapterFactory);
- this.editingDomain = editingDomain;
}
@Override
@@ -48,25 +45,26 @@
ProrPropertyContentProvider contentProvider = (ProrPropertyContentProvider) agileGrid
.getContentProvider();
- AttributeValue atrVal = contentProvider.getReqIfAttributeValue(row);
+ AttributeValue av = contentProvider.getReqIfAttributeValue(row);
// Get the default row height
int initRowHeight = ((DefaultLayoutAdvisor) agileGrid
.getLayoutAdvisor()).getInitialRowHeight(row);
int newRowHeight = initRowHeight;
- if (atrVal != null) {
+ if (av != null) {
IProrCellRenderer renderer = null;
- // Try to get cell renderer from presentation extension
- // point
+ // Try to get cell renderer from presentation
ProrPresentationConfiguration config = ConfigurationUtil
- .getPresentationConfig(atrVal, editingDomain);
+ .getPresentationConfiguration(av);
if (config != null) {
- PresentationService service = PresentationEditorManager
- .getPresentationService(config);
- if (service != null)
- renderer = service.getCellRenderer(atrVal);
+ ItemProviderAdapter ip = ProrUtil.getItemProvider(
+ adapterFactory, config);
+ if (ip instanceof PresentationEditorInterface) {
+ renderer = ((PresentationEditorInterface) ip)
+ .getCellRenderer(av);
+ }
}
// Check if the have a renderer from presentation extension
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/propertiesview/ProrPropertyCellRendererProvider.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/propertiesview/ProrPropertyCellRendererProvider.java
index 469be91..e280635 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/propertiesview/ProrPropertyCellRendererProvider.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/propertiesview/ProrPropertyCellRendererProvider.java
@@ -17,7 +17,6 @@
import org.agilemore.agilegrid.SWTResourceManager;
import org.agilemore.agilegrid.renderers.TextCellRenderer;
import org.eclipse.emf.common.notify.AdapterFactory;
-import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
import org.eclipse.rmf.pror.reqif10.editor.propertiesview.ProrPropertyContentProvider.ItemCategory;
@@ -36,9 +35,11 @@
// The cell renderer for category rows
private final TextCellRenderer categoryCellRenderer;
- public ProrPropertyCellRendererProvider(AgileGrid agileGrid, AdapterFactory adapterFactory, EditingDomain editingDomain) {
+ public ProrPropertyCellRendererProvider(AgileGrid agileGrid,
+ AdapterFactory adapterFactory) {
super(agileGrid);
- this.attributeCellRenderer = new ProrPropertyCellRenderer(agileGrid, adapterFactory, editingDomain);
+ this.attributeCellRenderer = new ProrPropertyCellRenderer(agileGrid,
+ adapterFactory);
this.categoryCellRenderer = new TextCellRenderer(agileGrid, SWT.BOLD);
this.categoryCellRenderer.setDefaultBackground(SWTResourceManager
.getColor(SWT.COLOR_WIDGET_BACKGROUND));
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/propertiesview/ProrPropertyControl.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/propertiesview/ProrPropertyControl.java
index 64c06cb..4ee6a48 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/propertiesview/ProrPropertyControl.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/propertiesview/ProrPropertyControl.java
@@ -34,7 +34,7 @@
this.contentProvider = new ProrPropertyContentProvider(editingDomain, showAllProps);
setContentProvider(this.contentProvider);
setCellRendererProvider(new ProrPropertyCellRendererProvider(this,
- adapterFactory, editingDomain));
+ adapterFactory));
setLayoutAdvisor(new ProrPropertyLayoutAdvisor(this));
setCellEditorProvider(new ProrPropertyCellEditorProvider(this,
adapterFactory, editingDomain, this.contentProvider));
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/util/ProrEditorUtil.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/util/ProrEditorUtil.java
index f44da61..9af6a8a 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/util/ProrEditorUtil.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/util/ProrEditorUtil.java
@@ -16,14 +16,16 @@
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CommandWrapper;
+import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.rmf.pror.reqif10.configuration.Column;
import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
import org.eclipse.rmf.pror.reqif10.configuration.ProrSpecViewConfiguration;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationEditorManager;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationService;
+import org.eclipse.rmf.pror.reqif10.editor.presentation.service.IProrCellRenderer;
+import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationEditorInterface;
import org.eclipse.rmf.pror.reqif10.util.ConfigurationUtil;
+import org.eclipse.rmf.pror.reqif10.util.ProrUtil;
import org.eclipse.rmf.reqif10.AttributeValue;
import org.eclipse.rmf.reqif10.DatatypeDefinition;
import org.eclipse.rmf.reqif10.EnumValue;
@@ -34,9 +36,11 @@
public class ProrEditorUtil {
- private static String createHtmlHeader(Specification spec) {
+ private static String createHtmlHeader(Specification spec,
+ AdapterFactory adapterFactory) {
StringBuilder sb = new StringBuilder();
- String title = ConfigurationUtil.getSpecElementLabel(spec);
+ String title = ConfigurationUtil.getSpecElementLabel(spec,
+ adapterFactory);
sb.append("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
sb.append("<html>\n");
@@ -81,8 +85,8 @@
private static void printRecursive(StringBuilder html,
ProrSpecViewConfiguration config, int indent,
- EList<SpecHierarchy> children, EditingDomain domain,
- List<PresentationService> presentations) {
+ EList<SpecHierarchy> children,
+ AdapterFactory adapterFactory) {
for (SpecHierarchy child : children) {
if (child.getObject() != null) {
SpecObject specObject = child.getObject();
@@ -91,7 +95,7 @@
for (Column col : config.getColumns()) {
html.append("<td valign='top'>");
- // Handle indenting TODO use something better than spaces.
+ // Handle indenting
if (first) {
html.append("<div style='margin-left: " + (indent * 20)
+ "px;'>");
@@ -101,27 +105,24 @@
DatatypeDefinition dd = ReqIF10Util
.getDatatypeDefinition(av);
ProrPresentationConfiguration configuration = ConfigurationUtil
- .getConfiguration(dd, domain);
+ .getPresentationConfiguration(dd);
- if (configuration != null) {
-
- PresentationService service = null;
+ Object itemProvider = ProrUtil.getItemProvider(
+ adapterFactory, configuration);
- if (presentations != null) {
- for (PresentationService serv : presentations) {
- if (serv.getConfigurationInterface()
- .isInstance(configuration))
- service = serv;
+ if (itemProvider instanceof PresentationEditorInterface) {
+ PresentationEditorInterface presentationEditor = (PresentationEditorInterface) itemProvider;
+ IProrCellRenderer renderer = presentationEditor
+ .getCellRenderer(av);
+ if (renderer != null) {
+ String content = renderer.doDrawHtmlContent(av);
+ if (content != null) {
+ html.append(content);
+ } else {
+ html.append(getDefaultValue(av));
}
- } else {
- service = PresentationEditorManager
- .getPresentationService(configuration);
}
- if (service != null)
- html.append(service.getCellRenderer(av)
- .doDrawHtmlContent(av));
-
} else {
html.append(getDefaultValue(av));
}
@@ -135,39 +136,34 @@
html.append("</tr>\n");
}
printRecursive(html, config, indent + 1, child.getChildren(),
- domain, presentations);
+ adapterFactory);
}
}
public static String createHtmlContent(Specification spec,
- EditingDomain domain) {
- return createHtmlContent(spec, domain, null);
- }
-
- public static String createHtmlContent(Specification spec,
- EditingDomain domain, List<PresentationService> presentations) {
+ EditingDomain domain, AdapterFactory adapterFactory) {
ProrSpecViewConfiguration config = ConfigurationUtil
- .getSpecViewConfiguration(spec, domain);
+ .createSpecViewConfiguration(spec, domain);
StringBuilder html = new StringBuilder();
// Draw the header
- html.append(ProrEditorUtil.createHtmlHeader(spec));
+ html.append(ProrEditorUtil.createHtmlHeader(spec, adapterFactory));
html.append("<table><tr>");
EList<Column> cols = config.getColumns();
for (Column col : cols) {
html.append("<td><b>" + col.getLabel() + "</b></td>");
}
html.append("</tr>\n");
- printRecursive(html, config, 0, spec.getChildren(), domain,
- presentations);
+ printRecursive(html, config, 0, spec.getChildren(),
+ adapterFactory);
html.append("</table>");
return html.toString();
}
-
+
public static Command getAffectedObjectCommand(final Object element,
Command cmd) {
return new CommandWrapper(cmd) {
diff --git a/org.eclipse.rmf.pror.reqif10.feature/feature.xml b/org.eclipse.rmf.pror.reqif10.feature/feature.xml
index 68f357f..4f3a70a 100644
--- a/org.eclipse.rmf.pror.reqif10.feature/feature.xml
+++ b/org.eclipse.rmf.pror.reqif10.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.rmf.pror.reqif10.feature"
label="RMF ProR Feature (Incubation)"
- version="0.3.2.qualifier"
+ version="0.4.0.qualifier"
provider-name="Eclipse Modeling Project"
plugin="org.eclipse.rmf.pror.reqif10">
@@ -29,12 +29,8 @@
<discovery label="RMF at Eclipse.org" url="http://eclipse.org/rmf"/>
</url>
- <includes
- id="org.eclipse.rmf.reqif10.feature"
- version="0.0.0"/>
-
<requires>
- <import feature="org.eclipse.rmf.reqif10.feature" version="0.3.2.qualifier"/>
+ <import feature="org.eclipse.rmf.reqif10.feature" version="0.4.0" match="greaterOrEqual"/>
</requires>
<plugin
diff --git a/org.eclipse.rmf.pror.reqif10.feature/pom.xml b/org.eclipse.rmf.pror.reqif10.feature/pom.xml
index 5a175bd..21b2069 100644
--- a/org.eclipse.rmf.pror.reqif10.feature/pom.xml
+++ b/org.eclipse.rmf.pror.reqif10.feature/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.pror.reqif10.feature</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
<groupId>org.eclipse.rmf.features</groupId>
</project>
\ No newline at end of file
diff --git a/org.eclipse.rmf.pror.reqif10.genhtml/META-INF/MANIFEST.MF b/org.eclipse.rmf.pror.reqif10.genhtml/META-INF/MANIFEST.MF
index 7eba1dd..5d19471 100644
--- a/org.eclipse.rmf.pror.reqif10.genhtml/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.pror.reqif10.genhtml/META-INF/MANIFEST.MF
@@ -3,15 +3,15 @@
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.pror.reqif10.genhtml
Bundle-Localization: plugin
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-Activator: org.eclipse.rmf.pror.reqif10.genhtml.Activator
Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.rmf.reqif10;bundle-version="0.3.2",
- org.eclipse.rmf.serialization;bundle-version="0.3.2",
- org.eclipse.rmf.pror.reqif10.presentation.headline;bundle-version="0.3.2",
- org.eclipse.rmf.pror.reqif10.presentation.id;bundle-version="0.3.2",
- org.eclipse.rmf.pror.reqif10.presentation.linewrap;bundle-version="0.3.2",
- org.eclipse.rmf.pror.reqif10.editor;bundle-version="0.3.2"
+ org.eclipse.rmf.reqif10;bundle-version="0.4.0",
+ org.eclipse.rmf.serialization;bundle-version="0.4.0",
+ org.eclipse.rmf.pror.reqif10.presentation.headline;bundle-version="0.4.0",
+ org.eclipse.rmf.pror.reqif10.presentation.id;bundle-version="0.4.0",
+ org.eclipse.rmf.pror.reqif10.presentation.linewrap;bundle-version="0.4.0",
+ org.eclipse.rmf.pror.reqif10.editor;bundle-version="0.4.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %providerName
diff --git a/org.eclipse.rmf.pror.reqif10.genhtml/pom.xml b/org.eclipse.rmf.pror.reqif10.genhtml/pom.xml
index 62df652..91461f4 100644
--- a/org.eclipse.rmf.pror.reqif10.genhtml/pom.xml
+++ b/org.eclipse.rmf.pror.reqif10.genhtml/pom.xml
@@ -6,12 +6,12 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<groupId>org.eclipse.rmf.plugins</groupId>
<artifactId>org.eclipse.rmf.pror.reqif10.genhtml</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<!--build>
<sourceDirectory>src</sourceDirectory>
diff --git a/org.eclipse.rmf.pror.reqif10.genhtml/src/org/eclipse/rmf/pror/reqif10/genhtml/GenerateHtml.java b/org.eclipse.rmf.pror.reqif10.genhtml/src/org/eclipse/rmf/pror/reqif10/genhtml/GenerateHtml.java
index ebc614a..3006545 100644
--- a/org.eclipse.rmf.pror.reqif10.genhtml/src/org/eclipse/rmf/pror/reqif10/genhtml/GenerateHtml.java
+++ b/org.eclipse.rmf.pror.reqif10.genhtml/src/org/eclipse/rmf/pror/reqif10/genhtml/GenerateHtml.java
@@ -17,8 +17,6 @@
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;
-import java.util.ArrayList;
-import java.util.List;
import java.util.Map;
import org.eclipse.emf.common.command.BasicCommandStack;
@@ -28,15 +26,11 @@
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
-import org.eclipse.rmf.pror.presentation.headline.ui.HeadlinePresentationService;
import org.eclipse.rmf.pror.presentation.headline.util.HeadlineAdapterFactory;
import org.eclipse.rmf.pror.presentation.linewrap.util.LinewrapAdapterFactory;
-import org.eclipse.rmf.pror.presentation.ui.LinewrapPresentationService;
import org.eclipse.rmf.pror.reqif10.configuration.util.ConfigurationAdapterFactory;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationService;
import org.eclipse.rmf.pror.reqif10.editor.util.ProrEditorUtil;
import org.eclipse.rmf.pror.reqif10.presentation.id.util.IdAdapterFactory;
-import org.eclipse.rmf.pror.reqif10.presentation.ui.IDPresentationService;
import org.eclipse.rmf.pror.reqif10.provider.ReqIF10ItemProviderAdapterFactory;
import org.eclipse.rmf.pror.reqif10.xhtml.provider.XhtmlItemProviderAdapterFactory;
import org.eclipse.rmf.reqif10.ReqIF;
@@ -46,6 +40,15 @@
import org.eclipse.rmf.serialization.ReqIFResourceImpl;
import org.eclipse.rmf.serialization.ReqIFResourceSetImpl;
+/**
+ * Standalone-executable class that is used to non-interactively generate HTML
+ * from .reqif files. This is used, for instance, to generate viewable
+ * specifications on the Eclipse Jenkins build system.
+ *
+ * @author ladenberger
+ * @author jastram
+ *
+ */
public class GenerateHtml {
public static void main(String[] args) throws FileNotFoundException,
@@ -97,18 +100,9 @@
int mid = fileName.lastIndexOf(".");
String fname = fileName.substring(0, mid);
- List<PresentationService> presentations = new ArrayList<PresentationService>();
- presentations
- .add(new LinewrapPresentationService());
- presentations
- .add(new HeadlinePresentationService());
- presentations.add(new IDPresentationService());
-
- // String ext = fileName.substring(mid + 1,
- // fileName.length());
String createHtmlHeader = ProrEditorUtil
.createHtmlContent(spec, editingDomain,
- presentations);
+ adapterFactory);
System.out
.println("===> Generate HTML file for Loading ReqIF file "
+ file.getName());
diff --git a/org.eclipse.rmf.pror.reqif10.help.ui/META-INF/MANIFEST.MF b/org.eclipse.rmf.pror.reqif10.help.ui/META-INF/MANIFEST.MF
index 2414e01..a42767b 100644
--- a/org.eclipse.rmf.pror.reqif10.help.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.pror.reqif10.help.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.pror.reqif10.help.ui;singleton:=true
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.help
Bundle-Vendor: %providerName
diff --git a/org.eclipse.rmf.pror.reqif10.help.ui/pom.xml b/org.eclipse.rmf.pror.reqif10.help.ui/pom.xml
index edc5c8d..7517907 100644
--- a/org.eclipse.rmf.pror.reqif10.help.ui/pom.xml
+++ b/org.eclipse.rmf.pror.reqif10.help.ui/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.pror.reqif10.help.ui</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<groupId>org.eclipse.rmf.plugins</groupId>
<build>
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.headline/META-INF/MANIFEST.MF b/org.eclipse.rmf.pror.reqif10.presentation.headline/META-INF/MANIFEST.MF
index cb5ce27..2358553 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.headline/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.pror.reqif10.presentation.headline/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.pror.reqif10.presentation.headline;singleton:=true
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.rmf.pror.presentation.headline.provider.HeadlineEditPlugin$Implementation
Bundle-Vendor: %providerName
@@ -13,6 +13,6 @@
org.eclipse.rmf.pror.presentation.headline.provider,
org.eclipse.rmf.pror.presentation.headline.ui,
org.eclipse.rmf.pror.presentation.headline.util
-Require-Bundle: org.eclipse.rmf.pror.reqif10.editor;bundle-version="0.3.2"
+Require-Bundle: org.eclipse.rmf.pror.reqif10.editor;bundle-version="0.4.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.headline/pom.xml b/org.eclipse.rmf.pror.reqif10.presentation.headline/pom.xml
index d423be5..f2b7626 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.headline/pom.xml
+++ b/org.eclipse.rmf.pror.reqif10.presentation.headline/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.pror.reqif10.presentation.headline</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<groupId>org.eclipse.rmf.plugins</groupId>
<build>
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.headline/src/org/eclipse/rmf/pror/presentation/headline/provider/HeadlineConfigurationItemProvider.java b/org.eclipse.rmf.pror.reqif10.presentation.headline/src/org/eclipse/rmf/pror/presentation/headline/provider/HeadlineConfigurationItemProvider.java
index a31a637..e105577 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.headline/src/org/eclipse/rmf/pror/presentation/headline/provider/HeadlineConfigurationItemProvider.java
+++ b/org.eclipse.rmf.pror.reqif10.presentation.headline/src/org/eclipse/rmf/pror/presentation/headline/provider/HeadlineConfigurationItemProvider.java
@@ -13,11 +13,21 @@
import java.util.Collection;
+import java.util.Iterator;
import java.util.List;
+import org.agilemore.agilegrid.AgileGrid;
+import org.agilemore.agilegrid.CellEditor;
+import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
+import org.eclipse.emf.common.notify.impl.NotificationImpl;
+import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
@@ -29,7 +39,17 @@
import org.eclipse.emf.edit.provider.ViewerNotification;
import org.eclipse.rmf.pror.presentation.headline.HeadlineConfiguration;
import org.eclipse.rmf.pror.presentation.headline.HeadlinePackage;
+import org.eclipse.rmf.pror.presentation.headline.ui.HeadlineCellRenderer;
+import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
import org.eclipse.rmf.pror.reqif10.configuration.provider.ProrPresentationConfigurationItemProvider;
+import org.eclipse.rmf.pror.reqif10.editor.presentation.service.IProrCellRenderer;
+import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationEditorInterface;
+import org.eclipse.rmf.reqif10.AttributeValue;
+import org.eclipse.rmf.reqif10.DatatypeDefinition;
+import org.eclipse.rmf.reqif10.SpecHierarchy;
+import org.eclipse.rmf.reqif10.Specification;
+import org.eclipse.rmf.reqif10.common.util.ReqIF10Util;
+import org.eclipse.rmf.reqif10.util.ReqIF10Switch;
/**
* This is the item provider adapter for a {@link org.eclipse.rmf.pror.presentation.headline.HeadlineConfiguration} object.
@@ -44,7 +64,8 @@
IStructuredItemContentProvider,
ITreeItemContentProvider,
IItemLabelProvider,
- IItemPropertySource {
+ IItemPropertySource,
+ PresentationEditorInterface {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
@@ -162,4 +183,108 @@
return HeadlineEditPlugin.INSTANCE;
}
+ public void registerPresentationConfiguration(ProrPresentationConfiguration config,
+ EditingDomain editingDomain) {
+ // No action required.
+ }
+
+ public void unregisterPresentationConfiguration(ProrPresentationConfiguration config) {
+ // No action required.
+ }
+
+ public Command handleDragAndDrop(Collection<?> source, Object target,
+ EditingDomain editingDomain, int operation) {
+ // No dnd support
+ return null;
+ }
+
+ public String getLabel(AttributeValue av) {
+ // no custom label
+ return null;
+ }
+
+ /**
+ * Allow editing
+ */
+ public boolean canEdit() {
+ return true;
+ }
+
+ private HeadlineCellRenderer headlineCellRenderer;
+
+ /**
+ * Lazily creates the renderer and tracks them on a per-configuration basis.
+ */
+ public IProrCellRenderer getCellRenderer(final AttributeValue av) {
+ if (headlineCellRenderer == null) {
+ headlineCellRenderer = createRenderer();
+ }
+ return headlineCellRenderer;
+ }
+
+ private HeadlineCellRenderer createRenderer() {
+ // Only works if this itemProvider is stateful (via model generator)
+ final HeadlineConfiguration config = (HeadlineConfiguration) getTarget();
+ DatatypeDefinition dd = config.getDatatype();
+
+
+ headlineCellRenderer = new HeadlineCellRenderer(dd.getIdentifier());
+ headlineCellRenderer.setFontSize(config.getSize());
+
+ // Register for notifications
+ config.eAdapters().add(new AdapterImpl() {
+ @Override
+ public void notifyChanged(Notification msg) {
+ // React to size changes
+ switch (msg.getFeatureID(HeadlineConfiguration.class)) {
+ case HeadlinePackage.HEADLINE_CONFIGURATION__SIZE:
+ headlineCellRenderer.setFontSize(msg.getNewIntValue());
+ refreshUi(config.getDatatype());
+ break;
+ case HeadlinePackage.HEADLINE_CONFIGURATION__DATATYPE:
+ if (msg.getNewValue() != null)
+ headlineCellRenderer
+ .setDatatypeId(((DatatypeDefinition) msg
+ .getNewValue()).getIdentifier());
+ refreshUi(config.getDatatype());
+ default:
+ break;
+ }
+ }
+ });
+
+ return headlineCellRenderer;
+ }
+
+ public CellEditor getCellEditor(AgileGrid agileGrid,
+ EditingDomain editingDomain, AttributeValue av,
+ Object affectedObject) {
+ // No custom cell editor
+ return null;
+ }
+
+ /**
+ * Called when the font size or {@link DatatypeDefinition} change.
+ */
+ @SuppressWarnings("rawtypes")
+ private void refreshUi(DatatypeDefinition dd) {
+ if (dd == null)
+ return;
+ ReqIF10Switch visitor = new ReqIF10Switch() {
+ @Override
+ public Object caseSpecHierarchy(SpecHierarchy object) {
+ Notification n = new NotificationImpl(Notification.SET,
+ object.getObject(), object.getObject());
+ object.eNotify(new ViewerNotification(n));
+ return super.caseSpecHierarchy(object);
+ }
+ };
+ EList<Specification> roots = ReqIF10Util.getReqIF(dd).getCoreContent()
+ .getSpecifications();
+ for (Iterator i = EcoreUtil.getAllProperContents(roots, true); i
+ .hasNext();) {
+ visitor.doSwitch((EObject) i.next());
+ }
+ }
+
}
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.headline/src/org/eclipse/rmf/pror/presentation/headline/ui/HeadlineCellRenderer.java b/org.eclipse.rmf.pror.reqif10.presentation.headline/src/org/eclipse/rmf/pror/presentation/headline/ui/HeadlineCellRenderer.java
index 9746bb8..f280bcd 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.headline/src/org/eclipse/rmf/pror/presentation/headline/ui/HeadlineCellRenderer.java
+++ b/org.eclipse.rmf.pror.reqif10.presentation.headline/src/org/eclipse/rmf/pror/presentation/headline/ui/HeadlineCellRenderer.java
@@ -13,6 +13,7 @@
import org.eclipse.jface.resource.FontRegistry;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.rmf.pror.reqif10.editor.presentation.service.IProrCellRenderer;
+import org.eclipse.rmf.reqif10.AttributeValue;
import org.eclipse.rmf.reqif10.AttributeValueSimple;
import org.eclipse.rmf.reqif10.common.util.ReqIF10Util;
import org.eclipse.swt.SWT;
@@ -23,29 +24,23 @@
public class HeadlineCellRenderer implements IProrCellRenderer {
- private String PROR_HEADLINE_FONT = "pror_headline_font-";
+ private String fontHandle = "pror_headline_font-";
private Font font;
private int fontSize;
private boolean fontSizeChanged = false;
public HeadlineCellRenderer(String identifier) {
- this.PROR_HEADLINE_FONT = "pror_headline_font-" + identifier;
+ this.fontHandle = "pror_headline_font-" + identifier;
}
public void setDatatypeId(String identifier) {
- this.PROR_HEADLINE_FONT = "pror_headline_font-" + identifier;
+ this.fontHandle = "pror_headline_font-" + identifier;
setFontSize(fontSize);
-
}
public void setFontSize(final int fontSize) {
this.fontSize = fontSize;
this.fontSizeChanged = true;
- // TODO: commented out, since maven java invoke can not handle UI
- // PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
- // public void run() {
- // }
- // });
}
public int doDrawCellContent(GC gc, Rectangle rect, Object value) {
@@ -55,13 +50,11 @@
text = ReqIF10Util.getTheValue(av).toString();
}
- if (font == null || fontSizeChanged) {
+ if (font == null || font.isDisposed() || fontSizeChanged) {
FontRegistry fr = JFaceResources.getFontRegistry();
FontData[] fontData = { new FontData("Arial", fontSize, SWT.BOLD) };
- if (font != null)
- font.dispose();
- fr.put(PROR_HEADLINE_FONT, fontData);
- font = fr.get(PROR_HEADLINE_FONT);
+ fr.put(fontHandle + this, fontData);
+ font = fr.get(fontHandle + this);
fontSizeChanged = false;
}
@@ -70,7 +63,7 @@
return gc.textExtent(text).y;
}
- public String doDrawHtmlContent(Object value) {
+ public String doDrawHtmlContent(AttributeValue value) {
AttributeValueSimple av = (AttributeValueSimple) value;
return "<div style='font-size: " + fontSize
+ "pt; font-weight: bold; padding-top: 4pt;'>"
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.headline/src/org/eclipse/rmf/pror/presentation/headline/ui/HeadlinePresentationService.java b/org.eclipse.rmf.pror.reqif10.presentation.headline/src/org/eclipse/rmf/pror/presentation/headline/ui/HeadlinePresentationService.java
index 4f75712..66d5ca4 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.headline/src/org/eclipse/rmf/pror/presentation/headline/ui/HeadlinePresentationService.java
+++ b/org.eclipse.rmf.pror.reqif10.presentation.headline/src/org/eclipse/rmf/pror/presentation/headline/ui/HeadlinePresentationService.java
@@ -10,110 +10,16 @@
******************************************************************************/
package org.eclipse.rmf.pror.presentation.headline.ui;
-import java.util.Iterator;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.common.notify.impl.NotificationImpl;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.edit.provider.ViewerNotification;
-import org.eclipse.rmf.pror.presentation.headline.HeadlineConfiguration;
import org.eclipse.rmf.pror.presentation.headline.HeadlineFactory;
-import org.eclipse.rmf.pror.presentation.headline.HeadlinePackage;
import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
import org.eclipse.rmf.pror.reqif10.editor.presentation.service.AbstractPresentationService;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.IProrCellRenderer;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationService;
-import org.eclipse.rmf.pror.reqif10.util.ConfigurationUtil;
-import org.eclipse.rmf.reqif10.AttributeValue;
-import org.eclipse.rmf.reqif10.DatatypeDefinition;
-import org.eclipse.rmf.reqif10.SpecHierarchy;
-import org.eclipse.rmf.reqif10.Specification;
-import org.eclipse.rmf.reqif10.common.util.ReqIF10Util;
-import org.eclipse.rmf.reqif10.util.ReqIF10Switch;
-public class HeadlinePresentationService extends AbstractPresentationService
- implements PresentationService {
+public class HeadlinePresentationService extends AbstractPresentationService {
- private HeadlineCellRenderer headlineCellRenderer;
@Override
public ProrPresentationConfiguration getConfigurationInstance() {
return HeadlineFactory.eINSTANCE.createHeadlineConfiguration();
}
- /**
- * TODO the bulk of this should go into the constructor of
- * {@link HeadlineCellRenderer}
- */
- @Override
- public IProrCellRenderer getCellRenderer(final AttributeValue av) {
- if (headlineCellRenderer == null) {
- if (ReqIF10Util.getDatatypeDefinition(av) == null)
- return null;
- headlineCellRenderer = new HeadlineCellRenderer(ReqIF10Util
- .getDatatypeDefinition(av).getIdentifier());
- HeadlineConfiguration headlineConfiguration = (HeadlineConfiguration) ConfigurationUtil
- .getPresentationConfig(av, null);
- headlineCellRenderer.setFontSize(headlineConfiguration.getSize());
-
- // Register for notifications
- headlineConfiguration.eAdapters().add(new AdapterImpl() {
- @Override
- public void notifyChanged(Notification msg) {
- // React to size changes
- switch (msg.getFeatureID(HeadlineConfiguration.class)) {
- case HeadlinePackage.HEADLINE_CONFIGURATION__SIZE:
- headlineCellRenderer.setFontSize(msg.getNewIntValue());
- refreshUi(av);
- break;
- case HeadlinePackage.HEADLINE_CONFIGURATION__DATATYPE:
- if (msg.getNewValue() != null)
- headlineCellRenderer
- .setDatatypeId(((DatatypeDefinition) msg
- .getNewValue()).getIdentifier());
- refreshUi(av);
- default:
- break;
- }
- }
- });
- }
- return headlineCellRenderer;
- }
-
- @Override
- public boolean canEdit() {
- return true;
- }
-
- /**
- * Called when the font size or {@link DatatypeDefinition} change.
- *
- * @param av
- */
- @SuppressWarnings("rawtypes")
- private void refreshUi(AttributeValue av) {
- if (ReqIF10Util.getDatatypeDefinition(av) == null)
- return;
- ReqIF10Switch visitor = new ReqIF10Switch() {
- @Override
- public Object caseSpecHierarchy(SpecHierarchy object) {
- Notification n = new NotificationImpl(Notification.SET,
- object.getObject(), object.getObject());
- object.eNotify(new ViewerNotification(n));
- return super.caseSpecHierarchy(object);
- }
- };
- EList<Specification> roots = ReqIF10Util
- .getReqIF(ReqIF10Util.getDatatypeDefinition(av))
- .getCoreContent().getSpecifications();
- for (Iterator i = EcoreUtil.getAllProperContents(roots, true); i
- .hasNext();) {
- visitor.doSwitch((EObject) i.next());
- }
- }
-
}
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.id.tests/META-INF/MANIFEST.MF b/org.eclipse.rmf.pror.reqif10.presentation.id.tests/META-INF/MANIFEST.MF
index b286e07..d71aad3 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.id.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.pror.reqif10.presentation.id.tests/META-INF/MANIFEST.MF
@@ -2,10 +2,10 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.pror.reqif10.presentation.id.tests
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-Localization: plugin
Fragment-Host: org.eclipse.rmf.pror.reqif10.presentation.id
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %providerName
-Require-Bundle: org.eclipse.rmf.pror.reqif10.tests;bundle-version="0.3.2",
+Require-Bundle: org.eclipse.rmf.pror.reqif10.tests;bundle-version="0.4.0",
org.junit;bundle-version="4.8.2"
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.id.tests/pom.xml b/org.eclipse.rmf.pror.reqif10.presentation.id.tests/pom.xml
index 859f946..719c769 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.id.tests/pom.xml
+++ b/org.eclipse.rmf.pror.reqif10.presentation.id.tests/pom.xml
@@ -6,12 +6,12 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<groupId>org.eclipse.rmf.plugins</groupId>
<artifactId>org.eclipse.rmf.pror.reqif10.presentation.id.tests</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<profiles>
<profile>
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.id/META-INF/MANIFEST.MF b/org.eclipse.rmf.pror.reqif10.presentation.id/META-INF/MANIFEST.MF
index 0c98402..5778b71 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.id/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.pror.reqif10.presentation.id/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.pror.reqif10.presentation.id;singleton:=true
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.rmf.pror.reqif10.presentation.id.provider.IDEditPlugin$Implementation
Bundle-Vendor: %providerName
@@ -13,5 +13,5 @@
org.eclipse.rmf.pror.reqif10.presentation.id.provider,
org.eclipse.rmf.pror.reqif10.presentation.id.util,
org.eclipse.rmf.pror.reqif10.presentation.ui
-Require-Bundle: org.eclipse.rmf.pror.reqif10.editor;bundle-version="0.3.2"
+Require-Bundle: org.eclipse.rmf.pror.reqif10.editor;bundle-version="0.4.0"
Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.id/model/ID.genmodel b/org.eclipse.rmf.pror.reqif10.presentation.id/model/ID.genmodel
index a0dc7a0..d82da58 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.id/model/ID.genmodel
+++ b/org.eclipse.rmf.pror.reqif10.presentation.id/model/ID.genmodel
@@ -1,20 +1,25 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="org.eclipse.rmf.pror.reqif10.presentation.id/src"
- editDirectory="/org.eclipse.rmf.pror.reqif10.presentation.id/src" editorDirectory="/org.eclipse.rmf.pror.reqif10.presentation.id.editor/src"
- modelPluginID="org.eclipse.rmf.pror.reqif10.presentation.id" modelName="ID" modelPluginClass=""
- editPluginClass="org.eclipse.rmf.pror.reqif10.presentation.id.provider.IDEditPlugin"
- testsDirectory="/org.eclipse.rmf.pror.reqif10.presentation.id.tests/tests" testSuiteClass=""
- importerID="org.eclipse.emf.importer.ecore" complianceLevel="6.0" copyrightFields="false"
- editPluginID="org.eclipse.rmf.pror.reqif10.presentation.id" editorPluginID="org.eclipse.rmf.pror.reqif10.presentation.id.editor"
- usedGenPackages="../../org.eclipse.rmf.pror.reqif10/model/reqif10.genmodel#//configuration ../../org.eclipse.rmf.pror.reqif10/model/reqif10.genmodel#//reqif10 ../../org.eclipse.rmf.pror.reqif10/model/reqif10.genmodel#//reqif10/datatypes">
- <foreignModel>ID.ecore</foreignModel>
- <genPackages prefix="Id" basePackage="org.eclipse.rmf.pror.reqif10.presentation"
- disposableProviderFactory="true" ecorePackage="ID.ecore#/">
- <genClasses ecoreClass="ID.ecore#//IdConfiguration">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute ID.ecore#//IdConfiguration/prefix"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute ID.ecore#//IdConfiguration/count"/>
- </genClasses>
- </genPackages>
-</genmodel:GenModel>
+<?xml version="1.0" encoding="UTF-8"?>
+<genmodel:GenModel xmi:version="2.0"
+ xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
+ xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="org.eclipse.rmf.pror.reqif10.presentation.id/src"
+ editDirectory="/org.eclipse.rmf.pror.reqif10.presentation.id/src" editorDirectory="/org.eclipse.rmf.pror.reqif10.presentation.id.editor/src"
+ modelPluginID="org.eclipse.rmf.pror.reqif10.presentation.id" modelName="ID" modelPluginClass=""
+ editPluginClass="org.eclipse.rmf.pror.reqif10.presentation.id.provider.IDEditPlugin"
+ testsDirectory="/org.eclipse.rmf.pror.reqif10.presentation.id.tests/tests" testSuiteClass=""
+ importerID="org.eclipse.emf.importer.ecore" complianceLevel="6.0" copyrightFields="false"
+ editPluginID="org.eclipse.rmf.pror.reqif10.presentation.id" editorPluginID="org.eclipse.rmf.pror.reqif10.presentation.id.editor"
+ usedGenPackages="../../org.eclipse.rmf.pror.reqif10/model/reqif10.genmodel#//configuration ../../org.eclipse.rmf.pror.reqif10/model/reqif10.genmodel#//reqif10 ../../org.eclipse.rmf.pror.reqif10/model/reqif10.genmodel#//xhtml platform:/plugin/org.eclipse.emf.ecore/model/XMLNamespace.genmodel#//namespace ../../org.eclipse.rmf.pror.reqif10/model/reqif10.genmodel#//datatypes">
+ <foreignModel>ID.ecore</foreignModel>
+ <genPackages prefix="Id" basePackage="org.eclipse.rmf.pror.reqif10.presentation"
+ disposableProviderFactory="true" ecorePackage="ID.ecore#/">
+ <genEnums typeSafeEnumCompatible="false" ecoreEnum="ID.ecore#//IdVerticalAlign">
+ <genEnumLiterals ecoreEnumLiteral="ID.ecore#//IdVerticalAlign/Top"/>
+ <genEnumLiterals ecoreEnumLiteral="ID.ecore#//IdVerticalAlign/Center"/>
+ </genEnums>
+ <genClasses provider="Stateful" ecoreClass="ID.ecore#//IdConfiguration">
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute ID.ecore#//IdConfiguration/prefix"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute ID.ecore#//IdConfiguration/count"/>
+ <genFeatures createChild="false" ecoreFeature="ecore:EAttribute ID.ecore#//IdConfiguration/verticalAlign"/>
+ </genClasses>
+ </genPackages>
+</genmodel:GenModel>
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.id/plugin.xml b/org.eclipse.rmf.pror.reqif10.presentation.id/plugin.xml
index 083a2c7..2158ffb 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.id/plugin.xml
+++ b/org.eclipse.rmf.pror.reqif10.presentation.id/plugin.xml
@@ -39,7 +39,7 @@
<extension
point="org.eclipse.rmf.pror.reqif10.editor.presentation">
<presentation
- service="org.eclipse.rmf.pror.reqif10.presentation.ui.IDPresentationService"
+ service="org.eclipse.rmf.pror.reqif10.presentation.ui.IdPresentationService"
name="ID Generator">
</presentation>
</extension>
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.id/pom.xml b/org.eclipse.rmf.pror.reqif10.presentation.id/pom.xml
index 979e585..f040f3a 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.id/pom.xml
+++ b/org.eclipse.rmf.pror.reqif10.presentation.id/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.pror.reqif10.presentation.id</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<groupId>org.eclipse.rmf.plugins</groupId>
<build>
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/id/impl/IdConfigurationImpl.java b/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/id/impl/IdConfigurationImpl.java
index 2534bb2..21d7fa1 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/id/impl/IdConfigurationImpl.java
+++ b/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/id/impl/IdConfigurationImpl.java
@@ -13,12 +13,17 @@
package org.eclipse.rmf.pror.reqif10.presentation.id.impl;
import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
+import org.eclipse.emf.ecore.util.EContentAdapter;
import org.eclipse.rmf.pror.reqif10.configuration.impl.ProrPresentationConfigurationImpl;
import org.eclipse.rmf.pror.reqif10.presentation.id.IdConfiguration;
import org.eclipse.rmf.pror.reqif10.presentation.id.IdPackage;
import org.eclipse.rmf.pror.reqif10.presentation.id.IdVerticalAlign;
+import org.eclipse.rmf.reqif10.AttributeValueString;
+import org.eclipse.rmf.reqif10.ReqIF;
+import org.eclipse.rmf.reqif10.common.util.ReqIF10Util;
/**
* <!-- begin-user-doc -->
@@ -276,4 +281,72 @@
return result.toString();
}
+ private EContentAdapter reqifAdapter;
+
+ /**
+ * Two listeners must be registered:
+ * <ul>
+ * <li>An adapter on the {@link ReqIF}, reacting to relevant SpecObject
+ * changes that require the creation of new IDs
+ * <li>An adapter to the {@link IdConfiguration}, reacting to changes of its
+ * attributes.
+ * </ul>
+ */
+ public void registerReqIF() {
+ reqifAdapter = buildReqifListener();
+ ReqIF10Util.getReqIF(this).getCoreContent().eAdapters()
+ .add(reqifAdapter);
+ }
+
+ public void unregisterReqIF() {
+ if (reqifAdapter != null) {
+ ReqIF10Util.getReqIF(this).getCoreContent().eAdapters()
+ .remove(reqifAdapter);
+ }
+ }
+
+ private EContentAdapter buildReqifListener() {
+ EContentAdapter adapter = new EContentAdapter() {
+ @Override
+ public void setTarget(Notifier target) {
+ super.setTarget(target);
+ if (target instanceof AttributeValueString) {
+ AttributeValueString value = (AttributeValueString) target;
+ if (value.getDefinition() != null
+ && value.getDefinition().getType() != null
+ && value.getDefinition().getType()
+ .equals(getDatatype())) {
+ if (value.getTheValue() == null
+ || value.getTheValue().length() == 0) {
+ int newCount = getCount() + 1;
+ value.setTheValue(getPrefix() + newCount);
+ setCount(newCount);
+ }
+ }
+ }
+ }
+ };
+ return adapter;
+ }
+
+ // private EContentAdapter buildAdapter(final IdConfiguration config) {
+ // config.eAdapters().add(new AdapterImpl() {
+ // @Override
+ // public void notifyChanged(Notification msg) {
+ // if
+ // (ConfigurationPackage.Literals.PROR_PRESENTATION_CONFIGURATION__DATATYPE
+ // .equals(msg.getFeature())) {
+ // EContentAdapter adapter = adapters.get(config);
+ // if (adapter != null) {
+ // ReqIF reqif = ReqIF10Util.getReqIF(config);
+ // reqif.eAdapters().remove(adapter);
+ // adapter = buildAdapter(config);
+ // reqif.eAdapters().add(adapter);
+ // adapters.put(config, adapter);
+ // }
+ // }
+ // }
+ // });
+ // }
+
} //IdConfigurationImpl
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/id/provider/IdConfigurationItemProvider.java b/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/id/provider/IdConfigurationItemProvider.java
index 2b88482..f17286e 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/id/provider/IdConfigurationItemProvider.java
+++ b/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/id/provider/IdConfigurationItemProvider.java
@@ -16,9 +16,16 @@
import java.util.Collection;
import java.util.List;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.notify.impl.AdapterImpl;
import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.ecore.util.EContentAdapter;
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
@@ -28,9 +35,15 @@
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.emf.edit.provider.ItemPropertyDescriptor;
import org.eclipse.emf.edit.provider.ViewerNotification;
+import org.eclipse.rmf.pror.reqif10.configuration.ConfigurationPackage;
+import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
import org.eclipse.rmf.pror.reqif10.configuration.provider.ProrPresentationConfigurationItemProvider;
import org.eclipse.rmf.pror.reqif10.presentation.id.IdConfiguration;
import org.eclipse.rmf.pror.reqif10.presentation.id.IdPackage;
+import org.eclipse.rmf.reqif10.AttributeValue;
+import org.eclipse.rmf.reqif10.AttributeValueString;
+import org.eclipse.rmf.reqif10.ReqIF10Package;
+import org.eclipse.rmf.reqif10.common.util.ReqIF10Util;
/**
* This is the item provider adapter for a {@link org.eclipse.rmf.pror.reqif10.presentation.id.IdConfiguration} object.
@@ -211,4 +224,114 @@
return IDEditPlugin.INSTANCE;
}
+ // Listener to be attached to the ReqIF
+ private EContentAdapter contentAdapter;
+
+ /**
+ * We do two things:
+ * <ul>
+ * <li>Register an adapter with the model to set IDs as needed
+ * <li>Register an adapter with the config element to react to config value
+ * changes.
+ * <ul>
+ */
+ public void registerPresentationConfiguration(
+ final ProrPresentationConfiguration config,
+ final EditingDomain editingDomain) {
+ registerModelListener((IdConfiguration) config, editingDomain);
+
+ config.eAdapters().add(new AdapterImpl() {
+ public void notifyChanged(Notification notification) {
+ if (notification.getFeature() == ConfigurationPackage.Literals.PROR_PRESENTATION_CONFIGURATION__DATATYPE) {
+ unregisterModelListener(config);
+ registerModelListener((IdConfiguration) config,
+ editingDomain);
+ }
+ }
+ });
+ }
+
+ public void unregisterPresentationConfiguration(
+ ProrPresentationConfiguration config) {
+ unregisterModelListener(config);
+ }
+
+ private void registerModelListener(final IdConfiguration config,
+ final EditingDomain editingDomain) {
+ if (contentAdapter != null) {
+ throw new IllegalStateException(
+ "Cannot register IDConfigAdapter without unregistering first!");
+ }
+ contentAdapter = new EContentAdapter() {
+ @Override
+ public void setTarget(final Notifier target) {
+ super.setTarget(target);
+ if (target instanceof AttributeValueString) {
+ AttributeValueString value = (AttributeValueString) target;
+ if (value.getDefinition() != null
+ && value.getDefinition().getType() != null
+ && value.getDefinition().getType()
+ .equals(config.getDatatype())) {
+ if (value.getTheValue() == null
+ || value.getTheValue().length() == 0) {
+ int newCount = config.getCount() + 1;
+
+ String label = "Assigning ID " + config.getPrefix()
+ + newCount;
+
+ // Catch undo
+ Command redoCommand = editingDomain
+ .getCommandStack().getRedoCommand();
+ if (redoCommand != null
+ && label.equals(redoCommand.getLabel())) {
+ System.out.println("Detected Undo - skip "
+ + label);
+ return;
+ }
+ CompoundCommand cmd = new CompoundCommand(
+ label);
+ cmd.append(SetCommand
+ .create(editingDomain,
+ value,
+ ReqIF10Package.Literals.ATTRIBUTE_VALUE_STRING__THE_VALUE,
+ config.getPrefix() + newCount));
+ cmd.append(SetCommand.create(editingDomain, config,
+ IdPackage.Literals.ID_CONFIGURATION__COUNT,
+ newCount));
+ editingDomain.getCommandStack().execute(cmd);
+ }
+ }
+ }
+ }
+ };
+ ReqIF10Util.getReqIF(config).getCoreContent().eAdapters()
+ .add(contentAdapter);
+ }
+
+ private void unregisterModelListener(ProrPresentationConfiguration config) {
+ if (contentAdapter != null) {
+ ReqIF10Util.getReqIF(config).getCoreContent().eAdapters()
+ .remove(contentAdapter);
+ contentAdapter = null;
+ }
+ }
+
+ public Command handleDragAndDrop(Collection<?> source, Object target,
+ EditingDomain editingDomain, int operation) {
+ // No drag and drop support
+ return null;
+ }
+
+ public String getLabel(AttributeValue av) {
+ // No custom label
+ return null;
+ }
+
+ /**
+ * Don't allow editing.
+ */
+ public boolean canEdit() {
+ return false;
+ }
+
}
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/id/provider/IdItemProviderAdapterFactory.java b/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/id/provider/IdItemProviderAdapterFactory.java
index 8467a69..165e793 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/id/provider/IdItemProviderAdapterFactory.java
+++ b/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/id/provider/IdItemProviderAdapterFactory.java
@@ -21,6 +21,7 @@
import org.eclipse.emf.edit.provider.ChangeNotifier;
import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.Disposable;
import org.eclipse.emf.edit.provider.IChangeNotifier;
import org.eclipse.emf.edit.provider.IDisposable;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
@@ -59,6 +60,14 @@
protected IChangeNotifier changeNotifier = new ChangeNotifier();
/**
+ * This keeps track of all the item providers created, so that they can be {@link #dispose disposed}.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ protected Disposable disposable = new Disposable();
+
+ /**
* This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -81,14 +90,6 @@
}
/**
- * This keeps track of the one adapter used for all {@link org.eclipse.rmf.pror.reqif10.presentation.id.IdConfiguration} instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected IdConfigurationItemProvider idConfigurationItemProvider;
-
- /**
* This creates an adapter for a {@link org.eclipse.rmf.pror.reqif10.presentation.id.IdConfiguration}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -96,11 +97,7 @@
*/
@Override
public Adapter createIdConfigurationAdapter() {
- if (idConfigurationItemProvider == null) {
- idConfigurationItemProvider = new IdConfigurationItemProvider(this);
- }
-
- return idConfigurationItemProvider;
+ return new IdConfigurationItemProvider(this);
}
/**
@@ -162,6 +159,20 @@
}
/**
+ * Associates an adapter with a notifier via the base implementation, then records it to ensure it will be disposed.
+ * <!-- begin-user-doc -->
+ * <!-- end-user-doc -->
+ * @generated
+ */
+ @Override
+ protected void associate(Adapter adapter, Notifier target) {
+ super.associate(adapter, target);
+ if (adapter != null) {
+ disposable.add(adapter);
+ }
+ }
+
+ /**
* This adds a listener.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
@@ -202,7 +213,7 @@
* @generated
*/
public void dispose() {
- if (idConfigurationItemProvider != null) idConfigurationItemProvider.dispose();
+ disposable.dispose();
}
}
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/ui/IDPresentationService.java b/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/ui/IDPresentationService.java
deleted file mode 100644
index 4f8eeaa..0000000
--- a/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/ui/IDPresentationService.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Formal Mind GmbH and University of Dusseldorf.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Michael Jastram - initial API and implementation
- * Kay Münch - vertical alignment of the spec objects id
- ******************************************************************************/
-package org.eclipse.rmf.pror.reqif10.presentation.ui;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.common.notify.impl.AdapterImpl;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.util.EContentAdapter;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.rmf.pror.reqif10.configuration.ConfigurationPackage;
-import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
-import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfigurations;
-import org.eclipse.rmf.pror.reqif10.configuration.ProrToolExtension;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.AbstractPresentationService;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.IProrCellRenderer;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationService;
-import org.eclipse.rmf.pror.reqif10.presentation.id.IdConfiguration;
-import org.eclipse.rmf.pror.reqif10.presentation.id.IdFactory;
-import org.eclipse.rmf.pror.reqif10.util.ConfigurationUtil;
-import org.eclipse.rmf.reqif10.AttributeValue;
-import org.eclipse.rmf.reqif10.AttributeValueString;
-import org.eclipse.rmf.reqif10.ReqIF;
-import org.eclipse.rmf.reqif10.common.util.ReqIF10Util;
-
-public class IDPresentationService extends AbstractPresentationService implements PresentationService {
-
- private final IProrCellRenderer idLabelCellRenderer;
- private final HashMap<IdConfiguration, EContentAdapter> adapters = new HashMap<IdConfiguration, EContentAdapter>();
-
- public IDPresentationService() {
- idLabelCellRenderer = new IdLabelCellRenderer();
- }
- /**
- * Upon opening, attaches a Listener that sets the ID if the Datatype
- * matches.
- */
- @Override
- public void openReqif(final ReqIF reqif, final EditingDomain domain) {
-
- ensureAllConfigsHaveAdapters(reqif, domain);
-
- // Make sure that IdConfig additions and removals are handled
-
- ProrPresentationConfigurations presentationConfigurations = getPresentationConfigurations(reqif, domain);
- if (presentationConfigurations == null) return;
-
- presentationConfigurations.eAdapters().add(new AdapterImpl() {
- @Override
- public void notifyChanged(Notification msg) {
- ensureAllConfigsHaveAdapters(reqif, domain);
- }
- });
- }
-
- private void ensureAllConfigsHaveAdapters(final ReqIF reqif, EditingDomain domain) {
- Set<IdConfiguration> configs = getConfigurationElements(reqif, domain);
- if (configs == null) return;
-
- // Process all existing IdConfigurations
- for (final IdConfiguration config : configs) {
- if (!adapters.containsKey(config)) {
- EContentAdapter adapter = buildAdapter(config);
- reqif.eAdapters().add(adapter);
- adapters.put(config, adapter);
- }
- }
- }
-
- private EContentAdapter buildAdapter(final IdConfiguration config) {
- config.eAdapters().add(new AdapterImpl() {
- @Override
- public void notifyChanged(Notification msg) {
- if (ConfigurationPackage.Literals.PROR_PRESENTATION_CONFIGURATION__DATATYPE
- .equals(msg.getFeature())) {
- EContentAdapter adapter = adapters.get(config);
- if (adapter != null) {
- ReqIF reqif = ReqIF10Util.getReqIF(config);
- reqif.eAdapters().remove(adapter);
- adapter = buildAdapter(config);
- reqif.eAdapters().add(adapter);
- adapters.put(config, adapter);
- }
- }
- }
- });
-
- EContentAdapter adapter = new EContentAdapter() {
- @Override
- public void setTarget(Notifier target) {
- super.setTarget(target);
- if (target instanceof AttributeValueString) {
- AttributeValueString value = (AttributeValueString) target;
- if (value.getDefinition() != null
- && value.getDefinition().getType() != null
- && value.getDefinition().getType()
- .equals(config.getDatatype())) {
- if (value.getTheValue() == null
- || value.getTheValue().length() == 0) {
- int newCount = config.getCount() + 1;
- value.setTheValue(config.getPrefix() + newCount);
- config.setCount(newCount);
- }
- }
- }
- }
- };
- return adapter;
- }
-
- /**
- * Get the {@link IdConfiguration}s for the given ReqIF
- */
- private Set<IdConfiguration> getConfigurationElements(ReqIF reqif, EditingDomain domain) {
- HashSet<IdConfiguration> idConfigs = new HashSet<IdConfiguration>();
- ProrPresentationConfigurations configsElement = getPresentationConfigurations(reqif, domain);
- if (configsElement == null) return null;
- EList<ProrPresentationConfiguration> configs = configsElement.getPresentationConfigurations();
- for (ProrPresentationConfiguration config : configs) {
- if (config instanceof IdConfiguration)
- idConfigs.add((IdConfiguration) config);
- }
- return idConfigs;
- }
-
- private ProrPresentationConfigurations getPresentationConfigurations(ReqIF reqif, EditingDomain domain) {
- ProrToolExtension uiExtension = ConfigurationUtil.getProrToolExtension(reqif, domain);
- ProrPresentationConfigurations configs = uiExtension
- .getPresentationConfigurations();
- return configs;
- }
-
- @Override
- public ProrPresentationConfiguration getConfigurationInstance() {
- return IdFactory.eINSTANCE.createIdConfiguration();
- }
-
- @Override
- public IProrCellRenderer getCellRenderer(AttributeValue av) {
- return idLabelCellRenderer;
- }
-
-}
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/ui/IdLabelCellRenderer.java b/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/ui/IdLabelCellRenderer.java
index 58047ce..c4ede09 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/ui/IdLabelCellRenderer.java
+++ b/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/ui/IdLabelCellRenderer.java
@@ -68,7 +68,7 @@
if (ad != null) {
DatatypeDefinitionString dd = ad.getType();
if (dd != null) {
- ProrPresentationConfiguration config = ConfigurationUtil.getConfiguration(dd);
+ ProrPresentationConfiguration config = ConfigurationUtil.getPresentationConfiguration(dd);
if (config instanceof IdConfiguration) {
return ((IdConfiguration) config).getVerticalAlign();
}
@@ -77,7 +77,7 @@
return IdVerticalAlign.CENTER;
}
- public String doDrawHtmlContent(Object value) {
+ public String doDrawHtmlContent(AttributeValue value) {
AttributeValueString av = (AttributeValueString) value;
return av.getTheValue();
}
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/ui/IdPresentationService.java b/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/ui/IdPresentationService.java
new file mode 100644
index 0000000..ff7e0d5
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.presentation.id/src/org/eclipse/rmf/pror/reqif10/presentation/ui/IdPresentationService.java
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Formal Mind GmbH and University of Dusseldorf.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Michael Jastram - initial API and implementation
+ * Kay Münch - vertical alignment of the spec objects id
+ ******************************************************************************/
+package org.eclipse.rmf.pror.reqif10.presentation.ui;
+
+import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
+import org.eclipse.rmf.pror.reqif10.editor.presentation.service.AbstractPresentationService;
+import org.eclipse.rmf.pror.reqif10.presentation.id.IdFactory;
+import org.eclipse.rmf.pror.reqif10.presentation.id.impl.IdConfigurationImpl;
+import org.eclipse.rmf.reqif10.AttributeValueString;
+
+/**
+ * A presentation to automatically assign human-readable IDs of the form
+ * Label-###, where ### is numeric. The ID is stored in an
+ * {@link AttributeValueString}.
+ * <p>
+ * The "hooking" takes place via {@link IdConfigurationImpl#registerReqIF()},
+ * which calls methods in this class.
+ * <p>
+ *
+ * TODOS:
+ * <ul>
+ * <li>Allow renaming of prefix
+ * <li>Prevent duplicates
+ * </ul>
+ *
+ * @author jastram
+ */
+public class IdPresentationService extends AbstractPresentationService {
+
+ public IdPresentationService() {
+ }
+
+ @Override
+ public ProrPresentationConfiguration getConfigurationInstance() {
+ return IdFactory.eINSTANCE.createIdConfiguration();
+ }
+}
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.linewrap/META-INF/MANIFEST.MF b/org.eclipse.rmf.pror.reqif10.presentation.linewrap/META-INF/MANIFEST.MF
index 4227780..9e4c955 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.linewrap/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.pror.reqif10.presentation.linewrap/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.pror.reqif10.presentation.linewrap;singleton:=true
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-ClassPath: .
Bundle-Activator: org.eclipse.rmf.pror.presentation.linewrap.provider.LinewrapEditPlugin$Implementation
Bundle-Vendor: %providerName
@@ -13,5 +13,5 @@
org.eclipse.rmf.pror.presentation.linewrap.provider,
org.eclipse.rmf.pror.presentation.linewrap.util,
org.eclipse.rmf.pror.presentation.ui
-Require-Bundle: org.eclipse.rmf.pror.reqif10.editor;bundle-version="0.3.2"
+Require-Bundle: org.eclipse.rmf.pror.reqif10.editor;bundle-version="0.4.0"
Bundle-ActivationPolicy: lazy
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.linewrap/pom.xml b/org.eclipse.rmf.pror.reqif10.presentation.linewrap/pom.xml
index 3712eb7..cc2e2b0 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.linewrap/pom.xml
+++ b/org.eclipse.rmf.pror.reqif10.presentation.linewrap/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.pror.reqif10.presentation.linewrap</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<groupId>org.eclipse.rmf.plugins</groupId>
<build>
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.linewrap/src/org/eclipse/rmf/pror/presentation/linewrap/provider/LinewrapConfigurationItemProvider.java b/org.eclipse.rmf.pror.reqif10.presentation.linewrap/src/org/eclipse/rmf/pror/presentation/linewrap/provider/LinewrapConfigurationItemProvider.java
index dc78733..7d81dfe 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.linewrap/src/org/eclipse/rmf/pror/presentation/linewrap/provider/LinewrapConfigurationItemProvider.java
+++ b/org.eclipse.rmf.pror.reqif10.presentation.linewrap/src/org/eclipse/rmf/pror/presentation/linewrap/provider/LinewrapConfigurationItemProvider.java
@@ -15,9 +15,13 @@
import java.util.Collection;
import java.util.List;
+import org.agilemore.agilegrid.AgileGrid;
+import org.agilemore.agilegrid.CellEditor;
+import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.ResourceLocator;
+import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.emf.edit.provider.IEditingDomainItemProvider;
import org.eclipse.emf.edit.provider.IItemLabelProvider;
import org.eclipse.emf.edit.provider.IItemPropertyDescriptor;
@@ -26,8 +30,15 @@
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.rmf.pror.presentation.LinewrapEditPlugin;
import org.eclipse.rmf.pror.presentation.linewrap.LinewrapConfiguration;
+import org.eclipse.rmf.pror.presentation.ui.LinewrapCellEditor;
+import org.eclipse.rmf.pror.presentation.ui.LinewrapCellRenderer;
+import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
import org.eclipse.rmf.pror.reqif10.configuration.provider.ProrPresentationConfigurationItemProvider;
+import org.eclipse.rmf.pror.reqif10.editor.presentation.service.IProrCellRenderer;
+import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationEditorInterface;
+import org.eclipse.rmf.reqif10.AttributeValue;
import org.eclipse.rmf.reqif10.DatatypeDefinitionSimple;
+import org.eclipse.rmf.reqif10.common.util.ReqIF10Util;
/**
* This is the item provider adapter for a {@link org.eclipse.rmf.pror.presentation.linewrap.LinewrapConfiguration} object.
@@ -42,7 +53,8 @@
IStructuredItemContentProvider,
ITreeItemContentProvider,
IItemLabelProvider,
- IItemPropertySource {
+ IItemPropertySource,
+ PresentationEditorInterface {
/**
* This constructs an instance from a factory and a notifier.
* <!-- begin-user-doc -->
@@ -134,4 +146,53 @@
return LinewrapEditPlugin.INSTANCE;
}
+ public void registerPresentationConfiguration(ProrPresentationConfiguration config,
+ EditingDomain editingDomain) {
+ // No action required.
+
+ }
+
+ public void unregisterPresentationConfiguration(ProrPresentationConfiguration config) {
+ // No action required.
+ }
+
+ private LinewrapCellRenderer linewrapCellRenderer;
+
+
+ public IProrCellRenderer getCellRenderer(AttributeValue av) {
+ if (linewrapCellRenderer == null) {
+ linewrapCellRenderer = new LinewrapCellRenderer();
+ }
+ return linewrapCellRenderer;
+ }
+
+ public String getLabel(AttributeValue av) {
+ Object value = ReqIF10Util.getTheValue(av);
+ if (value == null) {
+ return "";
+ }
+ String text = value.toString();
+ if (text.indexOf("\n") != -1) {
+ text = text.substring(0, text.indexOf("\n"));
+ }
+ if (text.length() > 15) {
+ text = text.substring(0, 13) + "...";
+ }
+ return text;
+ }
+
+ public CellEditor getCellEditor(AgileGrid agileGrid,
+ EditingDomain editingDomain, AttributeValue av, Object affectedObject) {
+ return new LinewrapCellEditor(agileGrid, editingDomain, affectedObject);
+ }
+
+ public boolean canEdit() {
+ return true;
+ }
+
+ public Command handleDragAndDrop(Collection<?> source, Object target,
+ EditingDomain editingDomain, int operation) {
+ return null;
+ }
+
}
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.linewrap/src/org/eclipse/rmf/pror/presentation/ui/LinewrapCellRenderer.java b/org.eclipse.rmf.pror.reqif10.presentation.linewrap/src/org/eclipse/rmf/pror/presentation/ui/LinewrapCellRenderer.java
index 94bf484..8d94a99 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.linewrap/src/org/eclipse/rmf/pror/presentation/ui/LinewrapCellRenderer.java
+++ b/org.eclipse.rmf.pror.reqif10.presentation.linewrap/src/org/eclipse/rmf/pror/presentation/ui/LinewrapCellRenderer.java
@@ -12,6 +12,7 @@
import org.eclipse.jface.viewers.ViewerCell;
import org.eclipse.rmf.pror.reqif10.editor.presentation.service.IProrCellRenderer;
+import org.eclipse.rmf.reqif10.AttributeValue;
import org.eclipse.rmf.reqif10.AttributeValueString;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Rectangle;
@@ -93,7 +94,7 @@
return sb.toString();
}
- public String doDrawHtmlContent(Object value) {
+ public String doDrawHtmlContent(AttributeValue value) {
AttributeValueString av = (AttributeValueString) value;
String text = av.getTheValue();
if (text != null)
diff --git a/org.eclipse.rmf.pror.reqif10.presentation.linewrap/src/org/eclipse/rmf/pror/presentation/ui/LinewrapPresentationService.java b/org.eclipse.rmf.pror.reqif10.presentation.linewrap/src/org/eclipse/rmf/pror/presentation/ui/LinewrapPresentationService.java
index 950a192..d42193b 100644
--- a/org.eclipse.rmf.pror.reqif10.presentation.linewrap/src/org/eclipse/rmf/pror/presentation/ui/LinewrapPresentationService.java
+++ b/org.eclipse.rmf.pror.reqif10.presentation.linewrap/src/org/eclipse/rmf/pror/presentation/ui/LinewrapPresentationService.java
@@ -10,17 +10,11 @@
******************************************************************************/
package org.eclipse.rmf.pror.presentation.ui;
-import org.agilemore.agilegrid.AgileGrid;
-import org.agilemore.agilegrid.CellEditor;
-import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.rmf.pror.presentation.linewrap.LinewrapFactory;
import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
+import org.eclipse.rmf.pror.reqif10.edit.presentation.service.PresentationInterface;
import org.eclipse.rmf.pror.reqif10.editor.presentation.service.AbstractPresentationService;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.IProrCellRenderer;
-import org.eclipse.rmf.pror.reqif10.editor.presentation.service.PresentationService;
-import org.eclipse.rmf.reqif10.AttributeValue;
import org.eclipse.rmf.reqif10.DatatypeDefinitionString;
-import org.eclipse.rmf.reqif10.common.util.ReqIF10Util;
/**
* A very basic Presentation that handles {@link DatatypeDefinitionString}s and
@@ -29,49 +23,14 @@
* @author jastram
*
*/
-public class LinewrapPresentationService extends AbstractPresentationService implements PresentationService {
+public class LinewrapPresentationService extends AbstractPresentationService implements PresentationInterface {
- private final LinewrapCellRenderer linewrapCellRenderer;
-
public LinewrapPresentationService() {
- linewrapCellRenderer = new LinewrapCellRenderer();
}
+
@Override
public ProrPresentationConfiguration getConfigurationInstance() {
return LinewrapFactory.eINSTANCE.createLinewrapConfiguration();
}
-
- @Override
- public IProrCellRenderer getCellRenderer(AttributeValue av) {
- return linewrapCellRenderer;
- }
-
- @Override
- public String getLabel(AttributeValue av) {
- Object value = ReqIF10Util.getTheValue(av);
- if (value == null) {
- return "";
- }
- String text = value.toString();
- if (text.indexOf("\n") != -1) {
- text = text.substring(0, text.indexOf("\n"));
- }
- if (text.length() > 15) {
- text = text.substring(0, 13) + "...";
- }
- return text;
- }
-
- @Override
- public CellEditor getCellEditor(AgileGrid agileGrid,
- EditingDomain editingDomain, AttributeValue av, Object affectedObject) {
- return new LinewrapCellEditor(agileGrid, editingDomain, affectedObject);
- }
-
- @Override
- public boolean canEdit() {
- return true;
- }
-
}
diff --git a/org.eclipse.rmf.pror.reqif10.sdk.feature/feature.xml b/org.eclipse.rmf.pror.reqif10.sdk.feature/feature.xml
index c1a529e..18384b8 100644
--- a/org.eclipse.rmf.pror.reqif10.sdk.feature/feature.xml
+++ b/org.eclipse.rmf.pror.reqif10.sdk.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.rmf.pror.reqif10.sdk.feature"
label="RMF ProR SDK Feature (Incubation)"
- version="0.3.2.qualifier"
+ version="0.4.0.qualifier"
provider-name="Eclipse Modeling Project"
plugin="org.eclipse.rmf.pror.reqif10">
@@ -34,7 +34,7 @@
version="0.0.0"/>
<requires>
- <import feature="org.eclipse.rmf.reqif10.sdk.feature" version="0.3.2" match="greaterOrEqual"/>
+ <import feature="org.eclipse.rmf.reqif10.sdk.feature" version="0.4.0" match="greaterOrEqual"/>
</requires>
<plugin
diff --git a/org.eclipse.rmf.pror.reqif10.sdk.feature/pom.xml b/org.eclipse.rmf.pror.reqif10.sdk.feature/pom.xml
index 67e3b03..25083d1 100644
--- a/org.eclipse.rmf.pror.reqif10.sdk.feature/pom.xml
+++ b/org.eclipse.rmf.pror.reqif10.sdk.feature/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.pror.reqif10.sdk.feature</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
<groupId>org.eclipse.rmf.features</groupId>
</project>
\ No newline at end of file
diff --git a/org.eclipse.rmf.pror.reqif10.tests/.classpath b/org.eclipse.rmf.pror.reqif10.tests/.classpath
index 14c329f..258e2db 100644
--- a/org.eclipse.rmf.pror.reqif10.tests/.classpath
+++ b/org.eclipse.rmf.pror.reqif10.tests/.classpath
@@ -1,7 +1,8 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="tests"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="tests"/>
+ <classpathentry kind="lib" path="lib/mockito-all-1.8.4.jar"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/org.eclipse.rmf.pror.reqif10.tests/META-INF/MANIFEST.MF b/org.eclipse.rmf.pror.reqif10.tests/META-INF/MANIFEST.MF
index ebb0dfc..9665118 100644
--- a/org.eclipse.rmf.pror.reqif10.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.pror.reqif10.tests/META-INF/MANIFEST.MF
@@ -1,18 +1,23 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.rmf.pror.reqif10.tests
-Bundle-Version: 0.3.2.qualifier
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.rmf.pror.reqif10.tests;singleton:=true
+Bundle-Version: 0.4.0.qualifier
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.junit,
org.eclipse.ui,
org.eclipse.core.resources,
org.eclipse.core.runtime,
- org.eclipse.rmf.serialization;bundle-version="0.3.2",
- org.eclipse.rmf.pror.reqif10.editor;bundle-version="0.3.2"
+ org.eclipse.rmf.serialization;bundle-version="0.4.0",
+ org.eclipse.rmf.pror.reqif10.editor;bundle-version="0.4.0",
+ org.eclipse.rmf.pror.reqif10.presentation.headline;bundle-version="0.4.0",
+ org.eclipse.rmf.pror.reqif10.presentation.id;bundle-version="0.4.0",
+ org.eclipse.rmf.pror.reqif10.presentation.linewrap;bundle-version="0.4.0"
Bundle-Vendor: %providerName
Export-Package: org.eclipse.rmf.pror.reqif10.testdata,
org.eclipse.rmf.pror.reqif10.testframework,
org.eclipse.rmf.pror.reqif10.tests.util,
org.eclipse.rmf.reqif10.configuration.tests
+Bundle-ClassPath: lib/mockito-all-1.8.4.jar,
+ .
diff --git a/org.eclipse.rmf.pror.reqif10.tests/build.properties b/org.eclipse.rmf.pror.reqif10.tests/build.properties
index c600505..0f34e36 100644
--- a/org.eclipse.rmf.pror.reqif10.tests/build.properties
+++ b/org.eclipse.rmf.pror.reqif10.tests/build.properties
@@ -10,4 +10,6 @@
output.. = bin/
bin.includes = META-INF/,\
.,\
- plugin.properties
+ plugin.properties,\
+ lib/mockito-all-1.8.4.jar,\
+ plugin.xml
diff --git a/org.eclipse.rmf.pror.reqif10.tests/lib/mockito-all-1.8.4.jar b/org.eclipse.rmf.pror.reqif10.tests/lib/mockito-all-1.8.4.jar
new file mode 100644
index 0000000..5986ea6
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.tests/lib/mockito-all-1.8.4.jar
Binary files differ
diff --git a/org.eclipse.rmf.pror.reqif10.tests/plugin.xml b/org.eclipse.rmf.pror.reqif10.tests/plugin.xml
new file mode 100644
index 0000000..5535690
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.tests/plugin.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+
+</plugin>
diff --git a/org.eclipse.rmf.pror.reqif10.tests/pom.xml b/org.eclipse.rmf.pror.reqif10.tests/pom.xml
index 1326c18..0069698 100644
--- a/org.eclipse.rmf.pror.reqif10.tests/pom.xml
+++ b/org.eclipse.rmf.pror.reqif10.tests/pom.xml
@@ -6,12 +6,12 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<groupId>org.eclipse.rmf.plugins</groupId>
<artifactId>org.eclipse.rmf.pror.reqif10.tests</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<profiles>
<profile>
diff --git a/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/pror/reqif10/editor/presentation/service/PresentationServiceManagerTest.java b/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/pror/reqif10/editor/presentation/service/PresentationServiceManagerTest.java
new file mode 100644
index 0000000..61bb938
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/pror/reqif10/editor/presentation/service/PresentationServiceManagerTest.java
@@ -0,0 +1,78 @@
+package org.eclipse.rmf.pror.reqif10.editor.presentation.service;
+
+import java.util.Map;
+
+import org.eclipse.rmf.pror.presentation.headline.HeadlineConfiguration;
+import org.eclipse.rmf.pror.presentation.headline.HeadlineFactory;
+import org.eclipse.rmf.pror.presentation.headline.ui.HeadlinePresentationService;
+import org.eclipse.rmf.pror.presentation.linewrap.LinewrapConfiguration;
+import org.eclipse.rmf.pror.presentation.linewrap.LinewrapFactory;
+import org.eclipse.rmf.pror.presentation.ui.LinewrapPresentationService;
+import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfiguration;
+import org.eclipse.rmf.pror.reqif10.configuration.impl.ProrPresentationConfigurationImpl;
+import org.eclipse.rmf.pror.reqif10.edit.presentation.service.PresentationInterface;
+import org.eclipse.rmf.pror.reqif10.presentation.id.IdConfiguration;
+import org.eclipse.rmf.pror.reqif10.presentation.id.IdFactory;
+import org.eclipse.rmf.pror.reqif10.presentation.ui.IdPresentationService;
+import org.junit.Assert;
+import org.junit.Test;
+
+public class PresentationServiceManagerTest {
+
+ /**
+ * Asserts that the map contains three elements (currently ID, Headline and
+ * Linewrap Presentations).
+ */
+ @Test
+ public void testGetPresentationServiceMapContent() {
+ Map<Class<? extends ProrPresentationConfiguration>, PresentationInterface> map = PresentationServiceManager
+ .getPresentationInterfaceMap();
+ Assert.assertEquals(3, map.size());
+ }
+
+ @Test(expected = UnsupportedOperationException.class)
+ public void testPresentationMapNotModifyable() {
+ PresentationServiceManager.getPresentationInterfaceMap().clear();
+ }
+
+ @Test
+ public void testHeadlinePresentationService() {
+ HeadlineConfiguration config = HeadlineFactory.eINSTANCE
+ .createHeadlineConfiguration();
+ PresentationInterface service = PresentationServiceManager
+ .getPresentationService(config);
+ Assert.assertTrue(service instanceof HeadlinePresentationService);
+ }
+
+ @Test
+ public void testIdPresentationService() {
+ IdConfiguration config = IdFactory.eINSTANCE.createIdConfiguration();
+ PresentationInterface service = PresentationServiceManager
+ .getPresentationService(config);
+ Assert.assertTrue(service instanceof IdPresentationService);
+ }
+
+ @Test
+ public void testLinewrapPresentationService() {
+ LinewrapConfiguration config = LinewrapFactory.eINSTANCE
+ .createLinewrapConfiguration();
+ PresentationInterface service = PresentationServiceManager
+ .getPresentationService(config);
+ Assert.assertTrue(service instanceof LinewrapPresentationService);
+ }
+
+ @Test
+ public void testMissingPresentationService() {
+ ProrPresentationConfiguration config = new ProrPresentationConfigurationImpl() {
+ public void registerReqIF() {
+ }
+
+ public void unregisterReqIF() {
+ }
+ };
+
+ PresentationInterface service = PresentationServiceManager
+ .getPresentationService(config);
+ Assert.assertNull(service);
+ }
+}
diff --git a/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/pror/reqif10/editor/presentation/service/README.txt b/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/pror/reqif10/editor/presentation/service/README.txt
new file mode 100644
index 0000000..dbd0b1c
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/pror/reqif10/editor/presentation/service/README.txt
@@ -0,0 +1 @@
+These test require the Eclipse infrastructure. Therefore, they must run as Plugin-Tests.
diff --git a/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/pror/reqif10/util/AllUtilTests.java b/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/pror/reqif10/util/AllUtilTests.java
index 1161cad..daf8c5a 100644
--- a/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/pror/reqif10/util/AllUtilTests.java
+++ b/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/pror/reqif10/util/AllUtilTests.java
@@ -16,7 +16,7 @@
@RunWith(Suite.class)
-@SuiteClasses({ ConfigUtilTest.class })
+@SuiteClasses({ ConfigurationUtilTest.class })
public class AllUtilTests {
}
diff --git a/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/pror/reqif10/util/ConfigUtilTest.java b/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/pror/reqif10/util/ConfigurationUtilTest.java
similarity index 71%
rename from org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/pror/reqif10/util/ConfigUtilTest.java
rename to org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/pror/reqif10/util/ConfigurationUtilTest.java
index 9fe926f..0d587f5 100644
--- a/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/pror/reqif10/util/ConfigUtilTest.java
+++ b/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/pror/reqif10/util/ConfigurationUtilTest.java
@@ -10,10 +10,7 @@
******************************************************************************/
package org.eclipse.rmf.pror.reqif10.util;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertSame;
+import static org.junit.Assert.*;
import java.net.URISyntaxException;
import java.util.List;
@@ -24,20 +21,23 @@
import org.eclipse.rmf.pror.reqif10.configuration.ConfigurationFactory;
import org.eclipse.rmf.pror.reqif10.configuration.ConfigurationPackage;
import org.eclipse.rmf.pror.reqif10.configuration.ProrGeneralConfiguration;
+import org.eclipse.rmf.pror.reqif10.configuration.ProrPresentationConfigurations;
import org.eclipse.rmf.pror.reqif10.configuration.ProrToolExtension;
import org.eclipse.rmf.pror.reqif10.testframework.AbstractItemProviderTest;
import org.eclipse.rmf.reqif10.ReqIF;
+import org.eclipse.rmf.reqif10.ReqIF10Factory;
+import org.eclipse.rmf.reqif10.ReqIF10Package;
import org.eclipse.rmf.reqif10.Specification;
import org.eclipse.rmf.reqif10.common.util.ReqIFToolExtensionUtil;
import org.junit.Test;
-public class ConfigUtilTest extends AbstractItemProviderTest {
+public class ConfigurationUtilTest extends AbstractItemProviderTest {
@Test
public void testGetProrToolExtensionNothingThere() throws URISyntaxException {
ReqIF reqif = getTestReqif("simple.reqif");
assertEquals(0, reqif.getToolExtensions().size());
- assertNotNull(ConfigurationUtil.getProrToolExtension(reqif, editingDomain));
+ assertNotNull(ConfigurationUtil.createProrToolExtension(reqif, editingDomain));
assertEquals(1, reqif.getToolExtensions().size());
}
@@ -48,7 +48,7 @@
commandStack.execute(ReqIFToolExtensionUtil.getAddToolExtensionCommand(reqif, extension));
assertEquals(1, reqif.getToolExtensions().size());
- ProrToolExtension retrieved = ConfigurationUtil.getProrToolExtension(reqif, editingDomain);
+ ProrToolExtension retrieved = ConfigurationUtil.createProrToolExtension(reqif, editingDomain);
assertEquals(1, reqif.getToolExtensions().size());
assertSame(extension, retrieved);
}
@@ -60,7 +60,7 @@
commandStack.execute(ReqIFToolExtensionUtil.getAddToolExtensionCommand(reqif, ePackage));
assertEquals(1, reqif.getToolExtensions().size());
- assertNotNull(ConfigurationUtil.getProrToolExtension(reqif, editingDomain));
+ assertNotNull(ConfigurationUtil.createProrToolExtension(reqif, editingDomain));
assertEquals(2, reqif.getToolExtensions().size());
}
@@ -93,4 +93,27 @@
assertNotNull(leftHeaderColumn);
}
+ /**
+ * Adds stepwise the hierarchy until there actually is a
+ * {@link ProrPresentationConfigurations} element. At no point must be there
+ * an exception.
+ */
+ @Test
+ public void testGetPresentationConfigurations() {
+ ReqIF reqif = ReqIF10Factory.eINSTANCE.createReqIF();
+ assertNull(ConfigurationUtil.getPresentationConfigurations(reqif));
+
+ ProrToolExtension toolExtension = ConfigurationFactory.eINSTANCE
+ .createProrToolExtension();
+ reqif.getToolExtensions().add(toolExtension);
+ setViaCommand(reqif, ReqIF10Package.Literals.REQ_IF__TOOL_EXTENSIONS,
+ toolExtension);
+ assertNull(ConfigurationUtil.getPresentationConfigurations(reqif));
+
+ ProrPresentationConfigurations configurations = ConfigurationFactory.eINSTANCE
+ .createProrPresentationConfigurations();
+ toolExtension.setPresentationConfigurations(configurations);
+ assertNotNull(ConfigurationUtil.getPresentationConfigurations(reqif));
+ }
+
}
diff --git a/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/reqif10/configuration/tests/ConfigurationUtilTest.java b/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/reqif10/configuration/tests/ConfigurationUtilTest.java
new file mode 100644
index 0000000..5adc0ec
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10.tests/tests/org/eclipse/rmf/reqif10/configuration/tests/ConfigurationUtilTest.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Formal Mind GmbH and University of Dusseldorf.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Michael Jastram - initial API and implementation
+ ******************************************************************************/
+package org.eclipse.rmf.reqif10.configuration.tests;
+
+import static org.junit.Assert.*;
+import static org.mockito.Mockito.*;
+
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMap.ValueListIterator;
+import org.eclipse.rmf.pror.reqif10.configuration.ProrToolExtension;
+import org.eclipse.rmf.pror.reqif10.testframework.AbstractItemProviderTest;
+import org.eclipse.rmf.pror.reqif10.util.ConfigurationUtil;
+import org.eclipse.rmf.reqif10.ReqIF;
+import org.eclipse.rmf.reqif10.ReqIF10Factory;
+import org.eclipse.rmf.reqif10.ReqIFToolExtension;
+import org.eclipse.rmf.reqif10.impl.ReqIFToolExtensionImpl;
+import org.junit.Test;
+
+public class ConfigurationUtilTest extends AbstractItemProviderTest {
+
+ @Test
+ public void testCreateProrToolExtension() {
+ ReqIF reqif = ReqIF10Factory.eINSTANCE.createReqIF();
+
+ ProrToolExtension toolExtension = ConfigurationUtil
+ .createProrToolExtension(reqif, editingDomain);
+ assertNotNull(toolExtension);
+
+ assertEquals(toolExtension,
+ ConfigurationUtil.createProrToolExtension(reqif, editingDomain));
+ }
+
+ @Test
+ public void testGetProrToolExtension() {
+ ReqIF reqif = ReqIF10Factory.eINSTANCE.createReqIF();
+ assertNull(ConfigurationUtil.getProrToolExtension(reqif));
+ ProrToolExtension toolExtension = ConfigurationUtil
+ .createProrToolExtension(reqif, editingDomain);
+ assertEquals(toolExtension,
+ ConfigurationUtil.getProrToolExtension(reqif));
+ }
+
+ @Test
+ public void testGetProrToolExtensionWithForeignExtension() {
+ ReqIF reqif = ReqIF10Factory.eINSTANCE.createReqIF();
+
+ ReqIFToolExtension mockToolExtension = buildMockToolExtension();
+
+ reqif.getToolExtensions().add(mockToolExtension);
+ assertNull(ConfigurationUtil.getProrToolExtension(reqif));
+ ProrToolExtension toolExtension = ConfigurationUtil
+ .createProrToolExtension(reqif, editingDomain);
+ assertEquals(toolExtension,
+ ConfigurationUtil.getProrToolExtension(reqif));
+ }
+
+ /**
+ * Mocks a {@link ProrToolExtension}. (mj) I am not too happy about this
+ * rather fragilie mocking.
+ *
+ * @return
+ */
+ private ReqIFToolExtension buildMockToolExtension() {
+ ReqIFToolExtension mockToolExtension = mock(ReqIFToolExtensionImpl.class);
+ FeatureMap featureMap = mock(FeatureMap.class);
+ @SuppressWarnings("unchecked")
+ ValueListIterator<Object> valueListIterator = mock(ValueListIterator.class);
+ when(featureMap.valueListIterator()).thenReturn(valueListIterator);
+ when(mockToolExtension.getAny()).thenReturn(featureMap);
+ return mockToolExtension;
+ }
+
+}
diff --git a/org.eclipse.rmf.pror.reqif10/META-INF/MANIFEST.MF b/org.eclipse.rmf.pror.reqif10/META-INF/MANIFEST.MF
index 00ec0c3..211360e 100644
--- a/org.eclipse.rmf.pror.reqif10/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.pror.reqif10/META-INF/MANIFEST.MF
@@ -2,13 +2,13 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.pror.reqif10;singleton:=true
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-ClassPath: .
Bundle-Localization: plugin
Require-Bundle: org.eclipse.emf.ecore,
org.eclipse.ui.intro,
- org.eclipse.rmf.reqif10;bundle-version="0.3.2";visibility:=reexport,
- org.eclipse.rmf.reqif10.common;bundle-version="0.3.2";visibility:=reexport
+ org.eclipse.rmf.reqif10;bundle-version="0.4.0";visibility:=reexport,
+ org.eclipse.rmf.reqif10.common;bundle-version="0.4.0";visibility:=reexport
Export-Package: org.eclipse.rmf.pror.reqif10.configuration,
org.eclipse.rmf.pror.reqif10.configuration.impl,
org.eclipse.rmf.pror.reqif10.configuration.util
diff --git a/org.eclipse.rmf.pror.reqif10/intro/img/block-bg.png b/org.eclipse.rmf.pror.reqif10/intro/img/block-bg.png
new file mode 100644
index 0000000..56562d9
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10/intro/img/block-bg.png
Binary files differ
diff --git a/org.eclipse.rmf.pror.reqif10/intro/img/block-bottom.png b/org.eclipse.rmf.pror.reqif10/intro/img/block-bottom.png
new file mode 100644
index 0000000..90cd56b
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10/intro/img/block-bottom.png
Binary files differ
diff --git a/org.eclipse.rmf.pror.reqif10/intro/img/block-top.png b/org.eclipse.rmf.pror.reqif10/intro/img/block-top.png
new file mode 100644
index 0000000..8737fbd
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10/intro/img/block-top.png
Binary files differ
diff --git a/org.eclipse.rmf.pror.reqif10/intro/img/pror-essentials.png b/org.eclipse.rmf.pror.reqif10/intro/img/pror-essentials.png
new file mode 100644
index 0000000..946bbaa
--- /dev/null
+++ b/org.eclipse.rmf.pror.reqif10/intro/img/pror-essentials.png
Binary files differ
diff --git a/org.eclipse.rmf.pror.reqif10/intro/intro.html b/org.eclipse.rmf.pror.reqif10/intro/intro.html
index 902f2a0..dc54c9b 100644
--- a/org.eclipse.rmf.pror.reqif10/intro/intro.html
+++ b/org.eclipse.rmf.pror.reqif10/intro/intro.html
@@ -18,19 +18,55 @@
</tr>
</table>
+<div style="float:right; position:relative; top:20px; margin: 20px; width: 265px; background-image: url('img/block-bg.png');">
+<img src="img/block-top.png"/>
+
+<p style="text-align: center; position:relative; top:-20px;">
+<img src="img/pror-essentials.png" />
+</p>
+
+<p style="margin:10px; position:relative; top:-20px;">
+Essentials are an extension to ProR that contain useful functionality, but are not part the Eclipse distribution. Features
+include: <b>XHTML support</b> (formatted text) and <b>Suspect Links</b> (set a flag if source or target of a link changes).
+</p>
+
+<p style="margin:10px; position:relative; top:-20px;">
+Essentials are free and can be installed via Help | Install new Software... Select <b>ProR Essentials</b>
+from the "Work with:" dropwdown and follow the standard installation procedure.
+</p>
+
+<p style="margin:10px; position:relative; top:-20px;">
+More information can be found at the
+<a href="http://www.formalmind.com/en/pror-essentials">ProR Essentials site</a>.
+</p>
+
+<img src="img/block-bottom.png"/>
+</div>
+
<h1>The ProR Platform for Requirements Engineering and Formal Modeling</h1>
<p> ProR is a tool for requirements engineering that supports the
-<a href="http://pror.org/category/glossary/reqif">ReqIF</a> 1.0.1 Standard natively.
+ReqIF 1.0.1 Standard natively.
It is Eclipse-based and is built for extensibility.</p>
-<p>Please visit the <a href="http://eclipse.org/rmf/pror">ProR page at Eclipse</a> for the latest information.</p>
+<ul>
-<p>ProR is part of the <a href="http://eclipse.org/rmf/">Requirements Modeling Framework (RMF)</a>.</p>
+<li><b>More Information?</b>
+Please visit the <a href="http://eclipse.org/rmf/pror">ProR page at Eclipse</a> for the latest information.
+ProR is part of the <a href="http://eclipse.org/rmf/">Requirements Modeling Framework (RMF)</a>.</li>
-<p>ProR and RMF are still in Incubation and currently under active development. Please use
-with care.</p>
+<li style="margin-top: 20px;"><b>Found a Bug?</b>
+ProR and RMF are still in Incubation and currently under active development. Please use with care.
+You can <a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?assigned_to=&blocked=&bug_file_loc=http%3A%2F%2F&bug_severity=normal&bug_status=NEW&comment=&contenttypeentry=&contenttypemethod=autodetect&contenttypeselection=text%2Fplain&data=&dependson=&description=&flag_type-1=X&flag_type-11=X&flag_type-12=X&flag_type-2=X&flag_type-4=X&flag_type-6=X&flag_type-7=X&flag_type-8=X&form_name=enter_bug&keywords=&maketemplate=Remember%20values%20as%20bookmarkable%20template&op_sys=All&product=MDT.RMF&qa_contact=&rep_platform=All&short_desc=&version=unspecified">report bugs</a>,
+or ask questions in the <a href="http://www.eclipse.org/forums/eclipse.rmf">RMF Forum</a>.</li>
-<p>Please close this view to start using ProR!</p>
+<li style="margin-top: 20px;"><b>Need more functionality?</b> Consider installing ProR Essentials (see box to the right).</li>
+
+<li style="margin-top: 20px;"><b>Regular news and information?</b> Consider subscribing to the <a href="http://www.formalmind.com/en/newsletter/subscriptions">ProR Newsletter</a>.</li>
+
+<li style="margin-top: 20px;"><b>Do you want to get started?</b> Just close this view and start creating requirements.</li>
+
+</ul>
+
</body>
</html>
\ No newline at end of file
diff --git a/org.eclipse.rmf.pror.reqif10/model/reqif10.genmodel b/org.eclipse.rmf.pror.reqif10/model/reqif10.genmodel
index 064de60..996416a 100644
--- a/org.eclipse.rmf.pror.reqif10/model/reqif10.genmodel
+++ b/org.eclipse.rmf.pror.reqif10/model/reqif10.genmodel
@@ -2,8 +2,7 @@
<genmodel:GenModel xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.rmf.pror.reqif10/src"
- modelPluginID="org.eclipse.rmf.pror.reqif10" templateDirectory="org.eclipse.rmf.pror.reqif10/model/templates"
- dynamicTemplates="true" modelName="Configuration" editPluginClass="org.eclipse.rmf.pror.reqif10.provider.Reqif10EditPlugin"
+ modelPluginID="org.eclipse.rmf.pror.reqif10" modelName="Configuration" editPluginClass="org.eclipse.rmf.pror.reqif10.provider.Reqif10EditPlugin"
importerID="org.eclipse.emf.importer.ecore" complianceLevel="6.0" copyrightFields="false"
usedGenPackages="platform:/plugin/org.eclipse.emf.ecore/model/XMLNamespace.genmodel#//namespace">
<foreignModel>configuration.ecore</foreignModel>
@@ -23,7 +22,7 @@
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute configuration.ecore#//Column/label"/>
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute configuration.ecore#//Column/width"/>
</genClasses>
- <genClasses image="false" ecoreClass="configuration.ecore#//ProrPresentationConfigurations">
+ <genClasses provider="Stateful" image="false" ecoreClass="configuration.ecore#//ProrPresentationConfigurations">
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference configuration.ecore#//ProrPresentationConfigurations/presentationConfigurations"/>
</genClasses>
<genClasses image="false" ecoreClass="configuration.ecore#//ProrPresentationConfiguration">
@@ -80,8 +79,8 @@
<genClasses image="false" ecoreClass="../../org.eclipse.rmf.reqif10/model/reqif10.ecore#//ReqIF">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ../../org.eclipse.rmf.reqif10/model/reqif10.ecore#//ReqIF/lang"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference ../../org.eclipse.rmf.reqif10/model/reqif10.ecore#//ReqIF/theHeader"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference ../../org.eclipse.rmf.reqif10/model/reqif10.ecore#//ReqIF/toolExtensions"/>
<genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference ../../org.eclipse.rmf.reqif10/model/reqif10.ecore#//ReqIF/coreContent"/>
+ <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference ../../org.eclipse.rmf.reqif10/model/reqif10.ecore#//ReqIF/toolExtensions"/>
</genClasses>
<genClasses image="false" ecoreClass="../../org.eclipse.rmf.reqif10/model/reqif10.ecore#//ReqIFHeader">
<genFeatures createChild="false" ecoreFeature="ecore:EAttribute ../../org.eclipse.rmf.reqif10/model/reqif10.ecore#//ReqIFHeader/comment"/>
diff --git a/org.eclipse.rmf.pror.reqif10/pom.xml b/org.eclipse.rmf.pror.reqif10/pom.xml
index 34fde6d..1b14bd7 100644
--- a/org.eclipse.rmf.pror.reqif10/pom.xml
+++ b/org.eclipse.rmf.pror.reqif10/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.pror.reqif10</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<groupId>org.eclipse.rmf.plugins</groupId>
<build>
diff --git a/org.eclipse.rmf.releng.devtool.modelcleaner/META-INF/MANIFEST.MF b/org.eclipse.rmf.releng.devtool.modelcleaner/META-INF/MANIFEST.MF
index 4135362..3ec5293 100644
--- a/org.eclipse.rmf.releng.devtool.modelcleaner/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.releng.devtool.modelcleaner/META-INF/MANIFEST.MF
@@ -2,5 +2,5 @@
Bundle-ManifestVersion: 2
Bundle-Name: Metamodel Plug-in
Bundle-SymbolicName: org.eclipse.rmf.releng.devtools.modelcleaner
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-Vendor:
diff --git a/org.eclipse.rmf.releng.product/plugin_customization.ini b/org.eclipse.rmf.releng.product/plugin_customization.ini
index 1c9215f..3811028 100644
--- a/org.eclipse.rmf.releng.product/plugin_customization.ini
+++ b/org.eclipse.rmf.releng.product/plugin_customization.ini
@@ -1,2 +1,6 @@
org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = true
defaultPerspectiveId = org.eclipse.rmf.pror.ProrPerspective
+
+# check for updates on startup
+org.eclipse.equinox.p2.ui.sdk.scheduler/enabled=true
+org.eclipse.equinox.p2.ui.sdk.scheduler/schedule=on-startup
\ No newline at end of file
diff --git a/org.eclipse.rmf.releng.product/pom.xml b/org.eclipse.rmf.releng.product/pom.xml
index 4854c10..7daef3b 100644
--- a/org.eclipse.rmf.releng.product/pom.xml
+++ b/org.eclipse.rmf.releng.product/pom.xml
@@ -6,28 +6,36 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.releng.product</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-repository</packaging>
<properties>
<maven.build.timestamp.format>yyyyMMddHHmm</maven.build.timestamp.format>
- <app.version>0.3.2</app.version>
+ <app.version>0.4.0</app.version>
</properties>
<build>
<plugins>
- <plugin>
+ <!--plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-repository-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<includeAllDependencies>true</includeAllDependencies>
</configuration>
- </plugin>
+ </plugin-->
+ <plugin>
+ <groupId>org.eclipse.tycho</groupId>
+ <artifactId>tycho-p2-publisher-plugin</artifactId>
+ <version>${tycho-version}</version>
+ <configuration>
+ <publishArtifacts>true</publishArtifacts>
+ </configuration>
+ </plugin>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-p2-director-plugin</artifactId>
diff --git a/org.eclipse.rmf.releng.product/rmf-pror-standalone.p2.inf b/org.eclipse.rmf.releng.product/rmf-pror-standalone.p2.inf
index 87ad91f..c9f3b54 100644
--- a/org.eclipse.rmf.releng.product/rmf-pror-standalone.p2.inf
+++ b/org.eclipse.rmf.releng.product/rmf-pror-standalone.p2.inf
@@ -1,11 +1,5 @@
-requires.1.namespace = org.eclipse.equinox.p2.iu
-requires.1.name = org.eclipse.rmf.pror.reqif10.feature.feature.group
-requires.1.range = [0.3.2, 0.5.0)
-
-requires.2.namespace = org.eclipse.equinox.p2.iu
-requires.2.name = org.eclipse.rmf.reqif10.feature.feature.group
-requires.2.range = [0.3.2, 0.5.0)
-
instructions.configure=\
-addRepository(type:0,location:http${#58}//download.eclipse.org/rmf/updates);\
-addRepository(type:1,location:http${#58}//download.eclipse.org/rmf/updates);
\ No newline at end of file
+addRepository(type:0,location:http${#58}//download.eclipse.org/rmf/product-updates);\
+addRepository(type:1,location:http${#58}//download.eclipse.org/rmf/product-updates);\
+addRepository(type:0,location:http${#58}//update.formalmind.com/essentials);\
+addRepository(type:1,location:http${#58}//update.formalmind.com/essentials);
\ No newline at end of file
diff --git a/org.eclipse.rmf.releng.product/rmf-pror-standalone.product b/org.eclipse.rmf.releng.product/rmf-pror-standalone.product
index e9188c5..ce174a1 100644
--- a/org.eclipse.rmf.releng.product/rmf-pror-standalone.product
+++ b/org.eclipse.rmf.releng.product/rmf-pror-standalone.product
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?pde version="3.5"?>
-<product name="RMF ProR Standalone" uid="org.eclipse.rmf.pror.reqif10.product" id="org.eclipse.rmf.pror.reqif10.product" application="org.eclipse.ui.ide.workbench" version="0.3.2" useFeatures="true" includeLaunchers="true">
+<product name="RMF ProR Standalone" uid="org.eclipse.rmf.pror.reqif10.product" id="org.eclipse.rmf.pror.reqif10.product" application="org.eclipse.ui.ide.workbench" version="0.4.0" useFeatures="true" includeLaunchers="true">
<aboutInfo>
<image path="/org.eclipse.rmf.pror.reqif10/pror-about.png"/>
diff --git a/org.eclipse.rmf.releng.repository/category.xml b/org.eclipse.rmf.releng.repository/category.xml
index f8cc28f..80ea726 100644
--- a/org.eclipse.rmf.releng.repository/category.xml
+++ b/org.eclipse.rmf.releng.repository/category.xml
@@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
- <feature url="features/org.eclipse.rmf.pror.reqif10.feature_0.3.2.qualifier.jar" id="org.eclipse.rmf.pror.reqif10.feature" version="0.3.2.qualifier">
+ <feature url="features/org.eclipse.rmf.pror.reqif10.feature_0.4.0.qualifier.jar" id="org.eclipse.rmf.pror.reqif10.feature" version="0.4.0.qualifier">
<category name="RMF"/>
</feature>
- <feature url="features/org.eclipse.rmf.reqif10.feature_0.3.2.qualifier.jar" id="org.eclipse.rmf.reqif10.feature" version="0.3.2.qualifier">
+ <feature url="features/org.eclipse.rmf.reqif10.feature_0.4.0.qualifier.jar" id="org.eclipse.rmf.reqif10.feature" version="0.4.0.qualifier">
<category name="RMF"/>
</feature>
- <feature url="features/org.eclipse.rmf.pror.reqif10.sdk.feature_0.3.2.qualifier.jar" id="org.eclipse.rmf.pror.reqif10.sdk.feature" version="0.3.2.qualifier">
+ <feature url="features/org.eclipse.rmf.pror.reqif10.sdk.feature_0.4.0.qualifier.jar" id="org.eclipse.rmf.pror.reqif10.sdk.feature" version="0.4.0.qualifier">
<category name="RMF SDK"/>
</feature>
- <feature url="features/org.eclipse.rmf.reqif10.sdk.feature_0.3.2.qualifier.jar" id="org.eclipse.rmf.reqif10.sdk.feature" version="0.3.2.qualifier">
+ <feature url="features/org.eclipse.rmf.reqif10.sdk.feature_0.4.0.qualifier.jar" id="org.eclipse.rmf.reqif10.sdk.feature" version="0.4.0.qualifier">
<category name="RMF SDK"/>
</feature>
<category-def name="RMF" label="RMF"/>
diff --git a/org.eclipse.rmf.releng.repository/pom.xml b/org.eclipse.rmf.releng.repository/pom.xml
index 3e09aed..dde4e08 100644
--- a/org.eclipse.rmf.releng.repository/pom.xml
+++ b/org.eclipse.rmf.releng.repository/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.releng.repository</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-repository</packaging>
<!--
diff --git a/org.eclipse.rmf.releng.target/pom.xml b/org.eclipse.rmf.releng.target/pom.xml
index 9d0da17..ebfd3a4 100644
--- a/org.eclipse.rmf.releng.target/pom.xml
+++ b/org.eclipse.rmf.releng.target/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.target</artifactId>
diff --git a/org.eclipse.rmf.releng/pom.xml b/org.eclipse.rmf.releng/pom.xml
index 554b5f9..f2047d3 100644
--- a/org.eclipse.rmf.releng/pom.xml
+++ b/org.eclipse.rmf.releng/pom.xml
@@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>pom</packaging>
<!-- this is the parent POM from which all modules inherit common settings -->
@@ -120,7 +120,7 @@
<artifact>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.target</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<classifier>INDIGO_3_7_1</classifier>
</artifact>
</target>
@@ -170,7 +170,7 @@
<artifact>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.target</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<classifier>INDIGO_3_7_2</classifier>
</artifact>
</target>
diff --git a/org.eclipse.rmf.reqif10.common/META-INF/MANIFEST.MF b/org.eclipse.rmf.reqif10.common/META-INF/MANIFEST.MF
index ac37e6b..d31c94f 100644
--- a/org.eclipse.rmf.reqif10.common/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.reqif10.common/META-INF/MANIFEST.MF
@@ -3,10 +3,10 @@
Bundle-Localization: plugin
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.reqif10.common
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-Activator: org.eclipse.rmf.reqif10.internal.common.Activator
Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.rmf.reqif10;bundle-version="0.3.2"
+ org.eclipse.rmf.reqif10;bundle-version="0.4.0"
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
Export-Package: org.eclipse.rmf.reqif10.common.util
diff --git a/org.eclipse.rmf.reqif10.common/pom.xml b/org.eclipse.rmf.reqif10.common/pom.xml
index 5f68a26..7e10a31 100644
--- a/org.eclipse.rmf.reqif10.common/pom.xml
+++ b/org.eclipse.rmf.reqif10.common/pom.xml
@@ -19,11 +19,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.reqif10.common</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<groupId>org.eclipse.rmf.plugins</groupId>
<build>
diff --git a/org.eclipse.rmf.reqif10.common/src/org/eclipse/rmf/reqif10/common/util/ReqIFToolExtensionUtil.java b/org.eclipse.rmf.reqif10.common/src/org/eclipse/rmf/reqif10/common/util/ReqIFToolExtensionUtil.java
index 7c8bec8..3def013 100644
--- a/org.eclipse.rmf.reqif10.common/src/org/eclipse/rmf/reqif10/common/util/ReqIFToolExtensionUtil.java
+++ b/org.eclipse.rmf.reqif10.common/src/org/eclipse/rmf/reqif10/common/util/ReqIFToolExtensionUtil.java
@@ -84,7 +84,7 @@
// add as any wildcard
ExtendedMetaData extendedMetaData = new BasicExtendedMetaData();
- EStructuralFeature toolExtensionFeature = extendedMetaData.demandFeature(toolExtension.eClass().getEPackage().getNsURI(), "root", true,
+ EStructuralFeature toolExtensionFeature = extendedMetaData.demandFeature(toolExtension.eClass().getEPackage().getNsURI(), "root", true, //$NON-NLS-1$
true);
reqIFToolExtension.eSet(toolExtensionFeature, toolExtension);
}
@@ -121,7 +121,7 @@
final boolean prepare;
if (null != reqIF && null != toolExtension) {
ExtendedMetaData extendedMetaData = new BasicExtendedMetaData();
- toolExtensionFeature = extendedMetaData.demandFeature(toolExtension.eClass().getEPackage().getNsURI(), "root", true, true);
+ toolExtensionFeature = extendedMetaData.demandFeature(toolExtension.eClass().getEPackage().getNsURI(), "root", true, true); //$NON-NLS-1$
prepare = true;
} else {
prepare = false;
diff --git a/org.eclipse.rmf.reqif10.feature/feature.xml b/org.eclipse.rmf.reqif10.feature/feature.xml
index 3c7c894..f122c7a 100644
--- a/org.eclipse.rmf.reqif10.feature/feature.xml
+++ b/org.eclipse.rmf.reqif10.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.rmf.reqif10.feature"
label="RMF ReqIf 1.0 Feature (Incubation)"
- version="0.3.2.qualifier"
+ version="0.4.0.qualifier"
provider-name="Eclipse Modeling Project"
plugin="org.eclipse.rmf.reqif10">
diff --git a/org.eclipse.rmf.reqif10.feature/pom.xml b/org.eclipse.rmf.reqif10.feature/pom.xml
index 0728a61..35e13e6 100644
--- a/org.eclipse.rmf.reqif10.feature/pom.xml
+++ b/org.eclipse.rmf.reqif10.feature/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.reqif10.feature</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
<groupId>org.eclipse.rmf.features</groupId>
</project>
\ No newline at end of file
diff --git a/org.eclipse.rmf.reqif10.sdk.feature/feature.xml b/org.eclipse.rmf.reqif10.sdk.feature/feature.xml
index 6c185a4..cafb58e 100644
--- a/org.eclipse.rmf.reqif10.sdk.feature/feature.xml
+++ b/org.eclipse.rmf.reqif10.sdk.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.rmf.reqif10.sdk.feature"
label="RMF ReqIf 1.0 SDK Feature (Incubation)"
- version="0.3.2.qualifier"
+ version="0.4.0.qualifier"
provider-name="Eclipse Modeling Project"
plugin="org.eclipse.rmf.reqif10">
diff --git a/org.eclipse.rmf.reqif10.sdk.feature/pom.xml b/org.eclipse.rmf.reqif10.sdk.feature/pom.xml
index e45b09f..38179da 100644
--- a/org.eclipse.rmf.reqif10.sdk.feature/pom.xml
+++ b/org.eclipse.rmf.reqif10.sdk.feature/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.reqif10.sdk.feature</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
<groupId>org.eclipse.rmf.features</groupId>
</project>
\ No newline at end of file
diff --git a/org.eclipse.rmf.reqif10.tests.feature/feature.xml b/org.eclipse.rmf.reqif10.tests.feature/feature.xml
index 1416dd0..c5180e7 100644
--- a/org.eclipse.rmf.reqif10.tests.feature/feature.xml
+++ b/org.eclipse.rmf.reqif10.tests.feature/feature.xml
@@ -2,7 +2,7 @@
<feature
id="org.eclipse.rmf.reqif10.tests.feature"
label="Feature"
- version="0.3.2.qualifier">
+ version="0.4.0.qualifier">
<description url="http://www.example.com/description">
[Enter Feature Description here.]
diff --git a/org.eclipse.rmf.reqif10.tests.feature/pom.xml b/org.eclipse.rmf.reqif10.tests.feature/pom.xml
index cdf66dc..60e1e8c 100644
--- a/org.eclipse.rmf.reqif10.tests.feature/pom.xml
+++ b/org.eclipse.rmf.reqif10.tests.feature/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.reqif10.tests.feature</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
<groupId>org.eclipse.rmf.features</groupId>
</project>
\ No newline at end of file
diff --git a/org.eclipse.rmf.reqif10.tests/META-INF/MANIFEST.MF b/org.eclipse.rmf.reqif10.tests/META-INF/MANIFEST.MF
index 8bc4290..83ea32c 100644
--- a/org.eclipse.rmf.reqif10.tests/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.reqif10.tests/META-INF/MANIFEST.MF
@@ -2,20 +2,20 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.reqif10.tests;singleton:=true
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.apache.xerces,
org.eclipse.core.runtime,
- org.eclipse.rmf.reqif10;bundle-version="0.3.2";visibility:=reexport,
+ org.eclipse.rmf.reqif10;bundle-version="0.4.0";visibility:=reexport,
org.eclipse.emf.ecore.xmi;visibility:=reexport,
org.junit;visibility:=reexport,
- org.eclipse.rmf.serialization;bundle-version="0.3.2",
- org.eclipse.rmf.pror.reqif10;bundle-version="0.3.2",
- org.eclipse.rmf.pror.reqif10.presentation.headline;bundle-version="0.3.2",
- org.eclipse.rmf.reqif10.common;bundle-version="0.3.2"
+ org.eclipse.rmf.serialization;bundle-version="0.4.0",
+ org.eclipse.rmf.pror.reqif10;bundle-version="0.4.0",
+ org.eclipse.rmf.pror.reqif10.presentation.headline;bundle-version="0.4.0",
+ org.eclipse.rmf.reqif10.common;bundle-version="0.4.0"
Bundle-ActivationPolicy: lazy
Export-Package: org.eclipse.rmf.reqif10.tests.uc001.tc1200,
org.eclipse.rmf.reqif10.tests.util
diff --git a/org.eclipse.rmf.reqif10.tests/pom.xml b/org.eclipse.rmf.reqif10.tests/pom.xml
index 86f9473..5c01a61 100644
--- a/org.eclipse.rmf.reqif10.tests/pom.xml
+++ b/org.eclipse.rmf.reqif10.tests/pom.xml
@@ -19,12 +19,12 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<groupId>org.eclipse.rmf.plugins</groupId>
<artifactId>org.eclipse.rmf.reqif10.tests</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<profiles>
<profile>
diff --git a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc000/tc4000/TC0004000ToolExtensionWithEcoreMetamodelModelBuilder.java b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc000/tc4000/TC0004000ToolExtensionWithEcoreMetamodelModelBuilder.java
index 524fac1..429411c 100644
--- a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc000/tc4000/TC0004000ToolExtensionWithEcoreMetamodelModelBuilder.java
+++ b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc000/tc4000/TC0004000ToolExtensionWithEcoreMetamodelModelBuilder.java
@@ -10,6 +10,7 @@
import org.eclipse.rmf.reqif10.common.util.ReqIFToolExtensionUtil;
import org.eclipse.rmf.reqif10.tests.util.MinimalModelBuilder;
+@SuppressWarnings("nls")
public class TC0004000ToolExtensionWithEcoreMetamodelModelBuilder extends MinimalModelBuilder {
public TC0004000ToolExtensionWithEcoreMetamodelModelBuilder() throws Exception {
diff --git a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc000/tc4000/TC0004000ToolExtensionWithEcoreMetamodelTests.java b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc000/tc4000/TC0004000ToolExtensionWithEcoreMetamodelTests.java
index 16ecca8..4922deb 100644
--- a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc000/tc4000/TC0004000ToolExtensionWithEcoreMetamodelTests.java
+++ b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc000/tc4000/TC0004000ToolExtensionWithEcoreMetamodelTests.java
@@ -12,6 +12,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
+@SuppressWarnings("nls")
public class TC0004000ToolExtensionWithEcoreMetamodelTests extends AbstractTestCase {
static final String TEST_CASE_ID = "TC0004000";
static final String REFERENCE_DATA_FILENAME = getWorkingFileName(getReferenceDataFileName(TEST_CASE_ID, false));
diff --git a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc000/tc4001/TC0004001ToolExtensionWithCustomRuntimeCreatedMetamodelModelBuilder.java b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc000/tc4001/TC0004001ToolExtensionWithCustomRuntimeCreatedMetamodelModelBuilder.java
index a07c8c2..b822f01 100644
--- a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc000/tc4001/TC0004001ToolExtensionWithCustomRuntimeCreatedMetamodelModelBuilder.java
+++ b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc000/tc4001/TC0004001ToolExtensionWithCustomRuntimeCreatedMetamodelModelBuilder.java
@@ -12,6 +12,7 @@
import org.eclipse.rmf.reqif10.common.util.ReqIFToolExtensionUtil;
import org.eclipse.rmf.reqif10.tests.util.MinimalModelBuilder;
+@SuppressWarnings("nls")
public class TC0004001ToolExtensionWithCustomRuntimeCreatedMetamodelModelBuilder extends MinimalModelBuilder {
EPackage metamodel;
@@ -35,6 +36,7 @@
createMetamodel();
}
+ @SuppressWarnings("unchecked")
@Override
public void createToolExtensions() throws Exception {
ReqIF reqIF = getReqIF();
@@ -75,7 +77,7 @@
// do nothing with mmSingleUnsetDefaultValue
// mmSingleSetNotDefaultValue
- EObject nodeWithReferences_1 = factory.create(mmNodeWithReferences);
+ // EObject nodeWithReferences_1 = factory.create(mmNodeWithReferences);
nodeWithReferences_root.eSet(mmSingleSetNotDefaultValue, null);
// do nothing for mmManyUnssetDefaultValue
diff --git a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc000/tc4001/TC0004001ToolExtensionWithCustomRuntimeCreatedMetamodelTests.java b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc000/tc4001/TC0004001ToolExtensionWithCustomRuntimeCreatedMetamodelTests.java
index 272715d..f89fb9c 100644
--- a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc000/tc4001/TC0004001ToolExtensionWithCustomRuntimeCreatedMetamodelTests.java
+++ b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc000/tc4001/TC0004001ToolExtensionWithCustomRuntimeCreatedMetamodelTests.java
@@ -12,6 +12,7 @@
import org.junit.BeforeClass;
import org.junit.Test;
+@SuppressWarnings("nls")
public class TC0004001ToolExtensionWithCustomRuntimeCreatedMetamodelTests extends AbstractTestCase {
static final String TEST_CASE_ID = "TC0004001";
static final String REFERENCE_DATA_FILENAME = getWorkingFileName(getReferenceDataFileName(TEST_CASE_ID, false));
diff --git a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1100/TC1100UnformattedSystemAttributesAndSpecHierarchyModelBuilder.java b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1100/TC1100UnformattedSystemAttributesAndSpecHierarchyModelBuilder.java
index 8ebda35..2abcd05 100644
--- a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1100/TC1100UnformattedSystemAttributesAndSpecHierarchyModelBuilder.java
+++ b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1100/TC1100UnformattedSystemAttributesAndSpecHierarchyModelBuilder.java
@@ -42,7 +42,7 @@
// SpecificationTypes
SpecificationType specificationType;
- AttributeDefinitionString specificationTypeAttributeDefinitionStringName;
+ AttributeDefinitionXHTML specificationTypeAttributeDefinitionXhtmlName;
AttributeDefinitionString specificationTypeAttributeDefinitionStringForeignCreatedBy;
AttributeDefinitionString specificationTypeAttributeDefinitionStringForeignModifiedBy;
AttributeDefinitionDate specificationTypeAttributeDefinitionDateForeignCreatedOn;
@@ -139,11 +139,11 @@
specificationType.setLongName("TC1100 SpecificationType");
specificationType.setLastChange(toDate(LAST_CHANGE_STRING));
- specificationTypeAttributeDefinitionStringName = ReqIF10Factory.eINSTANCE.createAttributeDefinitionString();
- specificationTypeAttributeDefinitionStringName.setIdentifier("ID_TC1100_SpecificationTypeAttributeDefinitionString_" + REQIF_NAME);
- specificationTypeAttributeDefinitionStringName.setLongName(REQIF_NAME);
- specificationTypeAttributeDefinitionStringName.setLastChange(toDate(LAST_CHANGE_STRING));
- specificationTypeAttributeDefinitionStringName.setType(datatypeDefinitionString);
+ specificationTypeAttributeDefinitionXhtmlName = ReqIF10Factory.eINSTANCE.createAttributeDefinitionXHTML();
+ specificationTypeAttributeDefinitionXhtmlName.setIdentifier("ID_TC1100_SpecificationTypeAttributeDefinitionXHTML_" + REQIF_NAME);
+ specificationTypeAttributeDefinitionXhtmlName.setLongName(REQIF_NAME);
+ specificationTypeAttributeDefinitionXhtmlName.setLastChange(toDate(LAST_CHANGE_STRING));
+ specificationTypeAttributeDefinitionXhtmlName.setType(datatypeDefinitionXhtml);
specificationTypeAttributeDefinitionStringForeignCreatedBy = ReqIF10Factory.eINSTANCE.createAttributeDefinitionString();
specificationTypeAttributeDefinitionStringForeignCreatedBy.setIdentifier("ID_TC1100_SpecificationTypeAttributeDefinitionString_"
@@ -166,7 +166,7 @@
specificationTypeAttributeDefinitionStringForeignModifiedBy.setLastChange(toDate(LAST_CHANGE_STRING));
specificationTypeAttributeDefinitionStringForeignModifiedBy.setType(datatypeDefinitionString);
- specificationType.getSpecAttributes().add(specificationTypeAttributeDefinitionStringName);
+ specificationType.getSpecAttributes().add(specificationTypeAttributeDefinitionXhtmlName);
specificationType.getSpecAttributes().add(specificationTypeAttributeDefinitionStringForeignCreatedBy);
specificationType.getSpecAttributes().add(specificationTypeAttributeDefinitionDateForeignCreatedOn);
specificationType.getSpecAttributes().add(specificationTypeAttributeDefinitionStringForeignModifiedBy);
@@ -356,12 +356,13 @@
// set the specification attributes
AttributeValueString attributeValueString;
+ AttributeValueXHTML attributeValueXhtml;
AttributeValueDate attributeValueDate;
- attributeValueString = ReqIF10Factory.eINSTANCE.createAttributeValueString();
- attributeValueString.setDefinition(specificationTypeAttributeDefinitionStringName);
- attributeValueString.setTheValue("Specification1");
- specification.getValues().add(attributeValueString);
+ attributeValueXhtml = ReqIF10Factory.eINSTANCE.createAttributeValueXHTML();
+ attributeValueXhtml.setDefinition(specificationTypeAttributeDefinitionXhtmlName);
+ attributeValueXhtml.setTheValue(createXhtmlValue("Specification1"));
+ specification.getValues().add(attributeValueXhtml);
attributeValueString = ReqIF10Factory.eINSTANCE.createAttributeValueString();
attributeValueString.setDefinition(specificationTypeAttributeDefinitionStringForeignCreatedBy);
diff --git a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1100/package.html b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1100/package.html
index d548262..c52a8fd 100644
--- a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1100/package.html
+++ b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1100/package.html
@@ -123,7 +123,7 @@
<tbody>
<tr>
<td valign="top" >ReqIF.Name</td>
-<td valign="top" >String</td>
+<td valign="top" >XHTML</td>
<td valign="top" > </td>
</tr>
diff --git a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1200/TC1200FormatedContentModelBuilder.java b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1200/TC1200FormatedContentModelBuilder.java
index 6df4d35..cfd85d2 100644
--- a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1200/TC1200FormatedContentModelBuilder.java
+++ b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1200/TC1200FormatedContentModelBuilder.java
@@ -48,6 +48,7 @@
import org.eclipse.rmf.reqif10.xhtml.XhtmlDtType;
import org.eclipse.rmf.reqif10.xhtml.XhtmlFactory;
import org.eclipse.rmf.reqif10.xhtml.XhtmlLiType;
+import org.eclipse.rmf.reqif10.xhtml.XhtmlObjectType;
import org.eclipse.rmf.reqif10.xhtml.XhtmlOlType;
import org.eclipse.rmf.reqif10.xhtml.XhtmlPType;
import org.eclipse.rmf.reqif10.xhtml.XhtmlPackage;
@@ -191,253 +192,214 @@
// level 1 / top level
// create fill XhtmlDivType in XhtmlContent.div at original value
- // description = "xhtml.p.type_the_original_value";
- // xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlPType(), true);
- // specObject = createSpecObject(description,
- // ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheOriginalValue(), xhtmlLevel1);
-
+ description = "xhtml.p.type_the_original_value";
+ xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlPType(), true);
+ specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheOriginalValue(), xhtmlLevel1);
description = "xhtml.p.type";
- xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlPType(), false);
+ xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlPType(), true);
specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(), xhtmlLevel1);
getReqIF().getCoreContent().getSpecObjects().add(specObject);
- //
- // // create fill XhtmlDivType in XhtmlContent.div at original value
- // description = "xhtml.div.type_the_original_value";
- // xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), true);
- // specObject = createSpecObject(description,
- // ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheOriginalValue(), xhtmlLevel1);
- // description = "xhtml.div.type";
- // xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), true);
- // specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(),
- // xhtmlLevel1);
- // getReqIF().getCoreContent().getSpecObjects().add(specObject);
- //
- // // level 2
- // // objects that are contained on xhtml.p.type
- // createSpecObjectWithPXhtml("xhtml.br.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Br(),
- // XhtmlPackage.eINSTANCE.getXhtmlBrType());
- // createSpecObjectWithPXhtml("xhtml.span.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Span(),
- // XhtmlPackage.eINSTANCE.getXhtmlSpanType());
- // createSpecObjectWithPXhtml("xhtml.em.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Em(),
- // XhtmlPackage.eINSTANCE.getXhtmlEmType());
- // createSpecObjectWithPXhtml("xhtml.strong.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Strong(),
- // XhtmlPackage.eINSTANCE.getXhtmlStrongType());
- // createSpecObjectWithPXhtml("xhtml.dfn.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Dfn(),
- // XhtmlPackage.eINSTANCE.getXhtmlDfnType());
- // createSpecObjectWithPXhtml("xhtml.code.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Code(),
- // XhtmlPackage.eINSTANCE.getXhtmlCodeType());
- // createSpecObjectWithPXhtml("xhtml.samp.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Samp(),
- // XhtmlPackage.eINSTANCE.getXhtmlSampType());
- // createSpecObjectWithPXhtml("xhtml.kbd.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Kbd(),
- // XhtmlPackage.eINSTANCE.getXhtmlKbdType());
- // createSpecObjectWithPXhtml("xhtml.var.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Var(),
- // XhtmlPackage.eINSTANCE.getXhtmlVarType());
- // createSpecObjectWithPXhtml("xhtml.cite.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Cite(),
- // XhtmlPackage.eINSTANCE.getXhtmlCiteType());
- // createSpecObjectWithPXhtml("xhtml.abbr.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Abbr(),
- // XhtmlPackage.eINSTANCE.getXhtmlAbbrType());
- // createSpecObjectWithPXhtml("xhtml.acronym.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Acronym(),
- // XhtmlPackage.eINSTANCE.getXhtmlAcronymType());
- // createSpecObjectWithPXhtml("xhtml.q.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Q(),
- // XhtmlPackage.eINSTANCE.getXhtmlQType());
- // createSpecObjectWithPXhtml("xhtml.inl.pres.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Tt(),
- // XhtmlPackage.eINSTANCE.getXhtmlInlPresType());
- // createSpecObjectWithPXhtml("xhtml.a.type", XhtmlPackage.eINSTANCE.getXhtmlPType_A(),
- // XhtmlPackage.eINSTANCE.getXhtmlAType());
+
+ // create fill XhtmlDivType in XhtmlContent.div at original value
+ description = "xhtml.div.type_the_original_value";
+ xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), true);
+ specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheOriginalValue(), xhtmlLevel1);
+ description = "xhtml.div.type";
+ xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), true);
+ specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(), xhtmlLevel1);
+ getReqIF().getCoreContent().getSpecObjects().add(specObject);
+
+ // level 2
+ // objects that are contained on xhtml.p.type
+ createSpecObjectWithPXhtml("xhtml.br.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Br(), XhtmlPackage.eINSTANCE.getXhtmlBrType());
+ createSpecObjectWithPXhtml("xhtml.span.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Span(), XhtmlPackage.eINSTANCE.getXhtmlSpanType());
+ createSpecObjectWithPXhtml("xhtml.em.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Em(), XhtmlPackage.eINSTANCE.getXhtmlEmType());
+ createSpecObjectWithPXhtml("xhtml.strong.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Strong(), XhtmlPackage.eINSTANCE.getXhtmlStrongType());
+ createSpecObjectWithPXhtml("xhtml.dfn.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Dfn(), XhtmlPackage.eINSTANCE.getXhtmlDfnType());
+ createSpecObjectWithPXhtml("xhtml.code.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Code(), XhtmlPackage.eINSTANCE.getXhtmlCodeType());
+ createSpecObjectWithPXhtml("xhtml.samp.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Samp(), XhtmlPackage.eINSTANCE.getXhtmlSampType());
+ createSpecObjectWithPXhtml("xhtml.kbd.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Kbd(), XhtmlPackage.eINSTANCE.getXhtmlKbdType());
+ createSpecObjectWithPXhtml("xhtml.var.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Var(), XhtmlPackage.eINSTANCE.getXhtmlVarType());
+ createSpecObjectWithPXhtml("xhtml.cite.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Cite(), XhtmlPackage.eINSTANCE.getXhtmlCiteType());
+ createSpecObjectWithPXhtml("xhtml.abbr.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Abbr(), XhtmlPackage.eINSTANCE.getXhtmlAbbrType());
+ createSpecObjectWithPXhtml("xhtml.acronym.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Acronym(), XhtmlPackage.eINSTANCE.getXhtmlAcronymType());
+ createSpecObjectWithPXhtml("xhtml.q.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Q(), XhtmlPackage.eINSTANCE.getXhtmlQType());
+ createSpecObjectWithPXhtml("xhtml.inl.pres.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Tt(), XhtmlPackage.eINSTANCE.getXhtmlInlPresType());
+ createSpecObjectWithPXhtml("xhtml.a.type", XhtmlPackage.eINSTANCE.getXhtmlPType_A(), XhtmlPackage.eINSTANCE.getXhtmlAType());
+
+ // (mj) we omit object here, as it does not support styles and is tested later on extensively. See REQIF-17
// createSpecObjectWithPXhtml("xhtml.object.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Object(),
// XhtmlPackage.eINSTANCE.getXhtmlObjectType());
- // createSpecObjectWithPXhtml("xhtml.edit.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Ins(),
- // XhtmlPackage.eINSTANCE.getXhtmlEditType());
- //
- // // first level objects that are contained in xhtml.div.type and are not already covered by xhtml.p.type
- // createSpecObjectWithDivXhtml("xhtml.h1.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_H1(),
- // XhtmlPackage.eINSTANCE.getXhtmlH1Type());
- // createSpecObjectWithDivXhtml("xhtml.h2.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_H2(),
- // XhtmlPackage.eINSTANCE.getXhtmlH2Type());
- // createSpecObjectWithDivXhtml("xhtml.h3.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_H3(),
- // XhtmlPackage.eINSTANCE.getXhtmlH3Type());
- // createSpecObjectWithDivXhtml("xhtml.h4.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_H4(),
- // XhtmlPackage.eINSTANCE.getXhtmlH4Type());
- // createSpecObjectWithDivXhtml("xhtml.h5.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_H5(),
- // XhtmlPackage.eINSTANCE.getXhtmlH5Type());
- // createSpecObjectWithDivXhtml("xhtml.h6.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_H6(),
- // XhtmlPackage.eINSTANCE.getXhtmlH6Type());
- // createSpecObjectWithDivXhtml("xhtml.ul.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_Ul(),
- // XhtmlPackage.eINSTANCE.getXhtmlUlType());
- // createSpecObjectWithDivXhtml("xhtml.ol.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_Ol(),
- // XhtmlPackage.eINSTANCE.getXhtmlOlType());
- // createSpecObjectWithDivXhtml("xhtml.dl.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_Dl(),
- // XhtmlPackage.eINSTANCE.getXhtmlDlType());
- // createSpecObjectWithDivXhtml("xhtml.pre.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_Pre(),
- // XhtmlPackage.eINSTANCE.getXhtmlPreType());
- // createSpecObjectWithDivXhtml("xhtml.blockquote.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_Blockquote(),
- // XhtmlPackage.eINSTANCE.getXhtmlBlockquoteType());
- // createSpecObjectWithDivXhtml("xhtml.address.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_Address(),
- // XhtmlPackage.eINSTANCE.getXhtmlAddressType());
- // createSpecObjectWithDivXhtml("xhtml.hr.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_Hr(),
- // XhtmlPackage.eINSTANCE.getXhtmlHrType());
- // createSpecObjectWithDivXhtml("xhtml.table.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(),
- // XhtmlPackage.eINSTANCE.getXhtmlTableType());
- //
- // // level 3
- // // xhtml.li.type
- // description = "xhtml.li.type";
- // xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
- // specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(),
- // xhtmlLevel1);
- // getReqIF().getCoreContent().getSpecObjects().add(specObject);
- //
- // xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlUlType(), false);
- // setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Ul(), xhtmlLevel2);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlLiType(), true);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlUlType_Li(), xhtmlLevel3);
- //
- // // xhtml.dt.type
- // description = "xhtml.dt.type";
- // xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
- // specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(),
- // xhtmlLevel1);
- // getReqIF().getCoreContent().getSpecObjects().add(specObject);
- //
- // xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDlType(), false);
- // setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Dl(), xhtmlLevel2);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDtType(), true);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlDlType_Dt(), xhtmlLevel3);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDdType(), false);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlDlType_Dd(), xhtmlLevel3);
- //
- // // xhtml.dd.type
- // description = "xhtml.dd.type";
- // xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
- // specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(),
- // xhtmlLevel1);
- // getReqIF().getCoreContent().getSpecObjects().add(specObject);
- //
- // xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDlType(), false);
- // setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Dl(), xhtmlLevel2);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDtType(), false);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlDlType_Dt(), xhtmlLevel3);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDdType(), true);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlDlType_Dd(), xhtmlLevel3);
- //
- // // xhtml.caption.type
- // description = "xhtml.caption.type";
- // xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
- // specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(),
- // xhtmlLevel1);
- // getReqIF().getCoreContent().getSpecObjects().add(specObject);
- //
- // xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTableType(), false);
- // setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(), xhtmlLevel2);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlCaptionType(), true);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Caption(), xhtmlLevel3);
- //
- // // xhtml.thead.type
- // description = "xhtml.thead.type";
- // xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
- // specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(),
- // xhtmlLevel1);
- // getReqIF().getCoreContent().getSpecObjects().add(specObject);
- //
- // xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTableType(), false);
- // ((XhtmlTableType) xhtmlLevel2).getTr().clear();
- // setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(), xhtmlLevel2);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTheadType(), true);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Thead(), xhtmlLevel3);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTbodyType(), false);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Tbody(), xhtmlLevel3);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTfootType(), false);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Tfoot(), xhtmlLevel3);
- //
- // // xhtml.col.type
- // description = "xhtml.col.type";
- // xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
- // specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(),
- // xhtmlLevel1);
- // getReqIF().getCoreContent().getSpecObjects().add(specObject);
- //
- // xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTableType(), false);
- // setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(), xhtmlLevel2);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlColType(), true);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Col(), xhtmlLevel3);
- //
- // // xhtml.colgroup.type
- // description = "xhtml.colgroup.type";
- // xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
- // specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(),
- // xhtmlLevel1);
- // getReqIF().getCoreContent().getSpecObjects().add(specObject);
- //
- // xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTableType(), false);
- // setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(), xhtmlLevel2);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlColgroupType(), true);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Colgroup(), xhtmlLevel3);
- //
- // // xhtml.tfoot.type
- // description = "xhtml.tfoot.type";
- // xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
- // specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(),
- // xhtmlLevel1);
- // getReqIF().getCoreContent().getSpecObjects().add(specObject);
- //
- // xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTableType(), false);
- // ((XhtmlTableType) xhtmlLevel2).getTr().clear();
- // setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(), xhtmlLevel2);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTheadType(), false);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Thead(), xhtmlLevel3);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTbodyType(), false);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Tbody(), xhtmlLevel3);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTfootType(), true);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Tfoot(), xhtmlLevel3);
- //
- // // xhtml.tbody.type
- // description = "xhtml.tbody.type";
- // xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
- // specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(),
- // xhtmlLevel1);
- // getReqIF().getCoreContent().getSpecObjects().add(specObject);
- //
- // xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTableType(), false);
- // ((XhtmlTableType) xhtmlLevel2).getTr().clear();
- // setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(), xhtmlLevel2);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTheadType(), false);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Thead(), xhtmlLevel3);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTbodyType(), true);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Tbody(), xhtmlLevel3);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTfootType(), false);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Tfoot(), xhtmlLevel3);
- //
- // // xhtml.tr.type
- // description = "xhtml.tr.type";
- // xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
- // specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(),
- // xhtmlLevel1);
- // getReqIF().getCoreContent().getSpecObjects().add(specObject);
- //
- // xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTableType(), false);
- // setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(), xhtmlLevel2);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTrType(), true);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Tr(), xhtmlLevel3);
- //
- // // xhtml.param.type
+ createSpecObjectWithPXhtml("xhtml.edit.type", XhtmlPackage.eINSTANCE.getXhtmlPType_Ins(), XhtmlPackage.eINSTANCE.getXhtmlEditType());
+
+ // first level objects that are contained in xhtml.div.type and are not already covered by xhtml.p.type
+ createSpecObjectWithDivXhtml("xhtml.h1.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_H1(), XhtmlPackage.eINSTANCE.getXhtmlH1Type());
+ createSpecObjectWithDivXhtml("xhtml.h2.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_H2(), XhtmlPackage.eINSTANCE.getXhtmlH2Type());
+ createSpecObjectWithDivXhtml("xhtml.h3.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_H3(), XhtmlPackage.eINSTANCE.getXhtmlH3Type());
+ createSpecObjectWithDivXhtml("xhtml.h4.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_H4(), XhtmlPackage.eINSTANCE.getXhtmlH4Type());
+ createSpecObjectWithDivXhtml("xhtml.h5.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_H5(), XhtmlPackage.eINSTANCE.getXhtmlH5Type());
+ createSpecObjectWithDivXhtml("xhtml.h6.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_H6(), XhtmlPackage.eINSTANCE.getXhtmlH6Type());
+ createSpecObjectWithDivXhtml("xhtml.ul.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_Ul(), XhtmlPackage.eINSTANCE.getXhtmlUlType());
+ createSpecObjectWithDivXhtml("xhtml.ol.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_Ol(), XhtmlPackage.eINSTANCE.getXhtmlOlType());
+ createSpecObjectWithDivXhtml("xhtml.dl.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_Dl(), XhtmlPackage.eINSTANCE.getXhtmlDlType());
+ createSpecObjectWithDivXhtml("xhtml.pre.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_Pre(), XhtmlPackage.eINSTANCE.getXhtmlPreType());
+ createSpecObjectWithDivXhtml("xhtml.blockquote.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_Blockquote(),
+ XhtmlPackage.eINSTANCE.getXhtmlBlockquoteType());
+ createSpecObjectWithDivXhtml("xhtml.address.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_Address(),
+ XhtmlPackage.eINSTANCE.getXhtmlAddressType());
+ createSpecObjectWithDivXhtml("xhtml.hr.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_Hr(), XhtmlPackage.eINSTANCE.getXhtmlHrType());
+ createSpecObjectWithDivXhtml("xhtml.table.type", XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(), XhtmlPackage.eINSTANCE.getXhtmlTableType());
+
+ // level 3
+ // xhtml.li.type
+ description = "xhtml.li.type";
+ xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
+ specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(), xhtmlLevel1);
+ getReqIF().getCoreContent().getSpecObjects().add(specObject);
+
+ xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlUlType(), false);
+ setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Ul(), xhtmlLevel2);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlLiType(), true);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlUlType_Li(), xhtmlLevel3);
+
+ // xhtml.dt.type
+ description = "xhtml.dt.type";
+ xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
+ specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(), xhtmlLevel1);
+ getReqIF().getCoreContent().getSpecObjects().add(specObject);
+
+ xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDlType(), false);
+ setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Dl(), xhtmlLevel2);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDtType(), true);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlDlType_Dt(), xhtmlLevel3);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDdType(), false);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlDlType_Dd(), xhtmlLevel3);
+
+ // xhtml.dd.type
+ description = "xhtml.dd.type";
+ xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
+ specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(), xhtmlLevel1);
+ getReqIF().getCoreContent().getSpecObjects().add(specObject);
+
+ xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDlType(), false);
+ setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Dl(), xhtmlLevel2);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDtType(), false);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlDlType_Dt(), xhtmlLevel3);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDdType(), true);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlDlType_Dd(), xhtmlLevel3);
+
+ // xhtml.caption.type
+ description = "xhtml.caption.type";
+ xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
+ specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(), xhtmlLevel1);
+ getReqIF().getCoreContent().getSpecObjects().add(specObject);
+
+ xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTableType(), false);
+ setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(), xhtmlLevel2);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlCaptionType(), true);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Caption(), xhtmlLevel3);
+
+ // xhtml.thead.type
+ description = "xhtml.thead.type";
+ xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
+ specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(), xhtmlLevel1);
+ getReqIF().getCoreContent().getSpecObjects().add(specObject);
+
+ xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTableType(), false);
+ ((XhtmlTableType) xhtmlLevel2).getTr().clear();
+ setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(), xhtmlLevel2);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTheadType(), true);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Thead(), xhtmlLevel3);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTbodyType(), false);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Tbody(), xhtmlLevel3);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTfootType(), false);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Tfoot(), xhtmlLevel3);
+
+ // xhtml.col.type
+ description = "xhtml.col.type";
+ xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
+ specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(), xhtmlLevel1);
+ getReqIF().getCoreContent().getSpecObjects().add(specObject);
+
+ xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTableType(), false);
+ setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(), xhtmlLevel2);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlColType(), true);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Col(), xhtmlLevel3);
+
+ // xhtml.colgroup.type
+ description = "xhtml.colgroup.type";
+ xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
+ specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(), xhtmlLevel1);
+ getReqIF().getCoreContent().getSpecObjects().add(specObject);
+
+ xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTableType(), false);
+ setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(), xhtmlLevel2);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlColgroupType(), true);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Colgroup(), xhtmlLevel3);
+
+ // xhtml.tfoot.type
+ description = "xhtml.tfoot.type";
+ xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
+ specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(), xhtmlLevel1);
+ getReqIF().getCoreContent().getSpecObjects().add(specObject);
+
+ xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTableType(), false);
+ ((XhtmlTableType) xhtmlLevel2).getTr().clear();
+ setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(), xhtmlLevel2);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTheadType(), false);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Thead(), xhtmlLevel3);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTbodyType(), false);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Tbody(), xhtmlLevel3);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTfootType(), true);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Tfoot(), xhtmlLevel3);
+
+ // xhtml.tbody.type
+ description = "xhtml.tbody.type";
+ xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
+ specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(), xhtmlLevel1);
+ getReqIF().getCoreContent().getSpecObjects().add(specObject);
+
+ xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTableType(), false);
+ ((XhtmlTableType) xhtmlLevel2).getTr().clear();
+ setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(), xhtmlLevel2);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTheadType(), false);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Thead(), xhtmlLevel3);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTbodyType(), true);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Tbody(), xhtmlLevel3);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTfootType(), false);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Tfoot(), xhtmlLevel3);
+
+ // xhtml.tr.type
+ description = "xhtml.tr.type";
+ xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
+ specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(), xhtmlLevel1);
+ getReqIF().getCoreContent().getSpecObjects().add(specObject);
+
+ xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTableType(), false);
+ setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(), xhtmlLevel2);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTrType(), true);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Tr(), xhtmlLevel3);
+
+ // xhtml.param.type
+ // (mj) removed, due to REQIF-17
// description = "xhtml.param.type";
// xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
// specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(),
@@ -445,44 +407,42 @@
// getReqIF().getCoreContent().getSpecObjects().add(specObject);
//
// xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlObjectType(), false);
- // setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Object(), xhtmlLevel2);
+ // // setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Object(), xhtmlLevel2);
//
// xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlParamType(), true);
// setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlObjectType_Param(), xhtmlLevel3);
- //
- // // level 4
- // // xhtml.td.type
- // description = "xhtml.td.type";
- // xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
- // specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(),
- // xhtmlLevel1);
- // getReqIF().getCoreContent().getSpecObjects().add(specObject);
- //
- // xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTableType(), false);
- // setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(), xhtmlLevel2);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTrType(), false);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Tr(), xhtmlLevel3);
- //
- // xhtmlLevel4 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTdType(), true);
- // setValue(xhtmlLevel3, XhtmlPackage.eINSTANCE.getXhtmlTrType_Td(), xhtmlLevel4);
- //
- // // xhtml.th.type
- // description = "xhtml.th.type";
- // xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
- // specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(),
- // xhtmlLevel1);
- // getReqIF().getCoreContent().getSpecObjects().add(specObject);
- //
- // xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTableType(), false);
- // setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(), xhtmlLevel2);
- //
- // xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTrType(), false);
- // setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Tr(), xhtmlLevel3);
- //
- // xhtmlLevel4 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlThType(), true);
- // setValue(xhtmlLevel3, XhtmlPackage.eINSTANCE.getXhtmlTrType_Th(), xhtmlLevel4);
- //
+
+ // level 4
+ // xhtml.td.type
+ description = "xhtml.td.type";
+ xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
+ specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(), xhtmlLevel1);
+ getReqIF().getCoreContent().getSpecObjects().add(specObject);
+
+ xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTableType(), false);
+ setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(), xhtmlLevel2);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTrType(), false);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Tr(), xhtmlLevel3);
+
+ xhtmlLevel4 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTdType(), true);
+ setValue(xhtmlLevel3, XhtmlPackage.eINSTANCE.getXhtmlTrType_Td(), xhtmlLevel4);
+
+ // xhtml.th.type
+ description = "xhtml.th.type";
+ xhtmlLevel1 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlDivType(), false);
+ specObject = createSpecObject(description, ReqIF10Package.eINSTANCE.getAttributeValueXHTML_TheValue(), xhtmlLevel1);
+ getReqIF().getCoreContent().getSpecObjects().add(specObject);
+
+ xhtmlLevel2 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTableType(), false);
+ setValue(xhtmlLevel1, XhtmlPackage.eINSTANCE.getXhtmlDivType_Table(), xhtmlLevel2);
+
+ xhtmlLevel3 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlTrType(), false);
+ setValue(xhtmlLevel2, XhtmlPackage.eINSTANCE.getXhtmlTableType_Tr(), xhtmlLevel3);
+
+ xhtmlLevel4 = createXhtmlInstance(XhtmlPackage.eINSTANCE.getXhtmlThType(), true);
+ setValue(xhtmlLevel3, XhtmlPackage.eINSTANCE.getXhtmlTrType_Th(), xhtmlLevel4);
+
}
private void createSpecObjectWithPXhtml(String description, EReference eReference, EClass targetType) throws Exception {
@@ -536,8 +496,8 @@
private EObject createXhtmlInstance(EClass eClass, boolean createAll) {
EObject eObject = EcoreUtil.create(eClass);
- // setAttributes(eObject, createAll);
- // setSubElements(eObject, createAll);
+ setAttributes(eObject, createAll);
+ setSubElements(eObject, createAll);
setMixedText(eObject, createAll);
return eObject;
@@ -607,6 +567,10 @@
} else {
// create full set of sub elements
for (EReference eReference : eObject.eClass().getEAllContainments()) {
+ // (mj) Skip XhtmlObjectType
+ if (eReference.getEReferenceType().getName().equals("XhtmlObjectType")) {
+ continue;
+ }
EObject subEObject = createXhtmlInstance(eReference.getEReferenceType(), false);
setValue(eObject, eReference, subEObject);
}
@@ -669,6 +633,20 @@
setAttributes(col, false);
setMixedText(col, false);
((XhtmlColgroupType) eObject).getCol().add(col);
+ } else if (eObject instanceof XhtmlObjectType) {
+ throw new UnsupportedOperationException("Looks like there is an XhtmlObject Type in this ModelBuilder."
+ + "However, we don't want to have any, as it this test is only meant for formatting, not object"
+ + "embedding (see issue REQIF-17).");
+ // also, set the required object data.
+ // ((XhtmlObjectType) eObject).setData("diagram.pdf");
+ // ((XhtmlObjectType) eObject).setType("application/pdf");
+ //
+ // XhtmlObjectType obj = XhtmlFactory.eINSTANCE.createXhtmlObjectType();
+ // obj.setType("image/png");
+ // obj.setData("placeholder.png");
+ // setAttributes(obj, false);
+ // setMixedText(obj, false);
+ // ((XhtmlObjectType) eObject).getObject().add(obj);
}
}
}
diff --git a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1300/TC1300SpecRelationModelBuilder.java b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1300/TC1300SpecRelationModelBuilder.java
index fc4d3e0..856f374 100644
--- a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1300/TC1300SpecRelationModelBuilder.java
+++ b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1300/TC1300SpecRelationModelBuilder.java
@@ -4,9 +4,12 @@
import org.eclipse.emf.common.util.EList;
import org.eclipse.rmf.reqif10.AttributeDefinitionString;
+import org.eclipse.rmf.reqif10.AttributeDefinitionXHTML;
import org.eclipse.rmf.reqif10.AttributeValueString;
+import org.eclipse.rmf.reqif10.AttributeValueXHTML;
import org.eclipse.rmf.reqif10.DatatypeDefinition;
import org.eclipse.rmf.reqif10.DatatypeDefinitionString;
+import org.eclipse.rmf.reqif10.DatatypeDefinitionXHTML;
import org.eclipse.rmf.reqif10.RelationGroup;
import org.eclipse.rmf.reqif10.RelationGroupType;
import org.eclipse.rmf.reqif10.ReqIF10Factory;
@@ -26,6 +29,7 @@
// datatypes
DatatypeDefinitionString datatypeDefinitionString;
+ DatatypeDefinitionXHTML datatypeDefinitionXHTML;
// SpecObjectTypes
SpecObjectType specObjectType;
@@ -40,7 +44,7 @@
// SpecRelationTypes
SpecRelationType specRelationType;
- AttributeDefinitionString attributeDefinitionStringForSpecRelation;
+ AttributeDefinitionXHTML attributeDefinitionXhtmlForSpecRelation;
// RelationGroupTypes
// TODO: why isn't it called SpecRelationGroupType?
@@ -61,15 +65,22 @@
@Override
public void createDatatypes() throws Exception {
+
datatypeDefinitionString = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionString();
datatypeDefinitionString.setIdentifier("ID_TC1300_DatatypeDefinitionString");
- datatypeDefinitionString.setLongName("ReqIF.Name");
+ datatypeDefinitionString.setLongName("TC1300 String");
datatypeDefinitionString.setLastChange(toDate(LAST_CHANGE_STRING));
datatypeDefinitionString.setMaxLength(new BigInteger("256"));
+ // datatypeDefinitionXHTML
+ datatypeDefinitionXHTML = ReqIF10Factory.eINSTANCE.createDatatypeDefinitionXHTML();
+ datatypeDefinitionXHTML.setIdentifier("ID_TC1300_DatatypeDefinitionXHTML");
+ datatypeDefinitionXHTML.setLongName("TC1300 XHTML");
+ datatypeDefinitionXHTML.setLastChange(toDate(LAST_CHANGE_STRING));
+
EList<DatatypeDefinition> datatypes = getReqIF().getCoreContent().getDatatypes();
datatypes.add(datatypeDefinitionString);
-
+ datatypes.add(datatypeDefinitionXHTML);
}
@Override
@@ -179,7 +190,6 @@
@Override
public void createSpecRelations() throws Exception {
- AttributeValueString attributeValueString;
specRelation = ReqIF10Factory.eINSTANCE.createSpecRelation();
specRelation.setIdentifier("ID_TC1300_SpecRelation");
@@ -189,10 +199,10 @@
specRelation.setSource(specObject1);
specRelation.setTarget(specObject2);
- attributeValueString = ReqIF10Factory.eINSTANCE.createAttributeValueString();
- attributeValueString.setDefinition(attributeDefinitionStringForSpecRelation);
- attributeValueString.setTheValue("TC 1300 SpecRelation");
- specRelation.getValues().add(attributeValueString);
+ AttributeValueXHTML attributeValueXhtml = ReqIF10Factory.eINSTANCE.createAttributeValueXHTML();
+ attributeValueXhtml.setDefinition(attributeDefinitionXhtmlForSpecRelation);
+ attributeValueXhtml.setTheValue(createXhtmlValue("TC 1300 SpecRelation"));
+ specRelation.getValues().add(attributeValueXhtml);
getReqIF().getCoreContent().getSpecRelations().add(specRelation);
}
@@ -204,13 +214,13 @@
specRelationType.setLongName("TC 1300 SpecRelationType");
specRelationType.setLastChange(toDate(LAST_CHANGE_STRING));
- attributeDefinitionStringForSpecRelation = ReqIF10Factory.eINSTANCE.createAttributeDefinitionString();
- attributeDefinitionStringForSpecRelation.setIdentifier("ID_TC1300_AttributeDefinitionString_SpecRelation");
- attributeDefinitionStringForSpecRelation.setLongName("ReqIF.Name");
- attributeDefinitionStringForSpecRelation.setLastChange(toDate(LAST_CHANGE_STRING));
- attributeDefinitionStringForSpecRelation.setType(datatypeDefinitionString);
+ attributeDefinitionXhtmlForSpecRelation = ReqIF10Factory.eINSTANCE.createAttributeDefinitionXHTML();
+ attributeDefinitionXhtmlForSpecRelation.setIdentifier("ID_TC1300_AttributeDefinitionString_SpecRelation");
+ attributeDefinitionXhtmlForSpecRelation.setLongName("ReqIF.Name");
+ attributeDefinitionXhtmlForSpecRelation.setLastChange(toDate(LAST_CHANGE_STRING));
+ attributeDefinitionXhtmlForSpecRelation.setType(datatypeDefinitionXHTML);
- specRelationType.getSpecAttributes().add(attributeDefinitionStringForSpecRelation);
+ specRelationType.getSpecAttributes().add(attributeDefinitionXhtmlForSpecRelation);
getReqIF().getCoreContent().getSpecTypes().add(specRelationType);
}
diff --git a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1300/package.html b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1300/package.html
index 423cf2a..39f2af4 100644
--- a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1300/package.html
+++ b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc001/tc1300/package.html
@@ -109,9 +109,8 @@
</thead>
<tbody>
<tr>
-<td>TC1300 String</td>
-<td>String</td>
-<td>maxLength := 256</td>
+<td>ReqIF.Name</td>
+<td>XHTML</td>
</tr>
</tbody>
</table>
@@ -137,7 +136,7 @@
<table border="1" cellspacing="0" cellpadding="0" >
<thead> <tr>
-<th>TC1300 String</th>
+<th>ReqIF.Name</th>
</tr>
</thead>
<tbody>
diff --git a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc003/tc18xx/TC1802HISExchangeProcessModelBuilder.java b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc003/tc18xx/TC1802HISExchangeProcessModelBuilder.java
index cd4aa4f..99ace03 100644
--- a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc003/tc18xx/TC1802HISExchangeProcessModelBuilder.java
+++ b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/uc003/tc18xx/TC1802HISExchangeProcessModelBuilder.java
@@ -5,6 +5,8 @@
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
+import org.eclipse.rmf.reqif10.AttributeDefinitionEnumeration;
+import org.eclipse.rmf.reqif10.AttributeValueEnumeration;
import org.eclipse.rmf.reqif10.AttributeValueString;
import org.eclipse.rmf.reqif10.ReqIF;
import org.eclipse.rmf.reqif10.SpecObject;
@@ -38,6 +40,10 @@
AttributeValueString value = (AttributeValueString) ReqIF10Util.getAttributeValueForLabel(specObject, "A1");
value.setTheValue("O3.A1 once");
specObject.setLastChange(toDate(LAST_CHANGE_STRING_2));
+
+ AttributeDefinitionEnumeration enumeration = (AttributeDefinitionEnumeration) specObject.getType().getSpecAttributes().get(3);
+ AttributeValueEnumeration valueEnum = (AttributeValueEnumeration) ReqIF10Util.getAttributeValueForLabel(specObject, "E1");
+ valueEnum.getValues().set(0, enumeration.getType().getSpecifiedValues().get(1));
}
public ReqIF getReqIF() {
diff --git a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/util/AbstractTestCase.java b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/util/AbstractTestCase.java
index d23cd01..755fc7c 100644
--- a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/util/AbstractTestCase.java
+++ b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/util/AbstractTestCase.java
@@ -15,7 +15,7 @@
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
-import java.io.InputStream;
+import java.net.URISyntaxException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
@@ -41,6 +41,7 @@
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.emf.ecore.xml.namespace.XMLNamespacePackage;
import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
@@ -71,7 +72,7 @@
// backup the registry
backupRegistry = new HashMap<String, Object>();
backupRegistry.putAll(EPackage.Registry.INSTANCE);
- System.out.println("BeforeClass: Initial package registry: " + EPackage.Registry.INSTANCE.keySet());
+ // System.out.println("BeforeClass: Initial package registry: " + EPackage.Registry.INSTANCE.keySet());
EPackage.Registry.INSTANCE.clear();
EPackage.Registry.INSTANCE.put(ReqIF10Package.eNS_URI, ReqIF10Package.eINSTANCE);
EPackage.Registry.INSTANCE.put(XhtmlPackage.eNS_URI, XhtmlPackage.eINSTANCE);
@@ -83,7 +84,7 @@
// TODO: me might be able to live without the last package
EPackage.Registry.INSTANCE.put(XMLTypePackage.eNS_URI, XMLTypePackage.eINSTANCE);
- System.out.println("BeforeClass: reset to: " + EPackage.Registry.INSTANCE.keySet());
+ // System.out.println("BeforeClass: reset to: " + EPackage.Registry.INSTANCE.keySet());
}
@AfterClass
@@ -92,7 +93,7 @@
EPackage.Registry.INSTANCE.clear();
EPackage.Registry.INSTANCE.putAll(backupRegistry);
}
- System.out.println("AfterClass: reset to: " + EPackage.Registry.INSTANCE.keySet());
+ // System.out.println("AfterClass: reset to: " + EPackage.Registry.INSTANCE.keySet());
}
protected static String getWorkingDirectoryFileName() {
@@ -121,7 +122,7 @@
}
protected static void saveReqIFFile(ReqIF reqif, String fileName) throws IOException {
- ReqIFResourceSetImpl resourceSet = getReqIFResourceSet();
+ ResourceSetImpl resourceSet = getResourceSet();
URI emfURI = createEMFURI(fileName);
Resource resource = resourceSet.createResource(emfURI);
@@ -131,7 +132,7 @@
}
protected static ReqIF loadReqIFFile(String fileName) throws IOException {
- ReqIFResourceSetImpl resourceSet = getReqIFResourceSet();
+ ResourceSetImpl resourceSet = getResourceSet();
URI emfURI = createEMFURI(fileName);
XMLResource resource = (XMLResource) resourceSet.createResource(emfURI);
@@ -154,6 +155,13 @@
return resourceSet;
}
+ private static ResourceSetImpl getResourceSet() {
+ ResourceSetImpl resourceSet = new ResourceSetImpl();
+
+ resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put("reqif", new ReqIFResourceFactoryImpl());
+ return resourceSet;
+ }
+
private static URI createEMFURI(String fileName) {
return URI.createURI(fileName, true);
}
@@ -231,7 +239,7 @@
return stringBuffer.toString();
}
- public static List<ReqIF> loadReqIFFromZip(String zipSourceFileName) throws IOException {
+ public static List<ReqIF> loadReqIFFromZip(String zipSourceFileName) throws IOException, URISyntaxException {
ZipFile zipSourceFile = new ZipFile(zipSourceFileName);
List<ReqIF> reqIFs = new ArrayList<ReqIF>();
Enumeration<? extends ZipEntry> zipFileEntries = zipSourceFile.entries();
@@ -243,13 +251,15 @@
if (entry.isDirectory() || !entry.getName().endsWith(".reqif")) {
continue;
}
- InputStream zipEntryInputStream;
- zipEntryInputStream = zipSourceFile.getInputStream(entry);
- Resource resource = new ReqIFResourceImpl();
- resourceSet.getResources().add(resource);
+ File zipFile = new File(zipSourceFileName);
+ String absoluteZipFilePath = zipFile.getAbsolutePath();
- resource.load(zipEntryInputStream, null);
+ URI uri = URI.createURI("archive:file:" + absoluteZipFilePath + "!/" + entry.getName());
+
+ Resource resource = resourceSet.createResource(uri);
+ resource.load(null);
+
List<EObject> rootObjects = resource.getContents();
if (0 < rootObjects.size()) {
reqIFs.add((ReqIF) rootObjects.get(0));
diff --git a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/util/ReqIFContentModelBuilder.java b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/util/ReqIFContentModelBuilder.java
index 4334a3f..81137d1 100644
--- a/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/util/ReqIFContentModelBuilder.java
+++ b/org.eclipse.rmf.reqif10.tests/src/org/eclipse/rmf/reqif10/tests/util/ReqIFContentModelBuilder.java
@@ -11,12 +11,10 @@
*/
package org.eclipse.rmf.reqif10.tests.util;
-import org.eclipse.rmf.reqif10.ReqIF;
import org.eclipse.rmf.reqif10.ReqIF10Factory;
import org.eclipse.rmf.reqif10.ReqIFContent;
public class ReqIFContentModelBuilder extends MinimalModelBuilder {
- private ReqIF reqIF;
public ReqIFContentModelBuilder() throws Exception {
super();
diff --git a/org.eclipse.rmf.reqif10/META-INF/MANIFEST.MF b/org.eclipse.rmf.reqif10/META-INF/MANIFEST.MF
index e00d82c..784cd8c 100644
--- a/org.eclipse.rmf.reqif10/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.reqif10/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.reqif10;singleton:=true
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/org.eclipse.rmf.reqif10/pom.xml b/org.eclipse.rmf.reqif10/pom.xml
index db5942f..38f67bb 100644
--- a/org.eclipse.rmf.reqif10/pom.xml
+++ b/org.eclipse.rmf.reqif10/pom.xml
@@ -19,11 +19,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.reqif10</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<groupId>org.eclipse.rmf.plugins</groupId>
<build>
diff --git a/org.eclipse.rmf.rif11.model.test/META-INF/MANIFEST.MF b/org.eclipse.rmf.rif11.model.test/META-INF/MANIFEST.MF
index e42670b..e7de9e5 100644
--- a/org.eclipse.rmf.rif11.model.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.rif11.model.test/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.rif11.model.test
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.rmf.rif11.model;bundle-version="0.1.0",
org.eclipse.rmf.rif11.xsd.model;bundle-version="0.1.0",
diff --git a/org.eclipse.rmf.rif11.model.test/pom.xml b/org.eclipse.rmf.rif11.model.test/pom.xml
index f377e5f..547d84e 100644
--- a/org.eclipse.rmf.rif11.model.test/pom.xml
+++ b/org.eclipse.rmf.rif11.model.test/pom.xml
@@ -6,12 +6,12 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<groupId>org.eclipse.rmf.plugins</groupId>
<artifactId>org.eclipse.rmf.rif11.model.test</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<profiles>
<profile>
diff --git a/org.eclipse.rmf.rif11.model/META-INF/MANIFEST.MF b/org.eclipse.rmf.rif11.model/META-INF/MANIFEST.MF
index 03be520..f7dbbbf 100644
--- a/org.eclipse.rmf.rif11.model/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.rif11.model/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.rif11.model;singleton:=true
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/org.eclipse.rmf.rif11.model/pom.xml b/org.eclipse.rmf.rif11.model/pom.xml
index 66d9754..4894002 100644
--- a/org.eclipse.rmf.rif11.model/pom.xml
+++ b/org.eclipse.rmf.rif11.model/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.rif11.model</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<groupId>org.eclipse.rmf.plugins</groupId>
<build>
diff --git a/org.eclipse.rmf.rif11.resource/META-INF/MANIFEST.MF b/org.eclipse.rmf.rif11.resource/META-INF/MANIFEST.MF
index e56a5a1..35eef04 100644
--- a/org.eclipse.rmf.rif11.resource/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.rif11.resource/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.rif11.resource;singleton:=true
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.emf.ecore;bundle-version="2.6.1",
org.eclipse.rmf.rif11.model;bundle-version="0.1.0",
diff --git a/org.eclipse.rmf.rif11.resource/pom.xml b/org.eclipse.rmf.rif11.resource/pom.xml
index 3100bd2..327c8d3 100644
--- a/org.eclipse.rmf.rif11.resource/pom.xml
+++ b/org.eclipse.rmf.rif11.resource/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.rif11.resource</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<groupId>org.eclipse.rmf.plugins</groupId>
<build>
diff --git a/org.eclipse.rmf.rif11.xsd.model/META-INF/MANIFEST.MF b/org.eclipse.rmf.rif11.xsd.model/META-INF/MANIFEST.MF
index ec40832..6121fda 100644
--- a/org.eclipse.rmf.rif11.xsd.model/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.rif11.xsd.model/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.rif11.xsd.model;singleton:=true
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/org.eclipse.rmf.rif11.xsd.model/pom.xml b/org.eclipse.rmf.rif11.xsd.model/pom.xml
index f7cd517..a6ae0c6 100644
--- a/org.eclipse.rmf.rif11.xsd.model/pom.xml
+++ b/org.eclipse.rmf.rif11.xsd.model/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.rif11.xsd.model</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<groupId>org.eclipse.rmf.plugins</groupId>
<build>
diff --git a/org.eclipse.rmf.rif12.model.test/META-INF/MANIFEST.MF b/org.eclipse.rmf.rif12.model.test/META-INF/MANIFEST.MF
index 5a299cc..44e1c9a 100644
--- a/org.eclipse.rmf.rif12.model.test/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.rif12.model.test/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.rif12.model.test
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Require-Bundle: org.eclipse.core.runtime,
org.junit,
org.eclipse.emf.ecore;bundle-version="2.6.1",
diff --git a/org.eclipse.rmf.rif12.model.test/pom.xml b/org.eclipse.rmf.rif12.model.test/pom.xml
index c7b0c64..d5b81b3 100644
--- a/org.eclipse.rmf.rif12.model.test/pom.xml
+++ b/org.eclipse.rmf.rif12.model.test/pom.xml
@@ -6,12 +6,12 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<groupId>org.eclipse.rmf.plugins</groupId>
<artifactId>org.eclipse.rmf.rif12.model.test</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-test-plugin</packaging>
<profiles>
<profile>
diff --git a/org.eclipse.rmf.rif12.model/META-INF/MANIFEST.MF b/org.eclipse.rmf.rif12.model/META-INF/MANIFEST.MF
index 3329f89..5885772 100644
--- a/org.eclipse.rmf.rif12.model/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.rif12.model/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.rif12.model;singleton:=true
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/org.eclipse.rmf.rif12.model/pom.xml b/org.eclipse.rmf.rif12.model/pom.xml
index cfccbd1..c058963 100644
--- a/org.eclipse.rmf.rif12.model/pom.xml
+++ b/org.eclipse.rmf.rif12.model/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.rif12.model</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<groupId>org.eclipse.rmf.plugins</groupId>
<build>
diff --git a/org.eclipse.rmf.rif12.resource/META-INF/MANIFEST.MF b/org.eclipse.rmf.rif12.resource/META-INF/MANIFEST.MF
index 1ad5a46..a8a58f4 100644
--- a/org.eclipse.rmf.rif12.resource/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.rif12.resource/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.rif12.resource;singleton:=true
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)",
org.eclipse.emf.ecore;bundle-version="[2.7.0,3.0.0)",
diff --git a/org.eclipse.rmf.rif12.resource/pom.xml b/org.eclipse.rmf.rif12.resource/pom.xml
index f6d7e7c..1ad5740 100644
--- a/org.eclipse.rmf.rif12.resource/pom.xml
+++ b/org.eclipse.rmf.rif12.resource/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.rif12.resource</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<groupId>org.eclipse.rmf.plugins</groupId>
<build>
diff --git a/org.eclipse.rmf.rif12.xsd.model/META-INF/MANIFEST.MF b/org.eclipse.rmf.rif12.xsd.model/META-INF/MANIFEST.MF
index 060a267..072987e 100644
--- a/org.eclipse.rmf.rif12.xsd.model/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.rif12.xsd.model/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.rmf.rif12.xsd.model;singleton:=true
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-ClassPath: .
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/org.eclipse.rmf.rif12.xsd.model/pom.xml b/org.eclipse.rmf.rif12.xsd.model/pom.xml
index db8241d..fecafcb 100644
--- a/org.eclipse.rmf.rif12.xsd.model/pom.xml
+++ b/org.eclipse.rmf.rif12.xsd.model/pom.xml
@@ -6,11 +6,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.rif12.xsd.model</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<groupId>org.eclipse.rmf.plugins</groupId>
<build>
diff --git a/org.eclipse.rmf.serialization/META-INF/MANIFEST.MF b/org.eclipse.rmf.serialization/META-INF/MANIFEST.MF
index 1732b3d..235bbf2 100644
--- a/org.eclipse.rmf.serialization/META-INF/MANIFEST.MF
+++ b/org.eclipse.rmf.serialization/META-INF/MANIFEST.MF
@@ -1,11 +1,11 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.rmf.serialization;singleton:=true
-Bundle-Version: 0.3.2.qualifier
+Bundle-Version: 0.4.0.qualifier
Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.emf.ecore.xmi,
- org.eclipse.rmf.reqif10;bundle-version="0.3.2",
+ org.eclipse.rmf.reqif10;bundle-version="0.4.0",
org.apache.xerces
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/org.eclipse.rmf.serialization/pom.xml b/org.eclipse.rmf.serialization/pom.xml
index 7a129c3..febfb5c 100644
--- a/org.eclipse.rmf.serialization/pom.xml
+++ b/org.eclipse.rmf.serialization/pom.xml
@@ -19,11 +19,11 @@
<parent>
<groupId>org.eclipse.rmf</groupId>
<artifactId>org.eclipse.rmf.releng</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<relativePath>../org.eclipse.rmf.releng/pom.xml</relativePath>
</parent>
<artifactId>org.eclipse.rmf.serialization</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.4.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<groupId>org.eclipse.rmf.plugins</groupId>
<build>
diff --git a/org.eclipse.rmf.serialization/src/org/eclipse/rmf/internal/serialization/ReqIFXMLSAXHandler.java b/org.eclipse.rmf.serialization/src/org/eclipse/rmf/internal/serialization/ReqIFXMLSAXHandler.java
index b5e5fb6..f6f77ab 100644
--- a/org.eclipse.rmf.serialization/src/org/eclipse/rmf/internal/serialization/ReqIFXMLSAXHandler.java
+++ b/org.eclipse.rmf.serialization/src/org/eclipse/rmf/internal/serialization/ReqIFXMLSAXHandler.java
@@ -34,7 +34,7 @@
private static final int OUT_OF_XHTML = -1;
private SerializationStrategy serializationStrategy = SerializationStrategy.REQIF;
- private String previousElement = "";
+ private String previousElement = ""; //$NON-NLS-1$
private int previousLevel = -1;;
int xhtmlLevel = OUT_OF_XHTML;
int toolExtensionsLevel = OUT_OF_XHTML;
@@ -105,7 +105,14 @@
@Override
protected void handleProxy(InternalEObject proxy, String uriLiteral) {
- URI proxyURI = URI.createURI("#" + uriLiteral); //$NON-NLS-1$
+ URI resourceURI = xmlResource.getURI();
+ URI proxyURI;
+ if (null == resourceURI) {
+ // this only happens if the resource is e.g. loaded from a stream without assigning any URI
+ proxyURI = URI.createURI("#" + uriLiteral); //$NON-NLS-1$
+ } else {
+ proxyURI = resourceURI.appendFragment(uriLiteral);
+ }
proxy.eSetProxyURI(proxyURI);
}
@@ -132,7 +139,7 @@
// this happens if we find an element that is nested in ReqIFToolExtensions
if (null == deferredFeatures.peek()) {
deferredFeatures.pop();
- EStructuralFeature feature = getFeature(peekObject, obj.eClass().getEPackage().getNsPrefix(), "root", true);
+ EStructuralFeature feature = getFeature(peekObject, obj.eClass().getEPackage().getNsPrefix(), "root", true); //$NON-NLS-1$
deferredFeatures.push(feature);
}
diff --git a/org.eclipse.rmf.serialization/src/org/eclipse/rmf/internal/serialization/ReqIFXMLSaveImpl.java b/org.eclipse.rmf.serialization/src/org/eclipse/rmf/internal/serialization/ReqIFXMLSaveImpl.java
index e03b624..718fb45 100644
--- a/org.eclipse.rmf.serialization/src/org/eclipse/rmf/internal/serialization/ReqIFXMLSaveImpl.java
+++ b/org.eclipse.rmf.serialization/src/org/eclipse/rmf/internal/serialization/ReqIFXMLSaveImpl.java
@@ -31,8 +31,6 @@
* @author broerkens
*/
public class ReqIFXMLSaveImpl extends XMLSaveImpl implements IReqIFSerializationConstants {
- private static final String EMPTY_URI = ""; //$NON-NLS-1$
-
private SerializationStrategy serializationStrategy = SerializationStrategy.REQIF;
public ReqIFXMLSaveImpl(XMLHelper xmlHelper) {
diff --git a/org.eclipse.rmf.serialization/src/org/eclipse/rmf/serialization/ReqIFResourceSetImpl.java b/org.eclipse.rmf.serialization/src/org/eclipse/rmf/serialization/ReqIFResourceSetImpl.java
index 612d097..3bc971c 100644
--- a/org.eclipse.rmf.serialization/src/org/eclipse/rmf/serialization/ReqIFResourceSetImpl.java
+++ b/org.eclipse.rmf.serialization/src/org/eclipse/rmf/serialization/ReqIFResourceSetImpl.java
@@ -18,19 +18,37 @@
public class ReqIFResourceSetImpl extends ResourceSetImpl {
@Override
+ /**
+ * ReqIF doesn't contain any information about the resource where to find an object with a given ID.
+ * Since most references are expected to be references to objects within the same file, we first search in the resource that contained the reference.
+ * If the referenced object is not found, then the search continues in all other resources that are contained in the resource set.
+ *
+ * In order to map this behavior to the standard EMF proxy resolution mechanism the
+ * URI of the resource that contains the reference is added to the reference by default during deserialization.
+ *
+ * This allows using the ReqIFResourceImpl in a standard EMF resource set if no cross resource links need to be resolved.
+ */
public EObject getEObject(URI uri, boolean loadOnDemand) {
- // brute force search in all contained ressources
EObject eObject = null;
- for (Resource resource : this.getResources()) {
- eObject = resource.getEObject(uri.fragment());
- if (null != eObject) {
- break;
- }
+ // first try to find the object in the resource that contained the reference using the standard EMF proxy
+ // resolution strategy
+
+ eObject = super.getEObject(uri, loadOnDemand);
+
+ // if the eObject was not found: continue searching in all other resources
+ if (null == eObject) {
+ Resource sourceResource = getResource(uri.trimFragment(), loadOnDemand);
+ for (Resource resource : getResources()) {
+ if (resource != sourceResource) {
+ eObject = resource.getEObject(uri.fragment());
+ if (null != eObject) {
+ break;
+ }
+ }
+ }
}
-
+
return eObject;
}
-
-
}