Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Jastram2013-02-06 15:13:39 +0000
committerMichael Jastram2013-02-06 15:13:39 +0000
commit55db01834f7096cc2b0928d84ecb093a12fdcf3e (patch)
tree4234666dcf61e08b9ea7fc2d84f1bfe9bdf80e03
parent40146579ac98248692a109d56cddb13da62dabe7 (diff)
downloadorg.eclipse.rmf-55db01834f7096cc2b0928d84ecb093a12fdcf3e.tar.gz
org.eclipse.rmf-55db01834f7096cc2b0928d84ecb093a12fdcf3e.tar.xz
org.eclipse.rmf-55db01834f7096cc2b0928d84ecb093a12fdcf3e.zip
Now automatically installs default presentations (under certain
circumstances)
-rw-r--r--org.eclipse.rmf.reqif10.pror.edit/src/org/eclipse/rmf/reqif10/pror/edit/presentation/service/PresentationInterface.java46
-rw-r--r--org.eclipse.rmf.reqif10.pror.editor/plugin.xml2
-rw-r--r--org.eclipse.rmf.reqif10.pror.editor/schema/presentation.exsd218
-rw-r--r--org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/preferences/PreferenceConstants.java29
-rw-r--r--org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/preferences/ProrDefaultPresentationPage.java6
-rw-r--r--org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/presentation/CheckDefaultPresentations.java94
-rw-r--r--org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/presentation/service/PresentationEditorInterface.java17
-rw-r--r--org.eclipse.rmf.reqif10.pror.presentation.headline/src/org/eclipse/rmf/reqif10/pror/presentation/headline/provider/HeadlineConfigurationItemProvider.java7
-rw-r--r--org.eclipse.rmf.reqif10.pror.presentation.linewrap/src/org/eclipse/rmf/reqif10/pror/presentation/linewrap/provider/LinewrapConfigurationItemProvider.java8
9 files changed, 275 insertions, 152 deletions
diff --git a/org.eclipse.rmf.reqif10.pror.edit/src/org/eclipse/rmf/reqif10/pror/edit/presentation/service/PresentationInterface.java b/org.eclipse.rmf.reqif10.pror.edit/src/org/eclipse/rmf/reqif10/pror/edit/presentation/service/PresentationInterface.java
index 595e7814..91d6cb2a 100644
--- a/org.eclipse.rmf.reqif10.pror.edit/src/org/eclipse/rmf/reqif10/pror/edit/presentation/service/PresentationInterface.java
+++ b/org.eclipse.rmf.reqif10.pror.edit/src/org/eclipse/rmf/reqif10/pror/edit/presentation/service/PresentationInterface.java
@@ -10,55 +10,33 @@
******************************************************************************/
package org.eclipse.rmf.reqif10.pror.edit.presentation.service;
-import java.util.Collection;
-
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.rmf.reqif10.DatatypeDefinition;
-import org.eclipse.rmf.reqif10.ReqIF;
+import org.eclipse.emf.edit.provider.ItemProvider;
import org.eclipse.rmf.reqif10.pror.configuration.ProrPresentationConfiguration;
+import org.eclipse.rmf.reqif10.pror.util.PresentationEditInterface;
/**
* 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.
+ * information to the System.
* <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.).
+ * The JavaDoc provides examples on how to implement the few methods of this
+ * interface.
* <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()}.
+ * The bulk of the presentation information is accessed via
+ * {@link PresentationEditInterface}, which should be implemented by the
+ * {@link ItemProvider} of the {@link ProrPresentationConfiguration} element.
* <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)}.
+ * <b>IMPORTANT:</b> The ItemProvider must be generated as "Stateful". This will
+ * result in one provider instance per configuration element.
* <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>
+ * Optionally, the ItemProvider may implment PresentationEditorInterface (in the
+ * editor plugin), allowing the Presentation to provide GUI functionality.
* <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 {
diff --git a/org.eclipse.rmf.reqif10.pror.editor/plugin.xml b/org.eclipse.rmf.reqif10.pror.editor/plugin.xml
index 47f90991..60192935 100644
--- a/org.eclipse.rmf.reqif10.pror.editor/plugin.xml
+++ b/org.eclipse.rmf.reqif10.pror.editor/plugin.xml
@@ -243,6 +243,8 @@ Contributors:
<startup
class="org.eclipse.rmf.reqif10.pror.editor.presentation.OpenFilesOnStartup">
</startup>
+ <startup
+ class="org.eclipse.rmf.reqif10.pror.editor.presentation.CheckDefaultPresentations"></startup>
</extension>
</plugin>
diff --git a/org.eclipse.rmf.reqif10.pror.editor/schema/presentation.exsd b/org.eclipse.rmf.reqif10.pror.editor/schema/presentation.exsd
index d4108c88..8739e6af 100644
--- a/org.eclipse.rmf.reqif10.pror.editor/schema/presentation.exsd
+++ b/org.eclipse.rmf.reqif10.pror.editor/schema/presentation.exsd
@@ -1,109 +1,109 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.rmf.reqif10.pror.editor" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.rmf.reqif10.pror.editor" id="presentation" name="Renderer and Editor for ReqIF Datatypes"/>
- </appInfo>
- <documentation>
- We cannot change the data structures, but we can decide on how to interpret them. Therefore, plugins provide new Renderers and Editors for DatatypeDefinitions. Unless assigned, the EMF Renderers and Editors are used.
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appInfo>
- <meta.element />
- </appInfo>
- </annotation>
- <complexType>
- <sequence minOccurs="0" maxOccurs="unbounded">
- <element ref="presentation"/>
- </sequence>
- <attribute name="point" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="id" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
-
- </documentation>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="presentation">
- <complexType>
- <attribute name="name" type="string">
- <annotation>
- <documentation>
- The name of the Presentation presented to the user.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="service" type="string" use="required">
- <annotation>
- <documentation>
- The Factory for creating LabelProviders and EditorSupport for this Presentation.
- </documentation>
- <appInfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.rmf.reqif10.pror.editor.presentation.service.PresentationService"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appInfo>
- <meta.section type="since"/>
- </appInfo>
- <documentation>
- 0.1.0
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="examples"/>
- </appInfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="apiinfo"/>
- </appInfo>
- <documentation>
- [Enter API information here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appInfo>
- <meta.section type="implementation"/>
- </appInfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
-
-</schema>
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.rmf.reqif10.pror.editor" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.eclipse.rmf.reqif10.pror.editor" id="presentation" name="Renderer and Editor for ReqIF Datatypes"/>
+ </appInfo>
+ <documentation>
+ We cannot change the data structures, but we can decide on how to interpret them. Therefore, plugins provide new Renderers and Editors for DatatypeDefinitions. Unless assigned, the EMF Renderers and Editors are used.
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence minOccurs="0" maxOccurs="unbounded">
+ <element ref="presentation"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="presentation">
+ <complexType>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+ The name of the Presentation presented to the user.
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="service" type="string" use="required">
+ <annotation>
+ <documentation>
+ The Factory for creating LabelProviders and EditorSupport for this Presentation.
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java" basedOn=":org.eclipse.rmf.reqif10.pror.edit.presentation.service.PresentationInterface"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ 0.1.0
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
diff --git a/org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/preferences/PreferenceConstants.java b/org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/preferences/PreferenceConstants.java
index b046bd7e..a2bbea89 100644
--- a/org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/preferences/PreferenceConstants.java
+++ b/org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/preferences/PreferenceConstants.java
@@ -11,6 +11,14 @@
******************************************************************************/
package org.eclipse.rmf.reqif10.pror.editor.preferences;
+import org.eclipse.rmf.reqif10.DatatypeDefinitionBoolean;
+import org.eclipse.rmf.reqif10.DatatypeDefinitionDate;
+import org.eclipse.rmf.reqif10.DatatypeDefinitionEnumeration;
+import org.eclipse.rmf.reqif10.DatatypeDefinitionInteger;
+import org.eclipse.rmf.reqif10.DatatypeDefinitionReal;
+import org.eclipse.rmf.reqif10.DatatypeDefinitionString;
+import org.eclipse.rmf.reqif10.DatatypeDefinitionXHTML;
+
/**
* @author Lukas Ladenberger
* @author Michael Jastram
@@ -21,11 +29,18 @@ public final class PreferenceConstants {
// Constants for default presentations
public static final String P_DEFAULT_PRESENTATION_BUILD_IN = "default_presentation_build_in";
- public static final String P_DEFAULT_PRESENTATION_STRING = "default_presentation_string";
- public static final String P_DEFAULT_PRESENTATION_XHTML = "default_presentation_xhtml";
- public static final String P_DEFAULT_PRESENTATION_BOOLEAN = "default_presentation_boolean";
- public static final String P_DEFAULT_PRESENTATION_DATE = "date";
- public static final String P_DEFAULT_PRESENTATION_ENUMERATION = "default_presentation_enumeration";
- public static final String P_DEFAULT_PRESENTATION_INTEGER = "default_presentation_integer";
- public static final String P_DEFAULT_PRESENTATION_REAL = "default_presentation_real";
+ public static final String P_DEFAULT_PRESENTATION_STRING = DatatypeDefinitionString.class
+ .getSimpleName();
+ public static final String P_DEFAULT_PRESENTATION_XHTML = DatatypeDefinitionXHTML.class
+ .getSimpleName();
+ public static final String P_DEFAULT_PRESENTATION_BOOLEAN = DatatypeDefinitionBoolean.class
+ .getSimpleName();
+ public static final String P_DEFAULT_PRESENTATION_DATE = DatatypeDefinitionDate.class
+ .getSimpleName();
+ public static final String P_DEFAULT_PRESENTATION_ENUMERATION = DatatypeDefinitionEnumeration.class
+ .getSimpleName();
+ public static final String P_DEFAULT_PRESENTATION_INTEGER = DatatypeDefinitionInteger.class
+ .getSimpleName();
+ public static final String P_DEFAULT_PRESENTATION_REAL = DatatypeDefinitionReal.class
+ .getSimpleName();
}
diff --git a/org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/preferences/ProrDefaultPresentationPage.java b/org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/preferences/ProrDefaultPresentationPage.java
index f01d468b..2fbd844e 100644
--- a/org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/preferences/ProrDefaultPresentationPage.java
+++ b/org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/preferences/ProrDefaultPresentationPage.java
@@ -8,6 +8,7 @@ import org.eclipse.rmf.reqif10.pror.configuration.ProrPresentationConfiguration;
import org.eclipse.rmf.reqif10.pror.edit.presentation.service.PresentationInterface;
import org.eclipse.rmf.reqif10.pror.editor.presentation.Reqif10EditorPlugin;
import org.eclipse.rmf.reqif10.pror.editor.presentation.service.PresentationServiceManager;
+import org.eclipse.rmf.reqif10.pror.util.ProrUtil;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
@@ -38,11 +39,12 @@ public class ProrDefaultPresentationPage extends FieldEditorPreferencePage
result[0][0] = "None";
result[0][1] = "";
result[1][0] = "Use Build-in";
- result[1][1] = "";
+ result[1][1] = PreferenceConstants.P_DEFAULT_PRESENTATION_BUILD_IN;
int i = 2;
for (@SuppressWarnings("rawtypes")
Class key : presentationMap.keySet()) {
- result[i][0] = key.getSimpleName();
+ result[i][0] = ProrUtil.substractPrefixPostfix(key,
+ "", "ConfigurationImpl");
result[i][1] = key.getCanonicalName();
i++;
}
diff --git a/org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/presentation/CheckDefaultPresentations.java b/org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/presentation/CheckDefaultPresentations.java
new file mode 100644
index 00000000..4b2fab2d
--- /dev/null
+++ b/org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/presentation/CheckDefaultPresentations.java
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2013 Formal Mind GmbH.
+ * 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.pror.editor.presentation;
+
+import org.eclipse.emf.common.notify.AdapterFactory;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.ItemProviderAdapter;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.rmf.reqif10.DatatypeDefinition;
+import org.eclipse.rmf.reqif10.pror.configuration.ProrPresentationConfiguration;
+import org.eclipse.rmf.reqif10.pror.edit.presentation.service.PresentationInterface;
+import org.eclipse.rmf.reqif10.pror.editor.preferences.PreferenceConstants;
+import org.eclipse.rmf.reqif10.pror.editor.presentation.service.PresentationEditorInterface;
+import org.eclipse.rmf.reqif10.pror.editor.presentation.service.PresentationServiceManager;
+import org.eclipse.rmf.reqif10.pror.util.ProrUtil;
+import org.eclipse.ui.IStartup;
+
+/**
+ * This class is triggered on startup and updates the default presentations,
+ * according to {@link PresentationEditorInterface#suggestAsDefault()}.
+ *
+ * @author jastram
+ *
+ */
+public class CheckDefaultPresentations implements IStartup {
+
+ public void earlyStartup() {
+ AdapterFactory adapterFactory = new ComposedAdapterFactory(
+ ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
+ for (PresentationInterface presentation : PresentationServiceManager
+ .getPresentationInterfaceMap().values()) {
+ ProrPresentationConfiguration config = presentation
+ .getConfigurationInstance();
+ ItemProviderAdapter ip = ProrUtil.getItemProvider(adapterFactory,
+ config);
+ if (ip instanceof PresentationEditorInterface) {
+ PresentationEditorInterface editorInterface = (PresentationEditorInterface) ip;
+ Class<? extends DatatypeDefinition> dd = editorInterface
+ .suggestAsDefault();
+ if (dd != null) {
+ checkDefault(dd, config.getClass());
+ }
+ }
+ }
+
+ }
+
+ /**
+ * We have a candidate for the given {@link DatatypeDefinition} (which is
+ * not null).
+ *
+ * If no default is set, set it. If a default is set, ask whether it should
+ * be replaced.
+ */
+ private void checkDefault(final Class<? extends DatatypeDefinition> dd,
+ final Class<? extends ProrPresentationConfiguration> config) {
+ IPreferenceStore store = Reqif10EditorPlugin.getPlugin()
+ .getPreferenceStore();
+ final String defaultPresentation = store.getString(dd.getSimpleName());
+ System.out.println("Retrieving for: " + dd.getSimpleName());
+ System.out.println("Constant: "
+ + PreferenceConstants.P_DEFAULT_PRESENTATION_STRING);
+
+ if (defaultPresentation
+ .equals(PreferenceConstants.P_DEFAULT_PRESENTATION_BUILD_IN)) {
+ System.out.println("Not setting default presentation for "
+ + dd.getSimpleName() + ", as the user forced the default.");
+ } else if (defaultPresentation == null
+ || defaultPresentation.equals("")) {
+ // Install, no questions asked.
+ store.setValue(dd.getSimpleName(), config.getCanonicalName());
+ System.out.println("Installed as default for " + dd.getSimpleName()
+ + ": " + config.getSimpleName());
+ } else {
+ // There is already a default configuration, which we leave alone.
+ // If we had time, we could get fancy and allow the user to replace
+ // one with the other.
+ System.out
+ .println("Not replacing default for " + dd.getSimpleName()
+ + " with " + config.getSimpleName()
+ + ", as there is already a default: "
+ + defaultPresentation);
+ }
+ }
+
+}
diff --git a/org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/presentation/service/PresentationEditorInterface.java b/org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/presentation/service/PresentationEditorInterface.java
index 8f6d1ec9..6933d17a 100644
--- a/org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/presentation/service/PresentationEditorInterface.java
+++ b/org.eclipse.rmf.reqif10.pror.editor/src/org/eclipse/rmf/reqif10/pror/editor/presentation/service/PresentationEditorInterface.java
@@ -94,4 +94,21 @@ public interface PresentationEditorInterface {
*/
boolean canEdit();
+ /**
+ * If this method returns a non-null value, it is matched against the ReqIF
+ * data types. If there is no default for the given type yet, it is
+ * installed as the default. If there is already a default, ProR asks the
+ * user whether the current default should be replaced.
+ * <p>
+ *
+ * A default makes sense for Presentations that improve rendering. For
+ * instance, a renderer for XHTML can replace the default renderer, which
+ * has no rich text capabilities.
+ * <p>
+ *
+ * Note that the user cannot configure a default!
+ * <p>
+ */
+ Class<? extends DatatypeDefinition> suggestAsDefault();
+
}
diff --git a/org.eclipse.rmf.reqif10.pror.presentation.headline/src/org/eclipse/rmf/reqif10/pror/presentation/headline/provider/HeadlineConfigurationItemProvider.java b/org.eclipse.rmf.reqif10.pror.presentation.headline/src/org/eclipse/rmf/reqif10/pror/presentation/headline/provider/HeadlineConfigurationItemProvider.java
index a9c185ca..90aabf7e 100644
--- a/org.eclipse.rmf.reqif10.pror.presentation.headline/src/org/eclipse/rmf/reqif10/pror/presentation/headline/provider/HeadlineConfigurationItemProvider.java
+++ b/org.eclipse.rmf.reqif10.pror.presentation.headline/src/org/eclipse/rmf/reqif10/pror/presentation/headline/provider/HeadlineConfigurationItemProvider.java
@@ -289,4 +289,11 @@ public class HeadlineConfigurationItemProvider
}
}
+ /**
+ * Does not make sense as default.
+ */
+ public Class<? extends DatatypeDefinition> suggestAsDefault() {
+ return null;
+ }
+
}
diff --git a/org.eclipse.rmf.reqif10.pror.presentation.linewrap/src/org/eclipse/rmf/reqif10/pror/presentation/linewrap/provider/LinewrapConfigurationItemProvider.java b/org.eclipse.rmf.reqif10.pror.presentation.linewrap/src/org/eclipse/rmf/reqif10/pror/presentation/linewrap/provider/LinewrapConfigurationItemProvider.java
index 692721f0..a919898c 100644
--- a/org.eclipse.rmf.reqif10.pror.presentation.linewrap/src/org/eclipse/rmf/reqif10/pror/presentation/linewrap/provider/LinewrapConfigurationItemProvider.java
+++ b/org.eclipse.rmf.reqif10.pror.presentation.linewrap/src/org/eclipse/rmf/reqif10/pror/presentation/linewrap/provider/LinewrapConfigurationItemProvider.java
@@ -29,7 +29,9 @@ import org.eclipse.emf.edit.provider.IItemPropertySource;
import org.eclipse.emf.edit.provider.IStructuredItemContentProvider;
import org.eclipse.emf.edit.provider.ITreeItemContentProvider;
import org.eclipse.rmf.reqif10.AttributeValue;
+import org.eclipse.rmf.reqif10.DatatypeDefinition;
import org.eclipse.rmf.reqif10.DatatypeDefinitionSimple;
+import org.eclipse.rmf.reqif10.DatatypeDefinitionString;
import org.eclipse.rmf.reqif10.SpecElementWithAttributes;
import org.eclipse.rmf.reqif10.common.util.ReqIF10Util;
import org.eclipse.rmf.reqif10.pror.configuration.ProrPresentationConfiguration;
@@ -198,4 +200,10 @@ public class LinewrapConfigurationItemProvider
return null;
}
+ /**
+ * Use as default for Strings
+ */
+ public Class<? extends DatatypeDefinition> suggestAsDefault() {
+ return DatatypeDefinitionString.class;
+ }
}

Back to the top