diff --git a/src/main/java/kieker/gui/view/MainWindow.java b/src/main/java/kieker/gui/view/MainWindow.java index 893bc763e2234ad846a8cb9a381aa7059d95a352..11374674906067cc09a35882cea1ed739eb8dfb7 100644 --- a/src/main/java/kieker/gui/view/MainWindow.java +++ b/src/main/java/kieker/gui/view/MainWindow.java @@ -25,8 +25,10 @@ import kieker.gui.model.Properties; import kieker.gui.model.domain.AggregatedExecutionEntry; import kieker.gui.model.domain.ExecutionEntry; import kieker.gui.model.domain.RecordEntry; -import kieker.gui.view.util.AbstractDirectedComparator; import kieker.gui.view.util.AggregatedExecutionTracesTreeSetDataListener; +import kieker.gui.view.util.ExecutionEntryComponentComparator; +import kieker.gui.view.util.ExecutionEntryDurationComparator; +import kieker.gui.view.util.ExecutionEntryOperationComparator; import kieker.gui.view.util.ExecutionTracesTreeSetDataListener; import kieker.gui.view.util.RecordEntryTimestampComparator; import kieker.gui.view.util.RecordEntryTypeComparator; @@ -366,18 +368,9 @@ public final class MainWindow { this.recordsTableTypeColumn.addListener(SWT.Selection, new TableColumnSortListener<RecordEntry>(new RecordEntryTypeComparator())); this.recordsTableRecordColumn.addListener(SWT.Selection, new TableColumnSortListener<RecordEntry>(new RecordEntryTimestampComparator())); - this.treeColumn_11.addListener(SWT.Selection, new TreeColumnSortListener(new AbstractDirectedComparator<ExecutionEntry>() { - - @Override - public int compare(final ExecutionEntry arg0, final ExecutionEntry arg1) { - int result = Long.compare(arg0.getDuration(), arg1.getDuration()); - if (this.getDirection() == SWT.UP) { - result = -result; - } - return result; - - } - })); + this.treeColumn_10.addListener(SWT.Selection, new TreeColumnSortListener<ExecutionEntry>(new ExecutionEntryOperationComparator())); + this.treeColumn_11.addListener(SWT.Selection, new TreeColumnSortListener<ExecutionEntry>(new ExecutionEntryDurationComparator())); + this.treeColumn_8.addListener(SWT.Selection, new TreeColumnSortListener<ExecutionEntry>(new ExecutionEntryComponentComparator())); this.explorerTree.addSelectionListener(new SelectionAdapter() { diff --git a/src/main/java/kieker/gui/view/util/ExecutionEntryComponentComparator.java b/src/main/java/kieker/gui/view/util/ExecutionEntryComponentComparator.java new file mode 100644 index 0000000000000000000000000000000000000000..9ef0303be70afc8232698de996a653f8bf758c9f --- /dev/null +++ b/src/main/java/kieker/gui/view/util/ExecutionEntryComponentComparator.java @@ -0,0 +1,19 @@ +package kieker.gui.view.util; + +import kieker.gui.model.domain.ExecutionEntry; + +import org.eclipse.swt.SWT; + +public class ExecutionEntryComponentComparator extends AbstractDirectedComparator<ExecutionEntry> { + + @Override + public int compare(final ExecutionEntry arg0, final ExecutionEntry arg1) { + int result = arg0.getComponent().compareTo(arg1.getOperation()); + if (this.getDirection() == SWT.UP) { + result = -result; + } + return result; + + } + +} diff --git a/src/main/java/kieker/gui/view/util/ExecutionEntryDurationComparator.java b/src/main/java/kieker/gui/view/util/ExecutionEntryDurationComparator.java new file mode 100644 index 0000000000000000000000000000000000000000..7f1537ff820aceb32a37802fb2e89a4f24f753e8 --- /dev/null +++ b/src/main/java/kieker/gui/view/util/ExecutionEntryDurationComparator.java @@ -0,0 +1,19 @@ +package kieker.gui.view.util; + +import kieker.gui.model.domain.ExecutionEntry; + +import org.eclipse.swt.SWT; + +public class ExecutionEntryDurationComparator extends AbstractDirectedComparator<ExecutionEntry> { + + @Override + public int compare(final ExecutionEntry arg0, final ExecutionEntry arg1) { + int result = Long.compare(arg0.getDuration(), arg1.getDuration()); + if (this.getDirection() == SWT.UP) { + result = -result; + } + return result; + + } + +} diff --git a/src/main/java/kieker/gui/view/util/ExecutionEntryOperationComparator.java b/src/main/java/kieker/gui/view/util/ExecutionEntryOperationComparator.java new file mode 100644 index 0000000000000000000000000000000000000000..61c9bca0dab8e2915ae8d437571153d3597a6629 --- /dev/null +++ b/src/main/java/kieker/gui/view/util/ExecutionEntryOperationComparator.java @@ -0,0 +1,19 @@ +package kieker.gui.view.util; + +import kieker.gui.model.domain.ExecutionEntry; + +import org.eclipse.swt.SWT; + +public class ExecutionEntryOperationComparator extends AbstractDirectedComparator<ExecutionEntry> { + + @Override + public int compare(final ExecutionEntry arg0, final ExecutionEntry arg1) { + int result = arg0.getOperation().compareTo(arg1.getOperation()); + if (this.getDirection() == SWT.UP) { + result = -result; + } + return result; + + } + +}