From a5f279486e2fe2b00d06182126283693095b761b Mon Sep 17 00:00:00 2001 From: Ansgar Radermacher Date: Thu, 19 Dec 2013 13:55:52 +0100 Subject: - Bug 422244 - [QDesigner] QDesigner should externalize natural language Strings --- .../infra/services/tracepoints/Messages.java | 30 ++ .../infra/services/tracepoints/TraceActions.java | 14 +- .../infra/services/tracepoints/TraceFunctions.java | 20 +- .../infra/services/tracepoints/TraceMechanism.java | 10 +- .../services/tracepoints/TracepointConstants.java | 10 +- .../commands/AbstractTracepointCommand.java | 6 +- .../ToggleBreakpointActivationCommand.java | 2 +- .../commands/ToggleBreakpointCommand.java | 2 +- .../ToggleTracepointActivationCommand.java | 2 +- .../commands/ToggleTracepointCommand.java | 2 +- .../commands/TracepointPropertiesCommand.java | 2 +- .../tracepoints/dialogs/TraceActionSelection.java | 25 +- .../infra/services/tracepoints/messages.properties | 15 + .../BinaryEncodedMChoiceFieldEditor.java | 4 +- .../preferences/TPPreferenceConstants.java | 14 +- .../preferences/TPPreferenceInitializer.java | 2 +- .../tracepoints/preferences/TPPreferencePage.java | 15 +- .../build.acceleo | 2 +- .../models/examples/SampleOOTraceTest.di | 46 +++ .../models/examples/SampleOOTraceTest.notation | 410 +++++++++++++++++++++ .../models/examples/SampleOOTraceTest.uml | 276 ++++++++++++++ .../tracing/ClientServerTraceTestModelWizard.java | 2 +- .../modellibs/tracing/IConfiguratorOTF.java | 18 +- .../modellibs/tracing/IConfiguratorTrace.java | 4 +- .../modellibs/tracing/QompassTraceMechanism.java | 6 +- .../qompass/modellibs/tracing/StringConstants.java | 6 + .../modellibs/tracing/acceleo/traceLTTng.mtl | 8 +- 27 files changed, 869 insertions(+), 84 deletions(-) create mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Messages.java create mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/messages.properties create mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.di create mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.notation create mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.uml create mode 100644 extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/StringConstants.java (limited to 'extraplugins/qompass-designer/tracing') diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Messages.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Messages.java new file mode 100644 index 00000000000..e1cc36702a5 --- /dev/null +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/Messages.java @@ -0,0 +1,30 @@ +package org.eclipse.papyrus.infra.services.tracepoints; + +import org.eclipse.osgi.util.NLS; + +public class Messages extends NLS { + private static final String BUNDLE_NAME = "org.eclipse.papyrus.infra.services.tracepoints.messages"; //$NON-NLS-1$ + + public static String TraceActionSelection_ClassOptions; + public static String TraceActionSelection_ImplementationOptions; + public static String TraceActionSelection_NoPluginsProvideTraceExt; + public static String TraceActionSelection_NotAvail; + public static String TraceActionSelection_OperationOptions; + public static String TraceActionSelection_SelectTraceAction; + public static String TraceActionSelection_StateOptions; + + public static String TPPreferencePage_ClassOptions; + public static String TPPreferencePage_OperationOptions; + public static String TPPreferencePage_StateOptions; + public static String TPPreferencePage_TMforOperations; + public static String TPPreferencePage_TMforPorts; + public static String TPPreferencePage_TMforStateMachines; + public static String TPPreferencePage_TraceOptions; + static { + // initialize resource bundle + NLS.initializeMessages(BUNDLE_NAME, Messages.class); + } + + private Messages() { + } +} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceActions.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceActions.java index 6eaf7a25518..e8268e95b13 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceActions.java +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceActions.java @@ -135,16 +135,16 @@ public class TraceActions { */ public static String getStringPrefix(TraceFeature feature) { if(feature == TraceFeature.Class) { - return "C:"; + return "C:"; //$NON-NLS-1$ } if(feature == TraceFeature.Port) { - return "P:"; + return "P:"; //$NON-NLS-1$ } else if(feature == TraceFeature.State) { - return "S:"; + return "S:"; //$NON-NLS-1$ } else if(feature == TraceFeature.Operation) { - return "O:"; + return "O:"; //$NON-NLS-1$ } return null; } @@ -171,12 +171,12 @@ public class TraceActions { else if(feature == TraceFeature.Operation) { return store.getString(TPPreferenceConstants.P_TRACE_OPTION_OP); } - return ""; + return ""; //$NON-NLS-1$ } public static String compositeClassOption(int classOption, int stateOption, int operationOption) { - return getStringPrefix(TraceFeature.Class) + classOption + "," + - getStringPrefix(TraceFeature.State) + stateOption + "," + + return getStringPrefix(TraceFeature.Class) + classOption + "," + //$NON-NLS-1$ + getStringPrefix(TraceFeature.State) + stateOption + "," + //$NON-NLS-1$ getStringPrefix(TraceFeature.Operation) + operationOption; } diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceFunctions.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceFunctions.java index eb9b2fc2a82..24aea1be26c 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceFunctions.java +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceFunctions.java @@ -24,21 +24,21 @@ import org.eclipse.papyrus.infra.services.markerlistener.IPapyrusMarker; public class TraceFunctions implements IDecorationSpecificFunctions { - public static final String activeBreakpoint16 = "icons/etool16/brkp_16x16.gif"; + public static final String activeBreakpoint16 = "icons/etool16/brkp_16x16.gif"; //$NON-NLS-1$ - public static final String inActiveBreakpoint16 = "icons/etool16/brkpd_16x16.gif"; + public static final String inActiveBreakpoint16 = "icons/etool16/brkpd_16x16.gif"; //$NON-NLS-1$ - public static final String activeTracepoint16 = "icons/etool16/trcp_16x16.gif"; + public static final String activeTracepoint16 = "icons/etool16/trcp_16x16.gif"; //$NON-NLS-1$ - public static final String inActiveTracepoint16 = "icons/etool16/trcpd_16x16.gif"; + public static final String inActiveTracepoint16 = "icons/etool16/trcpd_16x16.gif"; //$NON-NLS-1$ - public static final String activeBreakpoint9 = "icons/etool16/brkp_9x9.gif"; + public static final String activeBreakpoint9 = "icons/etool16/brkp_9x9.gif"; //$NON-NLS-1$ - public static final String inActiveBreakpoint9 = "icons/etool16/brkpd_9x9.gif"; + public static final String inActiveBreakpoint9 = "icons/etool16/brkpd_9x9.gif"; //$NON-NLS-1$ - public static final String activeTracepoint11 = "icons/etool16/trcp_11x12.gif"; + public static final String activeTracepoint11 = "icons/etool16/trcp_11x12.gif"; //$NON-NLS-1$ - public static final String inActiveTracepoint11 = "icons/etool16/trcp_11x12.gif"; + public static final String inActiveTracepoint11 = "icons/etool16/trcp_11x12.gif"; //$NON-NLS-1$ /** * Return the image descriptor associated with a trace or breakpoint marker @@ -95,8 +95,8 @@ public class TraceFunctions implements IDecorationSpecificFunctions { public String getMessage(IPapyrusMarker marker) { boolean isActive = marker.getAttribute(TracepointConstants.isActive, false); boolean isTracepoint = marker.getAttribute(TracepointConstants.isTracepoint, false); - return (isActive ? "active" : "inactive") + " " + - (isTracepoint ? "trace point" : "break point"); + return (isActive ? "active" : "inactive") + " " + //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ + (isTracepoint ? "trace point" : "break point"); //$NON-NLS-1$//$NON-NLS-2$ } public int getPriority(IMarker marker) { diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceMechanism.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceMechanism.java index 3edea4d3717..4866eb27422 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceMechanism.java +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TraceMechanism.java @@ -31,7 +31,7 @@ import org.eclipse.papyrus.infra.services.tracepoints.preferences.TPPreferenceCo public class TraceMechanism { - public static final String ITRACE_MECHANISM_ID = Activator.PLUGIN_ID + ".traceMechanism"; + public static final String ITRACE_MECHANISM_ID = Activator.PLUGIN_ID + ".traceMechanism"; //$NON-NLS-1$ public static EList getTraceMechanisms() { @@ -41,7 +41,7 @@ public class TraceMechanism { for(IConfigurationElement configElement : configElements) { try { // TODO: cache returned instance (avoid creating a new instance each time => more efficient, no need for static attributes) - final Object obj = configElement.createExecutableExtension("class"); + final Object obj = configElement.createExecutableExtension("class"); //$NON-NLS-1$ if(obj instanceof ITraceMechanism) { mechanisms.add((ITraceMechanism)obj); } @@ -62,8 +62,8 @@ public class TraceMechanism { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); if(store != null) { if(feature == TraceFeature.Class) { - return TraceActions.getStringPrefix(TraceFeature.Port) + store.getInt(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_PORT) + "," + - TraceActions.getStringPrefix(TraceFeature.State) + store.getInt(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_SM) + "," + + return TraceActions.getStringPrefix(TraceFeature.Port) + store.getInt(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_PORT) + "," + //$NON-NLS-1$ + TraceActions.getStringPrefix(TraceFeature.State) + store.getInt(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_SM) + "," + //$NON-NLS-1$ TraceActions.getStringPrefix(TraceFeature.Operation) + store.getInt(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_OP); } else if(feature == TraceFeature.State) { @@ -73,7 +73,7 @@ public class TraceMechanism { return store.getString(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_OP); } } - return ""; + return ""; //$NON-NLS-1$ } /** diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TracepointConstants.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TracepointConstants.java index f4d617c6e7c..7f29b3ccdde 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TracepointConstants.java +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/TracepointConstants.java @@ -20,13 +20,13 @@ public class TracepointConstants { /** * The id of the marker used for tracepoints and breakpoints */ - public static final String tpOrbpMarker = "org.eclipse.papyrus.tporbpmarker"; + public static final String tpOrbpMarker = "org.eclipse.papyrus.tporbpmarker"; //$NON-NLS-1$ - public static final String isActive = "isActive"; + public static final String isActive = "isActive"; //$NON-NLS-1$ - public static final String isTracepoint = "isTracepoint"; + public static final String isTracepoint = "isTracepoint"; //$NON-NLS-1$ - public static final String traceAction = "traceAction"; + public static final String traceAction = "traceAction"; //$NON-NLS-1$ - public static final String traceMechanism = "traceMechanism"; + public static final String traceMechanism = "traceMechanism"; //$NON-NLS-1$ } diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/AbstractTracepointCommand.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/AbstractTracepointCommand.java index 5f6758a19f8..3aacc8ea5cd 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/AbstractTracepointCommand.java +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/AbstractTracepointCommand.java @@ -68,7 +68,7 @@ abstract public class AbstractTracepointCommand extends AbstractTransactionalCom protected void updateResourceAndURI() { resource = selectedElement.eResource(); - uri = resource.getURI() + "#" + resource.getURIFragment(selectedElement); + uri = resource.getURI() + "#" + resource.getURIFragment(selectedElement); //$NON-NLS-1$ iresource = WorkspaceSynchronizer.getFile(selectedElement.eResource()); } @@ -77,7 +77,7 @@ abstract public class AbstractTracepointCommand extends AbstractTransactionalCom if(iresource != null) { try { for(IMarker marker : iresource.findMarkers(type, false, IResource.DEPTH_INFINITE)) { - String markerURI = marker.getAttribute(MarkerConstants.uri, ""); + String markerURI = marker.getAttribute(MarkerConstants.uri, ""); //$NON-NLS-1$ if((markerURI != null) && markerURI.equals(uri)) { return marker; } @@ -124,7 +124,7 @@ abstract public class AbstractTracepointCommand extends AbstractTransactionalCom id = store.getDefaultString(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_OP); } else if(selectedElement instanceof Port) { - id = store.getDefaultString(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_OP); + id = store.getDefaultString(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_PORT); } else if(selectedElement instanceof State) { id = store.getDefaultString(TPPreferenceConstants.P_TRACE_IMPLEMENTATION_SM); diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointActivationCommand.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointActivationCommand.java index aac91107a20..cb86d378340 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointActivationCommand.java +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointActivationCommand.java @@ -25,7 +25,7 @@ import org.eclipse.gmf.runtime.common.core.command.CommandResult; public class ToggleBreakpointActivationCommand extends AbstractTracepointCommand { public ToggleBreakpointActivationCommand(EObject selectedElement) { - super("Toggle Breakpoint activation", TransactionUtil.getEditingDomain(selectedElement), selectedElement); + super("Toggle Breakpoint activation", TransactionUtil.getEditingDomain(selectedElement), selectedElement); //$NON-NLS-1$ } /** diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointCommand.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointCommand.java index 2a3dcc3d415..60c891cd02f 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointCommand.java +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleBreakpointCommand.java @@ -25,7 +25,7 @@ import org.eclipse.gmf.runtime.common.core.command.CommandResult; public class ToggleBreakpointCommand extends AbstractTracepointCommand { public ToggleBreakpointCommand(EObject selectedElement) { - super("Toggle Breakpoint", TransactionUtil.getEditingDomain(selectedElement), selectedElement); + super("Toggle Breakpoint", TransactionUtil.getEditingDomain(selectedElement), selectedElement); //$NON-NLS-1$ } /** diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointActivationCommand.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointActivationCommand.java index 0b636e0b2cc..6881780fde1 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointActivationCommand.java +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointActivationCommand.java @@ -25,7 +25,7 @@ import org.eclipse.gmf.runtime.common.core.command.CommandResult; public class ToggleTracepointActivationCommand extends AbstractTracepointCommand { public ToggleTracepointActivationCommand(EObject selectedElement) { - super("Toggle tracepoint activation", TransactionUtil.getEditingDomain(selectedElement), selectedElement); + super("Toggle tracepoint activation", TransactionUtil.getEditingDomain(selectedElement), selectedElement); //$NON-NLS-1$ } /** diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointCommand.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointCommand.java index 178f271b95e..5130ae7dbbb 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointCommand.java +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/ToggleTracepointCommand.java @@ -29,7 +29,7 @@ import org.eclipse.papyrus.infra.services.tracepoints.TracepointConstants; public class ToggleTracepointCommand extends AbstractTracepointCommand { public ToggleTracepointCommand(EObject selectedElement) { - super("Toggle tracepoint", TransactionUtil.getEditingDomain(selectedElement), selectedElement); + super("Toggle tracepoint", TransactionUtil.getEditingDomain(selectedElement), selectedElement); //$NON-NLS-1$ } /** diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/TracepointPropertiesCommand.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/TracepointPropertiesCommand.java index feca6cb8a7c..791bd165fd1 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/TracepointPropertiesCommand.java +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/commands/TracepointPropertiesCommand.java @@ -32,7 +32,7 @@ import org.eclipse.uml2.uml.Element; public class TracepointPropertiesCommand extends AbstractTracepointCommand { public TracepointPropertiesCommand(EObject selectedElement) { - super("Tracepoint properties", TransactionUtil.getEditingDomain(selectedElement), selectedElement); + super("Tracepoint properties", TransactionUtil.getEditingDomain(selectedElement), selectedElement); //$NON-NLS-1$ } /** diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/dialogs/TraceActionSelection.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/dialogs/TraceActionSelection.java index b1258f9f19e..5036cd650db 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/dialogs/TraceActionSelection.java +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/dialogs/TraceActionSelection.java @@ -31,6 +31,7 @@ import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.SelectionChangedEvent; import org.eclipse.jface.viewers.Viewer; import org.eclipse.papyrus.infra.services.tracepoints.ITraceMechanism; +import org.eclipse.papyrus.infra.services.tracepoints.Messages; import org.eclipse.papyrus.infra.services.tracepoints.TraceActions; import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TAClass; import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TAOperation; @@ -106,7 +107,7 @@ public class TraceActionSelection extends SelectionStatusDialog { else if(m_me instanceof Operation) { traceActionValue = operationOptions.getResult(); } - String traceMechanism = ""; + String traceMechanism = ""; //$NON-NLS-1$ for(Object tableElement : fTraceImplementations.getCheckedElements()) { traceMechanism = (String)tableElement; }; @@ -149,7 +150,7 @@ public class TraceActionSelection extends SelectionStatusDialog { EList mechanisms = TraceMechanism.getTraceMechanisms(); if(mechanisms.size() == 0) { - items = new String[]{ "no plugins provide trace extension mechanism" }; + items = new String[]{ Messages.TraceActionSelection_NoPluginsProvideTraceExt }; } else { EList idList = new BasicEList(); @@ -168,7 +169,7 @@ public class TraceActionSelection extends SelectionStatusDialog { Composite contents = (Composite)super.createDialogArea(parent); Label label = new Label(contents, SWT.NONE); - label.setText("Select trace action for this element"); + label.setText(Messages.TraceActionSelection_SelectTraceAction); // need context dependent dialogs on options // we may need more than one options (e.g. AllOperations + OperationsWithParameters + (begin/end or both?)) @@ -177,28 +178,28 @@ public class TraceActionSelection extends SelectionStatusDialog { String[][] taClassOptions = TraceActions.getStringFields(TAClass.values()); String[][] taStateOptions = TraceActions.getStringFields(TAState.values()); String[][] taOperationOptions = TraceActions.getStringFields(TAOperation.values()); - String actionString = m_marker.getAttribute(TracepointConstants.traceAction, ""); - String mechanismID = m_marker.getAttribute(TracepointConstants.traceMechanism, ""); + String actionString = m_marker.getAttribute(TracepointConstants.traceAction, ""); //$NON-NLS-1$ + String mechanismID = m_marker.getAttribute(TracepointConstants.traceMechanism, ""); //$NON-NLS-1$ if(m_me instanceof State) { - stateOptions = new BinaryEncodedMChoiceFieldEditor("State options", 3, taStateOptions, contents, true); + stateOptions = new BinaryEncodedMChoiceFieldEditor(Messages.TraceActionSelection_StateOptions, 3, taStateOptions, contents, true); stateOptions.setupViaString(actionString); } else if(m_me instanceof Class) { - classOptions = new BinaryEncodedMChoiceFieldEditor("Class options", 3, taClassOptions, contents, true); - stateOptions = new BinaryEncodedMChoiceFieldEditor("State options", 3, taStateOptions, contents, true); - operationOptions = new BinaryEncodedMChoiceFieldEditor("Operation options", 3, taOperationOptions, contents, true); + classOptions = new BinaryEncodedMChoiceFieldEditor(Messages.TraceActionSelection_ClassOptions, 3, taClassOptions, contents, true); + stateOptions = new BinaryEncodedMChoiceFieldEditor(Messages.TraceActionSelection_StateOptions, 3, taStateOptions, contents, true); + operationOptions = new BinaryEncodedMChoiceFieldEditor(Messages.TraceActionSelection_OperationOptions, 3, taOperationOptions, contents, true); classOptions.setupViaString(TraceActions.getOptions(actionString, TraceFeature.Class)); stateOptions.setupViaString(TraceActions.getOptions(actionString, TraceFeature.State)); operationOptions.setupViaString(TraceActions.getOptions(actionString, TraceFeature.Operation)); } else if(m_me instanceof Operation) { - operationOptions = new BinaryEncodedMChoiceFieldEditor("Operation options", 3, taOperationOptions, contents, true); + operationOptions = new BinaryEncodedMChoiceFieldEditor(Messages.TraceActionSelection_OperationOptions, 3, taOperationOptions, contents, true); operationOptions.setupViaString(actionString); } Group implementationGroup = new Group(parent, SWT.NONE); - implementationGroup.setText("Implementation options"); + implementationGroup.setText(Messages.TraceActionSelection_ImplementationOptions); // need additional item how the trace mechanism should be realized, i.e. available tracing mechanisms fTraceImplementations = CheckboxTableViewer.newCheckList(implementationGroup, SWT.H_SCROLL | SWT.V_SCROLL); @@ -241,7 +242,7 @@ public class TraceActionSelection extends SelectionStatusDialog { } } if(noDesc) { - fDescription.setText(""); + fDescription.setText(Messages.TraceActionSelection_NotAvail); } } } diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/messages.properties b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/messages.properties new file mode 100644 index 00000000000..94ce99780de --- /dev/null +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/messages.properties @@ -0,0 +1,15 @@ +TPPreferencePage_ClassOptions=Class options +TPPreferencePage_OperationOptions=Operations options +TPPreferencePage_StateOptions=State options +TPPreferencePage_TMforOperations=Trace Mechanism for operations (+construction/destruction) +TPPreferencePage_TMforPorts=Trace Mechanism for ports +TPPreferencePage_TMforStateMachines=Trace Mechanism for state machines +TPPreferencePage_TraceOptions=Trace options + +TraceActionSelection_ClassOptions=Class options +TraceActionSelection_ImplementationOptions=Implementation options +TraceActionSelection_NoPluginsProvideTraceExt=no plugins provide trace extension mechanism +TraceActionSelection_NotAvail= +TraceActionSelection_OperationOptions=Operation options +TraceActionSelection_SelectTraceAction=Select trace action for this element +TraceActionSelection_StateOptions=State options \ No newline at end of file diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/BinaryEncodedMChoiceFieldEditor.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/BinaryEncodedMChoiceFieldEditor.java index b8db97671e8..243fbc81143 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/BinaryEncodedMChoiceFieldEditor.java +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/BinaryEncodedMChoiceFieldEditor.java @@ -61,7 +61,7 @@ public class BinaryEncodedMChoiceFieldEditor extends MultipleChoiceFieldEditor { * display contents within a group */ public BinaryEncodedMChoiceFieldEditor(String labeltext, int numColumns, String[][] labelsAndValues, Composite parent, boolean useGroup) { - super("", labeltext, numColumns, labelsAndValues, parent, useGroup); + super("", labeltext, numColumns, labelsAndValues, parent, useGroup); //$NON-NLS-1$ } /** @@ -105,7 +105,7 @@ public class BinaryEncodedMChoiceFieldEditor extends MultipleChoiceFieldEditor { int index = 0; for(String setting[] : settings) { // [0] = name, [1] = value [2] = checked - if(setting[2].equals("true")) { + if(setting[2].equals("true")) { //$NON-NLS-1$ traceActionValue += 1 << index; } index++; diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceConstants.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceConstants.java index 2a0845bb849..ae73d5f9a71 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceConstants.java +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceConstants.java @@ -21,31 +21,31 @@ public class TPPreferenceConstants { /** * The trace mechanism that should be used by default */ - public static final String P_TRACE_IMPLEMENTATION_PORT = "papyrus.trace.implementation.port"; + public static final String P_TRACE_IMPLEMENTATION_PORT = "papyrus.trace.implementation.port"; //$NON-NLS-1$ /** * The trace mechanism that should be used by default */ - public static final String P_TRACE_IMPLEMENTATION_OP = "papyrus.trace.implementation.op"; + public static final String P_TRACE_IMPLEMENTATION_OP = "papyrus.trace.implementation.op"; //$NON-NLS-1$ /** * The trace mechanism that should be used by default */ - public static final String P_TRACE_IMPLEMENTATION_SM = "papyrus.trace.implementation.sm"; + public static final String P_TRACE_IMPLEMENTATION_SM = "papyrus.trace.implementation.sm"; //$NON-NLS-1$ /** * Options for trace implementation via state machines */ - public static final String P_TRACE_OPTION_CLASS = "papyrus.trace.option.class"; + public static final String P_TRACE_OPTION_CLASS = "papyrus.trace.option.class"; //$NON-NLS-1$ /** * Options for trace implementation for operations */ - public static final String P_TRACE_OPTION_STATE = "papyrus.trace.option.state"; - + public static final String P_TRACE_OPTION_STATE = "papyrus.trace.option.state"; //$NON-NLS-1$ + /** * Options for trace implementation via state machines */ - public static final String P_TRACE_OPTION_OP = "papyrus.trace.option.op"; + public static final String P_TRACE_OPTION_OP = "papyrus.trace.option.op"; //$NON-NLS-1$ } diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceInitializer.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceInitializer.java index 096d661169d..ef1cfad72d7 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceInitializer.java +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferenceInitializer.java @@ -33,7 +33,7 @@ public class TPPreferenceInitializer extends AbstractPreferenceInitializer { public void initializeDefaultPreferences() { IPreferenceStore store = Activator.getDefault().getPreferenceStore(); EList mechanisms = TraceMechanism.getTraceMechanisms(); - String mechanismID = ""; + String mechanismID = ""; //$NON-NLS-1$ if(mechanisms.size() > 0) { ITraceMechanism mechanism = mechanisms.get(0); // TODO: function need to support null object diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferencePage.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferencePage.java index 773c30a6ee1..57554c5b6ea 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferencePage.java +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.infra.services.tracepoints/src/org/eclipse/papyrus/infra/services/tracepoints/preferences/TPPreferencePage.java @@ -19,6 +19,7 @@ import org.eclipse.jface.preference.FieldEditorPreferencePage; import org.eclipse.jface.preference.RadioGroupFieldEditor; import org.eclipse.papyrus.infra.services.tracepoints.Activator; import org.eclipse.papyrus.infra.services.tracepoints.ITraceMechanism; +import org.eclipse.papyrus.infra.services.tracepoints.Messages; import org.eclipse.papyrus.infra.services.tracepoints.TraceActions; import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TAClass; import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TAOperation; @@ -41,7 +42,7 @@ public class TPPreferencePage public TPPreferencePage() { super(GRID); setPreferenceStore(Activator.getDefault().getPreferenceStore()); - setDescription("Trace options"); + setDescription(Messages.TPPreferencePage_TraceOptions); } /** @@ -74,25 +75,25 @@ public class TPPreferencePage String[][] taStateOptions = TraceActions.getStringFields(TAState.values()); String[][] taOperationOptions = TraceActions.getStringFields(TAOperation.values()); - addField(new BinaryEncodedMChoiceFieldEditor(TPPreferenceConstants.P_TRACE_OPTION_CLASS, "Class options", 3, taClassOptions, getFieldEditorParent(), true)); + addField(new BinaryEncodedMChoiceFieldEditor(TPPreferenceConstants.P_TRACE_OPTION_CLASS, Messages.TPPreferencePage_ClassOptions, 3, taClassOptions, getFieldEditorParent(), true)); - addField(new BinaryEncodedMChoiceFieldEditor(TPPreferenceConstants.P_TRACE_OPTION_STATE, "State options", 3, taStateOptions, getFieldEditorParent(), true)); + addField(new BinaryEncodedMChoiceFieldEditor(TPPreferenceConstants.P_TRACE_OPTION_STATE, Messages.TPPreferencePage_StateOptions, 3, taStateOptions, getFieldEditorParent(), true)); addField(new RadioGroupFieldEditor( TPPreferenceConstants.P_TRACE_OPTION_OP, - "Operations options", 3, taOperationOptions, getFieldEditorParent(), true)); + Messages.TPPreferencePage_OperationOptions, 3, taOperationOptions, getFieldEditorParent(), true)); addField(new ComboFieldEditor( TPPreferenceConstants.P_TRACE_IMPLEMENTATION_PORT, - "Trace Mechanism for ports", mechList, getFieldEditorParent())); + Messages.TPPreferencePage_TMforPorts, mechList, getFieldEditorParent())); addField(new ComboFieldEditor( TPPreferenceConstants.P_TRACE_IMPLEMENTATION_OP, - "Trace Mechanism for operations (+construction/destruction)", mechList, getFieldEditorParent())); + Messages.TPPreferencePage_TMforOperations, mechList, getFieldEditorParent())); addField(new ComboFieldEditor( TPPreferenceConstants.P_TRACE_IMPLEMENTATION_SM, - "Trace Mechanism for state machines", mechList, getFieldEditorParent())); + Messages.TPPreferencePage_TMforStateMachines, mechList, getFieldEditorParent())); } diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.acceleo b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.acceleo index 0bc08b54a4a..94def70bf62 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.acceleo +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/build.acceleo @@ -18,7 +18,7 @@ diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.di b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.di new file mode 100644 index 00000000000..4b69336c601 --- /dev/null +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.di @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.notation b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.notation new file mode 100644 index 00000000000..62727ee1920 --- /dev/null +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.notation @@ -0,0 +1,410 @@ + + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + +
+ + +
+ + +
+ + + + + +
+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + +
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + +
+ + +
+ + +
+ + +
+ + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + +
+ + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.uml b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.uml new file mode 100644 index 00000000000..a0910ed1a3e --- /dev/null +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/models/examples/SampleOOTraceTest.uml @@ -0,0 +1,276 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + C/C++ + cout << "a=" << a << " b=" << b << " a+b=" << a+b << endl; +return a+b; + + + + + + + + + + + + + + + + + + C/C++ + cout << "a*b=" << a*b; +return a*b; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This interface contains services that are used by the client and provided by the server component + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The operation "run" (not the associated behavior) has been added automatically by Qompass in order to implement the operations of interfaces provided by ports, in this case of the operations of the "IStart" interface. It would be tedious to manually copy operations from an interface, as it would imply copying the complete signature with all parameters. The component developper has to provide a suitable behavior. A validation rule verifies if operations without behavior exist. + + + + + + + + C/C++ + cout << "call via port q: add (2, 3);" << endl; +for (int i=0; i<20; i++) { + cout << "result: " << q->add (2, (i+3)) << endl; + usleep((i+10)*5*1000); + cout << "result: " << q->mult (3.0, 7.0) << endl; + usleep(20*1000); + testOp(i*2); + usleep(30*1000); +} + + + C/C++ + cout << "This is a test operation" << endl; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + false + + diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/ClientServerTraceTestModelWizard.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/ClientServerTraceTestModelWizard.java index 44b716be54a..c3274d24415 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/ClientServerTraceTestModelWizard.java +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/ClientServerTraceTestModelWizard.java @@ -6,6 +6,6 @@ import org.eclipse.papyrus.qompass.modellibs.core.ModelCopyWizard; public class ClientServerTraceTestModelWizard extends ModelCopyWizard { public ClientServerTraceTestModelWizard () { - modelName = "ClientServerTraceTest"; + modelName = "ClientServerTraceTest"; //$NON-NLS-1$ } } diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorOTF.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorOTF.java index 6dae4aa1244..48cf53a4695 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorOTF.java +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorOTF.java @@ -13,10 +13,10 @@ import org.eclipse.uml2.uml.Property; public class IConfiguratorOTF implements IInstanceConfigurator { - static final String PROP_PORT_NAME = "portName"; - - static final String PROP_INSTANCE_NAME = "instanceName"; + static final String PROP_PORT_NAME = "portName"; //$NON-NLS-1$ + static final String PROP_INSTANCE_NAME = "instanceName"; //$NON-NLS-1$ + /** * Configure the passed trace instance * @@ -25,8 +25,8 @@ public class IConfiguratorOTF implements IInstanceConfigurator { public void configureInstance(InstanceSpecification instance, Property componentPart, ContainerContext context) { // The tracing code needs informations about the component instance and port. - DepPlanUtils.configureProperty(instance, PROP_INSTANCE_NAME, "\"" + instance.getName() + "\""); - + DepPlanUtils.configureProperty(instance, PROP_INSTANCE_NAME, StringConstants.QUOTE + instance.getName() + StringConstants.QUOTE); + // port in context => interception of port => provide information about port and interface if(context.port != null) { // obtain required or provided interface (TODO: will fail, if both are provided!) @@ -35,15 +35,15 @@ public class IConfiguratorOTF implements IInstanceConfigurator { intf = PortUtils.getRequired(context.port); } - DepPlanUtils.configureProperty(instance, PROP_PORT_NAME, "\"" + context.port.getName() + "\""); + DepPlanUtils.configureProperty(instance, PROP_PORT_NAME, StringConstants.QUOTE + context.port.getName() + StringConstants.QUOTE); if(intf != null) { // this is specific for OTF: // each container contains an attribute (id_) for each operation. This is configured here, // since we add instance information to the trace (is that useful??, seems like a hack) for(Operation op : intf.getOperations()) { - String id = Utils.getTop(context.executorIS).getName() + "::Tracing::Trace::ID_" + - context.executorIS.getName().replace(".", "_") + "_" + op.getName(); - DepPlanUtils.configureProperty(instance, "id_" + op.getName(), id); + String id = Utils.getTop(context.executorIS).getName() + "::Tracing::Trace::ID_" + //$NON-NLS-1$ + context.executorIS.getName().replace(".", "_") + "_" + op.getName(); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ + DepPlanUtils.configureProperty(instance, "id_" + op.getName(), id); //$NON-NLS-1$ } } } diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorTrace.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorTrace.java index 7c76623710f..43de8b800c1 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorTrace.java +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/IConfiguratorTrace.java @@ -30,11 +30,11 @@ public class IConfiguratorTrace implements IInstanceConfigurator { } } - DepPlanUtils.configureProperty(instance, PROP_INSTANCE_NAME, "\"" + instanceName + "\""); + DepPlanUtils.configureProperty(instance, PROP_INSTANCE_NAME, StringConstants.QUOTE + instanceName + StringConstants.QUOTE); // port in context => interception of port => provide information about port and interface if(context.port != null) { - DepPlanUtils.configureProperty(instance, PROP_PORT_NAME, "\"" + context.port.getName() + "\""); + DepPlanUtils.configureProperty(instance, PROP_PORT_NAME, StringConstants.QUOTE + context.port.getName() + StringConstants.QUOTE); } } } diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/QompassTraceMechanism.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/QompassTraceMechanism.java index e9593ba3cd2..e3e0ca8da86 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/QompassTraceMechanism.java +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/QompassTraceMechanism.java @@ -23,8 +23,8 @@ import org.eclipse.papyrus.infra.services.tracepoints.TraceActions.TAOperation; import org.eclipse.papyrus.infra.services.tracepoints.TracepointConstants; import org.eclipse.papyrus.qompass.designer.core.Description; import org.eclipse.papyrus.qompass.designer.core.Log; -import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; import org.eclipse.papyrus.qompass.designer.core.Utils; +import org.eclipse.papyrus.uml.tools.utils.StereotypeUtil; import org.eclipse.uml2.uml.Class; import org.eclipse.uml2.uml.Element; import org.eclipse.uml2.uml.NamedElement; @@ -34,7 +34,7 @@ import org.eclipse.uml2.uml.Property; public class QompassTraceMechanism implements ITraceMechanism { - public static final String EC3M_TRACING_URI = "pathmap://QML_TRACE/tracing.uml"; + public static final String EC3M_TRACING_URI = "pathmap://QML_TRACE/tracing.uml"; //$NON-NLS-1$ public static final URI tracingURI = URI.createURI(EC3M_TRACING_URI); @@ -104,7 +104,7 @@ public class QompassTraceMechanism implements ITraceMechanism { public boolean isForTracing(ContainerRule rule) { for(ConfigOption co : rule.getForConfig()) { // TODO: not very clean to used fixed string - if(co.getBase_Class().getName().equals("Trace")) { + if(co.getBase_Class().getName().equals("Trace")) { //$NON-NLS-1$ return true; } } diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/StringConstants.java b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/StringConstants.java new file mode 100644 index 00000000000..171fece98a4 --- /dev/null +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/StringConstants.java @@ -0,0 +1,6 @@ +package org.eclipse.papyrus.qompass.modellibs.tracing; + +public class StringConstants { + public static final String QUOTE = "\""; //$NON-NLS-1$ + +} diff --git a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/traceLTTng.mtl b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/traceLTTng.mtl index af7a3358147..cdddfb7314a 100644 --- a/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/traceLTTng.mtl +++ b/extraplugins/qompass-designer/tracing/org.eclipse.papyrus.qompass.modellibs.tracing/src/org/eclipse/papyrus/qompass/modellibs/tracing/acceleo/traceLTTng.mtl @@ -112,7 +112,7 @@ tracepoint([tpName1()/], [operation.tpName2()/], instanceName[if (operation.para [/template] -[template flattenParNameAndType(parameter : Parameter) post(trim())] +[template public flattenParNameAndType(parameter : Parameter) post(trim())] [if (type.oclIsTypeOf(DataType))] [for (attribute : Property | type.oclAsType(DataType).attribute) separator(', ')][attribute.type.cppTypeWB()/], [parameter.name + '_' + attribute.name/][/for] [else] @@ -120,7 +120,7 @@ tracepoint([tpName1()/], [operation.tpName2()/], instanceName[if (operation.para [/if] [/template] -[template flattenParName(parameter : Parameter) post(trim())] +[template public flattenParName(parameter : Parameter) post(trim())] [if (type.oclIsTypeOf(DataType))] [for (attribute : Property | type.oclAsType(DataType).attribute) separator(', ')][parameter.name + '.' + attribute.name/][/for] [else] @@ -129,7 +129,7 @@ tracepoint([tpName1()/], [operation.tpName2()/], instanceName[if (operation.para [/template] -[template flattenCtfType(type : Type, name : String) post(trim())] +[template public flattenCtfType(type : Type, name : String) post(trim())] [if (type.oclIsTypeOf(DataType))] [for (attribute : Property | type.oclAsType(DataType).attribute) separator('\n')][ctfType(attribute.type, name + '_' + attribute.name)/][/for] [else] @@ -138,7 +138,7 @@ tracepoint([tpName1()/], [operation.tpName2()/], instanceName[if (operation.para [/template] -[template cppTypeWB(type : Type) post(trim())] +[template public cppTypeWB(type : Type) post(trim())] [if (type.qualifiedName = 'UMLPrimitiveTypes::Boolean') or (type.qualifiedName = 'PrimitiveTypes::Boolean') or -- cgit v1.2.3