Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
*/
package org.eclipse.set.feature.table.pt1.ssit;

import static org.eclipse.nebula.widgets.nattable.sort.SortDirectionEnum.ASC;
import static org.eclipse.set.utils.table.sorting.ComparatorBuilder.CellComparatorType.LEXICOGRAPHICAL;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;

Expand All @@ -23,10 +19,8 @@
import org.eclipse.set.feature.table.pt1.messages.Messages;
import org.eclipse.set.model.planpro.Basisobjekte.Strecke_Km_TypeClass;
import org.eclipse.set.model.planpro.Verweise.ID_Strecke_TypeClass;
import org.eclipse.set.model.tablemodel.RowGroup;
import org.eclipse.set.ppmodel.extensions.utils.TableNameInfo;
import org.eclipse.set.utils.table.TableInfo.Pt1TableCategory;
import org.eclipse.set.utils.table.sorting.TableRowGroupComparator;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.Reference;
import org.osgi.service.event.EventAdmin;
Expand Down Expand Up @@ -54,13 +48,6 @@ public AbstractPlanPro2TableModelTransformator createTransformator() {
return new SsitTransformator(cols, enumTranslationService, eventAdmin);
}

@Override
public Comparator<RowGroup> getRowGroupComparator() {
return TableRowGroupComparator.builder()
.sort("A", LEXICOGRAPHICAL, ASC) //$NON-NLS-1$
.build();
}

