Bug 531340: Enforce correct documentation for module help
Change-Id: Icc705247650640ba2035acb6f4adbf91349d46fa
diff --git a/plugins/org.eclipse.ease.modules.charting/src/org/eclipse/ease/modules/charting/ChartingModule.java b/plugins/org.eclipse.ease.modules.charting/src/org/eclipse/ease/modules/charting/ChartingModule.java
index a8076ea..28f019f 100644
--- a/plugins/org.eclipse.ease.modules.charting/src/org/eclipse/ease/modules/charting/ChartingModule.java
+++ b/plugins/org.eclipse.ease.modules.charting/src/org/eclipse/ease/modules/charting/ChartingModule.java
@@ -28,7 +28,6 @@
import org.eclipse.nebula.visualization.xygraph.figures.XYGraph;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
/**
* Provide functions to display and populate line charts.
@@ -314,6 +313,8 @@
* @param y
* y coordinate of this point
* @return series as Trace type to set different properties for this series
+ * @throws Throwable
+ * when the view could not be initialized
*/
@WrapToScript
public Trace plotPoint(final double x, final double y) throws Throwable {
@@ -330,6 +331,8 @@
* @param y
* array of y coordinates
* @return series as Trace type to set different properties for this series
+ * @throws Throwable
+ * when the view could not be initialized
*/
@WrapToScript
public Trace plot(final double[] x, final double[] y) throws Throwable {
@@ -345,7 +348,7 @@
* @return {@link XYGraph} object or <code>null</code> if there is no active graph
*/
@WrapToScript(alias = "title")
- public XYGraph setPlotTitle(final String chartTitle) throws PartInitException {
+ public XYGraph setPlotTitle(final String chartTitle) {
if (fChart != null)
return fChart.setPlotTitle(chartTitle);
@@ -360,7 +363,7 @@
* @return {@link Axis} object or <code>null</code> if there is no active graph
*/
@WrapToScript(alias = "xlabel")
- public Axis setXLabel(final String label) throws PartInitException {
+ public Axis setXLabel(final String label) {
if (fChart != null)
return fChart.setXLabel(label);
@@ -375,7 +378,7 @@
* @return {@link Axis} object or <code>null</code> if there is no active graph
*/
@WrapToScript(alias = "ylabel")
- public Axis setYLabel(final String label) throws PartInitException {
+ public Axis setYLabel(final String label) {
if (fChart != null)
return fChart.setYLabel(label);
@@ -391,7 +394,7 @@
* Range from Y Axis to be set, format is [ymin, ymax]
*/
@WrapToScript(alias = "axis")
- public void setAxisRange(final double[] xRange, final double[] yRange) throws Exception {
+ public void setAxisRange(final double[] xRange, final double[] yRange) {
if (fChart != null)
fChart.setAxisRange(xRange, yRange);
}
@@ -403,7 +406,7 @@
* if <code>true</code> a grid will be displayed
*/
@WrapToScript
- public void showGrid(final boolean showGrid) throws PartInitException {
+ public void showGrid(final boolean showGrid) {
if (fChart != null)
fChart.showGrid(showGrid);
}
@@ -415,7 +418,7 @@
* if <code>true</code> auto scaling will be enabled
*/
@WrapToScript
- public void setAutoScale(final boolean performAutoScale) throws PartInitException {
+ public void setAutoScale(final boolean performAutoScale) {
if (fChart != null)
fChart.setAutoScale(performAutoScale);
}
@@ -424,7 +427,7 @@
* Clears the active chart.
*/
@WrapToScript
- public void clear() throws PartInitException {
+ public void clear() {
if (fChart != null)
fChart.clear();
@@ -443,7 +446,8 @@
* where to store image to. Accepts strings, {@link IFile} and {@link File} instances
* @param overwrite
* Overwrite flag, if <code>true</code> file will be overwritten without question
- * @throws Exception
+ * @throws Throwable
+ * when the view could not be initialized
*/
@WrapToScript
public void exportGraph(@ScriptParameter(defaultValue = ScriptParameter.NULL) final Object location,
@@ -460,6 +464,8 @@
*
* @param seriesName
* name of series to be deleted
+ * @throws Throwable
+ * when the view could not be initialized
*/
@WrapToScript
public void removeSeries(final String seriesName) throws Throwable {
diff --git a/plugins/org.eclipse.ease.modules.modeling/plugin.xml b/plugins/org.eclipse.ease.modules.modeling/plugin.xml
index 5b613bc..e7eadc7 100644
--- a/plugins/org.eclipse.ease.modules.modeling/plugin.xml
+++ b/plugins/org.eclipse.ease.modules.modeling/plugin.xml
@@ -56,6 +56,10 @@
<dependency
module="org.eclipse.ease.modules.modeling.selection">
</dependency>
+ <dependency
+ module="org.eclipse.ease.modules.modeling.ecore"
+ reload="false">
+ </dependency>
</module>
<module
category="org.eclipse.ease.modules.category.modeling"
@@ -67,7 +71,8 @@
module="org.eclipse.ease.modules.platform.ui">
</dependency>
<dependency
- module="org.eclipse.ease.modules.modeling.selection">
+ module="org.eclipse.ease.modules.modeling.ecore"
+ reload="false">
</dependency>
</module>
<module
@@ -76,6 +81,13 @@
id="org.eclipse.ease.modules.modeling.papyrus"
name="Papyrus"
visible="true">
+ <dependency
+ module="org.eclipse.ease.modules.modeling.uml">
+ </dependency>
+ <dependency
+ module="org.eclipse.ease.modules.modeling.notation"
+ reload="false">
+ </dependency>
</module>
<module
category="org.eclipse.ease.modules.category.modeling"
@@ -87,7 +99,7 @@
module="org.eclipse.ease.modules.platform.ui">
</dependency>
<dependency
- module="org.eclipse.ease.modules.modeling.selection">
+ module="org.eclipse.ease.modules.modeling.uml">
</dependency>
</module>
</extension>
diff --git a/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/DialogModule.java b/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/DialogHelper.java
similarity index 77%
rename from plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/DialogModule.java
rename to plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/DialogHelper.java
index c6ef0b0..2a4834c 100644
--- a/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/DialogModule.java
+++ b/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/DialogHelper.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.ease.modules.modeling;
-import org.eclipse.ease.modules.AbstractScriptModule;
import org.eclipse.ease.modules.WrapToScript;
import org.eclipse.ease.tools.RunnableWithResult;
import org.eclipse.jface.viewers.ILabelProvider;
@@ -20,20 +19,13 @@
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
/**
- * Module to display dialogs
- *
- * @author adaussy
- *
+ * Helper class to display dialogs.
*/
-public class DialogModule extends AbstractScriptModule {
-
- public DialogModule() {
- super();
- }
+public class DialogHelper {
/**
* Return the active {@link Shell}
- *
+ *
* @return
*/
@WrapToScript
@@ -43,14 +35,14 @@
/**
* Open a dialog
- *
+ *
* @param window
* A Window to open
* @return window.open().
*/
@WrapToScript
public static int openDialog(final Window window) {
- RunnableWithResult<Integer> run = new RunnableWithResult<Integer>() {
+ final RunnableWithResult<Integer> run = new RunnableWithResult<Integer>() {
@Override
public void run() {
@@ -63,7 +55,7 @@
/**
* Open a dialog and ask to the user to select from a list of element
- *
+ *
* @param selectionOption
* The list element from which the user shall choose
* @param labelProvider
@@ -72,11 +64,11 @@
*/
@WrapToScript
public static Object[] selectFromList(final Object[] selectionOption, final ILabelProvider labelProvider) {
- RunnableWithResult<Object[]> runnable = new RunnableWithResult<Object[]>() {
+ final RunnableWithResult<Object[]> runnable = new RunnableWithResult<Object[]>() {
@Override
public void run() {
- ElementListSelectionDialog dialog = new ElementListSelectionDialog(Display.getDefault().getActiveShell(), labelProvider);
+ final ElementListSelectionDialog dialog = new ElementListSelectionDialog(Display.getDefault().getActiveShell(), labelProvider);
dialog.setElements(selectionOption);
if (dialog.open() == Window.OK)
setResult(dialog.getResult());
@@ -88,13 +80,7 @@
}
public static void openWindow(final Window window) {
- Runnable runnable = new Runnable() {
-
- @Override
- public void run() {
- window.open();
- }
- };
+ final Runnable runnable = () -> window.open();
Display.getDefault().syncExec(runnable);
}
diff --git a/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/EcoreModule.java b/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/EcoreModule.java
index 2f1501a..dadcaa9 100644
--- a/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/EcoreModule.java
+++ b/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/EcoreModule.java
@@ -6,9 +6,9 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * Pierre-Charles David (Obeo) - initial API and implementation
- * Vincent Hemery (Atos Origin) - removing modeler dependencies
- * Arthur Daussy (Atos) - Update to be use in EASE
+ * Pierre-Charles David (Obeo) - initial API and implementation, pierre-charles.david@obeo.fr
+ * Vincent Hemery (Atos Origin) - removing modeler dependencies, laurent.redor@obeo.fr
+ * Arthur Daussy (Atos) - Update to be use in EASE, arthur.daussy@atos.net
*******************************************************************************/
package org.eclipse.ease.modules.modeling;
@@ -38,7 +38,6 @@
import org.eclipse.ease.modules.platform.UIModule;
import org.eclipse.ease.service.ScriptService;
import org.eclipse.ease.tools.ResourceTools;
-import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EFactory;
@@ -65,8 +64,6 @@
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.uml2.uml.Element;
-import org.eclipse.uml2.uml.Stereotype;
import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
@@ -75,10 +72,6 @@
* This offer to user means to handle EMF models (Create EObject, Select element, Handle resources etc..). This module need to be initialized with an nsURI
* referencing a metamodel usin {@link EcoreModule#initEPackage(String)}.Once this module has been initialized all creation method of the factory is injected in
* the script.
- *
- * @author <a href="mailto:pierre-charles.david@obeo.fr">Pierre-Charles David</a>
- * @author <a href="mailto:laurent.redor@obeo.fr">Laurent Redor</a>
- * @author <a href="mailto:arthur.daussy@atos.net">Laurent Redor</a>
*/
public class EcoreModule extends AbstractScriptModule {
@@ -92,10 +85,8 @@
public EObject getSelection() {
final Object selection = getSelectionModule().getCustomSelectionFromSelector(GMFSemanticSeletor.SELECTOR_ID);
if (selection instanceof EObject) {
- if (selection instanceof Element) {
- final EList<Stereotype> appliedStereotypes = ((Element) selection).getAppliedStereotypes();
- }
return (EObject) selection;
+
} else {
final String message = "Unable to retreive a EObject from the selection";
getEnvironment().getModule(UIModule.class).showErrorDialog("Error", message);
@@ -112,12 +103,12 @@
*
* @param eObject
* The {@link EObject} you want to test.
- * @param typeName
+ * @param type
* The name of the EClass defined in the metamodel
- * @return true if the {@link EObject} is instance of typeName
+ * @return <code>true</code> if the {@link EObject} is instance of typeName
*/
@WrapToScript
- public boolean eInstanceOf(@ScriptParameter(name = "eObject") final EObject eObject, @ScriptParameter(name = "type") final String type) {
+ public boolean eInstanceOf(final EObject eObject, final String type) {
final EClassifier classifier = getEPackage().getEClassifier(type);
if (classifier == null) {
getEnvironment().getModule(UIModule.class).showErrorDialog("Error", "Unable to find EClass named :" + type);
@@ -137,7 +128,7 @@
* @return the first element selected in the current editor if there is one and it is an instance of the named meta-class or a sub-class of it.
*/
@WrapToScript
- public EObject getSelection(@ScriptParameter(defaultValue = ScriptParameter.NULL, name = "type") final String type) {
+ public EObject getSelection(@ScriptParameter(defaultValue = ScriptParameter.NULL) final String type) {
final EObject selection = getSelection();
if (type != null) {
if (eInstanceOf(selection, type)) {
@@ -170,7 +161,7 @@
* of the metamodel
*/
@WrapToScript
- public void initEPackage(@ScriptParameter(name = "nsURI") final String nsURI) {
+ public void initEPackage(final String nsURI) {
if (nsURI == null)
initEPackageFromDialog();
else
@@ -199,11 +190,11 @@
* Name of the resource (Optional parameter ask dynamically to the user)
* @param uri
* URI locating the container of the resource (Optional parameter ask dynamically to the user)
- * @return
+ * @return the created resource
*/
@WrapToScript
- public Resource createResource(@ScriptParameter(name = "name", defaultValue = ScriptParameter.NULL) final String name,
- @ScriptParameter(name = "uri", defaultValue = ScriptParameter.NULL) final String uri) {
+ public Resource createResource(@ScriptParameter(defaultValue = ScriptParameter.NULL) final String name,
+ @ScriptParameter(defaultValue = ScriptParameter.NULL) final String uri) {
ResourceSet resourceSet = getResourceSet();
if (resourceSet == null) {
Logger.warning(Activator.PLUGIN_ID, "Unable to get the current resourceSet. Creating a new one...");
@@ -226,11 +217,11 @@
* path of the container of the new resource. (Optional Ask dynamically to the user)
* @param fileName
* name of the new resource. (Optional Ask dynamically to the user)
- * @return
+ * @return the created URI
*/
@WrapToScript
- public URI createURI(@ScriptParameter(name = "containerURI", defaultValue = ScriptParameter.NULL) final String containerURI,
- @ScriptParameter(name = "fileName", defaultValue = ScriptParameter.NULL) String fileName) {
+ public URI createURI(@ScriptParameter(defaultValue = ScriptParameter.NULL) final String containerURI,
+ @ScriptParameter(defaultValue = ScriptParameter.NULL) String fileName) {
URI container = null;
if (containerURI == null) {
// Launch dialog to get an URI
@@ -259,7 +250,7 @@
/**
* Get the factory of selected meta model.
*
- * @return
+ * @return the found factory
*/
@WrapToScript
public EFactory getFactory() {
@@ -276,7 +267,7 @@
/**
* Get the {@link EPackage} of the selected meta model
*
- * @return
+ * @return the EPackage for the meta model
*/
@WrapToScript
public EPackage getEPackage() {
@@ -290,7 +281,7 @@
private void initEPackageFromDialog() {
getEnvironment().getModule(UIModule.class);
final UriSelectionDialog dialog = new UriSelectionDialog(UIModule.getShell());
- final int returnCode = DialogModule.openDialog(dialog);
+ final int returnCode = DialogHelper.openDialog(dialog);
if (returnCode == Window.OK) {
final Object[] result = dialog.getResult();
if ((result != null) && (result.length == 1)) {
@@ -307,10 +298,10 @@
* @param message
* Message of the marker
* @throws CoreException
+ * If the marker cannot be added because of a null resource.
*/
@WrapToScript
- public void addErrorMarker(@ScriptParameter(name = "eObject") final EObject eObject, @ScriptParameter(name = "message") final String message)
- throws CoreException {
+ public void addErrorMarker(final EObject eObject, final String message) throws CoreException {
EMFMarkerUtil.addMarkerFor(eObject, message, IMarker.SEVERITY_ERROR);
}
@@ -322,10 +313,10 @@
* @param message
* Message of the marker
* @throws CoreException
+ * If the marker cannot be added because of a null resource.
*/
@WrapToScript
- public void addInfoMarker(@ScriptParameter(name = "eObject") final EObject eObject, @ScriptParameter(name = "message") final String message)
- throws CoreException {
+ public void addInfoMarker(final EObject eObject, final String message) throws CoreException {
EMFMarkerUtil.addMarkerFor(eObject, message, IMarker.SEVERITY_INFO);
}
@@ -337,10 +328,10 @@
* @param message
* Message of the marker
* @throws CoreException
+ * If the marker cannot be added because of a null resource.
*/
@WrapToScript
- public void addWarningMarker(@ScriptParameter(name = "eObject") final EObject eObject, @ScriptParameter(name = "message") final String message)
- throws CoreException {
+ public void addWarningMarker(final EObject eObject, final String message) throws CoreException {
EMFMarkerUtil.addMarkerFor(eObject, message, IMarker.SEVERITY_WARNING);
}
@@ -376,11 +367,11 @@
/**
* Save: The current editor if no eObject is passed in argument The resource containing the eObject passed in argument
*
- * @param eObject
+ * @param target
* Help to locate the resource to save (Optional save the current editor)
*/
@WrapToScript
- public void save(@ScriptParameter(defaultValue = ScriptParameter.NULL, name = "target") final Object target) {
+ public void save(@ScriptParameter(defaultValue = ScriptParameter.NULL) final Object target) {
Resource toSave = null;
if (target instanceof EObject) {
final EObject eObject = (EObject) target;
@@ -431,10 +422,11 @@
* Result[1] = The referencing object
*
* @param eObject
- * @return
+ * object to look for
+ * @return usages of the object
*/
@WrapToScript
- public static Collection<Object[]> getUsages(@ScriptParameter(name = "eObject") final EObject eObject) {
+ public static Collection<Object[]> getUsages(final EObject eObject) {
if (eObject == null) {
return Collections.emptyList();
}
@@ -472,7 +464,7 @@
return null;
}
- public void runOperation(@ScriptParameter(name = "operation") final Runnable operation) {
+ public void runOperation(final Runnable operation) {
runOperation(operation, "Script Operation");
}
@@ -485,8 +477,7 @@
* the name to give to the operation execution
*/
@WrapToScript
- public void runOperation(@ScriptParameter(name = "operation") final Runnable operation,
- @ScriptParameter(name = "name", defaultValue = "Script Operation") final String operationName) {
+ public void runOperation(final Runnable operation, @ScriptParameter(defaultValue = "Script Operation") final String operationName) {
final EditingDomain domain = getEditingDomain();
if (domain instanceof TransactionalEditingDomain) {
@@ -529,7 +520,7 @@
*/
@WrapToScript
public Object[] selectFromList(final List<? extends Object> inputs) {
- return DialogModule.selectFromList(inputs.toArray(), new LabelProvider() {
+ return DialogHelper.selectFromList(inputs.toArray(), new LabelProvider() {
@Override
public String getText(final Object element) {
@@ -544,10 +535,11 @@
private static ComposedAdapterFactory adapter = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
/**
- * Print an {@link EObject} using label providers
+ * Print an {@link EObject} using label providers.
*
* @param target
- * @return
+ * the object to print
+ * @return text provided from label provider
*/
@WrapToScript
public String ePrint(final EObject target) {
diff --git a/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/NotationModule.java b/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/NotationModule.java
index 6718105..93ff286 100644
--- a/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/NotationModule.java
+++ b/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/NotationModule.java
@@ -11,44 +11,48 @@
package org.eclipse.ease.modules.modeling;
import org.eclipse.ease.IScriptEngine;
+import org.eclipse.ease.modules.AbstractScriptModule;
import org.eclipse.ease.modules.IEnvironment;
+import org.eclipse.ease.modules.WrapToScript;
import org.eclipse.ease.modules.modeling.selector.GMFNotationSelector;
import org.eclipse.ease.modules.platform.UIModule;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.notation.NotationPackage;
/**
- * This module help to handle Notation models This extends {@link EcoreModule}
- *
- * @author adaussy
- *
+ * This module help to handle Notation models.
*/
-public class NotationModule extends EcoreModule {
-
- public NotationModule() {
- super();
-
- }
+public class NotationModule extends AbstractScriptModule {
@Override
public void initialize(final IScriptEngine engine, final IEnvironment environment) {
super.initialize(engine, environment);
- initEPackage(NotationPackage.eNS_URI);
+
+ getEcoreModule().initEPackage(NotationPackage.eNS_URI);
}
- @Override
- public EObject getSelection() {
- Object selection = getSelectionModule().getCustomSelectionFromSelector(GMFNotationSelector.SELECTOR_ID);
- if (selection instanceof EObject) {
- return (EObject) selection;
- } else {
- String message = "Unable to retreive a EObject from the selection";
- getEnvironment().getModule(UIModule.class).showErrorDialog("Error", message);
- return null;
- }
+ private EcoreModule getEcoreModule() {
+ return getEnvironment().getModule(EcoreModule.class);
}
private SelectionModule getSelectionModule() {
- return (SelectionModule) getEnvironment().getModule(SelectionModule.class);
+ return getEnvironment().getModule(SelectionModule.class);
+ }
+
+ /**
+ * Returns the currently selected model element, either in the editor or the outline view. If several elements are selected, only the first is returned.
+ *
+ * @return the currently selected model element.
+ */
+ @WrapToScript
+ public EObject getSelection() {
+ final Object selection = getSelectionModule().getCustomSelectionFromSelector(GMFNotationSelector.SELECTOR_ID);
+ if (selection instanceof EObject) {
+ return (EObject) selection;
+ } else {
+ final String message = "Unable to retreive a EObject from the selection";
+ getEnvironment().getModule(UIModule.class).showErrorDialog("Error", message);
+ return null;
+ }
}
}
diff --git a/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/PapyrusModule.java b/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/PapyrusModule.java
index 8ad3239..93683a3 100644
--- a/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/PapyrusModule.java
+++ b/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/PapyrusModule.java
@@ -19,6 +19,7 @@
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.ease.IScriptEngine;
import org.eclipse.ease.Logger;
+import org.eclipse.ease.modules.AbstractScriptModule;
import org.eclipse.ease.modules.IEnvironment;
import org.eclipse.ease.modules.ScriptParameter;
import org.eclipse.ease.modules.WrapToScript;
@@ -50,27 +51,34 @@
/**
* Module used to interact with Papyrus Editor.
- *
- * @author adaussy
- *
*/
-public class PapyrusModule extends UMLModule {
+public class PapyrusModule extends AbstractScriptModule {
- private final NotationModule notationModule = new NotationModule();
+ private EcoreModule getEcoreModule() {
+ return getEnvironment().getModule(EcoreModule.class);
+ }
+
+ private UMLModule getUMLModule() {
+ return getEnvironment().getModule(UMLModule.class);
+ }
+
+ private NotationModule getNotationModule() {
+ return getEnvironment().getModule(NotationModule.class);
+ }
/**
- * Return the model set (ResourceSet) of the current model open in Papyrus
+ * Return the model set (ResourceSet) of the current model open in Papyrus.
*
- * @return
+ * @return current model set
*/
@WrapToScript
public ModelSet getModelSet() {
- EditingDomain editingDomain = TransactionUtil.getEditingDomain(getModel());
+ final EditingDomain editingDomain = TransactionUtil.getEditingDomain(getUMLModule().getModel());
if (editingDomain == null) {
Logger.error(Activator.PLUGIN_ID, "Unable to get the editing domain");
return null;
}
- ResourceSet resourceSet = editingDomain.getResourceSet();
+ final ResourceSet resourceSet = editingDomain.getResourceSet();
if (resourceSet instanceof ModelSet) {
return (ModelSet) resourceSet;
@@ -82,52 +90,56 @@
@Override
public void initialize(final IScriptEngine engine, final IEnvironment environment) {
super.initialize(engine, environment);
- notationModule.initialize(engine, environment);
+ getNotationModule().initialize(engine, environment);
}
/**
- * Return the select view element (Notation metamodel)
+ * Return the select view element (Notation metamodel).
*
- * @return
+ * @return selection view or <code>null</code>
*/
@WrapToScript
public View getSelectionView() {
- EObject v = notationModule.getSelection();
+ final EObject v = getNotationModule().getSelection();
if (v instanceof View) {
return (View) v;
}
+
return null;
}
/**
- * Return the UML element from the selection
+ * Return the UML element from the selection.
*
- * @return
+ * @return UML element or <code>null</code>
*/
@WrapToScript
public Element getSelectionElement() {
- EObject elem = getSelection();
+ final EObject elem = getEcoreModule().getSelection();
if (elem instanceof Element) {
return (Element) elem;
}
+
return null;
}
/**
- * Create a new empty diagram WARNING: For now only Package and class diagram are implemented.
+ * Create a new empty diagram. WARNING: For now only Class diagrams are implemented.
*
* @param semanticElement
* UML or Sysml element of the diagram
- * @param newDiagram
+ * @param diagramType
+ * currently only <i>Class</i> is supported
+ * @param diagramName
* The name of the diagram (Optional set the name to newDiagram)
* @param open
- * True if the diagram shall be open (Optional default = false)
+ * <code>true</code> if the diagram shall be opened
*/
@WrapToScript
- public void createDiagram(final EObject semanticElement, @ScriptParameter(name = "diagramType") final String diagramType,
- @ScriptParameter(name = "diagramName", defaultValue = "NewDiagram") final String newDiagram, @ScriptParameter(name = "open") final boolean open) {
+ public void createDiagram(final EObject semanticElement, @ScriptParameter(defaultValue = "Class") final String diagramType,
+ @ScriptParameter(defaultValue = "NewDiagram") final String diagramName, @ScriptParameter(defaultValue = "false") final boolean open) {
if ("Class".equals(diagramType)) {
- createDiagram(getModelSet(), new CreateClassDiagramCommand(), new ClassDiagramCreationCondition(), semanticElement, newDiagram, open);
+ createDiagram(getModelSet(), new CreateClassDiagramCommand(), new ClassDiagramCreationCondition(), semanticElement, diagramName, open);
}
}
@@ -140,28 +152,28 @@
* The name of the new file
*/
@WrapToScript
- public void control(final EObject semanticElement, @ScriptParameter(name = "fileName") String fileName) {
+ public void control(final EObject semanticElement, String fileName) {
if (fileName == null) {
fileName = semanticElement.eResource().getURIFragment(semanticElement);
}
- URI baseURI = semanticElement.eResource().getURI();
- URI createURI = baseURI.trimSegments(1).appendSegment(fileName + ".uml");
- ControlModeRequest controlRequest = ControlModeRequest.createUIControlModelRequest(getEditingDomain(), semanticElement, createURI);
+ final URI baseURI = semanticElement.eResource().getURI();
+ final URI createURI = baseURI.trimSegments(1).appendSegment(fileName + ".uml");
+ final ControlModeRequest controlRequest = ControlModeRequest.createUIControlModelRequest(getEditingDomain(), semanticElement, createURI);
controlRequest.setIsUIAction(false);
- IControlModeManager controlMng = ControlModeManager.getInstance();
- ICommand controlCommand = controlMng.getControlCommand(controlRequest);
+ final IControlModeManager controlMng = ControlModeManager.getInstance();
+ final ICommand controlCommand = controlMng.getControlCommand(controlRequest);
getEditingDomain().getCommandStack().execute(new GMFtoEMFCommandWrapper(controlCommand));
}
private void createDiagram(final ModelSet modelSet, final ICreationCommand creationCommand, final ClassDiagramCreationCondition creationCondition,
final EObject target, final String diagramName, final boolean openDiagram) {
- NavigableElement navElement = getNavigableElementWhereToCreateDiagram(creationCondition, target);
+ final NavigableElement navElement = getNavigableElementWhereToCreateDiagram(creationCondition, target);
if ((navElement != null) && (modelSet != null)) {
- CompositeCommand command = getLinkCreateAndOpenNavigableDiagramCommand(navElement, creationCommand, diagramName, modelSet, openDiagram);
+ final CompositeCommand command = getLinkCreateAndOpenNavigableDiagramCommand(navElement, creationCommand, diagramName, modelSet, openDiagram);
// modelSet.getTransactionalEditingDomain().getCommandStack().execute(new GMFtoEMFCommandWrapper(command));
try {
command.execute(new NullProgressMonitor(), null);
- } catch (ExecutionException e) {
+ } catch (final ExecutionException e) {
e.printStackTrace();
}
@@ -175,11 +187,11 @@
if (creationCondition.create(selectedElement)) {
return new ExistingNavigableElement(selectedElement, null);
} else {
- List<NavigableElement> navElements = NavigationHelper.getInstance().getAllNavigableElements(selectedElement);
+ final List<NavigableElement> navElements = NavigationHelper.getInstance().getAllNavigableElements(selectedElement);
// this will sort elements by navigation depth
Collections.sort(navElements);
- for (NavigableElement navElement : navElements) {
+ for (final NavigableElement navElement : navElements) {
// ignore existing elements because we want a hierarchy to
// be created if it is not on the current element
if ((navElement instanceof CreatedNavigableElement) && creationCondition.create(navElement.getElement())) {
@@ -191,14 +203,13 @@
return null;
}
- @Override
protected TransactionalEditingDomain getEditingDomain() {
- return (TransactionalEditingDomain) super.getEditingDomain();
+ return (TransactionalEditingDomain) getEcoreModule().getEditingDomain();
}
public static CompositeCommand getLinkCreateAndOpenNavigableDiagramCommand(final NavigableElement navElement,
final ICreationCommand creationCommandInterface, final String diagramName, final ModelSet modelSet, final boolean openDiagram) {
- CompositeCommand compositeCommand = new CompositeCommand("Create diagram");
+ final CompositeCommand compositeCommand = new CompositeCommand("Create diagram");
if (navElement instanceof CreatedNavigableElement) {
compositeCommand.add(new AbstractTransactionalCommand(modelSet.getTransactionalEditingDomain(), "Create hierarchy", null) {
@@ -212,7 +223,7 @@
});
}
- ICommand createDiagCommand = creationCommandInterface.getCreateDiagramCommand(modelSet, navElement.getElement(), diagramName);
+ final ICommand createDiagCommand = creationCommandInterface.getCreateDiagramCommand(modelSet, navElement.getElement(), diagramName);
compositeCommand.add(createDiagCommand);
if (openDiagram) {
compositeCommand.add(new OpenDiagramCommand(modelSet.getTransactionalEditingDomain(), createDiagCommand));
@@ -222,24 +233,20 @@
}
/**
- * The same as eInstanceOf of the Ecore model. However it will look into UML and Notation metamodel
+ * Return if the current instance is a instance of an EClass define by its name. Will look into UML and Notation metamodel.
+ *
+ * @param eObject
+ * The {@link EObject} you want to test.
+ * @param type
+ * The name of the EClass defined in the metamodel
+ * @return <code>true</code> if the {@link EObject} is instance of typeName
*/
@WrapToScript
- @Override
- public boolean eInstanceOf(@ScriptParameter(name = "eObject") final EObject eObject, @ScriptParameter(name = "type") final String type) {
- EClassifier classifier = getEPackage().getEClassifier(type);
+ public boolean eInstanceOf(final EObject eObject, final String type) {
+ EClassifier classifier = getEcoreModule().getEPackage().getEClassifier(type);
if (classifier == null) {
- classifier = notationModule.getEPackage().getEClassifier(type);
+ classifier = getEcoreModule().getEPackage().getEClassifier(type);
}
return classifier.isInstance(eObject);
}
-
- /**
- * The the current Papyrus editor. The object parameter is useless
- */
- @Override
- @WrapToScript
- public void save(@ScriptParameter(name = "object", defaultValue = ScriptParameter.NULL) final Object object) {
- save();
- }
}
diff --git a/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/SYSMLModule.java b/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/SYSMLModule.java
index 29122a4..8f98dbe 100644
--- a/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/SYSMLModule.java
+++ b/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/SYSMLModule.java
@@ -10,39 +10,34 @@
*******************************************************************************/
package org.eclipse.ease.modules.modeling;
-import org.eclipse.ease.IScriptEngine;
-import org.eclipse.ease.modules.IEnvironment;
+import org.eclipse.ease.modules.AbstractScriptModule;
import org.eclipse.ease.modules.WrapToScript;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.uml2.uml.Class;
import org.eclipse.uml2.uml.Stereotype;
import org.eclipse.uml2.uml.UMLFactory;
-import org.eclipse.uml2.uml.UMLPackage;
/**
* This module help to handle UML models.
*/
-public class SYSMLModule extends UMLModule {
-
- @Override
- public void initialize(final IScriptEngine engine, final IEnvironment environment) {
- super.initialize(engine, environment);
- initEPackage(UMLPackage.eNS_URI);
- }
+public class SYSMLModule extends AbstractScriptModule {
/**
* Get the UML model from the current active editor
*
- * @return
+ * @param qualifiedName
+ * qualified name of the model
+ *
+ * @return UML model
*/
@WrapToScript
public EObject createSysML(final String qualifiedName) {
- Class clazz = ((UMLFactory) getFactory()).createClass();
- EList<Stereotype> stereotypes = clazz.getApplicableStereotypes();
- for (Stereotype s : stereotypes) {
+ final Class clazz = ((UMLFactory) getEnvironment().getModule(EcoreModule.class).getFactory()).createClass();
+ final EList<Stereotype> stereotypes = clazz.getApplicableStereotypes();
+ for (final Stereotype s : stereotypes) {
if (s.getQualifiedName().equals(qualifiedName)) {
- EObject sysml = clazz.applyStereotype(s);
+ final EObject sysml = clazz.applyStereotype(s);
return sysml;
}
}
diff --git a/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/SelectionModule.java b/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/SelectionModule.java
index 9d4464e..afb3770 100644
--- a/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/SelectionModule.java
+++ b/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/SelectionModule.java
@@ -26,22 +26,15 @@
import com.google.common.collect.Lists;
/**
- * Module to interact with selection
- *
- * @author adaussy
- *
+ * Module to interact with selections.
*/
public class SelectionModule extends AbstractScriptModule {
- public SelectionModule() {
- super();
- }
-
/**
* Return the current selection using the selection service. The selection service return transformed selection using some rules define in the platform.
* This method use the selector with the Highest priority
*
- * @return
+ * @return custom selection
*/
@WrapToScript
public Object getCustomSelection() {
@@ -61,7 +54,7 @@
*
* @param selectorID
* The if of the selector to use
- * @return
+ * @return custom selecton from selector
*/
@WrapToScript
public Object getCustomSelectionFromSelector(final String selectorID) {
@@ -73,13 +66,16 @@
/**
* Return the selection after being adapter to {@link IIterable}
*
- * @return
+ * @param name
+ * name or ID of part to get selection from
+ *
+ * @return iterable selection or <code>null</code>
*/
@WrapToScript
public Iterable<Object> getIterableSelection(@ScriptParameter(defaultValue = ScriptParameter.NULL) final String name) {
final ISelection selection = UIModule.getSelection(name);
- final IIterable result = getAdapter(IIterable.class, selection);
+ final IIterable<?> result = getAdapter(IIterable.class, selection);
if (result != null) {
return Lists.newArrayList(result.iterator());
}
diff --git a/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/UMLModule.java b/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/UMLModule.java
index 78b1655..9743aa8 100644
--- a/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/UMLModule.java
+++ b/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/UMLModule.java
@@ -11,6 +11,7 @@
package org.eclipse.ease.modules.modeling;
import org.eclipse.ease.IScriptEngine;
+import org.eclipse.ease.modules.AbstractScriptModule;
import org.eclipse.ease.modules.IEnvironment;
import org.eclipse.ease.modules.WrapToScript;
import org.eclipse.ease.modules.platform.UIModule;
@@ -20,40 +21,43 @@
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.edit.domain.EditingDomain;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
import org.eclipse.uml2.uml.Model;
import org.eclipse.uml2.uml.UMLPackage;
/**
* This module help to handle UML models
- *
- * @author adaussy
- *
*/
-public class UMLModule extends EcoreModule {
+public class UMLModule extends AbstractScriptModule {
@Override
public void initialize(final IScriptEngine engine, final IEnvironment environment) {
super.initialize(engine, environment);
- initEPackage(UMLPackage.eNS_URI);
+
+ getEcoreModule().initEPackage(NotationPackage.eNS_URI);
+ }
+
+ private EcoreModule getEcoreModule() {
+ return getEnvironment().getModule(EcoreModule.class);
}
/**
- * Get the UML model from the current active editor
+ * Get the UML model from the active editor.
*
- * @return
+ * @return UML model
*/
@WrapToScript
public Model getModel() {
- EditingDomain editingDomain = getEditingDomain();
+ final EditingDomain editingDomain = getEcoreModule().getEditingDomain();
if (editingDomain == null) {
- getEnvironment().getModule(UIModule.class).showErrorDialog("Error", "Unable to retreive editing domain");
+ getEnvironment().getModule(UIModule.class).showErrorDialog("Error", "Unable to retrieve editing domain");
}
- ResourceSet resourceSet = editingDomain.getResourceSet();
+ final ResourceSet resourceSet = editingDomain.getResourceSet();
if (resourceSet == null) {
- getEnvironment().getModule(UIModule.class).showErrorDialog("Error", "Unable to retreive the resource set");
+ getEnvironment().getModule(UIModule.class).showErrorDialog("Error", "Unable to retrieve the resource set");
}
- for (Resource r : resourceSet.getResources()) {
- Model result = lookForModel(r);
+ for (final Resource r : resourceSet.getResources()) {
+ final Model result = lookForModel(r);
if (result != null) {
return result;
}
@@ -62,12 +66,12 @@
}
private Model lookForModel(final Resource r) {
- URI resourceURI = r.getURI();
+ final URI resourceURI = r.getURI();
if (resourceURI != null) {
if (UMLPackage.eNS_PREFIX.equals(resourceURI.fileExtension())) {
- EList<EObject> content = r.getContents();
+ final EList<EObject> content = r.getContents();
if (!content.isEmpty()) {
- EObject root = content.get(0);
+ final EObject root = content.get(0);
if (root instanceof Model) {
return (Model) root;
}
diff --git a/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/WorkbenchModule.java b/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/WorkbenchModule.java
deleted file mode 100644
index 9f19958..0000000
--- a/plugins/org.eclipse.ease.modules.modeling/src/org/eclipse/ease/modules/modeling/WorkbenchModule.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2013 Atos
- * 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:
- * Arthur Daussy - initial implementation
- *******************************************************************************/
-package org.eclipse.ease.modules.modeling;
-
-import org.eclipse.ease.modules.AbstractScriptModule;
-import org.eclipse.ease.modules.WrapToScript;
-import org.eclipse.ease.tools.RunnableWithResult;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Module used to interact with the workbench
- *
- * @author adaussy
- *
- */
-public class WorkbenchModule extends AbstractScriptModule {
-
- public WorkbenchModule() {
- }
-
- /**
- * Return the active workbench
- *
- * @return
- */
- @WrapToScript
- public static IWorkbench getActiveWorkbench() {
- return PlatformUI.getWorkbench();
- }
-
- /**
- * Return the Active Window {@link IWorkbench#getActiveWorkbenchWindow()}
- *
- * @return
- */
- @WrapToScript
- public static IWorkbenchWindow getActiveWindow() {
- RunnableWithResult<IWorkbenchWindow> runnable = new RunnableWithResult<IWorkbenchWindow>() {
-
- @Override
- public void run() {
- setResult(getActiveWorkbench().getActiveWorkbenchWindow());
- }
- };
- Display.getDefault().syncExec(runnable);
- return runnable.getResult();
- }
-
- /**
- * Return the active shell
- *
- * @return The active shell
- */
- @WrapToScript
- public static Shell getActiveShell() {
- return getActiveWindow().getShell();
- }
-
- /**
- * Return the active page {@link IWorkbenchWindow#getActivePage()}
- *
- * @return
- */
- @WrapToScript
- public static IWorkbenchPage getActivePage() {
- return getActiveWindow().getActivePage();
- }
-
- /**
- * Return the current editor
- *
- * @return The current editor
- */
- @WrapToScript
- public static IEditorPart getActiveEditor() {
- return getActiveWindow().getActivePage().getActiveEditor();
- }
-}
diff --git a/plugins/org.eclipse.ease.modules.platform/src/org/eclipse/ease/modules/platform/PlatformModule.java b/plugins/org.eclipse.ease.modules.platform/src/org/eclipse/ease/modules/platform/PlatformModule.java
index 45741e4..a9d2cbd 100644
--- a/plugins/org.eclipse.ease.modules.platform/src/org/eclipse/ease/modules/platform/PlatformModule.java
+++ b/plugins/org.eclipse.ease.modules.platform/src/org/eclipse/ease/modules/platform/PlatformModule.java
@@ -84,9 +84,13 @@
* @param parameters
* command parameters
* @throws ExecutionException
+ * If the handler has problems executing this command.
* @throws NotDefinedException
+ * If the command you are trying to execute is not defined.
* @throws NotEnabledException
+ * If the command you are trying to execute is not enabled.
* @throws NotHandledException
+ * If there is no handler.
*/
@WrapToScript
public static void executeCommand(final String commandId, @ScriptParameter(defaultValue = ScriptParameter.NULL) final Map<String, String> parameters)
@@ -119,8 +123,7 @@
* program to run (with full path if necessary)
* @param args
* program arguments
- * @return
- * @return {@link FutureX} object tracking the program
+ * @return process object to track proces execution
* @throws IOException
* if an I/O error occurs
*/
@@ -147,7 +150,7 @@
* key name to read from
* @param defaultValue
* default value to use, if value is not set
- * @return
+ * @return preference value or <code>null</code>
*/
@WrapToScript
public static Object readPreferences(final String node, final String key, @ScriptParameter(defaultValue = "") final Object defaultValue) {
diff --git a/plugins/org.eclipse.ease.modules.platform/src/org/eclipse/ease/modules/platform/ResourcesModule.java b/plugins/org.eclipse.ease.modules.platform/src/org/eclipse/ease/modules/platform/ResourcesModule.java
index 031778b..92efa72 100644
--- a/plugins/org.eclipse.ease.modules.platform/src/org/eclipse/ease/modules/platform/ResourcesModule.java
+++ b/plugins/org.eclipse.ease.modules.platform/src/org/eclipse/ease/modules/platform/ResourcesModule.java
@@ -177,6 +177,20 @@
* folder location
* @return {@link IFolder}, {@link File} or <code>null</code> in case of error
* @throws CoreException
+ * if this method fails. Reasons include:
+ * <ul>
+ * <li>This resource already exists in the workspace.</li>
+ * <li>The workspace contains a resource of a different type at the same path as this resource.</li>
+ * <li>The parent of this resource does not exist.</li>
+ * <li>The parent of this resource is a project that is not open.</li>
+ * <li>The parent contains a resource of a different type at the same path as this resource.</li>
+ * <li>The parent of this resource is virtual, but this resource is not.</li>
+ * <li>The name of this resource is not valid (according to <code>IWorkspace.validateName</code>).</li>
+ * <li>The corresponding location in the local file system is occupied by a file (as opposed to a directory).</li>
+ * <li>The corresponding location in the local file system is occupied by a folder and <code>force </code> is <code>false</code>.</li>
+ * <li>Resource changes are disallowed during certain types of resource change event notification. See <code>IResourceChangeEvent</code> for
+ * more details.</li>
+ * </ul>
*/
@WrapToScript
public Object createFolder(final Object location) throws CoreException {
@@ -294,10 +308,10 @@
/**
* Copies a file from location to targetLocation.
*
- * @param location
- * file location, file handle or file instance
+ * @param sourceLocation
+ * file location, file handle or file instance for the source object
* @param targetLocation
- * file location, file handle or file instance
+ * file location, file handle or file instance for the target object
* @throws Exception
* problems on file access
*/
diff --git a/plugins/org.eclipse.ease.modules.platform/src/org/eclipse/ease/modules/platform/ScriptingModule.java b/plugins/org.eclipse.ease.modules.platform/src/org/eclipse/ease/modules/platform/ScriptingModule.java
index b8e7ab9..11d5a16 100644
--- a/plugins/org.eclipse.ease.modules.platform/src/org/eclipse/ease/modules/platform/ScriptingModule.java
+++ b/plugins/org.eclipse.ease.modules.platform/src/org/eclipse/ease/modules/platform/ScriptingModule.java
@@ -219,7 +219,7 @@
* monitor to synchronize on
* @param code
* code to run.
- * @return
+ * @return execution result of executed code
*/
@WrapToScript
public Object executeSync(final Object monitor, final Object code) {
diff --git a/plugins/org.eclipse.ease.modules.platform/src/org/eclipse/ease/modules/platform/debug/LaunchModule.java b/plugins/org.eclipse.ease.modules.platform/src/org/eclipse/ease/modules/platform/debug/LaunchModule.java
index 44b6cfd..ede17f5 100644
--- a/plugins/org.eclipse.ease.modules.platform/src/org/eclipse/ease/modules/platform/debug/LaunchModule.java
+++ b/plugins/org.eclipse.ease.modules.platform/src/org/eclipse/ease/modules/platform/debug/LaunchModule.java
@@ -58,6 +58,7 @@
*
* @return array of launch configuration names.
* @throws CoreException
+ * if an exception occurs retrieving configurations
*/
@WrapToScript
public static String[] getLaunchConfigurationNames() throws CoreException {
@@ -75,6 +76,7 @@
*
* @return array of launch configurations
* @throws CoreException
+ * if an exception occurs retrieving configurations
*/
@WrapToScript
public static ILaunchConfiguration[] getLaunchConfigurations() throws CoreException {
@@ -90,6 +92,7 @@
* @throws IllegalArgumentException
* if the name is not known to the launch manager
* @throws CoreException
+ * if an exception occurs retrieving configurations
* @see {@link ILaunchConfiguration#getWorkingCopy()}.
*/
@WrapToScript
@@ -119,6 +122,7 @@
* @throws IllegalArgumentException
* if the name is not known to the launch manager
* @throws CoreException
+ * if an exception occurs retrieving configurations
*/
@WrapToScript
public static ILaunch launch(Object launchConfiguration, @ScriptParameter(defaultValue = "run") String mode) throws CoreException {
@@ -144,6 +148,7 @@
* @param mode
* the launch mode, normally "debug" or "run" but can be any of the launch modes available on the platform. The default value is "run".
* @throws CoreException
+ * if an exception occurs retrieving configurations
*/
@WrapToScript
public static void launchUI(Object launchConfiguration, @ScriptParameter(defaultValue = "run") final String mode) throws CoreException {
diff --git a/plugins/org.eclipse.ease.modules.team.git/src/org/eclipse/ease/modules/git/GitModule.java b/plugins/org.eclipse.ease.modules.team.git/src/org/eclipse/ease/modules/git/GitModule.java
index 25df5ff..c163dd1 100644
--- a/plugins/org.eclipse.ease.modules.team.git/src/org/eclipse/ease/modules/git/GitModule.java
+++ b/plugins/org.eclipse.ease.modules.team.git/src/org/eclipse/ease/modules/git/GitModule.java
@@ -24,6 +24,7 @@
import org.eclipse.jgit.api.Status;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.api.errors.InvalidRemoteException;
+import org.eclipse.jgit.api.errors.NoFilepatternException;
import org.eclipse.jgit.api.errors.TransportException;
import org.eclipse.jgit.dircache.DirCache;
import org.eclipse.jgit.revwalk.RevCommit;
@@ -55,6 +56,7 @@
* @throws TransportException
* when transport operation failed
* @throws GitAPIException
+ * on a general error during git execution
*/
@WrapToScript
public Git clone(final String remoteLocation, final Object localLocation, @ScriptParameter(defaultValue = ScriptParameter.NULL) final String user,
@@ -90,6 +92,7 @@
* local repository root folder
* @return GIT API instance
* @throws IOException
+ * when resource cannot be accessed
*/
@WrapToScript
public Git openRepository(final Object location) throws IOException {
@@ -115,12 +118,11 @@
* @param bare
* <code>true</code> for bare repositories
* @return GIT API instance
- * @throws IllegalStateException
* @throws GitAPIException
+ * on a general error during git execution
*/
@WrapToScript
- public Git initRepository(final Object location, @ScriptParameter(defaultValue = "false") final boolean bare)
- throws IllegalStateException, GitAPIException {
+ public Git initRepository(final Object location, @ScriptParameter(defaultValue = "false") final boolean bare) throws GitAPIException {
final Object resource = ResourceTools.resolve(location, getScriptEngine().getExecutedFile());
final File folder = ResourceTools.toFile(resource);
@@ -166,6 +168,7 @@
* @throws IOException
* the repository could not be accessed
* @throws GitAPIException
+ * on a general error during git execution
*/
@WrapToScript
public RevCommit commit(final Object repository, final String message, @ScriptParameter(defaultValue = ScriptParameter.NULL) String author,
@@ -184,12 +187,18 @@
*
* @param repository
* repository instance or location (local) to get status from
+ * @param filepattern
+ * repository-relative path of file/directory to add (with <code>/</code> as separator)
* @return add result
* @throws IOException
+ * when resource cannot be accessed
+ * @throws NoFilepatternException
+ * when <i>filepattern</i> is empty
* @throws GitAPIException
+ * on a general error during git execution
*/
@WrapToScript
- public DirCache add(final Object repository, final String filepattern) throws IOException, GitAPIException {
+ public DirCache add(final Object repository, final String filepattern) throws IOException, NoFilepatternException, GitAPIException {
final Git repo = openRepository(repository);
if (repo != null) {
return repo.add().addFilepattern(filepattern).call();
@@ -205,7 +214,9 @@
* repository instance or location (local) to get status from
* @return repository status
* @throws IOException
+ * when resource cannot be accessed
* @throws GitAPIException
+ * on a general error during git execution
*/
@WrapToScript
public Status getStatus(final Object repository) throws IOException, GitAPIException {
@@ -224,7 +235,9 @@
* repository instance or location (local) to pull
* @return push result
* @throws IOException
+ * when resource cannot be accessed
* @throws GitAPIException
+ * on a general error during git execution
*/
@WrapToScript
public Iterable<PushResult> push(final Object repository) throws IOException, GitAPIException {
@@ -243,7 +256,9 @@
* repository instance or location (local) to pull
* @return pull result
* @throws IOException
+ * when resource cannot be accessed
* @throws GitAPIException
+ * on a general error during git execution
*/
@WrapToScript
public PullResult pull(final Object repository) throws IOException, GitAPIException {
diff --git a/plugins/org.eclipse.ease.modules.team.svn/src/org/eclipse/ease/modules/svn/SVNModule.java b/plugins/org.eclipse.ease.modules.team.svn/src/org/eclipse/ease/modules/svn/SVNModule.java
index 3f5aee6..1abfa17 100644
--- a/plugins/org.eclipse.ease.modules.team.svn/src/org/eclipse/ease/modules/svn/SVNModule.java
+++ b/plugins/org.eclipse.ease.modules.team.svn/src/org/eclipse/ease/modules/svn/SVNModule.java
@@ -13,7 +13,6 @@
import java.util.ArrayList;
import java.util.List;
-import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IResource;
import org.eclipse.ease.modules.AbstractScriptModule;
import org.eclipse.ease.modules.ScriptParameter;
@@ -41,7 +40,7 @@
/**
* Creates repository location.
*
- * Creates repository location with rooturl, if location already exists: return existing location
+ * Creates repository location with <i>rootUrl</i>, if location already exists: return existing location
*
* @param rootUrl
* defines the root URL of the repository
@@ -91,15 +90,13 @@
/**
* Imports project from repository location.
*
- * Imports project (given with projectLocation) from repository location.
- *
* @param rootLocation
- * can be a string (-> generate RepositoryLocation automatically) or already a RepositoryLocation
+ * can be a string (to generate RepositoryLocation automatically) or already a RepositoryLocation
* @param projectLocations
* array from relative paths to project locations
*/
@WrapToScript
- public void importProjectFromSVN(Object rootLocation, final String[] projectLocations) throws Exception {
+ public void importProjectFromSVN(Object rootLocation, final String[] projectLocations) {
if (rootLocation instanceof IRepositoryResource) {
} else {
rootLocation = createRepositoryLocation(rootLocation.toString(), null, null);
diff --git a/releng/org.eclipse.ease.modules.releng/pom.xml b/releng/org.eclipse.ease.modules.releng/pom.xml
index e7ef71f..62ec35e 100644
--- a/releng/org.eclipse.ease.modules.releng/pom.xml
+++ b/releng/org.eclipse.ease.modules.releng/pom.xml
@@ -179,7 +179,7 @@
<outputDirectory>${project.build.directory}/../mydocs</outputDirectory>
<doclet>org.eclipse.ease.helpgenerator.ModuleDoclet</doclet>
<docletPath>${doclet.path}</docletPath>
- <additionalparam>-root ${basedir}</additionalparam>
+ <additionalparam>-root ${basedir} -failOnHTMLError true -failOnMissingDocs true</additionalparam>
<useStandardDocletOptions>true</useStandardDocletOptions>
<links>