Skip to content
Snippets Groups Projects
Commit 93c4f10e authored by Vincent Aravantinos's avatar Vincent Aravantinos
Browse files

YELLOW

parent 3fdd665b
No related branches found
No related tags found
No related merge requests found
...@@ -54,9 +54,8 @@ import org.fortiss.tooling.kernel.utils.EcoreUtils; ...@@ -54,9 +54,8 @@ import org.fortiss.tooling.kernel.utils.EcoreUtils;
* @author aravantinos * @author aravantinos
* @author $Author$ * @author $Author$
* @version $Rev$ * @version $Rev$
* @ConQAT.Rating YELLOW Hash: 97453A8CA6928F43F260FB918B4C1AA4 * @ConQAT.Rating YELLOW Hash: B7B5322692639BE0093B6969ADC18BC6
*/ */
// TODO (FH): remove @params or document
public class ConstraintsUIUtils { public class ConstraintsUIUtils {
/** Gathers some statuses by verification status. */ /** Gathers some statuses by verification status. */
...@@ -83,10 +82,7 @@ public class ConstraintsUIUtils { ...@@ -83,10 +82,7 @@ public class ConstraintsUIUtils {
} }
} }
/** /** Returns {@link ClassifiedStatuses} corresponding to <code>constrained</code>. */
* @param constrained
* @return {@link ClassifiedStatuses} corresponding to <code>constrained</code>.
*/
public static ClassifiedStatuses getClassifiedStatuses(IConstrained constrained) { public static ClassifiedStatuses getClassifiedStatuses(IConstrained constrained) {
ClassifiedStatuses res = new ClassifiedStatuses(); ClassifiedStatuses res = new ClassifiedStatuses();
for(ConstraintInstance constraint : constrained.getConstraintInstances()) { for(ConstraintInstance constraint : constrained.getConstraintInstances()) {
...@@ -108,10 +104,7 @@ public class ConstraintsUIUtils { ...@@ -108,10 +104,7 @@ public class ConstraintsUIUtils {
return res; return res;
} }
/** /** Returns {@link ESeverity} corresponding to the status of the constraint <code>c</code> */
* @param c
* @return {@link ESeverity} corresponding to the status of the constraint <code>c</code>
*/
public static ESeverity getConstraintSeverity(ConstraintInstance c) { public static ESeverity getConstraintSeverity(ConstraintInstance c) {
IConstraintInstanceStatus status = IConstraintUIService.getInstance().getStatus(c); IConstraintInstanceStatus status = IConstraintUIService.getInstance().getStatus(c);
if(IConstraintUIService.getInstance().shallDisplayAsWarning(c)) { if(IConstraintUIService.getInstance().shallDisplayAsWarning(c)) {
...@@ -132,10 +125,7 @@ public class ConstraintsUIUtils { ...@@ -132,10 +125,7 @@ public class ConstraintsUIUtils {
} }
} }
/** /** Returns severity corresponding to the status of the constraints of <code>c</code>. */
* @param c
* @return Severity corresponding to the status of the constraints of <code>c</code>.
*/
public static ESeverity getSeverity(IConstrained c) { public static ESeverity getSeverity(IConstrained c) {
try { try {
return c.getConstraintInstances().stream().map(cstr -> getConstraintSeverity(cstr)) return c.getConstraintInstances().stream().map(cstr -> getConstraintSeverity(cstr))
...@@ -146,12 +136,8 @@ public class ConstraintsUIUtils { ...@@ -146,12 +136,8 @@ public class ConstraintsUIUtils {
} }
/** /**
* @param sev * Returns the maximum severity between <code>sev</code> and the severity resulting of possibly
* @param modelElement * unsatisfied constraints on <code>modelElement</code>.
* @return the maximum severity between <code>sev</code> and the severity resulting of possibly
* unsatisfied constraints on <code>modelElement</code>.
*
* Note: if, later on, {@link IConstraintViolation}
*/ */
public static ESeverity augmentSeverityWithConstraintSeverity(ESeverity sev, public static ESeverity augmentSeverityWithConstraintSeverity(ESeverity sev,
EObject modelElement) { EObject modelElement) {
...@@ -210,9 +196,7 @@ public class ConstraintsUIUtils { ...@@ -210,9 +196,7 @@ public class ConstraintsUIUtils {
} }
} }
/** /** Returns a standard text describing the status of <code>c</code>. */
* @return Standard text describing the status of <code>c</code>.
*/
public static String getText(ConstraintInstance c) { public static String getText(ConstraintInstance c) {
if(c == null) { if(c == null) {
return ""; return "";
...@@ -231,10 +215,7 @@ public class ConstraintsUIUtils { ...@@ -231,10 +215,7 @@ public class ConstraintsUIUtils {
return mainMsg; return mainMsg;
} }
/** /** Returns a standard "hint" indicating possible action on the status of <code>c</code>. */
* @param c
* @return Standard "hint" indicating possible action on the status of <code>c</code>.
*/
public static String getHint(ConstraintInstance c) { public static String getHint(ConstraintInstance c) {
if(c == null) { if(c == null) {
return ""; return "";
...@@ -248,10 +229,7 @@ public class ConstraintsUIUtils { ...@@ -248,10 +229,7 @@ public class ConstraintsUIUtils {
return ""; return "";
} }
/** /** Returns a standard color corresponding to the status of <code>c</code>. */
* @param c
* @return Standard colour corresponding to the status of <code>c</code>.
*/
public static Color getColor(ConstraintInstance c) { public static Color getColor(ConstraintInstance c) {
Display display = Display.getCurrent(); Display display = Display.getCurrent();
if(c == null) { if(c == null) {
...@@ -313,10 +291,7 @@ public class ConstraintsUIUtils { ...@@ -313,10 +291,7 @@ public class ConstraintsUIUtils {
} }
} }
/** /** Returns <code>true</code> iff <code>constraint</code> is active. */
* @param constraint
* @return <code>true</code> if <code>constraint</code> is active.
*/
public static boolean isConstraintActive(ConstraintInstance constraint) { public static boolean isConstraintActive(ConstraintInstance constraint) {
return IConstraintUIService.getInstance().getStatus(constraint) != null; return IConstraintUIService.getInstance().getStatus(constraint) != null;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment