Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src/org/eclipse/papyrus/customization/properties/model/xwt/resource/XWTResource.java8
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/Query/Contexts.querySet2
-rw-r--r--plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/ui/CustomizationDialog.java5
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/Activator.java7
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/commands/AddToResourceCommand.java6
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/databinding/AnnotationObservableValue.java42
-rw-r--r--plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java11
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/Activator.java11
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/BooleanConverter.java9
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/ColorToGMFConverter.java29
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/IntegerConverter.java9
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/StringConverter.java9
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java8
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/StyleListener.java6
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/BaseCSSEngine.java3
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/DiagramCSSEngine.java10
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/handler/CSSRefreshHandler.java8
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/CSSHelper.java1
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/GradientHelper.java19
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/ParserHelper.java20
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/SemanticElementHelper.java3
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/StringHelper.java12
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/lists/ExtendedCSSRuleList.java16
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagram.java16
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagramImpl.java5
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/ForceValueHelper.java5
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferenceInitializer.java2
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferences.java6
-rw-r--r--plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CSSCustomStyleDelegate.java13
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/plugin.xml5
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/Activator.java11
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/AbstractConstraint.java1
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/JavaQuery.java30
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/JavaQueryConstraint.java9
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/TrueConstraint.java1
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/providers/ConstraintTypeContentProvider.java10
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/ConstraintEngine.java18
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/ConstraintsManager.java36
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/DefaultConstraintEngine.java7
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/Activator.java7
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/databinding/AggregatedObservable.java4
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/databinding/MultipleObservableValue.java5
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ListHelper.java22
-rw-r--r--plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ReflectHelper.java11
-rw-r--r--plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/creation/StringEditionFactory.java9
-rw-r--r--plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/CLabelObservableValue.java46
-rw-r--r--plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/ComboObservableValue.java27
-rw-r--r--plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/GrayedCheckboxObservableValue.java12
-rw-r--r--plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/ReferenceDialogObservableValue.java24
-rw-r--r--plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/TextObservableValue.java29
-rw-r--r--plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/UnknownValueDiff.java6
-rw-r--r--plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/AbstractEditor.java22
-rw-r--r--plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/AbstractValueEditor.java10
-rw-r--r--plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanCheckbox.java6
-rw-r--r--plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanToggle.java26
-rw-r--r--plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/modelelement/StereotypeModelElement.java3
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/Activator.java7
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/AbstractStereotypeListener.java45
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/MultiplicityObservableValue.java2
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/NavigationObservableValue.java2
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/OwnerObservableValue.java2
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/PapyrusObservableList.java18
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProfileApplicationObservableList.java2
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/helper/UMLDatabindingHelper.java17
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/EditServiceValidator.java56
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/SemanticUMLContentProvider.java6
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/UMLContainerContentProvider.java7
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/UMLLabelProvider.java6
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/util/UMLProviderHelper.java5
69 files changed, 778 insertions, 95 deletions
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src/org/eclipse/papyrus/customization/properties/model/xwt/resource/XWTResource.java b/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src/org/eclipse/papyrus/customization/properties/model/xwt/resource/XWTResource.java
index 79640834d13..e64a0185f01 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src/org/eclipse/papyrus/customization/properties/model/xwt/resource/XWTResource.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties.model.xwt/src/org/eclipse/papyrus/customization/properties/model/xwt/resource/XWTResource.java
@@ -92,7 +92,11 @@ public class XWTResource extends ResourceImpl {
Root root = (Root)xmlResource.getContents().get(0);
try {
CompositeWidget widget = xmlToUISection(root);
- getContents().add(widget);
+ if(widget == null) {
+ Activator.log.warn("Cannot load the XWT Widget");
+ } else {
+ getContents().add(widget);
+ }
} catch (Exception ex) {
Activator.log.error(ex);
}
@@ -186,7 +190,9 @@ public class XWTResource extends ResourceImpl {
} else {
IStatus status = BasicDiagnostic.toIStatus(result);
Activator.getDefault().getLog().log(status);
+ Activator.log.error(status.getException());
}
+
return null;
}
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties/Query/Contexts.querySet b/plugins/customization/org.eclipse.papyrus.customization.properties/Query/Contexts.querySet
index 7bf736b16da..aea3810087c 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties/Query/Contexts.querySet
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties/Query/Contexts.querySet
@@ -46,7 +46,7 @@
<returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<scope href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context"/>
</queries>
- <queries xsi:type="query:OCLModelQuery" name="showDataContext" description="Blabla" lowerBound="1" query="true">
+ <queries xsi:type="query:OCLModelQuery" name="showDataContext" description="" lowerBound="1" query="true">
<returnType xsi:type="ecore:EDataType" href="http://www.eclipse.org/emf/2002/Ecore#//EBoolean"/>
<scope href="http://www.eclipse.org/papyrus/properties/contexts/0.9#//Context"/>
</queries>
diff --git a/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/ui/CustomizationDialog.java b/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/ui/CustomizationDialog.java
index 439415d7a60..17861495a83 100644
--- a/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/ui/CustomizationDialog.java
+++ b/plugins/customization/org.eclipse.papyrus.customization.properties/src/org/eclipse/papyrus/customization/properties/ui/CustomizationDialog.java
@@ -272,4 +272,9 @@ public class CustomizationDialog extends TrayDialog implements SelectionListener
}
}
}
+
+ @Override
+ public boolean isResizable() {
+ return true;
+ }
}
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/Activator.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/Activator.java
index a2f18016a6f..1af1ae18581 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/Activator.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/Activator.java
@@ -27,12 +27,17 @@ import org.osgi.framework.BundleContext;
*/
public class Activator extends AbstractUIPlugin {
- // The plug-in ID
+ /**
+ * The plug-in ID
+ */
public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.emf"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
+ /**
+ * The plug-in's logger
+ */
public static LogHelper log;
private CustomizationManager fCustomizationManager;
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/commands/AddToResourceCommand.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/commands/AddToResourceCommand.java
index b24bdf111c6..52ee15b938a 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/commands/AddToResourceCommand.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/commands/AddToResourceCommand.java
@@ -71,12 +71,11 @@ public class AddToResourceCommand extends AbstractCommand {
*
* @see org.eclipse.emf.common.command.AbstractCommand#prepare()
*
- * @return
*/
@Override
protected boolean prepare() {
return true;
- };
+ }
/**
@@ -87,13 +86,12 @@ public class AddToResourceCommand extends AbstractCommand {
@Override
public void undo() {
this.resource.getContents().remove(this.toAdd);
- };
+ }
/**
*
* @see org.eclipse.emf.common.command.AbstractCommand#canExecute()
*
- * @return
*/
@Override
public boolean canExecute() {
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/databinding/AnnotationObservableValue.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/databinding/AnnotationObservableValue.java
index 1b5e9551fd7..1e690d4c09a 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/databinding/AnnotationObservableValue.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/databinding/AnnotationObservableValue.java
@@ -120,6 +120,9 @@ public class AnnotationObservableValue extends AbstractObservableValue {
return annotation.getDetails().get(key);
}
+ /**
+ * @return the observed EAnnotation
+ */
protected EAnnotation getEAnnotation() {
return source.getEAnnotation(annotationName);
}
@@ -135,6 +138,13 @@ public class AnnotationObservableValue extends AbstractObservableValue {
}
}
+ /**
+ * Returns the command used to edit the observed annotation, which the
+ * given value
+ *
+ * @param value
+ * @return
+ */
protected Command getCommand(Object value) {
EAnnotation annotation = getEAnnotation();
@@ -192,6 +202,12 @@ public class AnnotationObservableValue extends AbstractObservableValue {
return emfCommand;
}
+ /**
+ * A Command to remove an entry from an EAnnotation
+ *
+ * @author Camille Letavernier
+ *
+ */
protected class RemoveEntryCommand extends AbstractCommand {
private EAnnotation annotation;
@@ -202,13 +218,22 @@ public class AnnotationObservableValue extends AbstractObservableValue {
private boolean undo = false;
+ /**
+ * Constructor
+ *
+ * @param annotation
+ * The EAnnotation to edit
+ * @param key
+ * The EAnnotation's key to edit
+ */
public RemoveEntryCommand(EAnnotation annotation, String key) {
this.annotation = annotation;
this.key = key;
}
public void execute() {
- if(undo = annotation.getDetails().containsKey(key)) {
+ undo = annotation.getDetails().containsKey(key);
+ if(undo) {
previousValue = annotation.getDetails().get(key);
annotation.getDetails().remove(key);
}
@@ -231,6 +256,11 @@ public class AnnotationObservableValue extends AbstractObservableValue {
}
}
+ /**
+ * A Command to set an EAnnotation's entry
+ *
+ * @author Camille Letavernier
+ */
protected class AddEntryCommand extends AbstractCommand {
private EAnnotation annotation;
@@ -239,6 +269,16 @@ public class AnnotationObservableValue extends AbstractObservableValue {
private String value;
+ /**
+ *
+ *
+ * @param annotation
+ * The EAnnotation to edit
+ * @param key
+ * The EAnnotation's key to edit
+ * @param value
+ * The value to set
+ */
public AddEntryCommand(EAnnotation annotation, String key, String value) {
this.annotation = annotation;
this.key = key;
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java
index 2746de19654..50fa841c273 100644
--- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java
+++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/utils/EMFHelper.java
@@ -117,6 +117,7 @@ public class EMFHelper {
/**
* Tests if the given eClass is a Subclass of fromClass
+ * Also returns true when eClass == fromClass
*
* @param eClass
* @param fromClass
@@ -185,10 +186,12 @@ public class EMFHelper {
*/
public static EditingDomain resolveEditingDomain(final EObject source) {
EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(source);
- if (domain == null) {
+ if(domain == null) {
try {
domain = ServiceUtilsForActionHandlers.getInstance().getTransactionalEditingDomain();
- } catch (ServiceException e) {}
+ } catch (ServiceException e) {
+ //Ignore: We cannot find the domain
+ }
}
return domain;
}
@@ -236,7 +239,7 @@ public class EMFHelper {
* @return
* The first EObject located at the given URI
* @throws IOException
- *
+ * When the URI cannot be loaded
*/
public static EObject loadEMFModel(ResourceSet resourceSet, final URI uri) throws IOException {
if(resourceSet == null) {
@@ -413,7 +416,7 @@ public class EMFHelper {
return false; //The property if not required
}
-
+
/**
*
* @param resource
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/Activator.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/Activator.java
index 2fb88878e2e..bfa98d4d754 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/Activator.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/Activator.java
@@ -11,6 +11,7 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.css;
+import org.eclipse.core.commands.contexts.Context;
import org.eclipse.papyrus.infra.core.log.LogHelper;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.contexts.IContextService;
@@ -22,14 +23,22 @@ import org.osgi.framework.BundleContext;
*/
public class Activator extends AbstractUIPlugin {
- // The plug-in ID
+ /**
+ * The plug-in ID
+ */
public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.gmfdiag.css"; //$NON-NLS-1$
+ /**
+ * The CSS {@link Context}
+ */
public static final String CSS = "Papyrus CSS"; //ID of the CSS context //$NON-NLS-1$
// The shared instance
private static Activator plugin;
+ /**
+ * The plug-in's logger
+ */
public static LogHelper log;
/**
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/BooleanConverter.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/BooleanConverter.java
index ab0200b8969..87b14cd71d2 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/BooleanConverter.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/BooleanConverter.java
@@ -18,9 +18,18 @@ import org.w3c.dom.css.CSSPrimitiveValue;
import org.w3c.dom.css.CSSValue;
+/**
+ * A Converter for Boolean values
+ * Converts a CSS String to a Java Boolean
+ *
+ * @author Camille Letavernier
+ */
@SuppressWarnings("restriction")
public class BooleanConverter extends AbstractCSSValueConverter {
+ /**
+ * Constructor
+ */
public BooleanConverter() {
super(Boolean.class);
}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/ColorToGMFConverter.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/ColorToGMFConverter.java
index 02028af4de8..e6ee0c28f29 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/ColorToGMFConverter.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/ColorToGMFConverter.java
@@ -20,11 +20,23 @@ import org.w3c.dom.css.CSSPrimitiveValue;
import org.w3c.dom.css.CSSValue;
import org.w3c.dom.css.RGBColor;
+/**
+ * A Converter for GMF Colors
+ * Converts a CSS Color to a GMF-compatible color (RGB Integer)
+ *
+ * @author Camille Letavernier
+ */
@SuppressWarnings("restriction")
public class ColorToGMFConverter extends AbstractCSSValueConverter {
+ /**
+ * The GMF Color type
+ */
public static final String GMFColor = "GMFColor"; //$NON-NLS-1$
+ /**
+ * Constructor
+ */
public ColorToGMFConverter() {
super(GMFColor);
}
@@ -47,6 +59,14 @@ public class ColorToGMFConverter extends AbstractCSSValueConverter {
throw new UnsupportedOperationException();
}
+ /**
+ * Returns a GMF-compatible integer color from a CSS RGBColor object
+ *
+ * @param color
+ * The CSS RGBColor to convert
+ * @return
+ * A GMF-compatible integer color
+ */
public static int getIntColor(RGBColor color) {
int red = getInt(color.getRed());
int green = getInt(color.getGreen());
@@ -55,6 +75,14 @@ public class ColorToGMFConverter extends AbstractCSSValueConverter {
return blue * 256 * 256 + green * 256 + red;
}
+ /**
+ * Returns an integer from a CSSPrimitiveValue
+ *
+ * @param value
+ * The CSSPrimitiveValue to convert
+ * @return
+ * A Java integer equivalent to the CSSPrimitiveValue
+ */
public static int getInt(CSSPrimitiveValue value) {
if(value instanceof Measure) {
Measure measure = (Measure)value;
@@ -63,6 +91,7 @@ public class ColorToGMFConverter extends AbstractCSSValueConverter {
return (int)value.getFloatValue(CSSValue.CSS_PRIMITIVE_VALUE);
}
+ //Unused
public static int getIntColor(String value, CSSValue cssValue) {
RGBColor color;
if(cssValue instanceof RGBColor) {
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/IntegerConverter.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/IntegerConverter.java
index 186cd4626a1..5b2dac92152 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/IntegerConverter.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/IntegerConverter.java
@@ -18,9 +18,18 @@ import org.eclipse.e4.ui.css.core.impl.dom.Measure;
import org.w3c.dom.css.CSSPrimitiveValue;
import org.w3c.dom.css.CSSValue;
+/**
+ * A Converter for Integer values
+ * Converts a CSS String to a Java Integer
+ *
+ * @author Camille Letavernier
+ */
@SuppressWarnings("restriction")
public class IntegerConverter extends AbstractCSSValueConverter {
+ /**
+ * Constructor
+ */
public IntegerConverter() {
super(Integer.class);
}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/StringConverter.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/StringConverter.java
index 56fee00a7ad..90ea287b37f 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/StringConverter.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/converters/StringConverter.java
@@ -17,9 +17,18 @@ import org.eclipse.e4.ui.css.core.engine.CSSEngine;
import org.w3c.dom.css.CSSPrimitiveValue;
import org.w3c.dom.css.CSSValue;
+/**
+ * A Converter for String values
+ * Converts a CSS String to a Java String
+ *
+ * @author Camille Letavernier
+ */
@SuppressWarnings("restriction")
public class StringConverter extends AbstractCSSValueConverter {
+ /**
+ * Constructor
+ */
public StringConverter() {
super(String.class);
}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java
index ef241ec8f79..7b4f76aed57 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/GMFElementAdapter.java
@@ -55,6 +55,10 @@ import org.w3c.dom.NodeList;
@SuppressWarnings("restriction")
public class GMFElementAdapter extends ElementAdapter implements NodeList, IChangeListener {
+ /**
+ * The map of Papyrus Diagram ids to human-readable and consistent diagram IDs
+ * The later can be used as valid CSS Selectors
+ */
//TODO : Use an extension point for this map, or find another way to map Diagram ID to CSS Element name
public static final Map<String, String> diagramNameMappings = new HashMap<String, String>();
@@ -153,6 +157,7 @@ public class GMFElementAdapter extends ElementAdapter implements NodeList, IChan
* @param sourceElement
* The source element must be a GMF notation object (View, Style, ...)
* @return
+ * the source element's local CSS style.
*/
public static String getCSSStyle(EObject sourceElement) {
return getCSSValue(sourceElement, CSS_GMF_STYLE_KEY);
@@ -441,6 +446,9 @@ public class GMFElementAdapter extends ElementAdapter implements NodeList, IChan
/**
* The GMF View element associated to this adapter
+ *
+ * @return
+ * The GMF View element associated to this adapter
*/
public View getNotationElement() {
return notationElement;
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/StyleListener.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/StyleListener.java
index f6f4d29bcfa..66aee7b704b 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/StyleListener.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/dom/StyleListener.java
@@ -24,6 +24,12 @@ public class StyleListener extends AdapterImpl {
private final GMFElementAdapter elementAdapter;
+ /**
+ * Constructor
+ *
+ * @param elementAdapter
+ * The GMFElementAdapter to listen to
+ */
public StyleListener(GMFElementAdapter elementAdapter) {
this.elementAdapter = elementAdapter;
}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/BaseCSSEngine.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/BaseCSSEngine.java
index 083349e531f..0c65a8180a9 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/BaseCSSEngine.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/BaseCSSEngine.java
@@ -40,6 +40,9 @@ public class BaseCSSEngine extends ExtendedCSSEngineImpl {
}
}
+ /**
+ * The Singleton instance of BaseCSSEngine
+ */
public static ExtendedCSSEngine instance = new BaseCSSEngine();
//Unsupported operations. The BaseCSSEngine should never be used directly.
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/DiagramCSSEngine.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/DiagramCSSEngine.java
index 503d28c0e06..7bb1e6fbfa8 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/DiagramCSSEngine.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/engine/DiagramCSSEngine.java
@@ -40,6 +40,16 @@ public class DiagramCSSEngine extends ExtendedCSSEngineImpl implements IChangeLi
private CSSDiagram diagram;
+ /**
+ * Constructor
+ *
+ * Builds a DiagramCSSEngine for a given CSSDiagram
+ *
+ * @param parent
+ * The diagram's parent CSSEngine. Its stylesheets will be inherited
+ * @param diagram
+ * This engine's diagram
+ */
public DiagramCSSEngine(ExtendedCSSEngine parent, CSSDiagram diagram) {
super(parent);
this.diagram = diagram;
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/handler/CSSRefreshHandler.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/handler/CSSRefreshHandler.java
index 891135daf05..f538b278ad0 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/handler/CSSRefreshHandler.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/handler/CSSRefreshHandler.java
@@ -16,7 +16,13 @@ import org.eclipse.core.commands.ExecutionException;
import org.eclipse.papyrus.infra.gmfdiag.common.handler.RefreshHandler;
import org.eclipse.papyrus.infra.gmfdiag.css.engine.BaseCSSEngine;
-
+/**
+ * A Handler for refreshing a single Papyrus Diagram
+ * It will refresh the CSS Stylesheets before refreshing the diagram.
+ *
+ * @author Camille Letavernier
+ *
+ */
public class CSSRefreshHandler extends RefreshHandler {
@Override
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/CSSHelper.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/CSSHelper.java
index 322af19c50d..745d1a4b3cd 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/CSSHelper.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/CSSHelper.java
@@ -27,6 +27,7 @@ public class CSSHelper {
* This method should be called before loading resources from this resource set.
*
* @param resourceSet
+ * The resource set on which the CSS Support will be installed
*/
public static void installCSSSupport(ResourceSet resourceSet) {
CSSNotationResourceFactory factory = new CSSNotationResourceFactory();
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/GradientHelper.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/GradientHelper.java
index af499fadba0..27a63a32ca9 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/GradientHelper.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/GradientHelper.java
@@ -38,8 +38,14 @@ import org.w3c.dom.css.CSSValue;
@SuppressWarnings("restriction")
public class GradientHelper {
+ /**
+ * The CSS Value for a Vertical gradient
+ */
public static final String GRADIENT_VERTICAL = "vertical";
+ /**
+ * The CSS Value for a Horizontal gradient
+ */
public static final String GRADIENT_HORIZONTAL = "horizontal";
//Type 1 :
@@ -54,6 +60,19 @@ public class GradientHelper {
//TODO: The Engine should provide a method to handle complex composite properties.
//The base CSS Engine provides such a feature. However, it is not powerful enough.
+ /**
+ * Returns a GradientData from the CSS "gradient", "gradientColor" and/or
+ * "gradientStyle" properties
+ *
+ * @param engine
+ * The engine used to retrieve the gradient
+ * @param node
+ * The semantic node for which the gradient should be retrieved
+ * (Probably a GMF View, FillStyle...)
+ * @return
+ * The computed GradientData, or the default GMF GradientData
+ * if the stylesheet doesn't specify a Gradient
+ */
public static GradientData computeGradient(ExtendedCSSEngine engine, Object node) {
//Type 1
CSSValue gradientColor = engine.retrievePropertyValue(node, "gradientColor");
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/ParserHelper.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/ParserHelper.java
index 571535daa10..fdca9fd5dbe 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/ParserHelper.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/ParserHelper.java
@@ -26,6 +26,17 @@ import org.w3c.dom.css.CSSValueList;
@SuppressWarnings("restriction")
public class ParserHelper {
+ /**
+ * Parses a list of CSS Values, and returns them as an Array of Strings
+ * Used for multivalued CSS values (Space-separated)
+ *
+ * @param engine
+ * The engine used to parse the values
+ * @param value
+ * The raw value to parse
+ * @return
+ * An Array containing each parsed value
+ */
public static String[] parseValues(CSSEngine engine, String value) {
CSSValue cssValue;
try {
@@ -43,6 +54,15 @@ public class ParserHelper {
return new String[]{ cssValue.getCssText() };
}
+ /**
+ * Converts a CSSValueList to an Array of Strings
+ *
+ * @param valueList
+ * The CSSValueList to convert
+ * @return
+ * An Array of Strings containing the CSSValues, in their raw form
+ * (CSS Text form)
+ */
public static String[] toArray(CSSValueList valueList) {
String[] result = new String[valueList.getLength()];
for(int i = 0; i < result.length; i++) {
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/SemanticElementHelper.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/SemanticElementHelper.java
index ce5251d822a..61026e56ede 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/SemanticElementHelper.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/SemanticElementHelper.java
@@ -28,6 +28,9 @@ public class SemanticElementHelper {
* Returns the semantic element attached to the given notation element
*
* The result element can also be a Diagram
+ *
+ * @param notationElement
+ * @return
*/
public static EObject findSemanticElement(EObject notationElement) {
if(notationElement == null) {
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/StringHelper.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/StringHelper.java
index c3ac1d215fc..653e8966fae 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/StringHelper.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/helper/StringHelper.java
@@ -11,16 +11,24 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.css.helper;
+/**
+ * A Helper class for Java Strings
+ *
+ * @author Camille Letavernier
+ */
public class StringHelper {
/**
- * Compares two strings. Case insensitive. The Strings are trimed.
+ * Compares two strings. Case insensitive. The Strings are trimmed.
*
- * Null strings already return false
+ * Null strings already return false (Even for equals(null, null))
*
* @param s1
+ * The first String to compare
* @param s2
+ * The second String to compare
* @return
+ * True if the strings are non-null and equal (After being trimmed)
*/
public static boolean equals(String s1, String s2) {
if(s1 == null || s2 == null) {
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/lists/ExtendedCSSRuleList.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/lists/ExtendedCSSRuleList.java
index 60a0a4170d3..05332e56751 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/lists/ExtendedCSSRuleList.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/lists/ExtendedCSSRuleList.java
@@ -26,16 +26,32 @@ public class ExtendedCSSRuleList extends LinkedList<CSSRule> implements CSSRuleL
private static final long serialVersionUID = 1L;
+ /**
+ * Builds an empty ExtendedCSSRuleList
+ */
public ExtendedCSSRuleList() {
}
+ /**
+ * Builds an ExtendedCSSRuleList by making a copy of a CSSRuleList
+ *
+ * @param listToCopy
+ * The CSSRuleList to copy
+ */
public ExtendedCSSRuleList(CSSRuleList listToCopy) {
for(int i = 0; i < listToCopy.getLength(); i++) {
add(listToCopy.item(i));
}
}
+ /**
+ * Builds an ExtendedCSSRuleList by making a copy of a Collection of
+ * CSSRules
+ *
+ * @param listToCopy
+ * The list of CSSRule to copy
+ */
public ExtendedCSSRuleList(Collection<? extends CSSRule> listToCopy) {
super(listToCopy);
}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagram.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagram.java
index c879f074240..d60b24308b5 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagram.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagram.java
@@ -17,10 +17,26 @@ import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet;
+/**
+ * A GMF Diagram with CSS Support
+ *
+ * @author Camille Letavernier
+ *
+ */
public interface CSSDiagram extends Diagram {
+ /**
+ * Returns the list of stylesheets directly owned by this diagram
+ *
+ * @return
+ */
public List<StyleSheet> getStyleSheets();
+ /**
+ * Returns the CSS Engine associated to this diagram
+ *
+ * @return
+ */
public ExtendedCSSEngine getEngine();
}
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagramImpl.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagramImpl.java
index 3b88e2a17cf..0e729005d3c 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagramImpl.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/CSSDiagramImpl.java
@@ -27,6 +27,11 @@ import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
import org.eclipse.papyrus.infra.gmfdiag.css.resource.CSSNotationResource;
import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheet;
+/**
+ * Default implementation for CSSDiagram
+ *
+ * @author Camille letavernier
+ */
@SuppressWarnings("restriction")
public class CSSDiagramImpl extends DiagramImpl implements CSSDiagram {
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/ForceValueHelper.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/ForceValueHelper.java
index 914b8022d8a..a3577e0e144 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/ForceValueHelper.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/notation/ForceValueHelper.java
@@ -44,6 +44,11 @@ import org.eclipse.papyrus.infra.gmfdiag.css.resource.CSSNotationResource;
*
* @author Camille Letavernier
*/
+//FIXME: The default behavior when undoing a setValue() is set(previous),
+//which may result in set(null) or set(default), instead of unset()
+//Thus, undoing a modification on a View may result in unexpected behavior
+//(e.g., GMF default appearance instead of CSS style)
+//Workaround: Use the "reset style" button to retrieve the correct CSS style
public class ForceValueHelper {
public static void setValue(View view, EStructuralFeature feature, Object value) {
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferenceInitializer.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferenceInitializer.java
index 8ac8f88fdc1..5e4956b2956 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferenceInitializer.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferenceInitializer.java
@@ -13,7 +13,7 @@ package org.eclipse.papyrus.infra.gmfdiag.css.preferences;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
-
+//Unused
public class ThemePreferenceInitializer extends AbstractPreferenceInitializer {
@Override
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferences.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferences.java
index c1877eb8bf9..c60b7bb3607 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferences.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/preferences/ThemePreferences.java
@@ -11,7 +11,11 @@
*****************************************************************************/
package org.eclipse.papyrus.infra.gmfdiag.css.preferences;
-
+/**
+ * Interface for Theme Preferences constants
+ *
+ * @author Camille Letavernier
+ */
public interface ThemePreferences {
/**
diff --git a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CSSCustomStyleDelegate.java b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CSSCustomStyleDelegate.java
index e1e83ef1097..27cf1bfe0ae 100644
--- a/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CSSCustomStyleDelegate.java
+++ b/plugins/infra/gmfdiag/css/org.eclipse.papyrus.infra.gmfdiag.css/src/org/eclipse/papyrus/infra/gmfdiag/css/provider/CSSCustomStyleDelegate.java
@@ -17,6 +17,11 @@ import org.eclipse.papyrus.infra.gmfdiag.css.helper.StringHelper;
import org.w3c.dom.Element;
import org.w3c.dom.css.CSSValue;
+/**
+ * Standard implementation of Papyrus Custom Style, CSS-based
+ *
+ * @author Camille Letavernier
+ */
@SuppressWarnings("restriction")
public class CSSCustomStyleDelegate implements CustomStyle {
@@ -34,6 +39,14 @@ public class CSSCustomStyleDelegate implements CustomStyle {
private static int FULL_VALUE = 0;
+ /**
+ * Constructor
+ *
+ * @param view
+ * The GMF view on which the custom style is applied
+ * @param engine
+ * The CSS engine used to handle the custom properties
+ */
public CSSCustomStyleDelegate(View view, ExtendedCSSEngine engine) {
this.view = view;
this.engine = engine;
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/plugin.xml b/plugins/infra/org.eclipse.papyrus.infra.constraints/plugin.xml
index d4d52edeb4b..adcf796f3ba 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/plugin.xml
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/plugin.xml
@@ -12,6 +12,11 @@
<extension point="org.eclipse.emf.ecore.generated_package">
<package class="org.eclipse.papyrus.infra.constraints.ConstraintsPackage" genModel="Model/Constraints.genmodel" uri="http://www.eclipse.org/papyrus/constraints/0.9"/>
+ <package
+ class="org.eclipse.papyrus.infra.constraints.environment.EnvironmentPackage"
+ genModel="Model/Constraints.genmodel"
+ uri="http://www.eclipse.org/papyrus/constraints/environment/0.9">
+ </package>
</extension>
<extension
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/Activator.java b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/Activator.java
index 6177d774a07..525dd6d6ac5 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/Activator.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/Activator.java
@@ -20,12 +20,17 @@ import org.osgi.framework.BundleContext;
*/
public class Activator extends AbstractUIPlugin {
- // The plug-in ID
+ /**
+ * The plug-in ID
+ */
public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.constraints"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
+ /**
+ * The plug-in's logger
+ */
public static LogHelper log;
/**
@@ -36,6 +41,7 @@ public class Activator extends AbstractUIPlugin {
/*
* (non-Javadoc)
+ *
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
@Override
@@ -47,6 +53,7 @@ public class Activator extends AbstractUIPlugin {
/*
* (non-Javadoc)
+ *
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
@Override
@@ -57,7 +64,7 @@ public class Activator extends AbstractUIPlugin {
/**
* Returns the shared instance
- *
+ *
* @return the shared instance
*/
public static Activator getDefault() {
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/AbstractConstraint.java b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/AbstractConstraint.java
index 569bbe4e7f2..996cbb400ed 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/AbstractConstraint.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/AbstractConstraint.java
@@ -123,6 +123,7 @@ public abstract class AbstractConstraint implements Constraint {
*
* @param propertyName
* @return
+ * True if the property exists in the constraint descriptor
*/
protected boolean hasProperty(String propertyName) {
if(descriptor == null || !(descriptor instanceof SimpleConstraint)) {
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/JavaQuery.java b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/JavaQuery.java
index 45496ffce81..e5fed44fef7 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/JavaQuery.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/JavaQuery.java
@@ -1,15 +1,37 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
package org.eclipse.papyrus.infra.constraints.constraints;
-
+/**
+ * Represents a Java Query
+ */
public interface JavaQuery {
+ /**
+ * Tests whether the query matches a given object
+ *
+ * @param selection
+ * @return
+ */
public boolean match(Object selection);
+ /**
+ * A Java query which is always false
+ *
+ * @author Camille Letavernier
+ *
+ */
public class FalseQuery implements JavaQuery {
- public FalseQuery() {
- }
-
public boolean match(Object selection) {
return false;
}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/JavaQueryConstraint.java b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/JavaQueryConstraint.java
index f8a602c6dff..46d85a2dc53 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/JavaQueryConstraint.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/JavaQueryConstraint.java
@@ -1,7 +1,7 @@
package org.eclipse.papyrus.infra.constraints.constraints;
import org.eclipse.papyrus.infra.constraints.Activator;
-import org.eclipse.papyrus.infra.constraints.ConstraintDescriptor;
+import org.eclipse.papyrus.infra.constraints.SimpleConstraint;
import org.eclipse.papyrus.infra.constraints.constraints.JavaQuery.FalseQuery;
import org.eclipse.papyrus.infra.tools.util.ClassLoaderHelper;
@@ -18,11 +18,15 @@ import org.eclipse.papyrus.infra.tools.util.ClassLoaderHelper;
*/
public class JavaQueryConstraint extends AbstractConstraint {
+ /**
+ * The Java Class property
+ */
public final static String QUERY_CLASS_NAME_PROPERTY = "className"; //$NON-NLS-1$
private JavaQuery query = new FalseQuery();
- protected void setDescriptor(ConstraintDescriptor descriptor) {
+ @Override
+ protected void setDescriptor(SimpleConstraint descriptor) {
String queryClassName = getValue(QUERY_CLASS_NAME_PROPERTY);
query = ClassLoaderHelper.newInstance(queryClassName, JavaQuery.class);
if(query == null) {
@@ -30,6 +34,7 @@ public class JavaQueryConstraint extends AbstractConstraint {
}
}
+ @Override
public boolean match(Object selection) {
return query.match(selection);
}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/TrueConstraint.java b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/TrueConstraint.java
index 2d9e4401a15..db601af68e4 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/TrueConstraint.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/constraints/TrueConstraint.java
@@ -18,6 +18,7 @@ package org.eclipse.papyrus.infra.constraints.constraints;
*/
public class TrueConstraint extends AbstractConstraint {
+ @Override
public boolean match(Object selection) {
return true;
}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/providers/ConstraintTypeContentProvider.java b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/providers/ConstraintTypeContentProvider.java
index b350660604a..77a29b7f127 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/providers/ConstraintTypeContentProvider.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/providers/ConstraintTypeContentProvider.java
@@ -5,12 +5,14 @@ import org.eclipse.papyrus.infra.widgets.providers.AbstractFilteredContentProvid
import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
//TODO : Move that to customization.constraints
+/**
+ * A ContentProvider which returns Constraint types
+ *
+ *
+ * @author Camille Letavernier
+ */
public class ConstraintTypeContentProvider extends AbstractFilteredContentProvider implements IStaticContentProvider {
- public ConstraintTypeContentProvider() {
-
- }
-
public Object[] getElements() {
return ConstraintsManager.instance.getConstraintTypes().toArray();
}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/ConstraintEngine.java b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/ConstraintEngine.java
index 8b8b756d515..b29a1299e8c 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/ConstraintEngine.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/ConstraintEngine.java
@@ -23,14 +23,30 @@ import org.eclipse.papyrus.infra.constraints.DisplayUnit;
* to display for a given ISelection.
*
* @author Camille Letavernier
+ * @param <E>
+ * The type of DisplayUnit managed by this Constraint Engine
*/
public interface ConstraintEngine<E extends DisplayUnit> {
-
+ /**
+ * Returns the DisplayUnits matching the given selection
+ *
+ * @param forSelection
+ * @return
+ */
public Set<E> getDisplayUnits(ISelection forSelection);
+ /**
+ * Adds a constraint descriptor to this engine
+ *
+ * @param descriptor
+ */
public void addConstraint(ConstraintDescriptor descriptor);
+ /**
+ * Indicate that the available constraints might have changed
+ * Refreshes the Constraint Engine
+ */
public void refresh();
}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/ConstraintsManager.java b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/ConstraintsManager.java
index 97c9ec2dce1..512cd29593a 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/ConstraintsManager.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/ConstraintsManager.java
@@ -16,9 +16,19 @@ import org.eclipse.papyrus.infra.constraints.environment.ConstraintEnvironment;
import org.eclipse.papyrus.infra.constraints.environment.ConstraintType;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
-
+/**
+ * A singleton instance to manage constraints.
+ * The available constraints can be loaded from an extension point, or
+ * dynamically
+ *
+ * @author Camille Letavernier
+ *
+ */
public class ConstraintsManager {
+ /**
+ * The Constraints extension point ID
+ */
public final static String EXTENSION_ID = Activator.PLUGIN_ID + ".ConstraintEnvironment"; //$NON-NLS-1$
private ResourceSet resourceSet;
@@ -45,6 +55,15 @@ public class ConstraintsManager {
}
}
+ /**
+ * Adds a constraint environment model, which should be loaded at
+ * the given URI. The root element should be a {@link ConstraintEnvironment}
+ *
+ * @param uri
+ * The location of the model to load. Its root element should be a {@link ConstraintEnvironment}
+ * @throws IOException
+ * If the model cannot be loaded
+ */
public void addEnvironment(URI uri) throws IOException {
EObject model = EMFHelper.loadEMFModel(resourceSet, uri);
if(model instanceof ConstraintEnvironment) {
@@ -52,12 +71,27 @@ public class ConstraintsManager {
}
}
+ /**
+ * Adds a constraint environment model to the manager
+ *
+ * @param environment
+ * The {@link ConstraintEnvironment} to add to the manager
+ */
public void addEnvironment(ConstraintEnvironment environment) {
environments.add(environment);
}
+ /**
+ * The singleton instance of {@link ConstraintsManager}
+ */
public static ConstraintsManager instance = new ConstraintsManager();
+ /**
+ * Returns all {@link ConstraintType}s contained in the {@link ConstraintEnvironment} managed by this singleton
+ *
+ * @return
+ * All known {@link ConstraintType}s
+ */
public Collection<ConstraintType> getConstraintTypes() {
Collection<ConstraintType> constraintTypes = new HashSet<ConstraintType>();
for(ConstraintEnvironment environment : environments) {
diff --git a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/DefaultConstraintEngine.java b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/DefaultConstraintEngine.java
index e8f05ca9df0..e51f43cb1ad 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/DefaultConstraintEngine.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.constraints/src/org/eclipse/papyrus/infra/constraints/runtime/DefaultConstraintEngine.java
@@ -22,12 +22,17 @@ import org.eclipse.papyrus.infra.constraints.DisplayUnit;
import org.eclipse.papyrus.infra.constraints.constraints.Constraint;
/**
- * The default implementation for ConstraintEngine
+ * The default, generic implementation for ConstraintEngine
*
* @author Camille Letavernier
+ * @param <E>
+ * The type of DisplayUnit managed by this Constraint Engine
*/
public abstract class DefaultConstraintEngine<E extends DisplayUnit> implements ConstraintEngine<E> {
+ /**
+ * The constraints instantiated by this Engine
+ */
protected final Set<Constraint> constraints = new LinkedHashSet<Constraint>();
public abstract void refresh();
diff --git a/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/Activator.java b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/Activator.java
index 3fefb3f26c6..c41ea145653 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/Activator.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/Activator.java
@@ -9,12 +9,17 @@ import org.osgi.framework.BundleContext;
*/
public class Activator extends AbstractUIPlugin {
- // The plug-in ID
+ /**
+ * The plug-in ID
+ */
public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.tools"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
+ /**
+ * The plug-in's logger
+ */
public static LogHelper log;
/**
diff --git a/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/databinding/AggregatedObservable.java b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/databinding/AggregatedObservable.java
index ce180145b78..294506260ba 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/databinding/AggregatedObservable.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/databinding/AggregatedObservable.java
@@ -30,7 +30,7 @@ public interface AggregatedObservable extends IObservable {
* Typically, only IObservable with similar ValueTypes can be
* aggregated.
*
- * @param value
+ * @param observable
* The IObservable to aggregate to the current IObservable
* @return
* The aggregated IObservable, or null if the aggregation is not
@@ -40,6 +40,8 @@ public interface AggregatedObservable extends IObservable {
/**
* Tests if the sub-observables have different values
+ *
+ * @return true if the sub-observables have different values
*/
public boolean hasDifferentValues();
}
diff --git a/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/databinding/MultipleObservableValue.java b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/databinding/MultipleObservableValue.java
index 87546fa9db8..bd8dadf1e11 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/databinding/MultipleObservableValue.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/databinding/MultipleObservableValue.java
@@ -124,7 +124,7 @@ public class MultipleObservableValue extends AbstractObservableValue implements
}
@Override
- public void dispose() {
+ public synchronized void dispose() {
super.dispose();
for(IObservableValue observable : observableValues) {
observable.removeChangeListener(this);
@@ -132,6 +132,9 @@ public class MultipleObservableValue extends AbstractObservableValue implements
}
}
+ /**
+ * The {@link IObservableValue}s aggregated by this Observable
+ */
protected List<IObservableValue> observableValues = new LinkedList<IObservableValue>();
public boolean hasDifferentValues() {
diff --git a/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ListHelper.java b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ListHelper.java
index ae55a0d1565..2376440f512 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ListHelper.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ListHelper.java
@@ -39,10 +39,32 @@ public class ListHelper {
return result;
}
+ /**
+ * Invokes the toString() method recursively on this list's elements.
+ * The values are separated by ", "
+ *
+ * @param list
+ * The list whose string representation to return
+ * @return
+ *
+ * @see #deepToString(List, String)
+ */
public static String deepToString(List<?> list) {
return deepToString(list, ", ");
}
+ /**
+ * Invokes the toString() method recursively on this list's elements.
+ * The values are separated by the given separator
+ *
+ * @param list
+ * The list whose string representation to return
+ * @param separator
+ * The string to insert between each element's string representation
+ * @return
+ *
+ * @see #deepToString(List)
+ */
public static String deepToString(List<?> list, String separator) {
boolean firstElement = true;
String result = "";
diff --git a/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ReflectHelper.java b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ReflectHelper.java
index a8c706ef087..b80d2884630 100644
--- a/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ReflectHelper.java
+++ b/plugins/infra/org.eclipse.papyrus.infra.tools/src/org/eclipse/papyrus/infra/tools/util/ReflectHelper.java
@@ -1,3 +1,14 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *****************************************************************************/
package org.eclipse.papyrus.infra.tools.util;
import java.lang.reflect.Method;
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/creation/StringEditionFactory.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/creation/StringEditionFactory.java
index fad7f1ceacc..837eaddffe9 100644
--- a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/creation/StringEditionFactory.java
+++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/creation/StringEditionFactory.java
@@ -63,6 +63,7 @@ public class StringEditionFactory implements ReferenceValueFactory {
* Constructor.
*
* @param validator
+ * The InputValidator used to check the entered String
*/
public StringEditionFactory(IInputValidator validator) {
this.validator = validator;
@@ -135,11 +136,19 @@ public class StringEditionFactory implements ReferenceValueFactory {
* Sets the Validator for this factory
*
* @param validator
+ * The InputValidator to be used to check the input String
*/
public void setValidator(IInputValidator validator) {
this.validator = validator;
}
+ /**
+ * Sets the content provider for this edition factory. The ContentProvider is used
+ * to suggest values to the user.
+ *
+ * @param provider
+ * The provider which will make suggestions to the user
+ */
public void setContentProvider(IStaticContentProvider provider) {
this.contentProvider = provider;
}
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/CLabelObservableValue.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/CLabelObservableValue.java
index b98449d4c6d..8cb70e9ee49 100644
--- a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/CLabelObservableValue.java
+++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/CLabelObservableValue.java
@@ -19,21 +19,60 @@ import org.eclipse.papyrus.infra.tools.databinding.AggregatedObservable;
import org.eclipse.papyrus.infra.widgets.messages.Messages;
import org.eclipse.swt.custom.CLabel;
-
+/**
+ * An IObservableValue to edit a CLabel (Text + Image), based on a LabelProvider
+ * It supports AggregatedObservable
+ *
+ * @author Camille Letavernier
+ */
public class CLabelObservableValue extends AbstractObservableValue {
+ /**
+ * The observed CLabel
+ */
protected CLabel label;
+ /**
+ * The current value
+ */
protected Object currentValue;
+ /**
+ * The LabelProvider used to define the CLabel's text and image,
+ * based on the current value
+ */
protected ILabelProvider labelProvider;
+ /**
+ * If the CLabel may represent more than one value,
+ * use an AggregatedObservable
+ *
+ * May be null
+ */
protected AggregatedObservable aggregated;
+ /**
+ * Constructor
+ *
+ * @param label
+ * The observed CLabel
+ * @param modelObservable
+ * The Model IObservable
+ */
public CLabelObservableValue(CLabel label, IObservableValue modelObservable) {
this(label, modelObservable, null);
}
+ /**
+ * Constructor
+ *
+ * @param label
+ * The observed CLabel
+ * @param modelObservable
+ * The Model IObservable
+ * @param labelProvider
+ * The LabelProvider used to define the CLabel's text/image from the current value
+ */
public CLabelObservableValue(CLabel label, IObservableValue modelObservable, ILabelProvider labelProvider) {
this.label = label;
setLabelProvider(labelProvider);
@@ -42,6 +81,11 @@ public class CLabelObservableValue extends AbstractObservableValue {
}
}
+ /**
+ * @param labelProvider
+ * The LabelProvider used to define the CLabel's text and image,
+ * based on the current value
+ */
public void setLabelProvider(ILabelProvider labelProvider) {
if(labelProvider != null) {
this.labelProvider = labelProvider;
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/ComboObservableValue.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/ComboObservableValue.java
index 69f1e88b2aa..7eef9f9d7ac 100644
--- a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/ComboObservableValue.java
+++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/ComboObservableValue.java
@@ -25,15 +25,38 @@ import org.eclipse.papyrus.infra.widgets.providers.ComboLabelProvider;
import org.eclipse.papyrus.infra.widgets.providers.UnchangedObject;
import org.eclipse.papyrus.infra.widgets.providers.UnsetObject;
-
+/**
+ * An ObservableValue for a ComboViewer, with support for AggregatedObservable
+ *
+ * @author Camille Letavernier
+ */
public class ComboObservableValue extends AbstractObservableValue implements ISelectionChangedListener {
+ /**
+ * The Observed ComboViewer
+ */
protected ComboViewer viewer;
+ /**
+ * The current value
+ */
protected Object currentValue;
+ /**
+ * If the Combo may represent more than one value,
+ * use an AggregatedObservable
+ *
+ * May be null
+ */
protected AggregatedObservable modelProperty;
+ /**
+ *
+ * @param viewer
+ * The observed ComboViewer
+ * @param modelProperty
+ * The Model IObservable
+ */
public ComboObservableValue(ComboViewer viewer, IObservableValue modelProperty) {
this.viewer = viewer;
viewer.setLabelProvider(new ComboLabelProvider(viewer.getLabelProvider()));
@@ -79,7 +102,7 @@ public class ComboObservableValue extends AbstractObservableValue implements ISe
}
@Override
- public void dispose() {
+ public synchronized void dispose() {
viewer.removeSelectionChangedListener(this);
super.dispose();
}
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/GrayedCheckboxObservableValue.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/GrayedCheckboxObservableValue.java
index f7ee5bd120c..e41a8316e0a 100644
--- a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/GrayedCheckboxObservableValue.java
+++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/GrayedCheckboxObservableValue.java
@@ -14,6 +14,7 @@ package org.eclipse.papyrus.infra.widgets.databinding;
import org.eclipse.core.databinding.observable.value.AbstractObservableValue;
import org.eclipse.core.databinding.observable.value.ValueDiff;
import org.eclipse.papyrus.infra.tools.databinding.AggregatedObservable;
+import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.widgets.Button;
@@ -24,7 +25,6 @@ import org.eclipse.swt.widgets.Button;
* of {@link Button#getSelection()} and {@link Button#getGrayed()}
*
* @author Camille Letavernier
- * @see {@link BooleanWithDefaultState}
*/
public class GrayedCheckboxObservableValue extends AbstractObservableValue implements SelectionListener {
@@ -34,6 +34,14 @@ public class GrayedCheckboxObservableValue extends AbstractObservableValue imple
private AggregatedObservable aggregated;
+ /**
+ * Constructor
+ *
+ * @param checkbox
+ * The observed checkbox
+ * @param aggregated
+ * The Observable aggregating the various observable booleans
+ */
public GrayedCheckboxObservableValue(Button checkbox, AggregatedObservable aggregated) {
this.checkbox = checkbox;
this.checkbox.addSelectionListener(this);
@@ -70,7 +78,7 @@ public class GrayedCheckboxObservableValue extends AbstractObservableValue imple
}
@Override
- public void dispose() {
+ public synchronized void dispose() {
checkbox.removeSelectionListener(this);
super.dispose();
}
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/ReferenceDialogObservableValue.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/ReferenceDialogObservableValue.java
index 09e62043378..32a1298bd58 100644
--- a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/ReferenceDialogObservableValue.java
+++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/ReferenceDialogObservableValue.java
@@ -17,14 +17,38 @@ import org.eclipse.papyrus.infra.widgets.editors.ReferenceDialog;
import org.eclipse.swt.custom.CLabel;
+/**
+ * An ObservableValue for ReferenceDialog widget (Which displays
+ * the current value with a CLabel)
+ *
+ * @author Camille Letavernier
+ */
public class ReferenceDialogObservableValue extends CLabelObservableValue {
private ReferenceDialog referenceDialog;
+ /**
+ * @param dialog
+ * The observed ReferenceDialog
+ * @param label
+ * The observed CLabel (Should correspond to dialog#currentValueLabel)
+ * @param modelObservable
+ * The Model IObservable
+ */
public ReferenceDialogObservableValue(ReferenceDialog dialog, CLabel label, IObservableValue modelObservable) {
this(dialog, label, modelObservable, null);
}
+ /**
+ * @param dialog
+ * The observed ReferenceDialog
+ * @param label
+ * The observed CLabel (Should correspond to dialog#currentValueLabel)
+ * @param modelObservable
+ * The Model IObservable
+ * @param labelProvider
+ * The LabelProvider used to define the CLabel's text/image from the current value
+ */
public ReferenceDialogObservableValue(ReferenceDialog dialog, CLabel label, IObservableValue modelObservable, ILabelProvider labelProvider) {
super(label, modelObservable, labelProvider);
this.referenceDialog = dialog;
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/TextObservableValue.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/TextObservableValue.java
index eaa4b861cd5..441cb2bac02 100644
--- a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/TextObservableValue.java
+++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/TextObservableValue.java
@@ -1,6 +1,5 @@
package org.eclipse.papyrus.infra.widgets.databinding;
-import org.eclipse.core.databinding.observable.Realm;
import org.eclipse.core.databinding.observable.value.AbstractObservableValue;
import org.eclipse.core.databinding.observable.value.IObservableValue;
import org.eclipse.core.databinding.observable.value.ValueDiff;
@@ -11,6 +10,11 @@ import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
+/**
+ * An ObservableValue for Text field, with support for AggregatedObservable
+ *
+ * @author Camille Letavernier
+ */
public class TextObservableValue extends AbstractObservableValue implements Listener {
private Text text;
@@ -19,8 +23,25 @@ public class TextObservableValue extends AbstractObservableValue implements List
private Object currentValue;
+ /**
+ * If the Text field may represent more than one value,
+ * use an AggregatedObservable
+ *
+ * May be null
+ */
protected AggregatedObservable modelProperty;
+ /**
+ * Constructor
+ *
+ * @param text
+ * The Text field to observe
+ * @param modelProperty
+ * The model IObservableValue
+ * @param eventType
+ * The eventType to listen to. When the event is fired by the Text
+ * widget, this IObservableValue will fire a ChangeEvent
+ */
public TextObservableValue(Text text, IObservableValue modelProperty, int eventType) {
this.text = text;
this.eventType = eventType;
@@ -30,10 +51,6 @@ public class TextObservableValue extends AbstractObservableValue implements List
this.text.addListener(eventType, this);
}
- public TextObservableValue(Realm realm) {
- super(realm);
- }
-
public Object getValueType() {
return String.class;
}
@@ -48,7 +65,7 @@ public class TextObservableValue extends AbstractObservableValue implements List
}
@Override
- protected void doSetValue(Object value){
+ protected void doSetValue(Object value) {
if(modelProperty != null && modelProperty.hasDifferentValues()) {
this.text.setText(UnchangedObject.instance.toString());
this.currentValue = UnchangedObject.instance;
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/UnknownValueDiff.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/UnknownValueDiff.java
index 47818d3f4b9..3bb5cbbbb2f 100644
--- a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/UnknownValueDiff.java
+++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/databinding/UnknownValueDiff.java
@@ -14,6 +14,12 @@ package org.eclipse.papyrus.infra.widgets.databinding;
import org.eclipse.core.databinding.observable.value.ValueDiff;
+/**
+ * An empty ValueDiff, when the diff is not known (Or not important)
+ *
+ * @author Camille Letavernier
+ */
+@Deprecated
public class UnknownValueDiff extends ValueDiff {
@Override
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/AbstractEditor.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/AbstractEditor.java
index 2ffd0219d4e..ef26fe81227 100644
--- a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/AbstractEditor.java
+++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/AbstractEditor.java
@@ -282,6 +282,14 @@ public abstract class AbstractEditor extends Composite {
*/
public abstract boolean isReadOnly();
+ /**
+ * Indicates that this editor should notify its commit listeners
+ * when the given control looses the Focus
+ *
+ * @param control
+ * The control on which a FocusListener should be added,
+ * to notify the CommitListeners
+ */
protected void setCommitOnFocusLost(Control control) {
control.addFocusListener(new FocusListener() {
@@ -305,6 +313,12 @@ public abstract class AbstractEditor extends Composite {
}
}
+ /**
+ * Sets the given toolTip to the label
+ *
+ * @param text
+ * The new label's tooltip
+ */
protected void setLabelToolTipText(String text) {
toolTipText = text;
if(label != null && !label.isDisposed()) {
@@ -312,6 +326,14 @@ public abstract class AbstractEditor extends Composite {
}
}
+ /**
+ * Excludes or includes the given control from the layout
+ *
+ * @param control
+ * The control to exclude or include
+ * @param exclude
+ * If true, the control will be excluded ; otherwise, it will be included
+ */
protected void setExclusion(Control control, boolean exclude) {
if(control.getLayoutData() == null) {
GridData data = new GridData();
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/AbstractValueEditor.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/AbstractValueEditor.java
index 016ca92ca9a..503b9a52bf0 100644
--- a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/AbstractValueEditor.java
+++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/AbstractValueEditor.java
@@ -78,6 +78,14 @@ public abstract class AbstractValueEditor extends AbstractEditor {
setConverters(targetToModel, modelToTarget);
}
+ /**
+ * Sets this editor's widgetObservable
+ *
+ * @param widgetObservable
+ * The widget observable value
+ * @param commitOnChange
+ * If true, CommitListeners will be notified when the widget observable changes
+ */
protected void setWidgetObservable(IObservableValue widgetObservable, boolean commitOnChange) {
this.widgetObservable = widgetObservable;
if(commitOnChange) {
@@ -145,7 +153,7 @@ public abstract class AbstractValueEditor extends AbstractEditor {
*
* When overriding this method, you should also override {@link #refreshValue()}
*
- * @see org.eclipse.papyrus.infra.widgets.AbstractEditor#doBinding()
+ * @see org.eclipse.papyrus.infra.widgets.editors.AbstractEditor#doBinding()
*/
@Override
protected void doBinding() {
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanCheckbox.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanCheckbox.java
index 579ca8ac489..0d23d5bf0b3 100644
--- a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanCheckbox.java
+++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanCheckbox.java
@@ -120,6 +120,12 @@ public class BooleanCheckbox extends AbstractValueEditor {
checkbox.setText(label);
}
+ /**
+ * Sets this widget's value
+ *
+ * @param selected
+ * Whether the checkbox should be selected or not
+ */
public void setValue(Boolean selected) {
if(modelProperty != null) {
modelProperty.setValue(selected);
diff --git a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanToggle.java b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanToggle.java
index 348b96f4a8c..83147753f2b 100644
--- a/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanToggle.java
+++ b/plugins/infra/widget/org.eclipse.papyrus.infra.widgets/src/org/eclipse/papyrus/infra/widgets/editors/BooleanToggle.java
@@ -19,7 +19,13 @@ import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-
+/**
+ * A widget to represent boolean values as a Toggle Button.
+ * The Button may have either an Icon or a Text
+ *
+ * @author Camille Letavernier
+ *
+ */
public class BooleanToggle extends AbstractValueEditor {
private Button toggleButton;
@@ -61,12 +67,24 @@ public class BooleanToggle extends AbstractValueEditor {
this(parent, style, null, null, null);
}
+ /**
+ * Sets this button's text
+ *
+ * @param text
+ * The text to set to this button
+ */
public void setText(String text) {
if(text != null) {
toggleButton.setText(text);
}
}
+ /**
+ * Sets this button's image
+ *
+ * @param image
+ * The image to set to this button
+ */
public void setImage(Image image) {
if(image != null) {
toggleButton.setImage(image);
@@ -99,6 +117,12 @@ public class BooleanToggle extends AbstractValueEditor {
setLabelToolTipText(text);
}
+ /**
+ * Indicates whether this button should be selected or not
+ *
+ * @param isActive
+ * If true, the button will be selected
+ */
public void setValue(boolean isActive) {
toggleButton.setSelection(isActive);
}
diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/modelelement/StereotypeModelElement.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/modelelement/StereotypeModelElement.java
index 22926c67168..2466e1542a1 100644
--- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/modelelement/StereotypeModelElement.java
+++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/modelelement/StereotypeModelElement.java
@@ -37,6 +37,9 @@ import org.eclipse.uml2.uml.Stereotype;
*/
public class StereotypeModelElement extends EMFModelElement {
+ /**
+ * The stereotype handled by this ModelElement
+ */
protected Stereotype stereotype;
/**
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/Activator.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/Activator.java
index 9ad41aaf511..2178c533d67 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/Activator.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/Activator.java
@@ -22,12 +22,17 @@ import org.osgi.framework.BundleContext;
*/
public class Activator extends AbstractUIPlugin {
- // The plug-in ID
+ /**
+ * The plug-in ID
+ */
public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.tools"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
+ /**
+ * The plug-in's logger
+ */
public static LogHelper log;
/**
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/AbstractStereotypeListener.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/AbstractStereotypeListener.java
index 28d50108abb..fec56b97eda 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/AbstractStereotypeListener.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/AbstractStereotypeListener.java
@@ -16,15 +16,29 @@ import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.papyrus.uml.tools.listeners.PapyrusStereotypeListener;
-import org.eclipse.swt.widgets.Listener;
import org.eclipse.uml2.uml.Element;
+/**
+ * An Abstract implementation of a stereotype application listener.
+ * This object will listener on
+ *
+ * @author Camille Letavernier
+ *
+ */
public abstract class AbstractStereotypeListener implements Adapter {
private Element umlElement;
private Notifier target;
+ /**
+ * Constructors
+ *
+ * Adds a Stereotype application listener to the given UML Element
+ *
+ * @param umlElement
+ * The observed UML Element
+ */
public AbstractStereotypeListener(Element umlElement) {
this.umlElement = umlElement;
umlElement.eAdapters().add(this);
@@ -47,17 +61,23 @@ public abstract class AbstractStereotypeListener implements Adapter {
}
}
- protected abstract void handleUnappliedStereotype(EObject newValue);
+ /**
+ * Notifies this listener that a stereotype has been unapplied from
+ * the observed UML Element
+ *
+ * @param unappliedStereotype
+ * The stereotype which has been unapplied
+ */
+ protected abstract void handleUnappliedStereotype(EObject unappliedStereotype);
- protected abstract void handleAppliedStereotype(EObject newValue);
-
- public void addChangeListener(Listener listener) {
- //Nothing
- }
-
- public void removeChangeListener(Listener listener) {
- //Nothing
- }
+ /**
+ * Notifies this listener that a stereotype has been applied from
+ * the observed UML Element
+ *
+ * @param appliedStereotype
+ * The new applied stereotype
+ */
+ protected abstract void handleAppliedStereotype(EObject appliedStereotype);
public Notifier getTarget() {
return target;
@@ -71,6 +91,9 @@ public abstract class AbstractStereotypeListener implements Adapter {
return false;
}
+ /**
+ * Disposes this stereotype application listener
+ */
public void dispose() {
umlElement.eAdapters().remove(this);
for(EObject eObject : umlElement.getStereotypeApplications()) {
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/MultiplicityObservableValue.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/MultiplicityObservableValue.java
index 4bd516ba84e..32c9a39f7fc 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/MultiplicityObservableValue.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/MultiplicityObservableValue.java
@@ -170,7 +170,7 @@ public class MultiplicityObservableValue extends AbstractObservableValue impleme
}
@Override
- public void dispose() {
+ public synchronized void dispose() {
lowerValue.removeChangeListener(this);
upperValue.removeChangeListener(this);
if(lowerValueSpecification != null) {
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/NavigationObservableValue.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/NavigationObservableValue.java
index 25176ba2402..d2fff73971a 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/NavigationObservableValue.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/NavigationObservableValue.java
@@ -91,7 +91,7 @@ public class NavigationObservableValue extends AbstractObservableValue implement
}
@Override
- public void dispose() {
+ public synchronized void dispose() {
super.dispose();
ownerObservableList.removeChangeListener(this);
ownerObservableList.dispose();
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/OwnerObservableValue.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/OwnerObservableValue.java
index 343ddd8424c..05c7f10339e 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/OwnerObservableValue.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/OwnerObservableValue.java
@@ -114,7 +114,7 @@ public class OwnerObservableValue extends AbstractObservableValue implements ICh
}
@Override
- public void dispose() {
+ public synchronized void dispose() {
super.dispose();
navigableEndsObservableList.removeChangeListener(this);
navigableEndsObservableList.dispose();
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/PapyrusObservableList.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/PapyrusObservableList.java
index 7612cfaf66e..2c3945d4aba 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/PapyrusObservableList.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/PapyrusObservableList.java
@@ -70,18 +70,18 @@ public class PapyrusObservableList extends EMFObservableList {
* Creates an EMF command from a GMF request, with the given IElementEditService
*
* @param provider
- * @param request
+ * @param requests
* @return
* The EMF command corresponding to the given request
*/
protected Command getCommandFromRequests(IElementEditService provider, Collection<? extends IEditCommandRequest> requests) {
- if (requests.size() == 1) {
+ if(requests.size() == 1) {
return new GMFtoEMFCommandWrapper(provider.getEditCommand(requests.iterator().next()));
}
CompositeCommand cc = new CompositeCommand("Edit list");
- for (IEditCommandRequest request : requests) {
+ for(IEditCommandRequest request : requests) {
ICommand cmd = provider.getEditCommand(request);
cc.add(cmd);
}
@@ -239,16 +239,18 @@ public class PapyrusObservableList extends EMFObservableList {
/**
* Compute the requests
*
- * @param newValues the new list that will be set as a value of the observed feature
- * @param removedValues if element has been removed from the list put it there : it handles destroy of elements if the observed feature is a containment
+ * @param newValues
+ * the new list that will be set as a value of the observed feature
+ * @param removedValues
+ * if element has been removed from the list put it there : it handles destroy of elements if the observed feature is a containment
* @return
*/
protected Collection<? extends IEditCommandRequest> getRequests(List<Object> newValues, Collection<?> removedValues) {
LinkedList<IEditCommandRequest> requests = new LinkedList<IEditCommandRequest>();
- if (feature instanceof EReference && ((EReference)feature).isContainment() && removedValues != null) {
- for (Object o : removedValues) {
- if (o instanceof EObject) {
+ if(feature instanceof EReference && ((EReference)feature).isContainment() && removedValues != null) {
+ for(Object o : removedValues) {
+ if(o instanceof EObject) {
requests.add(new DestroyElementRequest((TransactionalEditingDomain)editingDomain, (EObject)o, false));
}
}
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProfileApplicationObservableList.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProfileApplicationObservableList.java
index 8fae850b406..4aaa16ff532 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProfileApplicationObservableList.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/databinding/ProfileApplicationObservableList.java
@@ -124,7 +124,7 @@ public class ProfileApplicationObservableList extends WritableList implements IC
}
@Override
- public void dispose() {
+ public synchronized void dispose() {
super.dispose();
this.listener.dispose();
}
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/helper/UMLDatabindingHelper.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/helper/UMLDatabindingHelper.java
index 19f4c63f16e..f16adcce1d6 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/helper/UMLDatabindingHelper.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/helper/UMLDatabindingHelper.java
@@ -1,3 +1,14 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
package org.eclipse.papyrus.uml.tools.helper;
import org.eclipse.core.databinding.observable.value.IObservableValue;
@@ -7,7 +18,11 @@ import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.edit.domain.EditingDomain;
import org.eclipse.papyrus.uml.tools.databinding.PapyrusObservableValue;
-
+/**
+ * A Helper class for UML Databinding
+ *
+ * @author Camille Letavernier
+ */
public class UMLDatabindingHelper {
/**
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/EditServiceValidator.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/EditServiceValidator.java
index 53774f2c6d6..5268bfe6746 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/EditServiceValidator.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/EditServiceValidator.java
@@ -1,17 +1,33 @@
-/*
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
*
- */
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
package org.eclipse.papyrus.uml.tools.providers;
-import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.gmf.runtime.emf.core.util.EMFCoreUtil;
import org.eclipse.gmf.runtime.emf.type.core.requests.SetRequest;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.uml.tools.Activator;
-
+/**
+ * A Validator based on the Papyrus EditService
+ * Tests whether a given Object is a valid value for a specific
+ * feature on an EObject
+ *
+ * @author Camille Letavernier
+ *
+ */
public class EditServiceValidator {
private EObject editedEObject;
@@ -20,6 +36,12 @@ public class EditServiceValidator {
private IElementEditService editingService;
+ /**
+ * Constructor
+ *
+ * @param editedEObject
+ * @param editedFeature
+ */
public EditServiceValidator(EObject editedEObject, EStructuralFeature editedFeature) {
this.editedEObject = editedEObject;
this.editedFeature = editedFeature;
@@ -30,13 +52,21 @@ public class EditServiceValidator {
if(this.editingService == null) {
// log error service not found...
- System.err.println("Could not create service for " + EMFCoreUtil.getQualifiedName(editedEObject, true));
+ Activator.log.warn("Could not create service for " + EMFCoreUtil.getQualifiedName(editedEObject, true));
}
}
+ /**
+ * Tests whether the given element is a valid value,
+ * i.e. can be used as a value to edit this EObject/Feature pair
+ *
+ * @param element
+ * @return
+ * True if the given element is valid
+ */
public boolean isValidValue(Object element) {
// Get semantic element
- EObject semanticElement = getSemanticElement(element);
+ EObject semanticElement = EMFHelper.getEObject(element);
if((semanticElement == null) && (element != null)) {
return false;
}
@@ -49,18 +79,4 @@ public class EditServiceValidator {
return false;
}
-
- private EObject getSemanticElement(Object object) {
- EObject adapted = null;
-
- if(object instanceof EObject) {
- adapted = (EObject)object;
-
- } else if(object instanceof IAdaptable) {
- adapted = (EObject)((IAdaptable)object).getAdapter(EObject.class);
-
- }
-
- return adapted;
- }
}
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/SemanticUMLContentProvider.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/SemanticUMLContentProvider.java
index 86e33d1035b..e74fd039ccc 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/SemanticUMLContentProvider.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/SemanticUMLContentProvider.java
@@ -26,7 +26,11 @@ import org.eclipse.papyrus.uml.tools.utils.UMLUtil;
import org.eclipse.uml2.uml.Element;
import org.eclipse.uml2.uml.Stereotype;
-
+/**
+ * A semantic Hierarchic Content Provider for UML
+ *
+ * @author Camille Letavernier
+ */
public class SemanticUMLContentProvider extends SemanticEMFContentProvider {
public SemanticUMLContentProvider(EObject editedEObject, EStructuralFeature feature, EObject[] roots) {
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/UMLContainerContentProvider.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/UMLContainerContentProvider.java
index d4e97b6df7c..94715e21c1e 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/UMLContainerContentProvider.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/UMLContainerContentProvider.java
@@ -19,6 +19,13 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+/**
+ * A semantic Hierarchic Content Provider, which only browses the UML Containment tree.
+ * Standard references are ignored
+ *
+ * @author Camille Letavernier
+ *
+ */
public class UMLContainerContentProvider extends SemanticUMLContentProvider {
protected EClass type;
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/UMLLabelProvider.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/UMLLabelProvider.java
index 692b68d7ed2..e3de00cf45d 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/UMLLabelProvider.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/providers/UMLLabelProvider.java
@@ -32,6 +32,12 @@ import org.eclipse.uml2.uml.Type;
import org.eclipse.uml2.uml.ValueSpecification;
import org.eclipse.uml2.uml.util.UMLUtil;
+/**
+ * A global LabelProvider for UML
+ *
+ * @author Camille Letavernier
+ *
+ */
public class UMLLabelProvider extends EMFLabelProvider implements ILabelProvider {
/** icon for metaclass */
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/util/UMLProviderHelper.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/util/UMLProviderHelper.java
index 9b460306eab..e0bce2f435d 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/util/UMLProviderHelper.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/util/UMLProviderHelper.java
@@ -25,6 +25,11 @@ import org.eclipse.papyrus.infra.widgets.strategy.TreeBrowseStrategy;
import org.eclipse.papyrus.uml.tools.providers.UMLContainmentBrowseStrategy;
+/**
+ * A Helper class for UML Content Providers
+ *
+ * @author Camille Letavernier
+ */
public class UMLProviderHelper {
/**

Back to the top