Skip to content
Snippets Groups Projects

4018 error view java fx

Merged Saad bin Abid requested to merge 4018_ErrorViewJavaFX into master
5 files
+ 49
82
Compare changes
  • Side-by-side
  • Inline
Files
5
@@ -15,9 +15,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;
import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeContentProviderBase;
@@ -25,6 +23,8 @@ import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeTab
import org.fortiss.tooling.common.ui.javafx.control.treetableview.DynamicTreeTableViewer;
import org.fortiss.tooling.common.ui.javafx.layout.CompositeFXControllerBase;
import org.fortiss.tooling.kernel.extension.data.IConstraintViolation.ESeverity;
import org.fortiss.tooling.kernel.ui.internal.MarkerService;
import org.fortiss.tooling.kernel.ui.service.IMarkerService;
import javafx.fxml.FXML;
import javafx.scene.Node;
@@ -32,16 +32,10 @@ import javafx.scene.control.CheckBox;
import javafx.scene.layout.BorderPane;
/**
*
*
* Controller class for the "marker view". References the FXML layout and contains all control
*
* logic.
*
*
*
* @author abid
*
*/
public class ErrorViewFXLayoutController extends CompositeFXControllerBase<Node, Node> {
@@ -65,22 +59,16 @@ public class ErrorViewFXLayoutController extends CompositeFXControllerBase<Node,
@FXML
private BorderPane pane;
@SuppressWarnings("javadoc")
int btnOption = 0;
/** Toggle State */
@SuppressWarnings("unused")
private Map<ESeverity, Boolean> toggleState = new HashMap<ESeverity, Boolean>();
/** Tree table */
private DynamicTreeTableViewer<Object> treeTable;
/** */
List<ESeverity> SevrList = new ArrayList<ESeverity>();
/**
* @param toggleState
*/
/** Constructor. */
@SuppressWarnings("unchecked")
public ErrorViewFXLayoutController(Map<ESeverity, Boolean> toggleState) {
this.toggleState = toggleState;
((MarkerService)IMarkerService.getInstance()).setMarkerViewPart(this);
}
/** Called when debug checkbox is pushed. */
@@ -88,9 +76,9 @@ public class ErrorViewFXLayoutController extends CompositeFXControllerBase<Node,
if(!debugBtn.isSelected()) {
toggleState.put(ESeverity.DEBUG, true);
} else {
toggleState.remove(ESeverity.DEBUG);
toggleState.put(ESeverity.DEBUG, false);
}
initialize();
refresh();
}
/** Called when info check-box is pushed. */
@@ -98,20 +86,19 @@ public class ErrorViewFXLayoutController extends CompositeFXControllerBase<Node,
if(infoBtn.isSelected()) {
toggleState.put(ESeverity.INFO, true);
} else {
toggleState.remove(ESeverity.INFO);
toggleState.put(ESeverity.INFO, false);
}
initialize();
refresh();
}
/** Called when warning check-box is pushed. */
public void onWarningBtn() {
if(warningBtn.isSelected()) {
toggleState.put(ESeverity.WARNING, true);
} else {
toggleState.remove(ESeverity.WARNING);
toggleState.put(ESeverity.WARNING, false);
}
initialize();
refresh();
}
/** Called when error check-box is pushed. */
@@ -119,21 +106,19 @@ public class ErrorViewFXLayoutController extends CompositeFXControllerBase<Node,
if(errorBtn.isSelected()) {
toggleState.put(ESeverity.ERROR, true);
} else {
toggleState.remove(ESeverity.ERROR);
toggleState.put(ESeverity.ERROR, false);
}
initialize();
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);
}
if(fatalBtn.isPressed()) {
toggleState.remove(ESeverity.FATAL);
}
initialize();
refresh();
}
/** {@inheritDoc} */
@@ -142,16 +127,18 @@ public class ErrorViewFXLayoutController extends CompositeFXControllerBase<Node,
return "ErrorViewFXLayout.fxml";
}
/** Refreshes the tree table. */
public void refresh() {
treeTable.update();
}
/** {@inheritDoc} */
@Override
public void initialize() {
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);
DynamicTreeTableUIProviderBase<Object> uiProvider = new MarkerViewFXUIProvider();
treeTable = new DynamicTreeTableViewer<Object>(toggleState, false, 2, contentProvider,
uiProvider);
treeTable.addColumn("Severity", 80);
treeTable.addColumn("Element", 80);
treeTable.addColumn("Explanation", 80);
Loading