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 @@ -16,17 +16,22 @@
@SuppressWarnings("nls")
public class SxxxColumns {
/**
* A: Inhalt Bearbeitungsvermerk
* A: Bearbeitungsvermerk.Kurztext
*/
public static final String Text_Content = "A";
public static final String Kurztext_Content = "A";

/**
* B: Referenziert von Objekt
* B: Inhalt Bearbeitungsvermerk
*/
public static final String Reference_Object = "B";
public static final String Text_Content = "B";

/**
* C: Ausgabe in Plan
* C: Referenziert von Objekt
*/
public static final String Visualation_In_Table = "C";
public static final String Reference_Object = "C";

/**
* D: Ausgabe in Plan
*/
public static final String Visualation_In_Table = "D";
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
*/
package org.eclipse.set.feature.table.pt1.sxxx;

import static org.eclipse.set.feature.table.pt1.sxxx.SxxxColumns.*;
import static org.eclipse.set.ppmodel.extensions.EObjectExtensions.getNullableObject;

import java.util.List;
Expand Down Expand Up @@ -90,7 +91,7 @@ public Table transformTableContent(
.isSonstigeEnumWert(basisAttribut))
.toList();

if (sonstigeEnumReferee.size() > 0
if (!sonstigeEnumReferee.isEmpty()
&& referencedByList.size() == sonstigeEnumReferee.size()) {
// bearbeitungsvermerke that are only used at sonstige enum
// values shall not be displayed at all
Expand All @@ -99,14 +100,7 @@ public Table transformTableContent(

if (referencedByList.isEmpty()) {
final TableRow row = rowGroup.newTableRow();
// A: Bearbeitungsvermerke inhalt
fill(row, getColumn(cols, SxxxColumns.Text_Content), bv,
note -> EObjectExtensions
.getNullableObject(note,
e -> e.getBearbeitungsvermerkAllg()
.getKommentar()
.getWert())
.orElse("")); //$NON-NLS-1$
fillBearbeitungsvermerkContent(row, bv);
continue;
}
for (final EObject referencedBy : referencedByList) {
Expand All @@ -121,25 +115,41 @@ public Table transformTableContent(
final TableRow row = rowGroup.newTableRow();
row.setRowObject(referencedBy);

// A: Bearbeitungsvermerke inhalt
fill(row, getColumn(cols, SxxxColumns.Text_Content), bv,
note -> EObjectExtensions
.getNullableObject(note,
e -> e.getBearbeitungsvermerkAllg()
.getKommentar()
.getWert())
.orElse("")); //$NON-NLS-1$

// B: Referenziert von Objects
fill(row, getColumn(cols, SxxxColumns.Reference_Object), bv,
fillBearbeitungsvermerkContent(row, bv);

// C: Referenziert von Objects
fill(row, getColumn(cols, Reference_Object), bv,
note -> getReferenceObjDesignation(referencedBy));

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

}
}

return factory.getTable();

}

private void fillBearbeitungsvermerkContent(final TableRow row,
final Bearbeitungsvermerk bv) {
// A: Bearbeitungsvermerke.Kurztext
fill(row, getColumn(cols, Kurztext_Content), bv,
note -> EObjectExtensions
.getNullableObject(note,
e -> e.getBearbeitungsvermerkAllg()
.getKurztext()
.getWert())
.orElse("")); //$NON-NLS-1$

// B: Bearbeitungsvermerke inhalt
fill(row, getColumn(cols, Text_Content), bv,
note -> EObjectExtensions
.getNullableObject(note,
e -> e.getBearbeitungsvermerkAllg()
.getKommentar()
.getWert())
.orElse("")); //$NON-NLS-1$
}

@SuppressWarnings("nls")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -471,7 +471,7 @@ private void storageFootnotes(final ToolboxFileRole sessionRole,
&& !footnotesPerTable
.containsKey(createKeyValue.apply(table)))
.toList();
FootnoteExtensions.fillSxxxTableColumnC(resultTable,
FootnoteExtensions.fillSxxxTableColumnD(resultTable,
footnotesPerTable, missingTables.isEmpty(),
extractShortName);
return;
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public static Set<Footnote> getNotesInTable(final Table table) {
* @param extractTableShortName
* extract table name form footnotesPerTable key value
*/
public static void fillSxxxTableColumnC(final Table sxxxTable,
public static void fillSxxxTableColumnD(final Table sxxxTable,
final Map<String, Set<Footnote>> footnotesPerTable,
final boolean allTablesGenerated,
final UnaryOperator<String> extractTableShortName) {
Expand Down Expand Up @@ -193,12 +193,13 @@ public static void fillSxxxTableColumnC(final Table sxxxTable,
}

private static void fillValue(final TableRow row, final String value) {
final CellContent content = row.getCells().get(2).getContent();
// IMPROVE: the get row cell is hard code
final CellContent content = row.getCells().get(3).getContent();
if (content == null) {
final StringCellContent cellContent = TablemodelFactory.eINSTANCE
.createStringCellContent();
cellContent.getValue().add(value);
row.getCells().get(2).setContent(cellContent);
row.getCells().get(3).setContent(cellContent);
} else if (content instanceof final StringCellContent stringCellContent) {
stringCellContent.getValue().add(value);
stringCellContent.getValue().removeIf(String::isEmpty);
Expand Down
Loading