Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
kernel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
af3
kernel
Commits
93c4f10e
Commit
93c4f10e
authored
7 years ago
by
Vincent Aravantinos
Browse files
Options
Downloads
Patches
Plain Diff
YELLOW
parent
3fdd665b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/ConstraintsUIUtils.java
+10
-35
10 additions, 35 deletions
...rg/fortiss/tooling/kernel/ui/util/ConstraintsUIUtils.java
with
10 additions
and
35 deletions
org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/ConstraintsUIUtils.java
+
10
−
35
View file @
93c4f10e
...
@@ -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
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment