From 62b8f1cf0a5ffa5d4b3f504a77da775fb35b8bd1 Mon Sep 17 00:00:00 2001 From: Johannes Eder <eder@fortiss.org> Date: Thu, 13 Aug 2020 14:35:17 +0200 Subject: [PATCH] YELLOW Issue-Ref: 4018 Issue-Url: https://af3-developer.fortiss.org/issues/4018 Signed-off-by: Johannes Eder <eder@fortiss.org> --- .../kernel/ui/internal/views/fx/.ratings | 2 +- .../views/fx/ErrorViewFXLayoutController.java | 42 +++++-------------- 2 files changed, 11 insertions(+), 33 deletions(-) diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/fx/.ratings b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/fx/.ratings index ba52f648c..e2aeff032 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/fx/.ratings +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/fx/.ratings @@ -1,4 +1,4 @@ -ErrorViewFXLayoutController.java f0fab75e30e8f82818b98ed42ab5e34b3dc83b11 RED +ErrorViewFXLayoutController.java 382b8014acf4b0c625817d6279dfcdd670296cb2 YELLOW ErrorViewFXViewPart.java f620022aef647d7a019be8afc5351fabde05dcee GREEN MarkerViewFXContentProvider.java ecf92449414b2b8648ad151bc932189baa23dc12 GREEN MarkerViewFXUIProvider.java c5719d95ac7bd5605fff65d6150eca8b9ca6fc02 GREEN diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/fx/ErrorViewFXLayoutController.java b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/fx/ErrorViewFXLayoutController.java index f0fab75e3..382b8014a 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/fx/ErrorViewFXLayoutController.java +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/fx/ErrorViewFXLayoutController.java @@ -81,53 +81,31 @@ public class ErrorViewFXLayoutController extends CompositeFXControllerBase<Node, /** Called when debug checkbox is pushed. */ public void onDebugBtn() { - if(!debugBtn.isSelected()) { - // FIXME (AB) Usage of static import (Ctrl-Shift-M) is mandatory in coding guidelines. - // Also applies to the further occurrences below. - toggleState.put(ESeverity.DEBUG, true); - } else { - toggleState.put(ESeverity.DEBUG, false); - } + toggleState.put(DEBUG, debugBtn.isSelected()); refresh(); } /** Called when info check-box is pushed. */ public void onInfoBtn() { - if(infoBtn.isSelected()) { - toggleState.put(ESeverity.INFO, true); - } else { - toggleState.put(ESeverity.INFO, false); - } + toggleState.put(INFO, infoBtn.isSelected()); refresh(); } /** Called when warning check-box is pushed. */ public void onWarningBtn() { - if(warningBtn.isSelected()) { - toggleState.put(ESeverity.WARNING, true); - } else { - toggleState.put(ESeverity.WARNING, false); - } + toggleState.put(WARNING, warningBtn.isSelected()); refresh(); } /** Called when error check-box is pushed. */ public void onErrorBtn() { - if(errorBtn.isSelected()) { - toggleState.put(ESeverity.ERROR, true); - } else { - toggleState.put(ESeverity.ERROR, false); - } + toggleState.put(ERROR, errorBtn.isSelected()); refresh(); } /** Called when fatal check-box is pushed. */ public void onFatalBtn() { - if(fatalBtn.isSelected()) { - toggleState.put(ESeverity.FATAL, true); - } else { - toggleState.put(ESeverity.FATAL, false); - } + toggleState.put(FATAL, fatalBtn.isSelected()); refresh(); } @@ -155,32 +133,32 @@ public class ErrorViewFXLayoutController extends CompositeFXControllerBase<Node, treeTable.addColumn("Project", 80); // set up icons - ImageView debugImg = IMarkerService.getInstance().getFXImageFor(ESeverity.DEBUG, false); + ImageView debugImg = IMarkerService.getInstance().getFXImageFor(DEBUG, false); debugBtn.setGraphic(debugImg); debugBtn.setText(""); debugBtn.setTooltip(createToolTip(DEBUG.name())); toggleState.put(DEBUG, false); - ImageView errorImg = IMarkerService.getInstance().getFXImageFor(ESeverity.ERROR, false); + ImageView errorImg = IMarkerService.getInstance().getFXImageFor(ERROR, false); errorBtn.setGraphic(errorImg); errorBtn.setText(""); errorBtn.setTooltip(createToolTip(ERROR.name())); toggleState.put(ERROR, true); errorBtn.setSelected(true); - ImageView fatalImg = IMarkerService.getInstance().getFXImageFor(ESeverity.FATAL, false); + ImageView fatalImg = IMarkerService.getInstance().getFXImageFor(FATAL, false); fatalBtn.setGraphic(fatalImg); fatalBtn.setText(""); fatalBtn.setTooltip(createToolTip(FATAL.name())); toggleState.put(FATAL, false); - ImageView infoImg = IMarkerService.getInstance().getFXImageFor(ESeverity.INFO, false); + ImageView infoImg = IMarkerService.getInstance().getFXImageFor(INFO, false); infoBtn.setGraphic(infoImg); infoBtn.setText(""); infoBtn.setTooltip(createToolTip(INFO.name())); toggleState.put(INFO, false); - ImageView warnImg = IMarkerService.getInstance().getFXImageFor(ESeverity.WARNING, false); + ImageView warnImg = IMarkerService.getInstance().getFXImageFor(WARNING, false); warningBtn.setGraphic(warnImg); warningBtn.setText(""); warningBtn.setTooltip(createToolTip(WARNING.name())); -- GitLab