@Override
public TableNameInfo getTableNameInfo() {
return new TableNameInfo(messages.ToolboxTableNameSsitLong,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.List;
import java.util.Map;

import org.eclipse.set.basis.constants.TableType;
import org.eclipse.set.core.services.enumtranslation.EnumTranslationService;
import org.eclipse.set.feature.table.PlanPro2TableTransformationService;
import org.eclipse.set.feature.table.pt1.AbstractPlanPro2TableModelTransformator;
Expand Down Expand Up @@ -66,8 +67,9 @@ public AbstractPlanPro2TableModelTransformator createTransformator() {
}

@Override
public Comparator<RowGroup> getRowGroupComparator() {
return TableRowGroupComparator.builder()
public Comparator<RowGroup> getRowGroupComparator(
final TableType tableType) {
return TableRowGroupComparator.builder(tableType)
.sort(ESTW_Zentraleinheit.class, Aussenelementansteuerung.class)
.sort("A", LEXICOGRAPHICAL, ASC) //$NON-NLS-1$
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.List;
import java.util.Map;

import org.eclipse.set.basis.constants.TableType;
import org.eclipse.set.core.services.enumtranslation.EnumTranslationService;
import org.eclipse.set.feature.table.PlanPro2TableTransformationService;
import org.eclipse.set.feature.table.pt1.AbstractPlanPro2TableModelTransformator;
Expand Down Expand Up @@ -62,8 +63,9 @@ public AbstractPlanPro2TableModelTransformator createTransformator() {
}

@Override
public Comparator<RowGroup> getRowGroupComparator() {
return TableRowGroupComparator.builder()
public Comparator<RowGroup> getRowGroupComparator(
final TableType tableType) {
return TableRowGroupComparator.builder(tableType)
.sort("A", MIXED_STRING, ASC) //$NON-NLS-1$
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.List;
import java.util.Map;

import org.eclipse.set.basis.constants.TableType;
import org.eclipse.set.core.services.enumtranslation.EnumTranslationService;
import org.eclipse.set.core.services.graph.TopologicalGraphService;
import org.eclipse.set.feature.table.PlanPro2TableTransformationService;
Expand Down Expand Up @@ -68,15 +69,19 @@ public AbstractPlanPro2TableModelTransformator createTransformator() {
}

@Override
public Comparator<RowGroup> getRowGroupComparator() {
public Comparator<RowGroup> getRowGroupComparator(
final TableType tableType) {
// It can be directly compare by Column J/K but for consistent
// with another table the CompareRouteAndKm will be used.
return TableRowGroupComparator.builder().sortByRouteAndKm(obj -> {
if (obj instanceof final Punkt_Objekt po) {
return po;
}
return null;
}).sort(SskgColumns.Bezeichnung, LEXICOGRAPHICAL, ASC).build();
return TableRowGroupComparator.builder(tableType)
.sortByRouteAndKm(obj -> {
if (obj instanceof final Punkt_Objekt po) {
return po;
}
return null;
})
.sort(SskgColumns.Bezeichnung, LEXICOGRAPHICAL, ASC)
.build();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.function.Function;

import org.eclipse.nebula.widgets.nattable.sort.SortDirectionEnum;
import org.eclipse.set.basis.constants.TableType;
import org.eclipse.set.core.services.enumtranslation.EnumTranslationService;
import org.eclipse.set.core.services.graph.TopologicalGraphService;
import org.eclipse.set.feature.table.PlanPro2TableTransformationService;
Expand Down Expand Up @@ -127,19 +128,21 @@ private static String getCellContent(final TableCell cell) {
}

@Override
public Comparator<RowGroup> getRowGroupComparator() {
return TableRowGroupComparator.builder().sortByRouteAndKm(obj -> {
if (obj instanceof final PZB_Element pzb) {
final List<Basis_Objekt> bezugPunkts = PZBElementExtensions
.getPZBElementBezugspunkt(pzb);

if (!bezugPunkts.isEmpty() && bezugPunkts
.getFirst() instanceof final Punkt_Objekt po) {
return po;
}
}
return null;
})
public Comparator<RowGroup> getRowGroupComparator(
final TableType tableType) {
return TableRowGroupComparator.builder(tableType)
.sortByRouteAndKm(obj -> {
if (obj instanceof final PZB_Element pzb) {
final List<Basis_Objekt> bezugPunkts = PZBElementExtensions
.getPZBElementBezugspunkt(pzb);

if (!bezugPunkts.isEmpty() && bezugPunkts
.getFirst() instanceof final Punkt_Objekt po) {
return po;
}
}
return null;
})
.sort(Bezugselement, CellComparatorType.LEXICOGRAPHICAL,
SortDirectionEnum.ASC)
.sort(Wirkfrequenz,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import org.eclipse.e4.core.services.events.IEventBroker;
import org.eclipse.set.basis.constants.Events;
import org.eclipse.set.basis.constants.TableType;
import org.eclipse.set.core.services.enumtranslation.EnumTranslationService;
import org.eclipse.set.core.services.graph.BankService;
import org.eclipse.set.feature.table.PlanPro2TableTransformationService;
Expand Down Expand Up @@ -112,8 +113,9 @@ public void handleEvent(final Event event) {
}

@Override
public Comparator<RowGroup> getRowGroupComparator() {
return TableRowGroupComparator.builder()
public Comparator<RowGroup> getRowGroupComparator(
final TableType tableType) {
return TableRowGroupComparator.builder(tableType)
.sort(Reales_Signal, EMPTY_LAST, ASC)
.sort(Fiktives_Signal, EMPTY_LAST, ASC)
// It can be directly compare by Column E/F but for consistent
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.List;
import java.util.Map;

import org.eclipse.set.basis.constants.TableType;
import org.eclipse.set.core.services.enumtranslation.EnumTranslationService;
import org.eclipse.set.feature.table.PlanPro2TableTransformationService;
import org.eclipse.set.feature.table.pt1.AbstractPlanPro2TableModelTransformator;
Expand Down Expand Up @@ -62,8 +63,9 @@ public AbstractPlanPro2TableModelTransformator createTransformator() {
}

@Override
public Comparator<RowGroup> getRowGroupComparator() {
return TableRowGroupComparator.builder()
public Comparator<RowGroup> getRowGroupComparator(
final TableType tableType) {
return TableRowGroupComparator.builder(tableType)
.sort(Technik_Standort.class, Bedien_Standort.class)
.sort("A", MIXED_STRING, ASC) //$NON-NLS-1$
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.List;
import java.util.Map;

import org.eclipse.set.basis.constants.TableType;
import org.eclipse.set.core.services.enumtranslation.EnumTranslationService;
import org.eclipse.set.core.services.session.SessionService;
import org.eclipse.set.feature.table.PlanPro2TableTransformationService;
Expand Down Expand Up @@ -68,8 +69,9 @@ public AbstractPlanPro2TableModelTransformator createTransformator() {
}

@Override
public Comparator<RowGroup> getRowGroupComparator() {
return TableRowGroupComparator.builder()
public Comparator<RowGroup> getRowGroupComparator(
final TableType tableType) {
return TableRowGroupComparator.builder(tableType)
.sort("A", MIXED_STRING, ASC) //$NON-NLS-1$
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.eclipse.e4.core.services.events.IEventBroker;
import org.eclipse.nebula.widgets.nattable.sort.SortDirectionEnum;
import org.eclipse.set.basis.constants.Events;
import org.eclipse.set.basis.constants.TableType;
import org.eclipse.set.core.services.enumtranslation.EnumTranslationService;
import org.eclipse.set.core.services.graph.BankService;
import org.eclipse.set.feature.table.PlanPro2TableTransformationService;
Expand Down Expand Up @@ -128,13 +129,15 @@ protected Pt1TableCategory getTableCategory() {
}

@Override
public Comparator<RowGroup> getRowGroupComparator() {
return TableRowGroupComparator.builder().sortByRouteAndKm(obj -> {
if (obj instanceof final Signal signal) {
return signal;
}
return null;
})
public Comparator<RowGroup> getRowGroupComparator(
final TableType tableType) {
return TableRowGroupComparator.builder(tableType)
.sortByRouteAndKm(obj -> {
if (obj instanceof final Signal signal) {
return signal;
}
return null;
})
.sort(SskxColumns.Bezeichnung_Signal,
CellComparatorType.LEXICOGRAPHICAL,
SortDirectionEnum.ASC)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@
package org.eclipse.set.feature.table.pt1.ssla;

import static org.eclipse.nebula.widgets.nattable.sort.SortDirectionEnum.ASC;
import static org.eclipse.set.feature.table.pt1.ssla.SslaColumns.*;
import static org.eclipse.set.feature.table.pt1.ssla.SslaColumns.Art;
import static org.eclipse.set.feature.table.pt1.ssla.SslaColumns.Bezeichnung;
import static org.eclipse.set.feature.table.pt1.ssla.SslaColumns.Durchrutschweg_Ziel;
import static org.eclipse.set.feature.table.pt1.ssla.SslaColumns.Fahrweg_Start;
import static org.eclipse.set.feature.table.pt1.ssla.SslaColumns.Fahrweg_Ziel;
import static org.eclipse.set.feature.table.pt1.ssla.SslaColumns.Unterwegssignal;
import static org.eclipse.set.utils.table.sorting.ComparatorBuilder.CellComparatorType.LEXICOGRAPHICAL;

import java.util.Collections;
Expand All @@ -18,6 +23,7 @@
import java.util.Map;

import org.eclipse.nebula.widgets.nattable.sort.SortDirectionEnum;
import org.eclipse.set.basis.constants.TableType;
import org.eclipse.set.core.services.enumtranslation.EnumTranslationService;
import org.eclipse.set.feature.table.PlanPro2TableTransformationService;
import org.eclipse.set.feature.table.pt1.AbstractPlanPro2TableModelTransformator;
Expand Down Expand Up @@ -66,8 +72,9 @@ public AbstractPlanPro2TableModelTransformator createTransformator() {
}

@Override
public Comparator<RowGroup> getRowGroupComparator() {
return TableRowGroupComparator.builder()
public Comparator<RowGroup> getRowGroupComparator(
final TableType tableType) {
return TableRowGroupComparator.builder(tableType)
// Zugstraße - Z first, then Rangierstraßen - R
.sort(Art, LEXICOGRAPHICAL, SortDirectionEnum.DESC)
.sortByRouteAndKm(obj -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.util.Optional;

import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.set.basis.constants.TableType;
import org.eclipse.set.core.services.enumtranslation.EnumTranslationService;
import org.eclipse.set.core.services.graph.TopologicalGraphService;
import org.eclipse.set.feature.table.PlanPro2TableTransformationService;
Expand Down Expand Up @@ -86,8 +87,9 @@ public AbstractPlanPro2TableModelTransformator createTransformator() {
}

@Override
public Comparator<RowGroup> getRowGroupComparator() {
return TableRowGroupComparator.builder()
public Comparator<RowGroup> getRowGroupComparator(
final TableType tableType) {
return TableRowGroupComparator.builder(tableType)
.sort("F", LEXICOGRAPHICAL, ASC) //$NON-NLS-1$
.sort("I", LEXICOGRAPHICAL, ASC) //$NON-NLS-1$
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,21 @@
package org.eclipse.set.feature.table.pt1.ssld;

import static org.eclipse.nebula.widgets.nattable.sort.SortDirectionEnum.ASC;
import static org.eclipse.set.feature.table.pt1.ssld.SsldColumns.*;
import static org.eclipse.set.feature.table.pt1.ssld.SsldColumns.Aufloeseabschnitt_Laenge;
import static org.eclipse.set.feature.table.pt1.ssld.SsldColumns.Bezeichnung;
import static org.eclipse.set.feature.table.pt1.ssld.SsldColumns.Freigemeldet;
import static org.eclipse.set.feature.table.pt1.ssld.SsldColumns.Laenge_Ist;
import static org.eclipse.set.feature.table.pt1.ssld.SsldColumns.massgebende_Neigung;
import static org.eclipse.set.feature.table.pt1.ssld.SsldColumns.v_Aufwertung_Verzicht;
import static org.eclipse.set.feature.table.pt1.ssld.SsldColumns.von;
import static org.eclipse.set.utils.table.sorting.ComparatorBuilder.CellComparatorType.MIXED_STRING;

import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;

import org.eclipse.set.basis.constants.TableType;
import org.eclipse.set.core.services.enumtranslation.EnumTranslationService;
import org.eclipse.set.core.services.graph.TopologicalGraphService;
import org.eclipse.set.feature.table.PlanPro2TableTransformationService;
Expand Down Expand Up @@ -70,14 +77,16 @@ public AbstractPlanPro2TableModelTransformator createTransformator() {
}

@Override
public Comparator<RowGroup> getRowGroupComparator() {
return TableRowGroupComparator.builder().sortByRouteAndKm(obj -> {
if (obj instanceof final Fstr_DWeg fstr) {
return FahrwegExtensions
.getStart(DwegExtensions.getFstrFahrweg(fstr));
}
return null;
})
public Comparator<RowGroup> getRowGroupComparator(
final TableType tableType) {
return TableRowGroupComparator.builder(tableType)
.sortByRouteAndKm(obj -> {
if (obj instanceof final Fstr_DWeg fstr) {
return FahrwegExtensions
.getStart(DwegExtensions.getFstrFahrweg(fstr));
}
return null;
})
.sort(von, MIXED_STRING, ASC)
.sort(Bezeichnung, MIXED_STRING, ASC)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.List;
import java.util.Map;

import org.eclipse.set.basis.constants.TableType;
import org.eclipse.set.core.services.enumtranslation.EnumTranslationService;
import org.eclipse.set.feature.table.PlanPro2TableTransformationService;
import org.eclipse.set.feature.table.pt1.AbstractPlanPro2TableModelTransformator;
Expand Down Expand Up @@ -62,8 +63,9 @@ public AbstractPlanPro2TableModelTransformator createTransformator() {
}

@Override
public Comparator<RowGroup> getRowGroupComparator() {
return TableRowGroupComparator.builder()
public Comparator<RowGroup> getRowGroupComparator(
final TableType tableType) {
return TableRowGroupComparator.builder(tableType)
.sort("A", MIXED_STRING, ASC) //$NON-NLS-1$
.sort("B", MIXED_STRING, ASC) //$NON-NLS-1$
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.util.List;
import java.util.Map;

import org.eclipse.set.basis.constants.TableType;
import org.eclipse.set.core.services.enumtranslation.EnumTranslationService;
import org.eclipse.set.core.services.graph.TopologicalGraphService;
import org.eclipse.set.feature.table.PlanPro2TableTransformationService;
Expand Down Expand Up @@ -59,8 +60,9 @@ public AbstractPlanPro2TableModelTransformator createTransformator() {
}

@Override
public Comparator<RowGroup> getRowGroupComparator() {
return TableRowGroupComparator.builder()
public Comparator<RowGroup> getRowGroupComparator(
final TableType tableType) {
return TableRowGroupComparator.builder(tableType)
.sort("A", MIXED_STRING, ASC) //$NON-NLS-1$
.build();
}
Expand Down
Loading
Loading