diff --git a/java/bundles/org.eclipse.set.feature.plazmodel/META-INF/MANIFEST.MF b/java/bundles/org.eclipse.set.feature.plazmodel/META-INF/MANIFEST.MF index fec3b3ffcb..dead512b9c 100644 --- a/java/bundles/org.eclipse.set.feature.plazmodel/META-INF/MANIFEST.MF +++ b/java/bundles/org.eclipse.set.feature.plazmodel/META-INF/MANIFEST.MF @@ -74,6 +74,7 @@ Import-Package: jakarta.annotation, org.eclipse.set.utils.widgets, org.eclipse.swt, org.eclipse.swt.events, + org.eclipse.swt.layout, org.eclipse.swt.widgets, org.locationtech.jts.geom;version="1.19.0", org.osgi.service.component.annotations, diff --git a/java/bundles/org.eclipse.set.feature.plazmodel/OSGI-INF/l10n/bundle.properties b/java/bundles/org.eclipse.set.feature.plazmodel/OSGI-INF/l10n/bundle.properties index 2609e576d2..718f552c6d 100644 --- a/java/bundles/org.eclipse.set.feature.plazmodel/OSGI-INF/l10n/bundle.properties +++ b/java/bundles/org.eclipse.set.feature.plazmodel/OSGI-INF/l10n/bundle.properties @@ -36,7 +36,7 @@ PlazModellPart_ExportTitleMsg=Export als CSV PlazModellPart_ExportCsvFileName=PlaZ-Modell PlazModellPart_ExpandAllGroup= Alle ausklappen PlazModellPart_CollapseAllGroup= Alle einklappen - +PlazModellPart_ActiveDefaultFilterCheckbox=technische Meldungen ausblenden PlazReportColumns_Severity = Schweregrad PlazReportColumns_ProblemType = Problemart PlazReportColumns_LineNumber = Zeilennummer diff --git a/java/bundles/org.eclipse.set.feature.plazmodel/src/org/eclipse/set/feature/plazmodel/Messages.java b/java/bundles/org.eclipse.set.feature.plazmodel/src/org/eclipse/set/feature/plazmodel/Messages.java index 798b612073..3d3d521bfe 100644 --- a/java/bundles/org.eclipse.set.feature.plazmodel/src/org/eclipse/set/feature/plazmodel/Messages.java +++ b/java/bundles/org.eclipse.set.feature.plazmodel/src/org/eclipse/set/feature/plazmodel/Messages.java @@ -109,4 +109,9 @@ public class Messages { */ public String PlazExport_ExportProcess_ErrorDialog_Message; + /** + * technische Meldungen ausblenden + */ + public String PlazModellPart_ActiveDefaultFilterCheckbox; + } diff --git a/java/bundles/org.eclipse.set.feature.plazmodel/src/org/eclipse/set/feature/plazmodel/PlazModelPart.java b/java/bundles/org.eclipse.set.feature.plazmodel/src/org/eclipse/set/feature/plazmodel/PlazModelPart.java index 707cd7091c..050a5f8362 100644 --- a/java/bundles/org.eclipse.set.feature.plazmodel/src/org/eclipse/set/feature/plazmodel/PlazModelPart.java +++ b/java/bundles/org.eclipse.set.feature.plazmodel/src/org/eclipse/set/feature/plazmodel/PlazModelPart.java @@ -157,6 +157,8 @@ public String getText() { } }); + tableView.createActiveDefaultFilterCheckBox( + (Composite) getBanderole().getControl()); tableView.createExpandCollapseAllButton( (Composite) getBanderole().getControl(), messages.PlazModellPart_ExpandAllGroup, diff --git a/java/bundles/org.eclipse.set.feature.plazmodel/src/org/eclipse/set/feature/plazmodel/table/PlazModelTableView.java b/java/bundles/org.eclipse.set.feature.plazmodel/src/org/eclipse/set/feature/plazmodel/table/PlazModelTableView.java index e41cecb1d8..c93161ca16 100644 --- a/java/bundles/org.eclipse.set.feature.plazmodel/src/org/eclipse/set/feature/plazmodel/table/PlazModelTableView.java +++ b/java/bundles/org.eclipse.set.feature.plazmodel/src/org/eclipse/set/feature/plazmodel/table/PlazModelTableView.java @@ -9,6 +9,7 @@ package org.eclipse.set.feature.plazmodel.table; import java.nio.file.Path; +import java.util.Map; import org.eclipse.nebula.widgets.nattable.NatTable; import org.eclipse.set.basis.ToolboxPaths.ExportPathExtension; @@ -22,6 +23,11 @@ import org.eclipse.set.utils.table.menu.TableMenuService; import org.eclipse.set.utils.table.tree.AbstractTreeLayerTable; import org.eclipse.set.utils.xml.XMLNodeFinder; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Control; @@ -142,4 +148,41 @@ public void exportCsv() { exportCsv(part.getToolboxShell(), part.getDialogService(), messages.PlazModellPart_ExportTitleMsg, exportFileName); } + + @Override + protected Map getDefaultFilterValue() { + return Map.of(Integer.valueOf(2), "-GUID-Sortierung"); //$NON-NLS-1$ + } + + /** + * IMPROVE: when reimplementation the filter to like excel then the check + * box here can be removed + * + * @param parent + * the parent composite + */ + public void createActiveDefaultFilterCheckBox(final Composite parent) { + final Composite composite = new Composite(parent, SWT.NONE); + // Empty + final Composite space = new Composite(parent, SWT.NONE); + space.setLayout(new GridLayout()); + composite.setLayout(new GridLayout(2, false)); + final Button checkDefaultFilterButton = new Button(composite, + SWT.CHECK); + checkDefaultFilterButton.setSelection(true); + checkDefaultFilterButton + .setText(messages.PlazModellPart_ActiveDefaultFilterCheckbox); + checkDefaultFilterButton.addSelectionListener(new SelectionListener() { + + @Override + public void widgetSelected(final SelectionEvent e) { + widgetDefaultSelected(e); + } + + @Override + public void widgetDefaultSelected(final SelectionEvent e) { + setDefaultFilterState(checkDefaultFilterButton.getSelection()); + } + }); + } } diff --git a/java/bundles/org.eclipse.set.feature.validation/src/org/eclipse/set/feature/validation/table/ValidationTableView.java b/java/bundles/org.eclipse.set.feature.validation/src/org/eclipse/set/feature/validation/table/ValidationTableView.java index 17bb969d21..2dde638d1a 100644 --- a/java/bundles/org.eclipse.set.feature.validation/src/org/eclipse/set/feature/validation/table/ValidationTableView.java +++ b/java/bundles/org.eclipse.set.feature.validation/src/org/eclipse/set/feature/validation/table/ValidationTableView.java @@ -9,6 +9,8 @@ package org.eclipse.set.feature.validation.table; import java.nio.file.Path; +import java.util.Collections; +import java.util.Map; import org.eclipse.nebula.widgets.nattable.NatTable; import org.eclipse.set.basis.ToolboxPaths.ExportPathExtension; @@ -136,4 +138,9 @@ public void exportCsv() { exportCsv(shell, part.getDialogService(), messages.ExportValidationTitleMsg, exportFileName); } + + @Override + protected Map getDefaultFilterValue() { + return Collections.emptyMap(); + } } diff --git a/java/bundles/org.eclipse.set.swtbot/src/org/eclipse/set/swtbot/PlaZModelTest.java b/java/bundles/org.eclipse.set.swtbot/src/org/eclipse/set/swtbot/PlaZModelTest.java index c51be3ac0f..b7732fa16d 100644 --- a/java/bundles/org.eclipse.set.swtbot/src/org/eclipse/set/swtbot/PlaZModelTest.java +++ b/java/bundles/org.eclipse.set.swtbot/src/org/eclipse/set/swtbot/PlaZModelTest.java @@ -15,6 +15,7 @@ import org.eclipse.nebula.widgets.nattable.layer.ILayer; import org.eclipse.set.swtbot.table.AbstractTableTest; import org.eclipse.set.swtbot.table.TestFailHandle; +import org.eclipse.set.swtbot.utils.SWTBotUtils; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -36,6 +37,8 @@ public String getTestTableReferenceName() { private void whenOpeningPlaZModelNatTable() { givenNattableBot("PlaZ Modell"); + SWTBotUtils.checkBoxWithText(bot, "technische Meldungen ausblenden") + .click(); bot.button("Alle ausklappen").click(); } diff --git a/java/bundles/org.eclipse.set.swtbot/src/org/eclipse/set/swtbot/utils/SWTBotUtils.java b/java/bundles/org.eclipse.set.swtbot/src/org/eclipse/set/swtbot/utils/SWTBotUtils.java index 8646376adb..5bb86e6d23 100644 --- a/java/bundles/org.eclipse.set.swtbot/src/org/eclipse/set/swtbot/utils/SWTBotUtils.java +++ b/java/bundles/org.eclipse.set.swtbot/src/org/eclipse/set/swtbot/utils/SWTBotUtils.java @@ -12,46 +12,21 @@ import org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer; import org.eclipse.nebula.widgets.nattable.layer.ILayer; import org.eclipse.set.utils.table.BodyLayerStack; +import org.eclipse.swt.SWT; +import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.ExpandItem; import org.eclipse.swtbot.nebula.nattable.finder.SWTNatTableBot; import org.eclipse.swtbot.nebula.nattable.finder.widgets.SWTBotNatTable; import org.eclipse.swtbot.swt.finder.SWTBot; import org.eclipse.swtbot.swt.finder.waits.DefaultCondition; +import org.eclipse.swtbot.swt.finder.widgets.SWTBotCheckBox; import org.eclipse.swtbot.swt.finder.widgets.SWTBotExpandItem; +import org.hamcrest.Matcher; /** * Utilities for working with Nattable in SWTBot */ public class SWTBotUtils { - /** - * Waits for any nattable to be visible - * - * @param bot - * The SWT Bot - * @param timeout - * Timeout for waiting - * @return The SWTBotNatTable instance for accessing the nattable - */ - public static SWTBotNatTable waitForNattable(SWTBot bot, int timeout) { - var condition = new DefaultCondition() { - SWTBotNatTable nattableBot = null; - - @Override - public String getFailureMessage() { - return "Failed to find any nattable"; - } - - @Override - public boolean test() throws Exception { - nattableBot = new SWTNatTableBot().nattable(); - return nattableBot != null; - } - }; - - bot.waitUntil(condition, timeout); - return condition.nattableBot; - } - /** * @param gridLayer * The gridLayer @@ -79,24 +54,6 @@ public FreezeLayer freezeLayer() { } - /** - * @param nattableBot - * the nattable bot for the nattable - * @return a record of commonly used layers - */ - public static NattableLayers getNattableLayers(SWTBotNatTable nattableBot) { - final NatTable natTable = nattableBot.widget; - final ILayer layer = natTable.getLayer(); - assertInstanceOf(GridLayer.class, layer); - final GridLayer gridLayer = (GridLayer) layer; - assertInstanceOf(BodyLayerStack.class, gridLayer.getBodyLayer()); - final BodyLayerStack bodyLayerStack = (BodyLayerStack) gridLayer - .getBodyLayer(); - - return new NattableLayers(gridLayer, bodyLayerStack, - gridLayer.getColumnHeaderLayer()); - } - /** * @param bot * the {@link SWTBot} @@ -104,27 +61,35 @@ public static NattableLayers getNattableLayers(SWTBotNatTable nattableBot) { * the wait condition * @return the {@link DefaultCondition} */ - public static DefaultCondition botWaitUntil(SWTBot bot, - Supplier condition) { + public static DefaultCondition botWaitUntil(final SWTBot bot, + final Supplier condition) { return new DefaultCondition() { @Override - public boolean test() throws Exception { - return condition.get().booleanValue(); + public String getFailureMessage() { + return "Failed to wait for Application"; } @Override - public String getFailureMessage() { - return "Failed to wait for Application"; + public boolean test() throws Exception { + return condition.get().booleanValue(); } }; } + @SuppressWarnings("unchecked") + public static SWTBotCheckBox checkBoxWithText(final SWTBot bot, + final String text) { + final Matcher