diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/ErrorViewFX/ErrorViewFXLayoutController.java b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/ErrorViewFX/ErrorViewFXLayoutController.java index 68a573d7e397d15eeab4e3c0b0051aa239f22ac9..2d36daaff299924e9b8e079b99d2155b21a579b3 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/ErrorViewFX/ErrorViewFXLayoutController.java +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/ErrorViewFX/ErrorViewFXLayoutController.java @@ -16,6 +16,7 @@ package org.fortiss.tooling.kernel.ui.internal.views.ErrorViewFX; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -69,7 +70,7 @@ public class ErrorViewFXLayoutController extends CompositeFXControllerBase<Node, /** Toggle State */ @SuppressWarnings("unused") - private Map<ESeverity, Boolean> toggleState; + private Map<ESeverity, Boolean> toggleState = new HashMap<ESeverity, Boolean>(); /** */ List<ESeverity> SevrList = new ArrayList<ESeverity>(); @@ -84,50 +85,53 @@ public class ErrorViewFXLayoutController extends CompositeFXControllerBase<Node, /** Called when debug checkbox is pushed. */ public void onDebugBtn() { - if(!debugBtn.isPressed()) { - btnOption = 3; + if(!debugBtn.isSelected()) { + toggleState.put(ESeverity.DEBUG, true); } else { - btnOption = 0; + toggleState.remove(ESeverity.DEBUG); } initialize(); } - /** Called when info checkbox is pushed. */ + /** Called when info check-box is pushed. */ public void onInfoBtn() { - if(!infoBtn.isPressed()) { - btnOption = 4; + if(infoBtn.isSelected()) { + toggleState.put(ESeverity.INFO, true); } else { - btnOption = 0; + toggleState.remove(ESeverity.INFO); } initialize(); } - /** Called when warning checkbox is pushed. */ + /** Called when warning check-box is pushed. */ public void onWarningBtn() { - if(!warningBtn.isPressed()) { - btnOption = 2; + + if(warningBtn.isSelected()) { + toggleState.put(ESeverity.WARNING, true); } else { - btnOption = 0; + toggleState.remove(ESeverity.WARNING); } initialize(); } - /** Called when error checkbox is pushed. */ + /** Called when error check-box is pushed. */ public void onErrorBtn() { - if(!errorBtn.isPressed()) { - btnOption = 1; + if(errorBtn.isSelected()) { + toggleState.put(ESeverity.ERROR, true); } else { - btnOption = 0; + toggleState.remove(ESeverity.ERROR); } initialize(); + } - /** Called when fatal checkbox is pushed. */ + /** Called when fatal check-box is pushed. */ public void onFatalBtn() { - if(!fatalBtn.isPressed()) { - btnOption = 5; - } else { - btnOption = 0; + if(fatalBtn.isSelected()) { + toggleState.put(ESeverity.FATAL, true); + } + if(fatalBtn.isPressed()) { + toggleState.remove(ESeverity.FATAL); } initialize(); } @@ -142,47 +146,12 @@ public class ErrorViewFXLayoutController extends CompositeFXControllerBase<Node, @Override public void initialize() { - // To Complete (Under Construction): Currently the can only have filtering for only one type - // of Severity - // Johannes: need suggestion/feedback to complete it also please help me with grouping the - // severities w.r.t labels - switch(btnOption) { - case 0: // for showing all the Severities - SevrList.clear(); - SevrList.add(ESeverity.ERROR); - SevrList.add(ESeverity.WARNING); - SevrList.add(ESeverity.DEBUG); - SevrList.add(ESeverity.FATAL); - SevrList.add(ESeverity.INFO); - SevrList.add(ESeverity.NONE); - break; - case 1: // for showing only Error - SevrList.clear(); - SevrList.add(ESeverity.ERROR); - break; - case 2: // for showing only Warning - SevrList.clear(); - SevrList.add(ESeverity.WARNING); - break; - case 3: // for showing Debug - SevrList.clear(); - SevrList.add(ESeverity.DEBUG); - break; - case 4: // for showing Info - SevrList.clear(); - SevrList.add(ESeverity.INFO); - break; - case 5: // for showing Fatal - SevrList.clear(); - SevrList.add(ESeverity.FATAL); - break; - } - DynamicTreeContentProviderBase<Object> contentProvider = new MarkerViewFXContentProvider(); DynamicTreeTableUIProviderBase<Object> uiProvider = new MarkerViewFXUIProvider(this); + SevrList.clear(); + SevrList.addAll(toggleState.keySet()); DynamicTreeTableViewer<Object> treeTable = new DynamicTreeTableViewer<Object>(SevrList, false, 2, contentProvider, uiProvider); - treeTable.addColumn("Severity", 80); treeTable.addColumn("Element", 80); treeTable.addColumn("Explanation", 80); diff --git a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/ErrorViewFX/ErrorViewFXViewPart.java b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/ErrorViewFX/ErrorViewFXViewPart.java index 923ec8ae724cf521fe9e995a2b54f2d7e84a36de..d5f078f2193246a4d69c118f23a3541f62dc0055 100644 --- a/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/ErrorViewFX/ErrorViewFXViewPart.java +++ b/org.fortiss.tooling.kernel.ui/src/org/fortiss/tooling/kernel/ui/internal/views/ErrorViewFX/ErrorViewFXViewPart.java @@ -15,20 +15,12 @@ +--------------------------------------------------------------------------*/ package org.fortiss.tooling.kernel.ui.internal.views.ErrorViewFX; -import static org.fortiss.tooling.kernel.extension.data.IConstraintViolation.ESeverity.DEBUG; -import static org.fortiss.tooling.kernel.extension.data.IConstraintViolation.ESeverity.ERROR; -import static org.fortiss.tooling.kernel.extension.data.IConstraintViolation.ESeverity.FATAL; -import static org.fortiss.tooling.kernel.extension.data.IConstraintViolation.ESeverity.INFO; -import static org.fortiss.tooling.kernel.extension.data.IConstraintViolation.ESeverity.WARNING; - import java.util.HashMap; import java.util.Map; -import org.eclipse.jface.action.Action; import org.fortiss.tooling.common.ui.javafx.AF3FXViewPart; import org.fortiss.tooling.kernel.extension.data.IConstraintViolation.ESeverity; import org.fortiss.tooling.kernel.ui.internal.MarkerService; -import org.fortiss.tooling.kernel.ui.internal.views.MarkerViewerGUI; import org.fortiss.tooling.kernel.ui.service.IMarkerService; /** @@ -55,30 +47,20 @@ public class ErrorViewFXViewPart extends AF3FXViewPart { /** Stores the toggle state of for each severity level. */ private static Map<ESeverity, Boolean> toggleState = new HashMap<ESeverity, Boolean>(); - /** GUI builder viewer instance. */ - private MarkerViewerGUI gui; - - /** Toggle expert severity filter actions. */ - private Action[] toggleSeverityFilterAction = new Action[5]; - /** Constructor. */ public ErrorViewFXViewPart() throws Exception { super(new ErrorViewFXLayoutController(toggleState), null); ((MarkerService)IMarkerService.getInstance()).setMarkerViewPart(this); - toggleState.put(DEBUG, false); - toggleState.put(INFO, false); - toggleState.put(WARNING, true); - toggleState.put(ERROR, true); - toggleState.put(FATAL, false); } - /** Called when there are error amrker updates. */ + /** Called when there are error marker updates. */ public void refresh() { } /** Returns toggleState. */ /* package */Boolean getToggleState(ESeverity sev) { + return toggleState.get(sev); } }