Skip to content
Snippets Groups Projects
Commit 8fc1cd9c authored by Nils Christian Ehmke's avatar Nils Christian Ehmke
Browse files

#36 [Replace the (Tree)TableCellFactories with (Tree)TableRowFactories]

parent 33249553
No related branches found
No related tags found
No related merge requests found
Showing
with 87 additions and 118 deletions
1.2.0:
29 Jan 2017
Internal Improvement (#36)
The (Tree)TableCellFactories have been replaced with (Tree)TableRowFactories.
15 Jan 2017
Feature (#35)
Added the possibility to bookmark filter favorites during the analysis session.
......
......@@ -18,11 +18,8 @@ package kieker.diagnosis.components.table;
import javafx.scene.control.TableCell;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableRow;
import javafx.util.Callback;
import kieker.diagnosis.domain.AbstractOperationCall;
/**
* @author Nils Christian Ehmke
*/
......@@ -39,30 +36,15 @@ public abstract class AbstractTableCellFactory<S, T> implements Callback<TableCo
@Override
protected void updateItem(final T aItem, final boolean aEmpty) {
this.setFailedStyle();
super.updateItem(aItem, aEmpty);
if (aEmpty || (aItem == null)) {
this.setText(null);
this.setGraphic(null);
setText(null);
setGraphic(null);
} else {
this.setText(AbstractTableCellFactory.this.getItemLabel(aItem));
}
}
private void setFailedStyle() {
final TableRow<?> currentRow = super.getTableRow();
if (currentRow != null) {
final Object rowItem = currentRow.getItem();
super.getStyleClass().remove("failed");
if ((rowItem instanceof AbstractOperationCall) && ((AbstractOperationCall<?>) rowItem).isFailed()) {
super.getStyleClass().add("failed");
}
setText(getItemLabel(aItem));
}
}
}
}
......@@ -16,14 +16,38 @@
package kieker.diagnosis.components.table;
import javafx.scene.control.TableRow;
import javafx.scene.control.TableView;
import javafx.util.Callback;
import kieker.diagnosis.domain.AbstractOperationCall;
/**
* @author Nils Christian Ehmke
*/
public final class FailedTableCellFactory<S, T> extends AbstractTableCellFactory<S, T> {
public class FailedRowFactory<S> implements Callback<TableView<S>, TableRow<S>> {
@Override
protected String getItemLabel(final T aItem) {
return aItem.toString();
public TableRow<S> call(final TableView<S> param) {
return new FailedTableRow();
}
private class FailedTableRow extends TableRow<S> {
@Override
protected void updateItem(S item, boolean empty) {
super.updateItem(item, empty);
if (item instanceof AbstractOperationCall<?>) {
final AbstractOperationCall<?> call = (AbstractOperationCall<?>) item;
getStyleClass().remove("failed");
if (call.isFailed()) {
getStyleClass().add("failed");
}
}
}
}
}
......@@ -18,11 +18,8 @@ package kieker.diagnosis.components.treetable;
import javafx.scene.control.TreeTableCell;
import javafx.scene.control.TreeTableColumn;
import javafx.scene.control.TreeTableRow;
import javafx.util.Callback;
import kieker.diagnosis.domain.AbstractOperationCall;
/**
* @author Nils Christian Ehmke
*/
......@@ -39,28 +36,13 @@ public abstract class AbstractTreeTableCellFactory<S, T> implements Callback<Tre
@Override
protected void updateItem(final T aItem, final boolean aEmpty) {
this.setFailedStyle();
super.updateItem(aItem, aEmpty);
if (aEmpty || (aItem == null)) {
this.setText(null);
this.setGraphic(null);
setText(null);
setGraphic(null);
} else {
this.setText(AbstractTreeTableCellFactory.this.getItemLabel(aItem));
}
}
private void setFailedStyle() {
final TreeTableRow<?> currentRow = super.getTreeTableRow();
if (currentRow != null) {
final Object rowItem = currentRow.getItem();
super.getStyleClass().remove("failed");
if ((rowItem instanceof AbstractOperationCall) && ((AbstractOperationCall<?>) rowItem).isFailed()) {
super.getStyleClass().add("failed");
}
setText(getItemLabel(aItem));
}
}
......
......@@ -16,14 +16,38 @@
package kieker.diagnosis.components.treetable;
import javafx.scene.control.TreeTableRow;
import javafx.scene.control.TreeTableView;
import javafx.util.Callback;
import kieker.diagnosis.domain.AbstractOperationCall;
/**
* @author Nils Christian Ehmke
*/
public final class FailedTreeCellFactory<S, T> extends AbstractTreeTableCellFactory<S, T> {
public class FailedRowFactory<S> implements Callback<TreeTableView<S>, TreeTableRow<S>> {
@Override
protected String getItemLabel(final T aItem) {
return aItem.toString();
public TreeTableRow<S> call(final TreeTableView<S> param) {
return new FailedTreeTableRow();
}
private class FailedTreeTableRow extends TreeTableRow<S> {
@Override
protected void updateItem(S item, boolean empty) {
super.updateItem(item, empty);
if (item instanceof AbstractOperationCall<?>) {
final AbstractOperationCall<?> call = (AbstractOperationCall<?>) item;
getStyleClass().remove("failed");
if (call.isFailed()) {
getStyleClass().add("failed");
}
}
}
}
}
}
\ No newline at end of file
......@@ -9,5 +9,5 @@
}
.failed {
-fx-text-fill: red;
-fx-text-background-color: red;
}
\ No newline at end of file
......@@ -42,42 +42,34 @@
<TableView fx:id="ivTable" GridPane.hgrow="ALWAYS"
GridPane.vgrow="ALWAYS" GridPane.rowIndex="1" tableMenuButtonVisible="true" onMouseClicked="#selectCall" onKeyReleased="#selectCall">
<rowFactory>
<FailedRowFactory/>
</rowFactory>
<placeholder>
<Label text="%emptyTableText"/>
</placeholder>
<columns>
<TableColumn text="%AggregatedCallsView.tblclmnExecutionContainer.text">
<cellFactory>
<FailedTableCellFactory />
</cellFactory>
<cellValueFactory>
<PropertyValueFactory property="container" />
</cellValueFactory>
</TableColumn>
<TableColumn text="%AggregatedCallsView.tblclmnComponent.text">
<cellFactory>
<FailedTableCellFactory />
</cellFactory>
<cellValueFactory>
<ComponentCellValueFactory property="component" />
</cellValueFactory>
</TableColumn>
<TableColumn text="%AggregatedCallsView.tblclmnOperation.text">
<cellFactory>
<FailedTableCellFactory />
</cellFactory>
<cellValueFactory>
<OperationCellValueFactory property="operation" />
</cellValueFactory>
</TableColumn>
<TableColumn text="%AggregatedCallsView.tblclmnNumberOfCalls.text">
<cellFactory>
<FailedTableCellFactory />
</cellFactory>
<cellValueFactory>
<PropertyValueFactory property="calls" />
</cellValueFactory>
......
......@@ -9,5 +9,5 @@
}
.failed {
-fx-text-fill: red;
-fx-text-background-color: red;
}
\ No newline at end of file
......@@ -42,60 +42,46 @@
<TreeTableView fx:id="ivTreetable" GridPane.hgrow="ALWAYS"
GridPane.vgrow="ALWAYS" GridPane.rowIndex="1" tableMenuButtonVisible="true" onMouseClicked="#selectCall" onKeyReleased="#selectCall">
<rowFactory>
<FailedRowFactory/>
</rowFactory>
<placeholder>
<Label text="%emptyTableText"/>
</placeholder>
<columns>
<columns>
<TreeTableColumn text="%AggregatedTracesView.trclmnExecutionContainer.text">
<cellFactory>
<FailedTreeCellFactory/>
</cellFactory>
<cellValueFactory>
<TreeItemPropertyValueFactory property="container" />
</cellValueFactory>
</TreeTableColumn>
<TreeTableColumn text="%AggregatedTracesView.trclmnComponent.text">
<cellFactory>
<FailedTreeCellFactory />
</cellFactory>
<cellValueFactory>
<ComponentTreeCellValueFactory property="component" />
</cellValueFactory>
</TreeTableColumn>
<TreeTableColumn text="%AggregatedTracesView.trclmnOperation.text">
<cellFactory>
<FailedTreeCellFactory />
</cellFactory>
<cellValueFactory>
<OperationTreeCellValueFactory property="operation" />
</cellValueFactory>
</TreeTableColumn>
<TreeTableColumn text="%AggregatedTracesView.trclmnCalls.text">
<cellFactory>
<FailedTreeCellFactory />
</cellFactory>
<cellValueFactory>
<TreeItemPropertyValueFactory property="calls" />
</cellValueFactory>
</TreeTableColumn>
<TreeTableColumn text="%AggregatedTracesView.trclmnTraceDepth.text">
<cellFactory>
<FailedTreeCellFactory />
</cellFactory>
<cellValueFactory>
<TreeItemPropertyValueFactory property="stackDepth" />
</cellValueFactory>
</TreeTableColumn>
<TreeTableColumn text="%AggregatedTracesView.trclmnTraceSize.text">
<cellFactory>
<FailedTreeCellFactory />
</cellFactory>
<cellValueFactory>
<TreeItemPropertyValueFactory property="stackSize" />
</cellValueFactory>
......
......@@ -9,5 +9,5 @@
}
.failed {
-fx-text-fill: red;
-fx-text-background-color: red;
}
\ No newline at end of file
......@@ -51,51 +51,40 @@
<TableView fx:id="ivTable" GridPane.hgrow="ALWAYS"
GridPane.vgrow="ALWAYS" GridPane.rowIndex="1" tableMenuButtonVisible="true" onMouseClicked="#selectCall" onKeyReleased="#selectCall">
<rowFactory>
<FailedRowFactory/>
</rowFactory>
<placeholder>
<Label text="%emptyTableText"/>
</placeholder>
<columns>
<TableColumn text="%CallsView.tblclmnExecutionContainer.text">
<cellFactory>
<FailedTableCellFactory />
</cellFactory>
<cellValueFactory>
<PropertyValueFactory property="container" />
</cellValueFactory>
</TableColumn>
<TableColumn text="%CallsView.tblclmnComponent.text">
<cellFactory>
<FailedTableCellFactory />
</cellFactory>
<cellValueFactory>
<ComponentCellValueFactory property="component" />
</cellValueFactory>
</TableColumn>
<TableColumn text="%CallsView.tblclmnOperation.text">
<cellFactory>
<FailedTableCellFactory />
</cellFactory>
<cellValueFactory>
<OperationCellValueFactory property="operation" />
</cellValueFactory>
</TableColumn>
<TableColumn text="%CallsView.tblclmnDuration.text">
<cellFactory>
<DurationTableCellFactory />
</cellFactory>
<cellValueFactory>
<DurationCellValueFactory property="duration" />
</cellValueFactory>
</TableColumn>
<TableColumn text="%CallsView.tblclmnTraceID.text">
<cellFactory>
<FailedTableCellFactory />
</cellFactory>
<cellValueFactory>
<PropertyValueFactory property="traceID" />
</cellValueFactory>
......
......@@ -9,5 +9,5 @@
}
.failed {
-fx-text-fill: red;
-fx-text-background-color: red;
}
\ No newline at end of file
......@@ -50,15 +50,16 @@
<TreeTableView fx:id="ivTreetable" GridPane.hgrow="ALWAYS"
GridPane.vgrow="ALWAYS" GridPane.rowIndex="1" tableMenuButtonVisible="true" onMouseClicked="#selectCall" onKeyReleased="#selectCall">
<rowFactory>
<FailedRowFactory/>
</rowFactory>
<placeholder>
<Label text="%emptyTableText"/>
</placeholder>
<columns>
<TreeTableColumn text="%TracesView.trclmnExecutionContainer.text">
<cellFactory>
<FailedTreeCellFactory />
</cellFactory>
<cellValueFactory>
<TreeItemPropertyValueFactory
property="container" />
......@@ -66,27 +67,18 @@
</TreeTableColumn>
<TreeTableColumn text="%TracesView.trclmnComponent.text">
<cellFactory>
<FailedTreeCellFactory />
</cellFactory>
<cellValueFactory>
<ComponentTreeCellValueFactory property="component" />
</cellValueFactory>
</TreeTableColumn>
<TreeTableColumn text="%TracesView.trclmnOperation.text">
<cellFactory>
<FailedTreeCellFactory />
</cellFactory>
<cellValueFactory>
<OperationTreeCellValueFactory property="operation" />
</cellValueFactory>
</TreeTableColumn>
<TreeTableColumn text="%TracesView.trclmnTraceDepth.text">
<cellFactory>
<FailedTreeCellFactory />
</cellFactory>
<cellValueFactory>
<TreeItemPropertyValueFactory
property="stackDepth" />
......@@ -94,9 +86,6 @@
</TreeTableColumn>
<TreeTableColumn text="%TracesView.trclmnTraceSize.text">
<cellFactory>
<FailedTreeCellFactory />
</cellFactory>
<cellValueFactory>
<TreeItemPropertyValueFactory
property="stackSize" />
......@@ -124,9 +113,6 @@
</TreeTableColumn>
<TreeTableColumn text="%TracesView.trclmnTraceId.text" >
<cellFactory>
<FailedTreeCellFactory />
</cellFactory>
<cellValueFactory>
<TreeItemPropertyValueFactory
property="traceID" />
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment