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
415f3e93
Commit
415f3e93
authored
8 years ago
by
Vincent Aravantinos
Browse files
Options
Downloads
Patches
Plain Diff
adds further utility methods
refs 2334
parent
2c608748
No related branches found
Branches containing commit
No related tags found
Tags containing commit
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
+33
-4
33 additions, 4 deletions
...rg/fortiss/tooling/kernel/ui/util/ConstraintsUIUtils.java
with
33 additions
and
4 deletions
org.fortiss.tooling.kernel.ui/trunk/src/org/fortiss/tooling/kernel/ui/util/ConstraintsUIUtils.java
+
33
−
4
View file @
415f3e93
...
...
@@ -24,10 +24,12 @@ import java.util.List;
import
java.util.function.Function
;
import
org.eclipse.emf.ecore.EObject
;
import
org.eclipse.jface.dialogs.MessageDialog
;
import
org.eclipse.jface.viewers.ColumnLabelProvider
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.graphics.Color
;
import
org.eclipse.swt.widgets.Display
;
import
org.eclipse.swt.widgets.Shell
;
import
org.fortiss.tooling.kernel.extension.data.IConstraintViolation
;
import
org.fortiss.tooling.kernel.extension.data.IConstraintViolation.ESeverity
;
import
org.fortiss.tooling.kernel.model.constraints.ConstrainedWithChecksum
;
...
...
@@ -48,7 +50,7 @@ import org.fortiss.tooling.kernel.utils.EcoreUtils;
* @author aravantinos
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash:
8E535AAF5BE563F94B385D091D10B45E
* @ConQAT.Rating YELLOW Hash:
57BDB29B589BA33DA52FC4380EC8A7F2
*/
public
class
ConstraintsUIUtils
{
...
...
@@ -187,18 +189,29 @@ public class ConstraintsUIUtils {
public
static
void
triggerMarkerRefresh
(
String
id
,
IConstraintContainer
cstrContainer
)
{
for
(
Constraint
c
:
cstrContainer
.
getConstraints
())
{
if
(
c
.
getConstraintTypeID
().
equals
(
id
))
{
ConstraintsUIUtils
.
triggerMarkersRefresh
(
c
);
triggerMarkersRefresh
(
c
);
}
}
}
/**
* @param constraints
* Calls <code>triggerMarkersRefresh</code> on every constraint of
* <code>constraints</code>.
*/
public
static
void
triggerMarkerRefresh
(
List
<
Constraint
>
constraints
)
{
for
(
Constraint
c
:
constraints
)
{
triggerMarkersRefresh
(
c
);
}
}
/**
* @param c
* @return Standard text describing the status of <code>c</code>.
*/
public
static
String
getText
(
Constraint
c
)
{
if
(
c
==
null
)
{
return
""
;
return
"
NOT APPLICABLE
"
;
}
String
mainMsg
=
"ERROR"
;
IConstraintVerificationStatus
status
=
...
...
@@ -240,7 +253,7 @@ public class ConstraintsUIUtils {
public
static
Color
getColor
(
Constraint
c
)
{
Display
display
=
Display
.
getCurrent
();
if
(
c
==
null
)
{
return
display
.
getSystemColor
(
SWT
.
COLOR_
GRAY
);
return
display
.
getSystemColor
(
SWT
.
COLOR_
WIDGET_BACKGROUND
);
}
IConstraintVerificationStatus
status
=
IConstraintVerificationUIService
.
getInstance
().
getStatus
(
c
);
...
...
@@ -305,4 +318,20 @@ public class ConstraintsUIUtils {
return
IConstraintVerificationUIService
.
getInstance
().
getStatus
(
constraint
)
!=
null
;
}
/**
* Standard warning message to display when a resource-consuming check is activated for the
* first time.
*/
public
static
void
displayTimeConsumptionWarning
(
String
id
)
{
Display
d
=
Display
.
getCurrent
();
d
=
d
==
null
?
Display
.
getDefault
()
:
d
;
Shell
shell
=
d
.
getActiveShell
();
String
title
=
"Background operation about to start"
;
String
msg
=
"AutoFOCUS will now go through your project to check that "
;
msg
+=
IConstraintVerificationUIService
.
getInstance
().
getDescription
(
id
)
+
". "
;
msg
+=
"This might slow down your system.\n\n"
;
msg
+=
"Note that this is a one-time thing: once the check is activated, "
;
msg
+=
"subsequent runs should be unnoticed."
;
MessageDialog
.
openWarning
(
shell
,
title
,
msg
);
}
}
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