Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
af3
AF3
Commits
d8aa3b97
Commit
d8aa3b97
authored
Jan 04, 2018
by
Vivek Nigam
Browse files
Adding missing UI for the NoVAL constraint.
refs 3224
parent
7bf5c030
Changes
1
Hide whitespace changes
Inline
Side-by-side
org.fortiss.af3.specification.ui/trunk/src/org/fortiss/af3/specification/ui/constraint/AdmissibleNoValUI.java
0 → 100644
View file @
d8aa3b97
/*-------------------------------------------------------------------------+
| Copyright 2017 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package
org.fortiss.af3.specification.ui.constraint
;
import
static
org
.
fortiss
.
tooling
.
kernel
.
utils
.
ConstraintsUtils
.
getFirstConstrained
;
import
java.util.Arrays
;
import
java.util.List
;
import
org.fortiss.af3.component.model.Component
;
import
org.fortiss.af3.specification.constraint.FailedNoValAdmin
;
import
org.fortiss.tooling.kernel.model.constraints.ConstraintInstance
;
import
org.fortiss.tooling.kernel.model.constraints.FailedConstraintInstanceStatus
;
import
org.fortiss.tooling.kernel.model.constraints.IConstraintInstanceStatus
;
import
org.fortiss.tooling.kernel.ui.extension.base.ConstraintUIBases.ConstraintUIBaseAutocheck
;
import
org.fortiss.tooling.kernel.ui.service.IConstraintUIService.IFix
;
import
org.fortiss.tooling.kernel.ui.util.ConstraintsUIUtils.FixBase
;
/**
*
* @author vivek
*/
public
class
AdmissibleNoValUI
extends
ConstraintUIBaseAutocheck
{
/** {@inheritDoc} */
@Override
public
String
getDescription
()
{
return
"Provided all inputs have values, then all outputs ports have a values (different from NoVal)."
;
}
/** {@inheritDoc} */
@Override
public
boolean
shouldBeManuallyActivated
()
{
return
true
;
}
/** {@inheritDoc} */
@Override
public
List
<
IFix
>
fixes
(
ConstraintInstance
ci
,
IConstraintInstanceStatus
status
)
{
if
(
status
instanceof
FailedConstraintInstanceStatus
)
{
String
compName
=
((
Component
)
getFirstConstrained
(
ci
)).
getName
();
if
(
compName
!=
null
&&
compName
.
isEmpty
()
==
false
)
{
String
splitFix
=
compName
+
((
FailedNoValAdmin
)
status
).
getMsg
();
return
Arrays
.
asList
(
new
FixBase
(
splitFix
,
s
->
compName
.
toString
()));
}
}
return
super
.
fixes
(
ci
,
status
);
}
}
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment