Skip to content
Open
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 @@ -26,12 +26,17 @@ public class SxxxColumns {
public static final String Text_Content = "B";

/**
* C: Referenziert von Objekt
* C: Referenziert von Objekt Art
*/
public static final String Reference_Object = "C";
public static final String Reference_Object_Art = "C";

/**
* D: Ausgabe in Plan
* D: Referenziert von Objekt Bezeichnung
*/
public static final String Visualation_In_Table = "D";
public static final String Reference_Object_Bezeichnung = "D";

/**
* E: Ausgabe in Plan
*/
public static final String Visualation_In_Table = "E";
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public Comparator<RowGroup> getRowGroupComparator(
final TableType tableType) {
return TableRowGroupComparator.builder(tableType)
.sort(SxxxColumns.Text_Content, LEXICOGRAPHICAL, ASC)
.sort(SxxxColumns.Reference_Object, LEXICOGRAPHICAL, ASC)
.sort(SxxxColumns.Reference_Object_Art, LEXICOGRAPHICAL, ASC)
.build();
}

Expand All @@ -96,10 +96,11 @@ public ColumnDescriptor fillHeaderDescriptions(
final ColumnDescriptor cd = super.fillHeaderDescriptions(builder);
// only merge on column A
cd.setMergeCommonValues(RowMergeMode.ENABLED);
List.of(SxxxColumns.Reference_Object, SxxxColumns.Visualation_In_Table)
.forEach(it -> getColumnDescriptor(it).ifPresent(col -> {
col.setMergeCommonValues(RowMergeMode.DISABLED);
}));
List.of(SxxxColumns.Reference_Object_Art,
SxxxColumns.Reference_Object_Bezeichnung,
SxxxColumns.Visualation_In_Table)
.forEach(it -> getColumnDescriptor(it).ifPresent(col -> col
.setMergeCommonValues(RowMergeMode.DISABLED)));

return cd;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.Set;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.set.basis.Pair;
import org.eclipse.set.core.services.enumtranslation.EnumTranslationService;
import org.eclipse.set.feature.table.pt1.AbstractPlanPro2TableModelTransformator;
import org.eclipse.set.model.planpro.Ansteuerung_Element.Aussenelementansteuerung;
Expand Down Expand Up @@ -116,12 +117,17 @@ public Table transformTableContent(
row.setRowObject(referencedBy);

fillBearbeitungsvermerkContent(row, bv);
final Pair<String, String> refObjInfo = getReferenceObjDesignation(
referencedBy);
// C: Referenziert von Objects Art
fill(row, getColumn(cols, Reference_Object_Art), bv,
note -> refObjInfo.getFirst());

// C: Referenziert von Objects
fill(row, getColumn(cols, Reference_Object), bv,
note -> getReferenceObjDesignation(referencedBy));
// D: Referenziert von Objects Bezeichnung
fill(row, getColumn(cols, Reference_Object_Bezeichnung), bv,
note -> refObjInfo.getSecond());

// D: Ausgabe in Plan
// E: Ausgabe in Plan
// Will fill later in TableService

}
Expand Down Expand Up @@ -153,7 +159,8 @@ private void fillBearbeitungsvermerkContent(final TableRow row,
}

@SuppressWarnings("nls")
private static String getReferenceObjDesignation(final EObject refObj) {
private static Pair<String, String> getReferenceObjDesignation(
final EObject refObj) {
final String typeName = UrObjectExtensions.getTypeName(refObj)
.replace("_TypeClass", "");
final String objDesignation = switch (refObj) {
Expand Down Expand Up @@ -183,8 +190,8 @@ private static String getReferenceObjDesignation(final EObject refObj) {
default -> "";
};
if (objDesignation != null && !objDesignation.isEmpty()) {
return typeName + " " + objDesignation;
return new Pair<>(typeName, objDesignation);
}
return typeName;
return new Pair<>(typeName, "");
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public static void fillSxxxTableColumnD(final Table sxxxTable,

private static void fillValue(final TableRow row, final String value) {
// IMPROVE: the get row cell is hard code
final CellContent content = row.getCells().get(3).getContent();
final CellContent content = row.getCells().get(4).getContent();
if (content == null) {
final StringCellContent cellContent = TablemodelFactory.eINSTANCE
.createStringCellContent();
Expand Down
Loading