Loading plugins/org.etsi.mts.tdl.rt.ui/icons/ValidateIcon.png 0 → 100644 +869 B Loading image diff... plugins/org.etsi.mts.tdl.rt.ui/plugin.xml +27 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,11 @@ categoryId="org.etsi.mts.tdl.tools.rt.ui.commands.category" id="org.etsi.mts.tdl.tools.rt.ui.commands.tp2tdCommand"> </command> <command name="Reload OCL constraints" categoryId="org.etsi.mts.tdl.tools.rt.ui.commands.category" id="org.etsi.mts.tdl.tools.rt.ui.commands.reloadValidatorCommand"> </command> </extension> <extension point="org.eclipse.ui.handlers"> Loading @@ -29,6 +34,10 @@ commandId="org.etsi.mts.tdl.tools.rt.ui.commands.tp2tdCommand" class="org.etsi.mts.tdl.tools.rt.ui.handlers.TP2TDHandler"> </handler> <handler commandId="org.etsi.mts.tdl.tools.rt.ui.commands.reloadValidatorCommand" class="org.etsi.mts.tdl.tools.rt.ui.handlers.ReloadValidationHandler"> </handler> </extension> <extension point="org.eclipse.ui.bindings"> Loading Loading @@ -61,10 +70,21 @@ <command commandId="org.etsi.mts.tdl.tools.rt.ui.commands.tp2tdCommand" icon="icons/TransformIcon.png" mnemonic="T" mnemonic="P" id="org.etsi.mts.tdl.tools.rt.ui.menus.tp2tdCommand"> </command> </menu> <menu label="TDL" mnemonic="T" id="org.etsi.mts.tdl.tools.menus.TDLMenu"> <command commandId="org.etsi.mts.tdl.tools.rt.ui.commands.reloadValidatorCommand" icon="icons/ValidateIcon.png" mnemonic="V" id="org.etsi.mts.tdl.tools.rt.ui.menus.reloadValidatorCommand"> </command> </menu> </menuContribution> <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions"> Loading @@ -82,6 +102,12 @@ tooltip="Transform TPs to TDs" id="org.etsi.mts.tdl.tools.rt.ui.toolbars.tp2tdCommand"> </command> <command commandId="org.etsi.mts.tdl.tools.rt.ui.commands.reloadValidatorCommand" icon="icons/ValidateIcon.png" tooltip="Reload OCL constraints" id="org.etsi.mts.tdl.tools.rt.ui.toolbars.reloadValidatorCommand"> </command> </toolbar> </menuContribution> </extension> Loading plugins/org.etsi.mts.tdl.rt.ui/src/org/etsi/mts/tdl/tools/rt/ui/handlers/ReloadValidationHandler.java 0 → 100644 +58 −0 Original line number Diff line number Diff line package org.etsi.mts.tdl.tools.rt.ui.handlers; import java.util.LinkedHashMap; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.Platform; import org.eclipse.emf.ecore.EValidator; import org.eclipse.ui.IWorkbenchWindow; import org.etsi.mts.tdl.Validator; import org.etsi.mts.tdl.tdlPackage; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; /** * Our sample handler extends AbstractHandler, an IHandler base class. * @see org.eclipse.core.commands.IHandler * @see org.eclipse.core.commands.AbstractHandler */ public class ReloadValidationHandler extends AbstractHandler { LinkedHashMap<String, String> targetFormats = new LinkedHashMap<>(); private IWorkbenchWindow window; /** * The constructor. */ public ReloadValidationHandler() { init(); } private void init() { } /** * the command has been executed, so extract extract the needed information * from the application context. */ public Object execute(ExecutionEvent event) throws ExecutionException { EValidator.Registry.INSTANCE.remove(tdlPackage.eINSTANCE); Bundle bundle = Platform.getBundle("org.etsi.mts.tdl.model"); BundleContext context = bundle.getBundleContext(); Validator.registerValidator("model/tdl-constraints.ocl", tdlPackage.eINSTANCE, context); return null; } public void init(IWorkbenchWindow window) { this.window = window; } @Override public boolean isEnabled() { return true; } } Loading
plugins/org.etsi.mts.tdl.rt.ui/plugin.xml +27 −1 Original line number Diff line number Diff line Loading @@ -18,6 +18,11 @@ categoryId="org.etsi.mts.tdl.tools.rt.ui.commands.category" id="org.etsi.mts.tdl.tools.rt.ui.commands.tp2tdCommand"> </command> <command name="Reload OCL constraints" categoryId="org.etsi.mts.tdl.tools.rt.ui.commands.category" id="org.etsi.mts.tdl.tools.rt.ui.commands.reloadValidatorCommand"> </command> </extension> <extension point="org.eclipse.ui.handlers"> Loading @@ -29,6 +34,10 @@ commandId="org.etsi.mts.tdl.tools.rt.ui.commands.tp2tdCommand" class="org.etsi.mts.tdl.tools.rt.ui.handlers.TP2TDHandler"> </handler> <handler commandId="org.etsi.mts.tdl.tools.rt.ui.commands.reloadValidatorCommand" class="org.etsi.mts.tdl.tools.rt.ui.handlers.ReloadValidationHandler"> </handler> </extension> <extension point="org.eclipse.ui.bindings"> Loading Loading @@ -61,10 +70,21 @@ <command commandId="org.etsi.mts.tdl.tools.rt.ui.commands.tp2tdCommand" icon="icons/TransformIcon.png" mnemonic="T" mnemonic="P" id="org.etsi.mts.tdl.tools.rt.ui.menus.tp2tdCommand"> </command> </menu> <menu label="TDL" mnemonic="T" id="org.etsi.mts.tdl.tools.menus.TDLMenu"> <command commandId="org.etsi.mts.tdl.tools.rt.ui.commands.reloadValidatorCommand" icon="icons/ValidateIcon.png" mnemonic="V" id="org.etsi.mts.tdl.tools.rt.ui.menus.reloadValidatorCommand"> </command> </menu> </menuContribution> <menuContribution locationURI="toolbar:org.eclipse.ui.main.toolbar?after=additions"> Loading @@ -82,6 +102,12 @@ tooltip="Transform TPs to TDs" id="org.etsi.mts.tdl.tools.rt.ui.toolbars.tp2tdCommand"> </command> <command commandId="org.etsi.mts.tdl.tools.rt.ui.commands.reloadValidatorCommand" icon="icons/ValidateIcon.png" tooltip="Reload OCL constraints" id="org.etsi.mts.tdl.tools.rt.ui.toolbars.reloadValidatorCommand"> </command> </toolbar> </menuContribution> </extension> Loading
plugins/org.etsi.mts.tdl.rt.ui/src/org/etsi/mts/tdl/tools/rt/ui/handlers/ReloadValidationHandler.java 0 → 100644 +58 −0 Original line number Diff line number Diff line package org.etsi.mts.tdl.tools.rt.ui.handlers; import java.util.LinkedHashMap; import org.eclipse.core.commands.AbstractHandler; import org.eclipse.core.commands.ExecutionEvent; import org.eclipse.core.commands.ExecutionException; import org.eclipse.core.runtime.Platform; import org.eclipse.emf.ecore.EValidator; import org.eclipse.ui.IWorkbenchWindow; import org.etsi.mts.tdl.Validator; import org.etsi.mts.tdl.tdlPackage; import org.osgi.framework.Bundle; import org.osgi.framework.BundleContext; /** * Our sample handler extends AbstractHandler, an IHandler base class. * @see org.eclipse.core.commands.IHandler * @see org.eclipse.core.commands.AbstractHandler */ public class ReloadValidationHandler extends AbstractHandler { LinkedHashMap<String, String> targetFormats = new LinkedHashMap<>(); private IWorkbenchWindow window; /** * The constructor. */ public ReloadValidationHandler() { init(); } private void init() { } /** * the command has been executed, so extract extract the needed information * from the application context. */ public Object execute(ExecutionEvent event) throws ExecutionException { EValidator.Registry.INSTANCE.remove(tdlPackage.eINSTANCE); Bundle bundle = Platform.getBundle("org.etsi.mts.tdl.model"); BundleContext context = bundle.getBundleContext(); Validator.registerValidator("model/tdl-constraints.ocl", tdlPackage.eINSTANCE, context); return null; } public void init(IWorkbenchWindow window) { this.window = window; } @Override public boolean isEnabled() { return true; } }