...
 
Commits (3)
......@@ -310,33 +310,32 @@ any resulting litigation.
<requires>
<import plugin="org.eclipse.core.runtime"/>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.xtext"/>
<import plugin="org.eclipse.ocl.common"/>
<import plugin="org.eclipse.ocl.ecore"/>
<import plugin="org.etsi.mts.tdl.model"/>
<import plugin="org.eclipse.swt"/>
<import plugin="org.eclipse.xtext.ui"/>
<import plugin="org.etsi.mts.tdl.TPLan2.ui"/>
<import plugin="org.apache.commons.io"/>
<import plugin="org.etsi.mts.tdl.TPLan2"/>
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.core.resources"/>
<import plugin="org.eclipse.ui.editors" version="3.5.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui.ide" version="3.5.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.ui.workbench"/>
<import plugin="com.google.inject"/>
<import plugin="org.eclipse.xtext.ui"/>
<import plugin="org.eclipse.emf.ecore"/>
<import plugin="org.eclipse.ocl.xtext.essentialocl"/>
</requires>
<plugin
id="org.etsi.mts.tdl.tools.to.docx"
id="org.etsi.mts.tdl.tools.to.docx.poi"
download-size="0"
install-size="0"
version="0.0.0"/>
version="0.0.0"
unpack="false"/>
<plugin
id="org.etsi.mts.tdl.tools.to.docx.ui"
id="org.etsi.mts.tdl.tools.to.docx.poi.ui"
download-size="0"
install-size="0"
version="0.0.0"/>
version="0.0.0"
unpack="false"/>
</feature>
......@@ -5,13 +5,10 @@
version="1.0.0.qualifier">
<requires>
<import feature="org.etsi.mts.tdl.model.feature" version="1.4.0.qualifier"/>
<import plugin="org.etsi.mts.tdl.model"/>
<import plugin="org.eclipse.xtext"/>
<import plugin="org.eclipse.xtext.xbase"/>
<import plugin="org.eclipse.equinox.common" version="3.5.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.xbase.lib"/>
<import plugin="org.antlr.runtime"/>
<import plugin="org.eclipse.xtext.util"/>
<import plugin="org.eclipse.xtend.lib"/>
<import plugin="org.apache.log4j"/>
......@@ -25,6 +22,9 @@
<import plugin="org.eclipse.ui"/>
<import plugin="org.eclipse.compare"/>
<import plugin="org.eclipse.xtext.builder"/>
<import feature="org.etsi.mts.tdl.model.feature" version="1.4.0.qualifier"/>
<import plugin="org.eclipse.xtext.xbase.lib" version="2.14.0" match="greaterOrEqual"/>
<import plugin="org.antlr.runtime" version="3.2.0" match="perfect"/>
</requires>
<plugin
......@@ -48,4 +48,11 @@
version="0.0.0"
unpack="false"/>
<plugin
id="org.etsi.mts.tdl.common"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>
......@@ -5,13 +5,12 @@
version="1.0.0.qualifier">
<requires>
<import plugin="org.etsi.mts.tdl.model"/>
<import plugin="org.eclipse.xtext"/>
<import plugin="org.eclipse.xtext.xbase"/>
<import plugin="org.eclipse.equinox.common" version="3.5.0" match="greaterOrEqual"/>
<import plugin="org.eclipse.xtext.xbase.lib"/>
<import plugin="org.eclipse.xtext.util"/>
<import plugin="org.eclipse.xtend.lib"/>
<import plugin="org.antlr.runtime"/>
<import plugin="org.apache.log4j"/>
<import plugin="org.eclipse.xtext.ide"/>
<import plugin="org.eclipse.xtext.xbase.ide"/>
......@@ -24,7 +23,8 @@
<import plugin="org.eclipse.compare"/>
<import plugin="org.eclipse.xtext.builder"/>
<import feature="org.etsi.mts.tdl.model.feature" version="1.4.0.qualifier"/>
<import plugin="org.etsi.mts.tdl.model"/>
<import plugin="org.eclipse.xtext.xbase.lib" version="2.14.0" match="greaterOrEqual"/>
<import plugin="org.antlr.runtime" version="3.2.0" match="perfect"/>
</requires>
<plugin
......@@ -48,4 +48,11 @@
version="0.0.0"
unpack="false"/>
<plugin
id="org.etsi.mts.tdl.common"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
</feature>
<?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/JavaSE-1.7"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.etsi.mts.tdl.tools.to.docx.poi.ui</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>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Ui
Bundle-SymbolicName: org.etsi.mts.tdl.tools.to.docx.poi.ui;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.etsi.mts.tdl.tools.to.docx.poi.ui.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.ui.editors;bundle-version="3.5.0",
org.eclipse.ui.ide;bundle-version="3.5.0",
org.eclipse.ui.workbench,
com.google.inject,
org.eclipse.xtext.ui,
org.etsi.mts.tdl.tools.to.docx.poi
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
source.. = src/
output.. = bin/
bin.includes = plugin.xml,\
META-INF/,\
.,\
icons/
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.ui.commands">
<category
name="TDL"
id="org.etsi.mts.tdl.tools.to.docx.poi.ui.commands.category">
</category>
<command
categoryId="org.etsi.mts.tdl.tools.to.docx.poi.ui.commands.category"
id="org.etsi.mts.tdl.tools.to.docx.poi.ui.commands.generateCommand"
name="Generate Document">
</command>
</extension>
<extension
point="org.eclipse.ui.handlers">
<handler
commandId="org.etsi.mts.tdl.tools.to.docx.poi.ui.commands.generateCommand"
class="org.etsi.mts.tdl.tools.to.docx.poi.ui.handlers.GenerationHandler">
</handler>
</extension>
<extension
point="org.eclipse.ui.bindings">
<key
commandId="org.etsi.mts.tdl.tools.to.docx.poi.ui.commands.generateCommand"
contextId="org.eclipse.ui.contexts.window"
sequence="M1+G"
schemeId="org.eclipse.ui.defaultAcceleratorConfiguration">
</key>
</extension>
<extension
point="org.eclipse.ui.menus">
<menuContribution
locationURI="menu:org.eclipse.ui.main.menu?after=additions">
<menu
label="TDL"
mnemonic="T"
id="org.etsi.mts.tdl.tools.menus.TDLMenu">
<command
icon="icons/WordIcon.png"
commandId="org.etsi.mts.tdl.tools.to.docx.poi.ui.commands.generateCommand"
mnemonic="G"
id="org.etsi.mts.tdl.tools.to.docx.poi.ui.menus.generateCommand">
</command>
</menu>
</menuContribution>
<menuContribution
locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions">
<toolbar
id="org.etsi.mts.tdl.constraints.ui.toolbars.generate">
<command
commandId="org.etsi.mts.tdl.tools.to.docx.poi.ui.commands.generateCommand"
icon="icons/WordIcon.png"
tooltip="Generate Document"
id="org.etsi.mts.tdl.tools.to.docx.poi.ui.toolbars.generateCommand">
</command>
</toolbar>
</menuContribution>
</extension>
</plugin>
package org.etsi.mts.tdl.tools.to.docx.poi.ui;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.etsi.mts.tdl.tools.to.docx.poi.ui"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
/**
* Returns an image descriptor for the image file at the given
* plug-in relative path
*
* @param path the path
* @return the image descriptor
*/
public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}
}
<?xml version="1.0" encoding="UTF-8"?><projectDescription><name>DUMMY</name><comment></comment><projects></projects><buildSpec></buildSpec><natures></natures></projectDescription>
\ No newline at end of file
package org.etsi.mts.tdl.tools.to.docx.poi.ui.handlers;
import java.io.File;
import java.util.Arrays;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.xtext.ui.resource.IResourceSetProvider;
import org.etsi.mts.tdl.tools.to.docx.poi.Generator;
import com.google.inject.Inject;
/**
* Our sample handler extends AbstractHandler, an IHandler base class.
* @see org.eclipse.core.commands.IHandler
* @see org.eclipse.core.commands.AbstractHandler
*/
public class GenerationHandler extends AbstractHandler {
@Inject
IResourceSetProvider resourceSetProvider;
private IWorkbenchWindow window;
/**
* The constructor.
*/
public GenerationHandler() {
}
/**
* the command has been executed, so extract extract the needed information
* from the application context.
*/
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = HandlerUtil.getCurrentSelection(event);
IEditorInput input = HandlerUtil.getActiveEditorInput(event);
IFile file = null;
if (input != null && input instanceof FileEditorInput) {
file = ((FileEditorInput) input).getFile();
} else if (selection !=null && selection instanceof IStructuredSelection) {
IStructuredSelection structuredSelection = (IStructuredSelection) selection;
Object firstElement = structuredSelection.getFirstElement();
if (firstElement instanceof IFile) {
file = (IFile) firstElement;
}
}
if (file !=null) {
URI uri = URI.createPlatformResourceURI(file.getFullPath().toString(), true);
ResourceSet rs = new ResourceSetImpl();
Resource r = rs.getResource(uri, true);
ElementListSelectionDialog dialog = new ElementListSelectionDialog(Display.getDefault().getActiveShell(), new LabelProvider());
dialog.setTitle("Generation Configuration");
dialog.setMessage("Select template:");
dialog.setElements(new String[] { "TO_4_TABLE_TEMPLATE_EDITHELP", "TO_5_TABLE_TEMPLATE_ONEM2M", "TO_2_TABLE_TEMPLATE" });
dialog.setInitialElementSelections(Arrays.asList(new String[] {Generator.selectedTemplate}));
// user pressed cancel
if (dialog.open() != Window.OK) {
return false;
} else {
Object[] result = dialog.getResult();
String selected = (String)result[0];
Generator generator = new Generator();
String target = file.getLocation().toOSString()+".docx";
try {
generator.generate(r, target, file.getName(), selected);
MessageDialog.openInformation(
Display.getDefault().getActiveShell(),
"Generation Results",
"Generated output in "+target);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
MessageDialog.openError(
Display.getDefault().getActiveShell(),
"Generation Results",
"Generation failed!");
}
}
}
return null;
}
public void init(IWorkbenchWindow window) {
this.window = window;
}
@Override
public boolean isEnabled() {
return true;
}
}
<?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/JavaSE-10">
<attributes>
<attribute name="module" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="lib" path="lib/activation-1.1.1.jar"/>
<classpathentry kind="lib" path="lib/commons-codec-1.11.jar"/>
<classpathentry kind="lib" path="lib/commons-collections4-4.2.jar"/>
<classpathentry kind="lib" path="lib/commons-compress-1.18.jar"/>
<classpathentry kind="lib" path="lib/commons-logging-1.2.jar"/>
<classpathentry kind="lib" path="lib/commons-math3-3.6.1.jar"/>
<classpathentry kind="lib" path="lib/curvesapi-1.05.jar"/>
<classpathentry kind="lib" path="lib/jaxb-api-2.3.0.jar"/>
<classpathentry kind="lib" path="lib/jaxb-core-2.3.0.1.jar"/>
<classpathentry kind="lib" path="lib/jaxb-impl-2.3.0.1.jar"/>
<classpathentry kind="lib" path="lib/junit-4.12.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2.17.jar"/>
<classpathentry kind="lib" path="lib/poi-4.0.1.jar"/>
<classpathentry kind="lib" path="lib/poi-examples-4.0.1.jar"/>
<classpathentry kind="lib" path="lib/poi-excelant-4.0.1.jar"/>
<classpathentry kind="lib" path="lib/poi-ooxml-4.0.1.jar"/>
<classpathentry kind="lib" path="lib/poi-ooxml-schemas-4.0.1.jar"/>
<classpathentry kind="lib" path="lib/poi-scratchpad-4.0.1.jar"/>
<classpathentry kind="lib" path="lib/xmlbeans-3.0.2.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.etsi.mts.tdl.tools.to.docx.poi</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>
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=10
org.eclipse.jdt.core.compiler.compliance=10
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=10
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: TDL-TO to Docx Generation (Apache POI Binding)
Bundle-SymbolicName: org.etsi.mts.tdl.tools.to.docx.poi
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: org.etsi.mts.tdl.tools.to.docx.poi.Activator
Bundle-Vendor: ETSI
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.core.resources,
org.eclipse.emf.ecore,
org.eclipse.xtext,
org.etsi.mts.tdl.model,
org.etsi.mts.tdl.TPLan2,
org.eclipse.ocl.xtext.essentialocl
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Automatic-Module-Name: org.etsi.mts.tdl.tools.to.docx.poi
Bundle-ActivationPolicy: lazy
Export-Package: org.etsi.mts.tdl.tools.to.docx.poi
Bundle-ClassPath: lib/activation-1.1.1.jar,
lib/commons-codec-1.11.jar,
lib/commons-collections4-4.2.jar,
lib/commons-compress-1.18.jar,
lib/commons-logging-1.2.jar,
lib/commons-math3-3.6.1.jar,
lib/curvesapi-1.05.jar,
lib/jaxb-api-2.3.0.jar,
lib/jaxb-core-2.3.0.1.jar,
lib/jaxb-impl-2.3.0.1.jar,
lib/junit-4.12.jar,
lib/log4j-1.2.17.jar,
lib/poi-4.0.1.jar,
lib/poi-examples-4.0.1.jar,
lib/poi-excelant-4.0.1.jar,
lib/poi-ooxml-4.0.1.jar,
lib/poi-ooxml-schemas-4.0.1.jar,
lib/poi-scratchpad-4.0.1.jar,
lib/xmlbeans-3.0.2.jar,
.
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
lib/activation-1.1.1.jar,\
lib/commons-codec-1.11.jar,\
lib/commons-collections4-4.2.jar,\
lib/commons-compress-1.18.jar,\
lib/commons-logging-1.2.jar,\
lib/commons-math3-3.6.1.jar,\
lib/curvesapi-1.05.jar,\
lib/jaxb-api-2.3.0.jar,\
lib/jaxb-core-2.3.0.1.jar,\
lib/jaxb-impl-2.3.0.1.jar,\
lib/junit-4.12.jar,\
lib/log4j-1.2.17.jar,\
lib/poi-4.0.1.jar,\
lib/poi-examples-4.0.1.jar,\
lib/poi-excelant-4.0.1.jar,\
lib/poi-ooxml-4.0.1.jar,\
lib/poi-ooxml-schemas-4.0.1.jar,\
lib/poi-scratchpad-4.0.1.jar,\
lib/xmlbeans-3.0.2.jar,\
resource/
src.includes = resource/
package org.etsi.mts.tdl.tools.to.docx.poi;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
public class Activator implements BundleActivator {
private static BundleContext context;
static BundleContext getContext() {
return context;
}
public void start(BundleContext bundleContext) throws Exception {
Activator.context = bundleContext;
}
public void stop(BundleContext bundleContext) throws Exception {
Activator.context = null;
}
}
package org.etsi.mts.tdl.tools.to.docx.poi;
import java.io.File;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EOperation;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.EValidator;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.ocl.common.OCLConstants;
import org.eclipse.ocl.pivot.internal.delegate.OCLInvocationDelegateFactory;
import org.eclipse.ocl.pivot.internal.delegate.OCLSettingDelegateFactory;
import org.eclipse.ocl.pivot.internal.delegate.OCLValidationDelegateFactory;
import org.eclipse.ocl.xtext.essentialocl.EssentialOCLStandaloneSetup;
import org.eclipse.xtext.resource.XtextResource;
import org.eclipse.xtext.resource.XtextResourceSet;
import org.etsi.mts.tdl.TPLan2StandaloneSetup;
import org.etsi.mts.tdl.impl.tdlPackageImpl;
import org.etsi.mts.tdl.structuredobjectives.impl.StructuredObjectivesPackageImpl;
import com.google.inject.Injector;
public class GeneratorApp {
public static void main(String[] args) {
// TODO Auto-generated method stub
Generator generator = new Generator();
try {
//generator.generateExample("test.docx", "TEST");
String filename = "/Users/philip-iii/Dev/workspaces/runtime-EclipseXtext-top/v141/variants-examples/variants.tplan2";
// filename = "/Users/philip-iii/Dev/workspaces/runtime-EclipseXtext-top/v141/tr-examples/objectives.tplan2";
init();
Resource resource = load(filename);
File file = new File(filename);
String target = file.getName()+".docx";
generator.generate(resource, target, "TEST-RESOURCE");
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static void init() {
tdlPackageImpl.init();
StructuredObjectivesPackageImpl.init();
EssentialOCLStandaloneSetup.doSetup();
initializeValidator();
}
public static Resource load(String filename) {
new org.eclipse.emf.mwe.utils.StandaloneSetup().setPlatformUri("../");
Injector injector = new TPLan2StandaloneSetup().createInjectorAndDoEMFRegistration();
XtextResourceSet resourceSet = injector.getInstance(XtextResourceSet.class);
resourceSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE);
Resource resource = resourceSet.getResource(URI.createURI(filename), true);
return resource;
}
public static void initializeValidator() {
// OCL.initialize(null);
String oclDelegateURI = OCLConstants.OCL_DELEGATE_URI+"/Pivot";
EOperation.Internal.InvocationDelegate.Factory.Registry.INSTANCE.put(oclDelegateURI,
new OCLInvocationDelegateFactory(oclDelegateURI));
EStructuralFeature.Internal.SettingDelegate.Factory.Registry.INSTANCE.put(oclDelegateURI,
new OCLSettingDelegateFactory(oclDelegateURI));
EValidator.ValidationDelegate.Registry.INSTANCE.put(oclDelegateURI,
new OCLValidationDelegateFactory(oclDelegateURI));
// EStructuralFeature.Internal.SettingDelegate.Factory.Registry.INSTANCE.put(oclDelegateURI,
// new OCLSettingDelegateFactory.Global());
// QueryDelegate.Factory.Registry.INSTANCE.put(oclDelegateURI, new OCLQueryDelegateFactory.Global());
}
}
package org.etsi.mts.tdl.tools.to.docx.poi;
public class Placeholders {
public static String NAME = "<TESTOBJECTIVENAMELABEL_PLACEHOLDER>";
public static String DESCRIPTION = "<DESCRIPTIONLABEL_PLACEHOLDER>";
public static String URI = "<URIOFOBJECTIVELABEL_PLACEHOLDER>";
public static String CONFIGURATION = "<CONFIGURATIONLABEL_PLACEHOLDER>";
public static String PICS = "<PICSSELECTIONLABEL_PLACEHOLDER>";
public static String INITIAL = "<INITIALCONDITIONSLABEL_PLACEHOLDER>";
public static String EXPECTED = "<EXPECTEDBEHAVIOURLABEL_PLACEHOLDER>";
public static String FINAL = "<FINALCONDITIONSLABEL_PLACEHOLDER>";
public static String WHEN = "<EXPECTEDBEHAVIOURLABEL_WHENPART_PLACEHOLDER>";
public static String THEN = "<EXPECTEDBEHAVIOURLABEL_THENPART_PLACEHOLDER>";
public static String THEN_DIRECTION = "<THEN_DIRECTION>";
public static String WHEN_DIRECTION = "<WHEN_DIRECTION>";
}
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: TO Word Export
Bundle-Name: TO Word Export (deprecated docx4j Binding)
Bundle-SymbolicName: org.etsi.mts.tdl.tools.to.docx
Bundle-Version: 1.0.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
......
......@@ -18,7 +18,7 @@ import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import javax.xml.bind.JAXBElement;
//import javax.xml.bind.JAXBElement;
public class WordTemplateTestObjective {
......@@ -341,17 +341,17 @@ public class WordTemplateTestObjective {
*/
private static List<Object> getAllElementFromObject(Object obj, Class<?> toSearch) {
List<Object> result = new ArrayList<Object>();
if (obj instanceof JAXBElement) obj = ((JAXBElement<?>) obj).getValue();
if (obj.getClass().equals(toSearch))
result.add(obj);
else if (obj instanceof ContentAccessor) {
List<?> children = ((ContentAccessor) obj).getContent();
for (Object child : children) {
result.addAll(getAllElementFromObject(child, toSearch));
}
}
// if (obj instanceof JAXBElement) obj = ((JAXBElement<?>) obj).getValue();
//
// if (obj.getClass().equals(toSearch))
// result.add(obj);
// else if (obj instanceof ContentAccessor) {
// List<?> children = ((ContentAccessor) obj).getContent();
// for (Object child : children) {
// result.addAll(getAllElementFromObject(child, toSearch));
// }
//
// }
return result;
}
......