diff --git a/api-baseline/org.eclipse.nebula.widgets.nattable.core_2.5.0.202411280718.jar b/api-baseline/org.eclipse.nebula.widgets.nattable.core_2.5.0.202411280718.jar deleted file mode 100644 index 2de629894..000000000 Binary files a/api-baseline/org.eclipse.nebula.widgets.nattable.core_2.5.0.202411280718.jar and /dev/null differ diff --git a/api-baseline/org.eclipse.nebula.widgets.nattable.core_2.6.0.202509190702.jar b/api-baseline/org.eclipse.nebula.widgets.nattable.core_2.6.0.202509190702.jar new file mode 100644 index 000000000..b810369ab Binary files /dev/null and b/api-baseline/org.eclipse.nebula.widgets.nattable.core_2.6.0.202509190702.jar differ diff --git a/api-baseline/org.eclipse.nebula.widgets.nattable.extension.e4_2.5.0.202411280718.jar b/api-baseline/org.eclipse.nebula.widgets.nattable.extension.e4_2.5.0.202411280718.jar deleted file mode 100644 index 3a93dd021..000000000 Binary files a/api-baseline/org.eclipse.nebula.widgets.nattable.extension.e4_2.5.0.202411280718.jar and /dev/null differ diff --git a/api-baseline/org.eclipse.nebula.widgets.nattable.extension.e4_2.6.0.202509190702.jar b/api-baseline/org.eclipse.nebula.widgets.nattable.extension.e4_2.6.0.202509190702.jar new file mode 100644 index 000000000..bf7147a28 Binary files /dev/null and b/api-baseline/org.eclipse.nebula.widgets.nattable.extension.e4_2.6.0.202509190702.jar differ diff --git a/api-baseline/org.eclipse.nebula.widgets.nattable.extension.glazedlists_2.5.0.202411280718.jar b/api-baseline/org.eclipse.nebula.widgets.nattable.extension.glazedlists_2.5.0.202411280718.jar deleted file mode 100644 index 7d4099478..000000000 Binary files a/api-baseline/org.eclipse.nebula.widgets.nattable.extension.glazedlists_2.5.0.202411280718.jar and /dev/null differ diff --git a/api-baseline/org.eclipse.nebula.widgets.nattable.extension.glazedlists_2.6.0.202509190702.jar b/api-baseline/org.eclipse.nebula.widgets.nattable.extension.glazedlists_2.6.0.202509190702.jar new file mode 100644 index 000000000..81254e9dc Binary files /dev/null and b/api-baseline/org.eclipse.nebula.widgets.nattable.extension.glazedlists_2.6.0.202509190702.jar differ diff --git a/api-baseline/org.eclipse.nebula.widgets.nattable.extension.nebula_2.5.0.202411280718.jar b/api-baseline/org.eclipse.nebula.widgets.nattable.extension.nebula_2.5.0.202411280718.jar deleted file mode 100644 index 2e2e2ecad..000000000 Binary files a/api-baseline/org.eclipse.nebula.widgets.nattable.extension.nebula_2.5.0.202411280718.jar and /dev/null differ diff --git a/api-baseline/org.eclipse.nebula.widgets.nattable.extension.nebula_2.6.0.202509190702.jar b/api-baseline/org.eclipse.nebula.widgets.nattable.extension.nebula_2.6.0.202509190702.jar new file mode 100644 index 000000000..db38ea8d8 Binary files /dev/null and b/api-baseline/org.eclipse.nebula.widgets.nattable.extension.nebula_2.6.0.202509190702.jar differ diff --git a/api-baseline/org.eclipse.nebula.widgets.nattable.extension.poi_2.5.0.202411280718.jar b/api-baseline/org.eclipse.nebula.widgets.nattable.extension.poi_2.5.0.202411280718.jar deleted file mode 100644 index c92c3c789..000000000 Binary files a/api-baseline/org.eclipse.nebula.widgets.nattable.extension.poi_2.5.0.202411280718.jar and /dev/null differ diff --git a/api-baseline/org.eclipse.nebula.widgets.nattable.extension.poi_2.6.0.202509190702.jar b/api-baseline/org.eclipse.nebula.widgets.nattable.extension.poi_2.6.0.202509190702.jar new file mode 100644 index 000000000..54f6a67b0 Binary files /dev/null and b/api-baseline/org.eclipse.nebula.widgets.nattable.extension.poi_2.6.0.202509190702.jar differ diff --git a/org.eclipse.nebula.widgets.nattable.core.feature/feature.xml b/org.eclipse.nebula.widgets.nattable.core.feature/feature.xml index 99946b389..9d7a0a465 100644 --- a/org.eclipse.nebula.widgets.nattable.core.feature/feature.xml +++ b/org.eclipse.nebula.widgets.nattable.core.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.nebula.widgets.nattable.core.test/.classpath b/org.eclipse.nebula.widgets.nattable.core.test/.classpath index 4dc96935c..cc46d65a6 100644 --- a/org.eclipse.nebula.widgets.nattable.core.test/.classpath +++ b/org.eclipse.nebula.widgets.nattable.core.test/.classpath @@ -1,7 +1,7 @@ - + diff --git a/org.eclipse.nebula.widgets.nattable.core.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.nebula.widgets.nattable.core.test/.settings/org.eclipse.jdt.core.prefs index b38a47341..f1cb4e370 100644 --- a/org.eclipse.nebula.widgets.nattable.core.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.nebula.widgets.nattable.core.test/.settings/org.eclipse.jdt.core.prefs @@ -1,8 +1,8 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.compliance=17 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -11,7 +11,7 @@ org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.compiler.source=17 org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 diff --git a/org.eclipse.nebula.widgets.nattable.core.test/META-INF/MANIFEST.MF b/org.eclipse.nebula.widgets.nattable.core.test/META-INF/MANIFEST.MF index 6067602fa..f0da4c5e6 100644 --- a/org.eclipse.nebula.widgets.nattable.core.test/META-INF/MANIFEST.MF +++ b/org.eclipse.nebula.widgets.nattable.core.test/META-INF/MANIFEST.MF @@ -2,9 +2,9 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: NatTable Core Tests Bundle-SymbolicName: org.eclipse.nebula.widgets.nattable.core.test -Bundle-Version: 2.6.0.qualifier +Bundle-Version: 2.7.0.qualifier Fragment-Host: org.eclipse.nebula.widgets.nattable.core -Bundle-RequiredExecutionEnvironment: JavaSE-11 +Bundle-RequiredExecutionEnvironment: JavaSE-17 Import-Package: org.eclipse.core.commands.common, org.eclipse.nebula.widgets.nattable.dataset;version="1.4.0", org.eclipse.nebula.widgets.nattable.dataset.car;version="1.5.0", diff --git a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/filterrow/combobox/FilterRowComboBoxDataProviderTest.java b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/filterrow/combobox/FilterRowComboBoxDataProviderTest.java index fa80ce3c9..bb140d97e 100644 --- a/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/filterrow/combobox/FilterRowComboBoxDataProviderTest.java +++ b/org.eclipse.nebula.widgets.nattable.core.test/src/org/eclipse/nebula/widgets/nattable/filterrow/combobox/FilterRowComboBoxDataProviderTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2019, 2024 Dirk Fauth and others. + * Copyright (c) 2019, 2025 Dirk Fauth and others. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -107,7 +107,7 @@ public int compare(String o1, String o2) { } }); - this.provider.configureComparator(columnHeaderDataLayer, configRegistry); + this.provider.configureConfigRegistryAccess(columnHeaderDataLayer, configRegistry); List values = this.provider.collectValues(0); assertEquals(8, values.size()); diff --git a/org.eclipse.nebula.widgets.nattable.core/.classpath b/org.eclipse.nebula.widgets.nattable.core/.classpath index f0d0c735f..e3378d07f 100644 --- a/org.eclipse.nebula.widgets.nattable.core/.classpath +++ b/org.eclipse.nebula.widgets.nattable.core/.classpath @@ -1,7 +1,7 @@ - + diff --git a/org.eclipse.nebula.widgets.nattable.core/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.nebula.widgets.nattable.core/.settings/org.eclipse.jdt.core.prefs index bfde0c7da..0acac7e97 100644 --- a/org.eclipse.nebula.widgets.nattable.core/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.nebula.widgets.nattable.core/.settings/org.eclipse.jdt.core.prefs @@ -10,9 +10,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nul org.eclipse.jdt.core.compiler.annotation.nullable.secondary= org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.compliance=17 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -114,7 +114,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.compiler.source=17 org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 diff --git a/org.eclipse.nebula.widgets.nattable.core/META-INF/MANIFEST.MF b/org.eclipse.nebula.widgets.nattable.core/META-INF/MANIFEST.MF index b789bf379..e5f26f32c 100644 --- a/org.eclipse.nebula.widgets.nattable.core/META-INF/MANIFEST.MF +++ b/org.eclipse.nebula.widgets.nattable.core/META-INF/MANIFEST.MF @@ -2,186 +2,186 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: NatTable Core Bundle-SymbolicName: org.eclipse.nebula.widgets.nattable.core -Bundle-Version: 2.6.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-11 +Bundle-Version: 2.7.0.qualifier +Bundle-RequiredExecutionEnvironment: JavaSE-17 Eclipse-ExtensibleAPI: true -Export-Package: org.eclipse.nebula.widgets.nattable;version="2.6.0", - org.eclipse.nebula.widgets.nattable.blink;version="2.6.0", - org.eclipse.nebula.widgets.nattable.blink.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.blink.event;version="2.6.0", - org.eclipse.nebula.widgets.nattable.columnCategories;version="2.6.0", - org.eclipse.nebula.widgets.nattable.columnCategories.gui;version="2.6.0", - org.eclipse.nebula.widgets.nattable.columnChooser;version="2.6.0", - org.eclipse.nebula.widgets.nattable.columnChooser.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.columnChooser.gui;version="2.6.0", - org.eclipse.nebula.widgets.nattable.columnRename;version="2.6.0", - org.eclipse.nebula.widgets.nattable.columnRename.event;version="2.6.0", - org.eclipse.nebula.widgets.nattable.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.conflation;version="2.6.0", - org.eclipse.nebula.widgets.nattable.coordinate;version="2.6.0", - org.eclipse.nebula.widgets.nattable.copy;version="2.6.0", - org.eclipse.nebula.widgets.nattable.copy.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.copy.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.copy.serializing;version="2.6.0", - org.eclipse.nebula.widgets.nattable.data;version="2.6.0", - org.eclipse.nebula.widgets.nattable.data.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.data.convert;version="2.6.0", - org.eclipse.nebula.widgets.nattable.data.validate;version="2.6.0", - org.eclipse.nebula.widgets.nattable.datachange;version="2.6.0", - org.eclipse.nebula.widgets.nattable.datachange.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.datachange.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.datachange.event;version="2.6.0", - org.eclipse.nebula.widgets.nattable.edit;version="2.6.0", - org.eclipse.nebula.widgets.nattable.edit.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.edit.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.edit.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.edit.editor;version="2.6.0", - org.eclipse.nebula.widgets.nattable.edit.event;version="2.6.0", - org.eclipse.nebula.widgets.nattable.edit.gui;version="2.6.0", - org.eclipse.nebula.widgets.nattable.export;version="2.6.0", - org.eclipse.nebula.widgets.nattable.export.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.export.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.export.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.export.csv;version="2.6.0", - org.eclipse.nebula.widgets.nattable.export.excel;version="2.6.0", - org.eclipse.nebula.widgets.nattable.export.image;version="2.6.0", - org.eclipse.nebula.widgets.nattable.export.image.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.fillhandle;version="2.6.0", - org.eclipse.nebula.widgets.nattable.fillhandle.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.fillhandle.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.fillhandle.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.fillhandle.event;version="2.6.0", - org.eclipse.nebula.widgets.nattable.filterrow;version="2.6.0", - org.eclipse.nebula.widgets.nattable.filterrow.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.filterrow.combobox;version="2.6.0", - org.eclipse.nebula.widgets.nattable.filterrow.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.filterrow.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.filterrow.event;version="2.6.0", - org.eclipse.nebula.widgets.nattable.formula;version="2.6.0", - org.eclipse.nebula.widgets.nattable.formula.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.formula.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.formula.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.formula.function;version="2.6.0", - org.eclipse.nebula.widgets.nattable.freeze;version="2.6.0", - org.eclipse.nebula.widgets.nattable.freeze.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.freeze.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.freeze.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.freeze.event;version="2.6.0", - org.eclipse.nebula.widgets.nattable.grid;version="2.6.0", - org.eclipse.nebula.widgets.nattable.grid.cell;version="2.6.0", - org.eclipse.nebula.widgets.nattable.grid.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.grid.data;version="2.6.0", - org.eclipse.nebula.widgets.nattable.grid.layer;version="2.6.0", - org.eclipse.nebula.widgets.nattable.grid.layer.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.grid.layer.event;version="2.6.0", - org.eclipse.nebula.widgets.nattable.group;version="2.6.0", - org.eclipse.nebula.widgets.nattable.group.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.group.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.group.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.group.event;version="2.6.0", - org.eclipse.nebula.widgets.nattable.group.gui;version="2.6.0", - org.eclipse.nebula.widgets.nattable.group.model;version="2.6.0", - org.eclipse.nebula.widgets.nattable.group.painter;version="2.6.0", - org.eclipse.nebula.widgets.nattable.group.performance;version="2.6.0", - org.eclipse.nebula.widgets.nattable.group.performance.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.group.performance.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.group.performance.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.group.performance.event;version="2.6.0", - org.eclipse.nebula.widgets.nattable.group.performance.gui;version="2.6.0", - org.eclipse.nebula.widgets.nattable.group.performance.painter;version="2.6.0", - org.eclipse.nebula.widgets.nattable.groupby;version="2.6.0", - org.eclipse.nebula.widgets.nattable.hideshow;version="2.6.0", - org.eclipse.nebula.widgets.nattable.hideshow.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.hideshow.event;version="2.6.0", - org.eclipse.nebula.widgets.nattable.hideshow.indicator;version="2.6.0", - org.eclipse.nebula.widgets.nattable.hierarchical;version="2.6.0", - org.eclipse.nebula.widgets.nattable.hierarchical.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.hierarchical.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.hierarchical.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.hover;version="2.6.0", - org.eclipse.nebula.widgets.nattable.hover.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.hover.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.hover.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.layer;version="2.6.0", - org.eclipse.nebula.widgets.nattable.layer.cell;version="2.6.0", - org.eclipse.nebula.widgets.nattable.layer.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.layer.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.layer.event;version="2.6.0", - org.eclipse.nebula.widgets.nattable.layer.stack;version="2.6.0", - org.eclipse.nebula.widgets.nattable.painter;version="2.6.0", - org.eclipse.nebula.widgets.nattable.painter.cell;version="2.6.0", - org.eclipse.nebula.widgets.nattable.painter.cell.decorator;version="2.6.0", - org.eclipse.nebula.widgets.nattable.painter.layer;version="2.6.0", - org.eclipse.nebula.widgets.nattable.persistence;version="2.6.0", - org.eclipse.nebula.widgets.nattable.persistence.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.persistence.gui;version="2.6.0", - org.eclipse.nebula.widgets.nattable.print;version="2.6.0", - org.eclipse.nebula.widgets.nattable.print.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.print.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.print.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.reorder;version="2.6.0", - org.eclipse.nebula.widgets.nattable.reorder.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.reorder.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.reorder.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.reorder.event;version="2.6.0", - org.eclipse.nebula.widgets.nattable.resize;version="2.6.0", - org.eclipse.nebula.widgets.nattable.resize.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.resize.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.resize.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.resize.event;version="2.6.0", - org.eclipse.nebula.widgets.nattable.resize.mode;version="2.6.0", - org.eclipse.nebula.widgets.nattable.search;version="2.6.0", - org.eclipse.nebula.widgets.nattable.search.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.search.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.search.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.search.event;version="2.6.0", - org.eclipse.nebula.widgets.nattable.search.gui;version="2.6.0", - org.eclipse.nebula.widgets.nattable.search.strategy;version="2.6.0", - org.eclipse.nebula.widgets.nattable.selection;version="2.6.0", - org.eclipse.nebula.widgets.nattable.selection.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.selection.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.selection.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.selection.event;version="2.6.0", - org.eclipse.nebula.widgets.nattable.selection.preserve;version="2.6.0", - org.eclipse.nebula.widgets.nattable.serializing;version="2.6.0", - org.eclipse.nebula.widgets.nattable.sort;version="2.6.0", - org.eclipse.nebula.widgets.nattable.sort.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.sort.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.sort.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.sort.event;version="2.6.0", - org.eclipse.nebula.widgets.nattable.sort.painter;version="2.6.0", - org.eclipse.nebula.widgets.nattable.style;version="2.6.0", - org.eclipse.nebula.widgets.nattable.style.editor;version="2.6.0", - org.eclipse.nebula.widgets.nattable.style.editor.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.style.theme;version="2.6.0", - org.eclipse.nebula.widgets.nattable.summaryrow;version="2.6.0", - org.eclipse.nebula.widgets.nattable.summaryrow.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.tickupdate;version="2.6.0", - org.eclipse.nebula.widgets.nattable.tickupdate.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.tickupdate.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.tickupdate.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.tooltip;version="2.6.0", - org.eclipse.nebula.widgets.nattable.tree;version="2.6.0", - org.eclipse.nebula.widgets.nattable.tree.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.tree.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.tree.config;version="2.6.0", - org.eclipse.nebula.widgets.nattable.tree.painter;version="2.6.0", - org.eclipse.nebula.widgets.nattable.ui;version="2.6.0", - org.eclipse.nebula.widgets.nattable.ui.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.ui.binding;version="2.6.0", - org.eclipse.nebula.widgets.nattable.ui.matcher;version="2.6.0", - org.eclipse.nebula.widgets.nattable.ui.menu;version="2.6.0", - org.eclipse.nebula.widgets.nattable.ui.mode;version="2.6.0", - org.eclipse.nebula.widgets.nattable.ui.rename;version="2.6.0", - org.eclipse.nebula.widgets.nattable.ui.scaling;version="2.6.0", - org.eclipse.nebula.widgets.nattable.ui.util;version="2.6.0", - org.eclipse.nebula.widgets.nattable.util;version="2.6.0", - org.eclipse.nebula.widgets.nattable.viewport;version="2.6.0", - org.eclipse.nebula.widgets.nattable.viewport.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.viewport.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.viewport.event;version="2.6.0", - org.eclipse.nebula.widgets.nattable.widget;version="2.6.0" +Export-Package: org.eclipse.nebula.widgets.nattable;version="2.7.0", + org.eclipse.nebula.widgets.nattable.blink;version="2.7.0", + org.eclipse.nebula.widgets.nattable.blink.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.blink.event;version="2.7.0", + org.eclipse.nebula.widgets.nattable.columnCategories;version="2.7.0", + org.eclipse.nebula.widgets.nattable.columnCategories.gui;version="2.7.0", + org.eclipse.nebula.widgets.nattable.columnChooser;version="2.7.0", + org.eclipse.nebula.widgets.nattable.columnChooser.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.columnChooser.gui;version="2.7.0", + org.eclipse.nebula.widgets.nattable.columnRename;version="2.7.0", + org.eclipse.nebula.widgets.nattable.columnRename.event;version="2.7.0", + org.eclipse.nebula.widgets.nattable.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.conflation;version="2.7.0", + org.eclipse.nebula.widgets.nattable.coordinate;version="2.7.0", + org.eclipse.nebula.widgets.nattable.copy;version="2.7.0", + org.eclipse.nebula.widgets.nattable.copy.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.copy.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.copy.serializing;version="2.7.0", + org.eclipse.nebula.widgets.nattable.data;version="2.7.0", + org.eclipse.nebula.widgets.nattable.data.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.data.convert;version="2.7.0", + org.eclipse.nebula.widgets.nattable.data.validate;version="2.7.0", + org.eclipse.nebula.widgets.nattable.datachange;version="2.7.0", + org.eclipse.nebula.widgets.nattable.datachange.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.datachange.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.datachange.event;version="2.7.0", + org.eclipse.nebula.widgets.nattable.edit;version="2.7.0", + org.eclipse.nebula.widgets.nattable.edit.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.edit.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.edit.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.edit.editor;version="2.7.0", + org.eclipse.nebula.widgets.nattable.edit.event;version="2.7.0", + org.eclipse.nebula.widgets.nattable.edit.gui;version="2.7.0", + org.eclipse.nebula.widgets.nattable.export;version="2.7.0", + org.eclipse.nebula.widgets.nattable.export.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.export.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.export.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.export.csv;version="2.7.0", + org.eclipse.nebula.widgets.nattable.export.excel;version="2.7.0", + org.eclipse.nebula.widgets.nattable.export.image;version="2.7.0", + org.eclipse.nebula.widgets.nattable.export.image.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.fillhandle;version="2.7.0", + org.eclipse.nebula.widgets.nattable.fillhandle.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.fillhandle.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.fillhandle.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.fillhandle.event;version="2.7.0", + org.eclipse.nebula.widgets.nattable.filterrow;version="2.7.0", + org.eclipse.nebula.widgets.nattable.filterrow.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.filterrow.combobox;version="2.7.0", + org.eclipse.nebula.widgets.nattable.filterrow.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.filterrow.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.filterrow.event;version="2.7.0", + org.eclipse.nebula.widgets.nattable.formula;version="2.7.0", + org.eclipse.nebula.widgets.nattable.formula.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.formula.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.formula.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.formula.function;version="2.7.0", + org.eclipse.nebula.widgets.nattable.freeze;version="2.7.0", + org.eclipse.nebula.widgets.nattable.freeze.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.freeze.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.freeze.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.freeze.event;version="2.7.0", + org.eclipse.nebula.widgets.nattable.grid;version="2.7.0", + org.eclipse.nebula.widgets.nattable.grid.cell;version="2.7.0", + org.eclipse.nebula.widgets.nattable.grid.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.grid.data;version="2.7.0", + org.eclipse.nebula.widgets.nattable.grid.layer;version="2.7.0", + org.eclipse.nebula.widgets.nattable.grid.layer.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.grid.layer.event;version="2.7.0", + org.eclipse.nebula.widgets.nattable.group;version="2.7.0", + org.eclipse.nebula.widgets.nattable.group.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.group.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.group.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.group.event;version="2.7.0", + org.eclipse.nebula.widgets.nattable.group.gui;version="2.7.0", + org.eclipse.nebula.widgets.nattable.group.model;version="2.7.0", + org.eclipse.nebula.widgets.nattable.group.painter;version="2.7.0", + org.eclipse.nebula.widgets.nattable.group.performance;version="2.7.0", + org.eclipse.nebula.widgets.nattable.group.performance.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.group.performance.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.group.performance.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.group.performance.event;version="2.7.0", + org.eclipse.nebula.widgets.nattable.group.performance.gui;version="2.7.0", + org.eclipse.nebula.widgets.nattable.group.performance.painter;version="2.7.0", + org.eclipse.nebula.widgets.nattable.groupby;version="2.7.0", + org.eclipse.nebula.widgets.nattable.hideshow;version="2.7.0", + org.eclipse.nebula.widgets.nattable.hideshow.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.hideshow.event;version="2.7.0", + org.eclipse.nebula.widgets.nattable.hideshow.indicator;version="2.7.0", + org.eclipse.nebula.widgets.nattable.hierarchical;version="2.7.0", + org.eclipse.nebula.widgets.nattable.hierarchical.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.hierarchical.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.hierarchical.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.hover;version="2.7.0", + org.eclipse.nebula.widgets.nattable.hover.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.hover.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.hover.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.layer;version="2.7.0", + org.eclipse.nebula.widgets.nattable.layer.cell;version="2.7.0", + org.eclipse.nebula.widgets.nattable.layer.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.layer.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.layer.event;version="2.7.0", + org.eclipse.nebula.widgets.nattable.layer.stack;version="2.7.0", + org.eclipse.nebula.widgets.nattable.painter;version="2.7.0", + org.eclipse.nebula.widgets.nattable.painter.cell;version="2.7.0", + org.eclipse.nebula.widgets.nattable.painter.cell.decorator;version="2.7.0", + org.eclipse.nebula.widgets.nattable.painter.layer;version="2.7.0", + org.eclipse.nebula.widgets.nattable.persistence;version="2.7.0", + org.eclipse.nebula.widgets.nattable.persistence.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.persistence.gui;version="2.7.0", + org.eclipse.nebula.widgets.nattable.print;version="2.7.0", + org.eclipse.nebula.widgets.nattable.print.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.print.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.print.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.reorder;version="2.7.0", + org.eclipse.nebula.widgets.nattable.reorder.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.reorder.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.reorder.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.reorder.event;version="2.7.0", + org.eclipse.nebula.widgets.nattable.resize;version="2.7.0", + org.eclipse.nebula.widgets.nattable.resize.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.resize.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.resize.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.resize.event;version="2.7.0", + org.eclipse.nebula.widgets.nattable.resize.mode;version="2.7.0", + org.eclipse.nebula.widgets.nattable.search;version="2.7.0", + org.eclipse.nebula.widgets.nattable.search.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.search.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.search.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.search.event;version="2.7.0", + org.eclipse.nebula.widgets.nattable.search.gui;version="2.7.0", + org.eclipse.nebula.widgets.nattable.search.strategy;version="2.7.0", + org.eclipse.nebula.widgets.nattable.selection;version="2.7.0", + org.eclipse.nebula.widgets.nattable.selection.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.selection.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.selection.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.selection.event;version="2.7.0", + org.eclipse.nebula.widgets.nattable.selection.preserve;version="2.7.0", + org.eclipse.nebula.widgets.nattable.serializing;version="2.7.0", + org.eclipse.nebula.widgets.nattable.sort;version="2.7.0", + org.eclipse.nebula.widgets.nattable.sort.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.sort.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.sort.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.sort.event;version="2.7.0", + org.eclipse.nebula.widgets.nattable.sort.painter;version="2.7.0", + org.eclipse.nebula.widgets.nattable.style;version="2.7.0", + org.eclipse.nebula.widgets.nattable.style.editor;version="2.7.0", + org.eclipse.nebula.widgets.nattable.style.editor.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.style.theme;version="2.7.0", + org.eclipse.nebula.widgets.nattable.summaryrow;version="2.7.0", + org.eclipse.nebula.widgets.nattable.summaryrow.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.tickupdate;version="2.7.0", + org.eclipse.nebula.widgets.nattable.tickupdate.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.tickupdate.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.tickupdate.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.tooltip;version="2.7.0", + org.eclipse.nebula.widgets.nattable.tree;version="2.7.0", + org.eclipse.nebula.widgets.nattable.tree.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.tree.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.tree.config;version="2.7.0", + org.eclipse.nebula.widgets.nattable.tree.painter;version="2.7.0", + org.eclipse.nebula.widgets.nattable.ui;version="2.7.0", + org.eclipse.nebula.widgets.nattable.ui.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.ui.binding;version="2.7.0", + org.eclipse.nebula.widgets.nattable.ui.matcher;version="2.7.0", + org.eclipse.nebula.widgets.nattable.ui.menu;version="2.7.0", + org.eclipse.nebula.widgets.nattable.ui.mode;version="2.7.0", + org.eclipse.nebula.widgets.nattable.ui.rename;version="2.7.0", + org.eclipse.nebula.widgets.nattable.ui.scaling;version="2.7.0", + org.eclipse.nebula.widgets.nattable.ui.util;version="2.7.0", + org.eclipse.nebula.widgets.nattable.util;version="2.7.0", + org.eclipse.nebula.widgets.nattable.viewport;version="2.7.0", + org.eclipse.nebula.widgets.nattable.viewport.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.viewport.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.viewport.event;version="2.7.0", + org.eclipse.nebula.widgets.nattable.widget;version="2.7.0" Import-Package: org.eclipse.collections.api;version="11.1.0", org.eclipse.collections.api.block;version="11.1.0", org.eclipse.collections.api.block.function;version="11.1.0", diff --git a/org.eclipse.nebula.widgets.nattable.core/pom.xml b/org.eclipse.nebula.widgets.nattable.core/pom.xml index 7612303b4..7ad52dadd 100644 --- a/org.eclipse.nebula.widgets.nattable.core/pom.xml +++ b/org.eclipse.nebula.widgets.nattable.core/pom.xml @@ -5,7 +5,7 @@ org.eclipse.nebula.widgets.nattable parent - 2.6.0-SNAPSHOT + 2.7.0-SNAPSHOT ../pom.xml diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/filterrow/combobox/ComboBoxFilterUtils.java b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/filterrow/combobox/ComboBoxFilterUtils.java index fb000cc3e..7ca98ebad 100644 --- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/filterrow/combobox/ComboBoxFilterUtils.java +++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/filterrow/combobox/ComboBoxFilterUtils.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2023, 2024 Dirk Fauth and others. + * Copyright (c) 2023, 2025 Dirk Fauth and others. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -12,9 +12,11 @@ ******************************************************************************/ package org.eclipse.nebula.widgets.nattable.filterrow.combobox; +import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.List; +import java.util.function.Function; import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; import org.eclipse.nebula.widgets.nattable.edit.EditConfigAttributes; @@ -36,6 +38,27 @@ private ComboBoxFilterUtils() { // private default constructor for helper class } + /** + * {@link Function} that maps a {@link String} that contains comma separated + * values to a {@link List} of trimmed {@link String}s. + * + * @since 2.7 + */ + public static Function DEFAULT_LIST_VALUE_MAP_FUNCTION = o -> { + if (o instanceof String) { + String[] s = ((String) o).split(","); //$NON-NLS-1$ + + for (int i = 0; i < s.length; i++) { + String str = s[i]; + if (str != null) { + s[i] = str.trim(); + } + } + return Arrays.asList(s); + } + return o; + }; + /** * Check if all values of the combo box are selected, which actually means * "no filter". diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/filterrow/combobox/FilterRowCategoryValueMapper.java b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/filterrow/combobox/FilterRowCategoryValueMapper.java new file mode 100644 index 000000000..c9fe6a293 --- /dev/null +++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/filterrow/combobox/FilterRowCategoryValueMapper.java @@ -0,0 +1,47 @@ +/******************************************************************************* + * Copyright (c) 2025 Dirk Fauth and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Dirk Fauth - initial API and implementation + *******************************************************************************/ +package org.eclipse.nebula.widgets.nattable.filterrow.combobox; + +import java.util.Collection; +import java.util.List; + +/** + * Interface to map the values in a filter row combo box to categories. + * + * @since 2.7 + */ +public interface FilterRowCategoryValueMapper { + + /** + * Maps the values in the input list to their corresponding categories. + * + * @param values + * The list of values to be mapped to categories. + * @return A list of categories corresponding to the input values. Needs to + * be a mutable list to support further modifications. + */ + public List valuesToCategories(List values); + + /** + * Resolves the categories in the given collection back to their original + * values. If a value does not belong to a category it should be returned as + * is. + * + * @param valuesWithCategories + * The values selected for filtering, including selected + * categories. + * @return The values selected for filtering, with categories resolved back + * to their original values. + */ + public Collection resolveCategories(Collection valuesWithCategories); +} diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/filterrow/combobox/FilterRowComboBoxDataProvider.java b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/filterrow/combobox/FilterRowComboBoxDataProvider.java index ef8adf7df..60c3a1ffc 100644 --- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/filterrow/combobox/FilterRowComboBoxDataProvider.java +++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/filterrow/combobox/FilterRowComboBoxDataProvider.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013, 2024 Dirk Fauth and others. + * Copyright (c) 2013, 2025 Dirk Fauth and others. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -26,9 +26,14 @@ import java.util.Set; import java.util.concurrent.locks.ReadWriteLock; import java.util.concurrent.locks.ReentrantReadWriteLock; +import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Collectors; +import org.eclipse.collections.api.factory.primitive.IntBooleanMaps; +import org.eclipse.collections.api.factory.primitive.IntObjectMaps; +import org.eclipse.collections.api.map.primitive.MutableIntBooleanMap; +import org.eclipse.collections.api.map.primitive.MutableIntObjectMap; import org.eclipse.nebula.widgets.nattable.command.ILayerCommandHandler; import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; import org.eclipse.nebula.widgets.nattable.config.NullComparator; @@ -37,6 +42,7 @@ import org.eclipse.nebula.widgets.nattable.edit.command.UpdateDataCommand; import org.eclipse.nebula.widgets.nattable.edit.editor.IComboBoxDataProvider; import org.eclipse.nebula.widgets.nattable.edit.event.DataUpdateEvent; +import org.eclipse.nebula.widgets.nattable.filterrow.config.FilterRowConfigAttributes; import org.eclipse.nebula.widgets.nattable.filterrow.event.FilterAppliedEvent; import org.eclipse.nebula.widgets.nattable.layer.ILayer; import org.eclipse.nebula.widgets.nattable.layer.ILayerListener; @@ -218,6 +224,39 @@ public class FilterRowComboBoxDataProvider implements IComboBoxDataProvider, */ private Predicate contentFilter = t -> true; + /** + * Flags to configure if collection values should be extracted to single + * values in {@link #collectValues(int, Collection)}. + * + * @since 2.7 + */ + private MutableIntBooleanMap flattenCollectionValues = IntBooleanMaps.mutable.empty(); + + /** + * Custom map functions to transform the values before collecting distinct + * values in {@link #collectValues(int, Collection)}. + * + * @since 2.7 + */ + private MutableIntObjectMap> customMapper = IntObjectMaps.mutable.empty(); + + /** + * Map functions to transform the values into categories before collecting + * distinct values in {@link #collectValues(int, Collection)}. + * + * @since 2.7 + */ + private MutableIntObjectMap> categoryValueMapper = IntObjectMaps.mutable.empty(); + + /** + * Flag to configure if categories mapped via a + * {@link FilterRowCategoryValueMapper} should replace the values in the + * filter combobox or if they should be added. + * + * @since 2.7 + */ + private MutableIntBooleanMap categoriesOnly = IntBooleanMaps.mutable.empty(); + /** * @param bodyLayer * A layer in the body region. Usually the DataLayer or a layer @@ -420,13 +459,13 @@ protected List collectValuesForColumn(int columnIndex) { * The collection out of which the distinct values should be * collected. * @param columnIndex - * The column index for which the values should be collected + * The column index for which the values should be collected. * @return List of all distinct values that are contained in the given * collection for the given column. * * @since 2.1 */ - @SuppressWarnings({ "rawtypes", "unchecked" }) + @SuppressWarnings({ "rawtypes" }) protected List collectValues(Collection collection, int columnIndex) { List result = collection.stream() .unordered() @@ -439,25 +478,102 @@ protected List collectValues(Collection collection, int columnIndex) { } return x; }) + .map(getCustomMapper(columnIndex)) .distinct() .collect(Collectors.toList()); - Object firstNonNull = result.stream() + if (isFlattenCollectionValues(columnIndex)) { + Set extractedValues = new HashSet<>(); + for (Object value : result) { + if (value instanceof Collection) { + extractedValues.addAll((Collection) value); + } else { + extractedValues.add(value); + } + } + result = new ArrayList<>(extractedValues); + } + + sortCollection(result, columnIndex); + + result = handleCategoriesCollection(result, columnIndex); + + return result; + } + + /** + * Sorts the given collection based on the comparator configured for the + * column if the values are of type {@link Comparable}. Ensures that + * null is always at the first position. + * + * @param collection + * The collection to sort. + * @param columnIndex + * The column index for which the comparator should be retrieved. + * + * @since 2.7 + */ + @SuppressWarnings({ "rawtypes", "unchecked" }) + protected void sortCollection(List collection, int columnIndex) { + Object firstNonNull = collection.stream() .filter(Objects::nonNull) .findFirst() .orElse(null); if (firstNonNull instanceof Comparable) { - result.sort(Comparator.nullsFirst(getColumnComparator(columnIndex))); + collection.sort(Comparator.nullsFirst(getColumnComparator(columnIndex))); } else { // always ensure that null is at the first position - int index = result.indexOf(null); + int index = collection.indexOf(null); if (index >= 0) { - result.remove(index); - result.add(0, null); + collection.remove(index); + collection.add(0, null); } } + } - return result; + /** + * Checks if a {@link FilterRowCategoryValueMapper} is configured for the + * given column. If so it will either add the categories to the list of + * values or replace the values with the categories based on the + * configuration. + * + * @param collection + * List of all distinct values that are contained in the given + * column. + * @param columnIndex + * The column index for which the values should be collected + * @return List of values that should be used in the filter combobox after + * handling categories. + * + * @since 2.7 + */ + @SuppressWarnings({ "rawtypes", "unchecked" }) + protected List handleCategoriesCollection(List collection, int columnIndex) { + FilterRowCategoryValueMapper mapper = getCategoryValueMapper(columnIndex); + if (mapper != null) { + try { + List categories = mapper.valuesToCategories(collection); + + sortCollection(categories, columnIndex); + + if (!isCategoriesOnly(columnIndex)) { + // check if the values collection contains a null and ensure + // that there is only one null in the final list at the + // first position + boolean containsNull = collection.remove(null); + if (!categories.contains(null) && containsNull) { + categories.add(0, null); + } + collection.addAll(0, categories); + } else { + return categories; + } + } catch (Exception e) { + LOG.error("Error while mapping values to categories for column index " + columnIndex, e); //$NON-NLS-1$ + } + } + + return collection; } @Override @@ -1141,8 +1257,37 @@ protected boolean isFilterApplied() { * @param configRegistry * The {@link IConfigRegistry} of the underlying NatTable. * @since 2.3 + * @deprecated Use + * {@link #configureConfigRegistryAccess(ILayer, IConfigRegistry)} + * instead. */ + @Deprecated public void configureComparator(ILayer columnHeaderDataLayer, IConfigRegistry configRegistry) { + configureConfigRegistryAccess(columnHeaderDataLayer, configRegistry); + } + + /** + * Set the {@link IConfigRegistry} that should be used to retrieve + * configurations like the comparator to sort the filter collection, or for + * combobox filterrows if String values should be mapped to a collection and + * if collection values should be flattened. If one of the parameters is + * null the filter collection will always be sorted via + * {@link Comparator#naturalOrder()} and the collection handling + * configurations are taken from the local members. + * + * @param columnHeaderDataLayer + * The DataLayer of the column header region. Needed to be able + * to get the cell which is needed to get the comparator that + * should be used to sort the filter collection. + * @param configRegistry + * The {@link IConfigRegistry} of the underlying NatTable. + * + * @see #isFlattenCollectionValues(int) + * @see #getCustomMapper(int) + * + * @since 2.7 + */ + public void configureConfigRegistryAccess(ILayer columnHeaderDataLayer, IConfigRegistry configRegistry) { this.columnHeaderDataLayer = columnHeaderDataLayer; this.configRegistry = configRegistry; } @@ -1196,6 +1341,264 @@ public void setContentFilter(Predicate predicate) { } } + /** + * + * @return The {@link Predicate} that allows to filter the values that are + * contained in the filter combo box. By default filters nothing. + * + * @since 2.7 + */ + protected Predicate getContentFilter() { + return this.contentFilter; + } + + /** + * Returns the setting if nested collection values should be flattened for a + * specific column. First checks if a {@link FilterRowCategoryValueMapper} + * is set for the given column, which enforces flattening of the collection + * values. * Then it checks if a configuration is registered via + * {@link FilterRowConfigAttributes#FLATTEN_COLLECTION_VALUES} in the + * {@link IConfigRegistry}, otherwise returns the locally registered value + * is registered via {@link #setFlattenCollectionValues(int, boolean)}. It + * can be overridden to handle specific columns differently. By default + * nested collection values are not flattened. + * + * @param columnIndex + * The column index for which it should be checked if nested + * collection values should be flattened. + * @return true if nested collection values should be flattened + * to single values, false if nested collection values + * should be treated as collections. + * + * @since 2.7 + */ + public boolean isFlattenCollectionValues(int columnIndex) { + // check if a FilterRowCategoryValueMapper is registered + if (getCategoryValueMapper(columnIndex) != null) { + return true; + } + + if (this.configRegistry != null && this.columnHeaderDataLayer != null) { + ILayerCell cell = this.columnHeaderDataLayer.getCellByPosition(columnIndex, 0); + if (cell != null) { + Boolean flatten = this.configRegistry.getConfigAttribute( + FilterRowConfigAttributes.FLATTEN_COLLECTION_VALUES, + cell.getDisplayMode(), + cell.getConfigLabels()); + + if (flatten != null) { + return flatten; + } + } + } + return this.flattenCollectionValues.getIfAbsent(columnIndex, false); + } + + /** + * Setting this value effects on how nested collection values are handled on + * collecting the values. false means nested collection values + * are treated as collections, true will flatten them to single + * values in the collected values. + * + * @param columnIndex + * The column index of the column for which the setting should be + * applied. + * @param flattenCollectionValues + * true if nested collection values are flattened to + * single values, false if nested collection values + * are treated as collections. + * + * @since 2.7 + */ + public void setFlattenCollectionValues(int columnIndex, boolean flattenCollectionValues) { + this.flattenCollectionValues.put(columnIndex, flattenCollectionValues); + if (this.cachingEnabled) { + clearCache(true); + } + } + + /** + * Returns the custom map function to transform the values before collecting + * the distinct values in {@link #collectValues(Collection, int)}. First + * checks if a custom map function is registered via + * {@link FilterRowConfigAttributes#LIST_VALUE_MAP_FUNCTION} in the + * {@link IConfigRegistry}, otherwise returns the locally registered map + * function that is registered via {@link #setCustomMapper(int, Function)}. + * By default maps to a no-op. + * + * @param columnIndex + * The column index of the column for which the custom map + * function should be retrieved. + * @return Map function that is added to transform the values before + * collecting distinct values in + * {@link #collectValues(Collection, int)}. By default maps to + * itself as a no-op. + * + * @since 2.7 + */ + public Function getCustomMapper(int columnIndex) { + if (this.configRegistry != null && this.columnHeaderDataLayer != null) { + ILayerCell cell = this.columnHeaderDataLayer.getCellByPosition(columnIndex, 0); + if (cell != null) { + Function mapper = this.configRegistry.getConfigAttribute( + FilterRowConfigAttributes.LIST_VALUE_MAP_FUNCTION, + cell.getDisplayMode(), + cell.getConfigLabels()); + + if (mapper != null) { + return mapper; + } + } + } + + return this.customMapper.getIfAbsentPut(columnIndex, o -> o); + } + + /** + * Set a custom map function to transform the values before collecting + * distinct values in {@link #collectValues(Collection, int)}. Can be used + * for example to map a comma separated string to a collection of strings, + * which in combination with + * {@link #setFlattenCollectionValues(int, boolean)} can then be interpreted + * as multiple distinct values. + * + * @param columnIndex + * The column index of the column for which the setting should be + * applied. + * @param customMapper + * Custom map function to transform the values before collecting + * distinct values in {@link #collectValues(Collection, int)}. + * + * @since 2.7 + */ + public void setCustomMapper(int columnIndex, Function customMapper) { + if (customMapper == null) { + this.customMapper.put(columnIndex, o -> o); + } else { + this.customMapper.put(columnIndex, customMapper); + } + + if (this.cachingEnabled) { + clearCache(true); + } + } + + /** + * Returns the setting if categories mapped via a + * {@link FilterRowCategoryValueMapper} should be added to the collection + * values or if they should replace them. It first checks if a configuration + * is registered via {@link FilterRowConfigAttributes#USE_CATEGORIES_ONLY} + * in the {@link IConfigRegistry}, otherwise returns the locally registered + * value is registered via {@link #setCategoriesOnly(int, boolean)}. It can + * be overridden to handle specific columns differently. By default + * categories are added.. + * + * @param columnIndex + * The column index for which it should be checked if categories + * should be added or replace the collection values. + * @return true if categories should replace the collection + * values, false if categories should be added. + * + * @since 2.7 + */ + public boolean isCategoriesOnly(int columnIndex) { + if (this.configRegistry != null && this.columnHeaderDataLayer != null) { + ILayerCell cell = this.columnHeaderDataLayer.getCellByPosition(columnIndex, 0); + if (cell != null) { + Boolean categoriesOnly = this.configRegistry.getConfigAttribute( + FilterRowConfigAttributes.USE_CATEGORIES_ONLY, + cell.getDisplayMode(), + cell.getConfigLabels()); + + if (categoriesOnly != null) { + return categoriesOnly; + } + } + } + return this.categoriesOnly.getIfAbsent(columnIndex, false); + } + + /** + * Setting this value effects on how categories mapped via a + * {@link FilterRowCategoryValueMapper} should be handled. Setting it to + * true means that the distinct values in the filter combobox + * are replaced by the categories, so there are no single values to select. + * Setting it to false means to add the categories to the list + * of filter values. + * + * @param columnIndex + * The column index of the column for which the setting should be + * applied. + * @param categoriesOnly + * true if the filter combobox should only contain + * the categories, false if the categories should be + * added to the values. + * + * @since 2.7 + */ + public void setCategoriesOnly(int columnIndex, boolean categoriesOnly) { + this.categoriesOnly.put(columnIndex, categoriesOnly); + if (this.cachingEnabled) { + clearCache(true); + } + } + + /** + * Returns the {@link FilterRowCategoryValueMapper} that is used to map + * values in a filter collection to a category. + * + * @param columnIndex + * The column index of the column for which the category value + * mapper should be retrieved. + * @return The {@link FilterRowCategoryValueMapper} that is used to map + * values in a filter collection to a category or null + * if no mapper is set. + * + * @since 2.7 + */ + public FilterRowCategoryValueMapper getCategoryValueMapper(int columnIndex) { + if (this.configRegistry != null && this.columnHeaderDataLayer != null) { + ILayerCell cell = this.columnHeaderDataLayer.getCellByPosition(columnIndex, 0); + if (cell != null) { + FilterRowCategoryValueMapper mapper = this.configRegistry.getConfigAttribute( + FilterRowConfigAttributes.CATEGORY_VALUE_MAPPER, + cell.getDisplayMode(), + cell.getConfigLabels()); + + if (mapper != null) { + return mapper; + } + } + } + + return this.categoryValueMapper.get(columnIndex); + } + + /** + * Set a {@link FilterRowCategoryValueMapper} that is used to map values in + * the collection to categories. + * + * @param columnIndex + * The column index of the column for which the setting should be + * applied. + * @param mapper + * The {@link FilterRowCategoryValueMapper} to be used to map + * values in a filter. + * + * @since 2.7 + */ + public void setCategoryValueMapper(int columnIndex, FilterRowCategoryValueMapper mapper) { + if (mapper == null) { + this.categoryValueMapper.remove(columnIndex); + } else { + this.categoryValueMapper.put(columnIndex, mapper); + } + + if (this.cachingEnabled) { + clearCache(true); + } + } + /** * * @return The class that is handled by this {@link ILayerCommandHandler} diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/filterrow/config/FilterRowConfigAttributes.java b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/filterrow/config/FilterRowConfigAttributes.java index 6638e51c4..d3fea25e1 100644 --- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/filterrow/config/FilterRowConfigAttributes.java +++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/filterrow/config/FilterRowConfigAttributes.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2020 Original authors and others. + * Copyright (c) 2012, 2025 Original authors and others. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -13,9 +13,12 @@ package org.eclipse.nebula.widgets.nattable.filterrow.config; import java.util.Comparator; +import java.util.List; +import java.util.function.Function; import org.eclipse.nebula.widgets.nattable.data.convert.IDisplayConverter; import org.eclipse.nebula.widgets.nattable.filterrow.TextMatchingMode; +import org.eclipse.nebula.widgets.nattable.filterrow.combobox.FilterRowCategoryValueMapper; import org.eclipse.nebula.widgets.nattable.style.ConfigAttribute; /** @@ -50,4 +53,45 @@ private FilterRowConfigAttributes() { * @since 2.0 */ public static final ConfigAttribute FILTER_CONTENT_DISPLAY_CONVERTER = new ConfigAttribute<>(); + + /** + * Flag to configure whether collection values in the cell should be + * flattened when using the combobox filter row. + * + * @since 2.7 + */ + public static final ConfigAttribute FLATTEN_COLLECTION_VALUES = new ConfigAttribute<>(); + + /** + * {@link Function} that maps a {@link String} that contains a collection of + * values to a {@link List} of trimmed {@link String}s. + * + * @since 2.7 + */ + public static final ConfigAttribute> LIST_VALUE_MAP_FUNCTION = new ConfigAttribute<>(); + + /** + * {@link FilterRowCategoryValueMapper} that is used to map values in a + * filter collection to a category. If a + * {@link FilterRowCategoryValueMapper} is set, + * {@link #FLATTEN_COLLECTION_VALUES} is automatically treated as + * true. + * + * @see #USE_CATEGORIES_ONLY + * + * @since 2.7 + */ + public static final ConfigAttribute> CATEGORY_VALUE_MAPPER = new ConfigAttribute<>(); + + /** + * Flag to configure whether values in the filter combobox should be + * replaced by the categories mapped via {@link #CATEGORY_VALUE_MAPPER} or + * if the categories should be added to the available values. If not set it + * will be treated as false. + * + * @see CATEGORY_VALUE_MAPPER + * + * @since 2.7 + */ + public static final ConfigAttribute USE_CATEGORIES_ONLY = new ConfigAttribute<>(); } diff --git a/org.eclipse.nebula.widgets.nattable.dataset.test/.classpath b/org.eclipse.nebula.widgets.nattable.dataset.test/.classpath index 4dc96935c..cc46d65a6 100644 --- a/org.eclipse.nebula.widgets.nattable.dataset.test/.classpath +++ b/org.eclipse.nebula.widgets.nattable.dataset.test/.classpath @@ -1,7 +1,7 @@ - + diff --git a/org.eclipse.nebula.widgets.nattable.dataset.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.nebula.widgets.nattable.dataset.test/.settings/org.eclipse.jdt.core.prefs index b38a47341..f1cb4e370 100644 --- a/org.eclipse.nebula.widgets.nattable.dataset.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.nebula.widgets.nattable.dataset.test/.settings/org.eclipse.jdt.core.prefs @@ -1,8 +1,8 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.compliance=17 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -11,7 +11,7 @@ org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.compiler.source=17 org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 diff --git a/org.eclipse.nebula.widgets.nattable.dataset.test/META-INF/MANIFEST.MF b/org.eclipse.nebula.widgets.nattable.dataset.test/META-INF/MANIFEST.MF index eed9c1ea9..623a586a6 100644 --- a/org.eclipse.nebula.widgets.nattable.dataset.test/META-INF/MANIFEST.MF +++ b/org.eclipse.nebula.widgets.nattable.dataset.test/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: NatTable Dataset Utilities Tests Bundle-SymbolicName: org.eclipse.nebula.widgets.nattable.dataset.test Bundle-Version: 2.6.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-11 +Bundle-RequiredExecutionEnvironment: JavaSE-17 Fragment-Host: org.eclipse.nebula.widgets.nattable.dataset Require-Bundle: junit-jupiter-api;bundle-version="5.10.0", junit-jupiter-engine;bundle-version="5.10.0", diff --git a/org.eclipse.nebula.widgets.nattable.dataset/.classpath b/org.eclipse.nebula.widgets.nattable.dataset/.classpath index f0d0c735f..e3378d07f 100644 --- a/org.eclipse.nebula.widgets.nattable.dataset/.classpath +++ b/org.eclipse.nebula.widgets.nattable.dataset/.classpath @@ -1,7 +1,7 @@ - + diff --git a/org.eclipse.nebula.widgets.nattable.dataset/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.nebula.widgets.nattable.dataset/.settings/org.eclipse.jdt.core.prefs index b38a47341..f1cb4e370 100644 --- a/org.eclipse.nebula.widgets.nattable.dataset/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.nebula.widgets.nattable.dataset/.settings/org.eclipse.jdt.core.prefs @@ -1,8 +1,8 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.compliance=17 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -11,7 +11,7 @@ org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.compiler.source=17 org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 diff --git a/org.eclipse.nebula.widgets.nattable.dataset/META-INF/MANIFEST.MF b/org.eclipse.nebula.widgets.nattable.dataset/META-INF/MANIFEST.MF index 9e7a098be..649704b66 100644 --- a/org.eclipse.nebula.widgets.nattable.dataset/META-INF/MANIFEST.MF +++ b/org.eclipse.nebula.widgets.nattable.dataset/META-INF/MANIFEST.MF @@ -2,8 +2,8 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: NatTable Dataset Utilities (internal usage) Bundle-SymbolicName: org.eclipse.nebula.widgets.nattable.dataset -Bundle-Version: 2.6.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-11 +Bundle-Version: 2.7.0.qualifier +Bundle-RequiredExecutionEnvironment: JavaSE-17 Export-Package: org.eclipse.nebula.widgets.nattable.dataset;version="1.4.0", org.eclipse.nebula.widgets.nattable.dataset.car;version="1.5.0", org.eclipse.nebula.widgets.nattable.dataset.fixture.data;version="1.4.0", diff --git a/org.eclipse.nebula.widgets.nattable.examples.e4.feature/feature.xml b/org.eclipse.nebula.widgets.nattable.examples.e4.feature/feature.xml index e5ed0ba19..9966011bc 100644 --- a/org.eclipse.nebula.widgets.nattable.examples.e4.feature/feature.xml +++ b/org.eclipse.nebula.widgets.nattable.examples.e4.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.nebula.widgets.nattable.examples.e4.product/org.eclipse.nebula.widgets.nattable.examples.e4.product b/org.eclipse.nebula.widgets.nattable.examples.e4.product/org.eclipse.nebula.widgets.nattable.examples.e4.product index 2c4b79043..7f5df6ed3 100644 --- a/org.eclipse.nebula.widgets.nattable.examples.e4.product/org.eclipse.nebula.widgets.nattable.examples.e4.product +++ b/org.eclipse.nebula.widgets.nattable.examples.e4.product/org.eclipse.nebula.widgets.nattable.examples.e4.product @@ -1,7 +1,7 @@ - + diff --git a/org.eclipse.nebula.widgets.nattable.examples.e4.product/pom.xml b/org.eclipse.nebula.widgets.nattable.examples.e4.product/pom.xml index 9821e8d9a..c62f83b17 100644 --- a/org.eclipse.nebula.widgets.nattable.examples.e4.product/pom.xml +++ b/org.eclipse.nebula.widgets.nattable.examples.e4.product/pom.xml @@ -8,7 +8,7 @@ parent org.eclipse.nebula.widgets.nattable - 2.6.0-SNAPSHOT + 2.7.0-SNAPSHOT .. diff --git a/org.eclipse.nebula.widgets.nattable.examples.e4/META-INF/MANIFEST.MF b/org.eclipse.nebula.widgets.nattable.examples.e4/META-INF/MANIFEST.MF index a86d530f9..2f41239f3 100644 --- a/org.eclipse.nebula.widgets.nattable.examples.e4/META-INF/MANIFEST.MF +++ b/org.eclipse.nebula.widgets.nattable.examples.e4/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: NatTable Eclipse 4 Examples Bundle-SymbolicName: org.eclipse.nebula.widgets.nattable.examples.e4;singleton:=true -Bundle-Version: 2.6.0.qualifier +Bundle-Version: 2.7.0.qualifier Require-Bundle: org.eclipse.core.runtime;bundle-version="0.0.0", org.eclipse.swt;bundle-version="0.0.0", org.eclipse.e4.ui.model.workbench;bundle-version="0.0.0", diff --git a/org.eclipse.nebula.widgets.nattable.examples/META-INF/MANIFEST.MF b/org.eclipse.nebula.widgets.nattable.examples/META-INF/MANIFEST.MF index aa14b12cd..c06c26a2c 100644 --- a/org.eclipse.nebula.widgets.nattable.examples/META-INF/MANIFEST.MF +++ b/org.eclipse.nebula.widgets.nattable.examples/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: NatTable Examples Bundle-SymbolicName: org.eclipse.nebula.widgets.nattable.examples -Bundle-Version: 2.6.0.qualifier +Bundle-Version: 2.7.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-17 Require-Bundle: ca.odell.glazedlists, org.eclipse.swt, diff --git a/org.eclipse.nebula.widgets.nattable.examples/pom.xml b/org.eclipse.nebula.widgets.nattable.examples/pom.xml index 0e51bafe6..89c7f5579 100644 --- a/org.eclipse.nebula.widgets.nattable.examples/pom.xml +++ b/org.eclipse.nebula.widgets.nattable.examples/pom.xml @@ -5,7 +5,7 @@ org.eclipse.nebula.widgets.nattable parent - 2.6.0-SNAPSHOT + 2.7.0-SNAPSHOT .. diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_603_Filter/_6037_MixedFilterRowExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_603_Filter/_6037_MixedFilterRowExample.java index e74936f5c..9a86c5ad6 100644 --- a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_603_Filter/_6037_MixedFilterRowExample.java +++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_603_Filter/_6037_MixedFilterRowExample.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2022, 2023 Dirk Fauth and others. + * Copyright (c) 2022, 2025 Dirk Fauth and others. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -15,6 +15,7 @@ import java.io.Serializable; import java.util.ArrayList; import java.util.Arrays; +import java.util.Comparator; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -90,6 +91,7 @@ import org.eclipse.nebula.widgets.nattable.layer.AbstractIndexLayerTransform; import org.eclipse.nebula.widgets.nattable.layer.DataLayer; import org.eclipse.nebula.widgets.nattable.layer.ILayer; +import org.eclipse.nebula.widgets.nattable.layer.LabelStack; import org.eclipse.nebula.widgets.nattable.layer.cell.AggregateConfigLabelAccumulator; import org.eclipse.nebula.widgets.nattable.layer.cell.ColumnLabelAccumulator; import org.eclipse.nebula.widgets.nattable.layer.cell.IConfigLabelAccumulator; @@ -99,6 +101,7 @@ import org.eclipse.nebula.widgets.nattable.persistence.command.DisplayPersistenceDialogCommandHandler; import org.eclipse.nebula.widgets.nattable.reorder.ColumnReorderLayer; import org.eclipse.nebula.widgets.nattable.selection.SelectionLayer; +import org.eclipse.nebula.widgets.nattable.sort.SortConfigAttributes; import org.eclipse.nebula.widgets.nattable.style.CellStyleAttributes; import org.eclipse.nebula.widgets.nattable.style.DisplayMode; import org.eclipse.nebula.widgets.nattable.style.Style; @@ -142,6 +145,7 @@ public class _6037_MixedFilterRowExample extends AbstractNatExample { private static final String EXCLUDE_LABEL = "EXCLUDE"; + private static final String LIST_VALUES = "LIST_VALUES"; private ArrayList filterExcludes = new ArrayList<>(); @@ -175,7 +179,8 @@ public Control createExampleControl(Composite parent) { "address.street", "address.housenumber", "address.postalCode", - "address.city" }; + "address.city", + "description" }; // mapping from property to label, needed for column header labels Map propertyToLabelMap = new HashMap<>(); @@ -188,6 +193,7 @@ public Control createExampleControl(Composite parent) { propertyToLabelMap.put("address.housenumber", "Housenumber"); propertyToLabelMap.put("address.postalCode", "Postal Code"); propertyToLabelMap.put("address.city", "City"); + propertyToLabelMap.put("description", "Description"); IColumnPropertyAccessor columnPropertyAccessor = new ExtendedReflectiveColumnPropertyAccessor<>(propertyNames); @@ -208,11 +214,35 @@ public Control createExampleControl(Composite parent) { bodyLayerStack.getBodyDataLayer().setDataValue(2, 3, null); bodyLayerStack.getBodyDataLayer().setDataValue(2, 5, null); + // add some description values to test the combobox filter + for (int i = 0; i < bodyLayerStack.filterList.size(); i++) { + var person = bodyLayerStack.filterList.get(i); + int modulo = i % 5; + switch (modulo) { + case 0 -> person.setDescription("One"); + case 1 -> person.setDescription("One, Two"); + case 2 -> person.setDescription("One, Two, Three"); + case 3 -> person.setDescription("One, Three, Five"); + case 4 -> person.setDescription("Two, Four, Six"); + } + } + // build the column header layer IDataProvider columnHeaderDataProvider = new DefaultColumnHeaderDataProvider(propertyNames, propertyToLabelMap); DataLayer columnHeaderDataLayer = new DefaultColumnHeaderDataLayer(columnHeaderDataProvider); + columnHeaderDataLayer.setConfigLabelAccumulator(new IConfigLabelAccumulator() { + + @Override + public void accumulateConfigLabels(LabelStack configLabels, int columnPosition, int rowPosition) { + if (columnPosition == 9) { + configLabels.addLabel(LIST_VALUES); + } + + } + }); + ColumnHeaderLayer columnHeaderLayer = new ColumnHeaderLayer( columnHeaderDataLayer, @@ -249,6 +279,7 @@ public Control createExampleControl(Composite parent) { configRegistry, false); + filterRowComboBoxDataProvider.configureConfigRegistryAccess(columnHeaderDataLayer, configRegistry); filterRowComboBoxDataProvider.setFilterCollection(bodyLayerStack.getFilterList(), filterRowHeaderLayer); // add a default ComboBoxFilterRowConfiguration with an updated editor @@ -868,6 +899,76 @@ public Object canonicalToDisplayValue(Object sourceValue) { FilterRowDataLayer.FILTER_ROW_COLUMN_LABEL_PREFIX + DataModelConstants.BIRTHDAY_COLUMN_POSITION); + // register a map function to convert the description values to to a + // list + configRegistry.registerConfigAttribute( + FilterRowConfigAttributes.LIST_VALUE_MAP_FUNCTION, + ComboBoxFilterUtils.DEFAULT_LIST_VALUE_MAP_FUNCTION, + DisplayMode.NORMAL, + LIST_VALUES); + + // register the flag to flatten the collection values in the + // resulting filter combobox + configRegistry.registerConfigAttribute( + FilterRowConfigAttributes.FLATTEN_COLLECTION_VALUES, + Boolean.TRUE, + DisplayMode.NORMAL, + LIST_VALUES); + + // register a comparator to sort the list values according to its + // semantic value + configRegistry.registerConfigAttribute( + SortConfigAttributes.SORT_COMPARATOR, + new Comparator() { + @Override + public int compare(String o1, String o2) { + int o1Int = -1; + switch (o1) { + case "One": + o1Int = 0; + break; + case "Two": + o1Int = 1; + break; + case "Three": + o1Int = 2; + break; + case "Four": + o1Int = 3; + break; + case "Five": + o1Int = 4; + break; + case "Six": + o1Int = 5; + break; + } + int o2Int = -1; + switch (o2) { + case "One": + o2Int = 0; + break; + case "Two": + o2Int = 1; + break; + case "Three": + o2Int = 2; + break; + case "Four": + o2Int = 3; + break; + case "Five": + o2Int = 4; + break; + case "Six": + o2Int = 5; + break; + } + return o1Int < o2Int ? -1 : (o1Int == o2Int ? 0 : 1); + } + }, + DisplayMode.NORMAL, + LIST_VALUES); } } diff --git a/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_603_Filter/_6038_ExtendedExcelLikeFilterRowExample.java b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_603_Filter/_6038_ExtendedExcelLikeFilterRowExample.java new file mode 100644 index 000000000..a78509e15 --- /dev/null +++ b/org.eclipse.nebula.widgets.nattable.examples/src/org/eclipse/nebula/widgets/nattable/examples/_600_GlazedLists/_603_Filter/_6038_ExtendedExcelLikeFilterRowExample.java @@ -0,0 +1,417 @@ +/******************************************************************************* + * Copyright (c) 2025 Dirk Fauth and others. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Dirk Fauth - initial API and implementation + *******************************************************************************/ +package org.eclipse.nebula.widgets.nattable.examples._600_GlazedLists._603_Filter; + +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.nebula.widgets.nattable.NatTable; +import org.eclipse.nebula.widgets.nattable.config.AbstractRegistryConfiguration; +import org.eclipse.nebula.widgets.nattable.config.ConfigRegistry; +import org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration; +import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry; +import org.eclipse.nebula.widgets.nattable.config.IEditableRule; +import org.eclipse.nebula.widgets.nattable.data.ExtendedReflectiveColumnPropertyAccessor; +import org.eclipse.nebula.widgets.nattable.data.IColumnPropertyAccessor; +import org.eclipse.nebula.widgets.nattable.data.IDataProvider; +import org.eclipse.nebula.widgets.nattable.data.ListDataProvider; +import org.eclipse.nebula.widgets.nattable.dataset.person.ExtendedPersonWithAddress; +import org.eclipse.nebula.widgets.nattable.dataset.person.PersonService; +import org.eclipse.nebula.widgets.nattable.edit.EditConfigAttributes; +import org.eclipse.nebula.widgets.nattable.examples.AbstractNatExample; +import org.eclipse.nebula.widgets.nattable.examples.runner.StandaloneNatExampleRunner; +import org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsEventLayer; +import org.eclipse.nebula.widgets.nattable.extension.glazedlists.filterrow.ComboBoxFilterRowHeaderComposite; +import org.eclipse.nebula.widgets.nattable.filterrow.combobox.ComboBoxFilterUtils; +import org.eclipse.nebula.widgets.nattable.filterrow.combobox.FilterRowCategoryValueMapper; +import org.eclipse.nebula.widgets.nattable.freeze.CompositeFreezeLayer; +import org.eclipse.nebula.widgets.nattable.freeze.FreezeLayer; +import org.eclipse.nebula.widgets.nattable.grid.data.DefaultColumnHeaderDataProvider; +import org.eclipse.nebula.widgets.nattable.grid.data.DefaultCornerDataProvider; +import org.eclipse.nebula.widgets.nattable.grid.data.DefaultRowHeaderDataProvider; +import org.eclipse.nebula.widgets.nattable.grid.layer.ColumnHeaderLayer; +import org.eclipse.nebula.widgets.nattable.grid.layer.CornerLayer; +import org.eclipse.nebula.widgets.nattable.grid.layer.DefaultColumnHeaderDataLayer; +import org.eclipse.nebula.widgets.nattable.grid.layer.DefaultRowHeaderDataLayer; +import org.eclipse.nebula.widgets.nattable.grid.layer.GridLayer; +import org.eclipse.nebula.widgets.nattable.grid.layer.RowHeaderLayer; +import org.eclipse.nebula.widgets.nattable.layer.AbstractLayerTransform; +import org.eclipse.nebula.widgets.nattable.layer.DataLayer; +import org.eclipse.nebula.widgets.nattable.layer.ILayer; +import org.eclipse.nebula.widgets.nattable.persistence.command.DisplayPersistenceDialogCommandHandler; +import org.eclipse.nebula.widgets.nattable.selection.SelectionLayer; +import org.eclipse.nebula.widgets.nattable.ui.menu.DebugMenuConfiguration; +import org.eclipse.nebula.widgets.nattable.ui.menu.HeaderMenuConfiguration; +import org.eclipse.nebula.widgets.nattable.ui.menu.PopupMenuBuilder; +import org.eclipse.nebula.widgets.nattable.viewport.ViewportLayer; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.layout.GridLayout; +import org.eclipse.swt.layout.RowLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; + +import ca.odell.glazedlists.EventList; +import ca.odell.glazedlists.FilterList; +import ca.odell.glazedlists.GlazedLists; +import ca.odell.glazedlists.SortedList; +import ca.odell.glazedlists.TransformedList; + +/** + * Example showing how to add the filter row to the layer composition of a grid + * that looks like the Excel filter with extended support for value collections. + */ +public class _6038_ExtendedExcelLikeFilterRowExample extends AbstractNatExample { + + private FilterRowCategoryValueMapper foodCategoryMapper = new FilterRowCategoryValueMapper() { + @Override + public List valuesToCategories(List values) { + if (values == null || values.size() == 0 || !(values.get(0) instanceof String)) { + return Collections.emptyList(); + } + + return values.stream().map(value -> { + switch (value) { + case "Vegetables", "Prezels", "Donut" -> { + return "Vegetarian Dish"; + } + case "Bacon", "Ham" -> { + return "Meat Dish"; + } + case "Fish" -> { + return "Fish Dish"; + } + } + return null; + }).distinct().collect(Collectors.toList()); + } + + @Override + public Collection resolveCategories(Collection valuesWithCategories) { + return valuesWithCategories.stream().map(category -> { + switch (category) { + case "Vegetarian Dish" -> { + return Arrays.asList("Vegetables", "Prezels", "Donut"); + } + case "Meat Dish" -> { + return Arrays.asList("Bacon", "Ham"); + } + case "Fish Dish" -> { + return Arrays.asList("Fish"); + } + } + return Arrays.asList(category); + }).flatMap(List::stream).distinct().collect(Collectors.toList()); + } + + }; + + public static void main(String[] args) throws Exception { + StandaloneNatExampleRunner.run(1600, 800, new _6038_ExtendedExcelLikeFilterRowExample()); + } + + @Override + public String getDescription() { + return "This example shows the usage of the filter row within a grid that looks like the Excel" + + " filter row and some extended features like handling of value collections in cells."; + } + + @Override + public Control createExampleControl(Composite parent) { + Composite container = new Composite(parent, SWT.NONE); + container.setLayout(new GridLayout()); + + // create a new ConfigRegistry which will be needed for GlazedLists + // handling + ConfigRegistry configRegistry = new ConfigRegistry(); + + // property names of the Person class + String[] propertyNames = { "firstName", "lastName", + "description", "gender", + "married", "birthday", "address.street", "address.housenumber", + "address.postalCode", "address.city", "favouriteFood", + "favouriteDrinks" }; + + // mapping from property to label, needed for column header labels + Map propertyToLabelMap = new HashMap<>(); + propertyToLabelMap.put("firstName", "Firstname"); + propertyToLabelMap.put("lastName", "Lastname"); + propertyToLabelMap.put("description", "Description"); + propertyToLabelMap.put("gender", "Gender"); + propertyToLabelMap.put("married", "Married"); + propertyToLabelMap.put("birthday", "Birthday"); + propertyToLabelMap.put("address.street", "Street"); + propertyToLabelMap.put("address.housenumber", "Housenumber"); + propertyToLabelMap.put("address.postalCode", "Postal Code"); + propertyToLabelMap.put("address.city", "City"); + propertyToLabelMap.put("favouriteFood", "Food"); + propertyToLabelMap.put("favouriteDrinks", "Drinks"); + + IColumnPropertyAccessor columnPropertyAccessor = + new ExtendedReflectiveColumnPropertyAccessor<>(propertyNames); + + final BodyLayerStack bodyLayerStack = + new BodyLayerStack<>( + PersonService.getExtendedPersonsWithAddress(50), + columnPropertyAccessor); + + for (int i = 0; i < bodyLayerStack.filterList.size(); i++) { + var person = bodyLayerStack.filterList.get(i); + int modulo = i % 5; + switch (modulo) { + case 0 -> person.setDescription("One"); + case 1 -> person.setDescription("One,Two"); + case 2 -> person.setDescription("One,Two,Three"); + case 3 -> person.setDescription("One,Two,Three,Four"); + case 4 -> person.setDescription("One,Two,Three,Four,Five"); + } + } + + // build the column header layer + IDataProvider columnHeaderDataProvider = + new DefaultColumnHeaderDataProvider(propertyNames, propertyToLabelMap); + DataLayer columnHeaderDataLayer = + new DefaultColumnHeaderDataLayer(columnHeaderDataProvider); + ILayer columnHeaderLayer = + new ColumnHeaderLayer( + columnHeaderDataLayer, + bodyLayerStack, + bodyLayerStack.getSelectionLayer()); + + ComboBoxFilterRowHeaderComposite filterRowHeaderLayer = + new ComboBoxFilterRowHeaderComposite<>( + bodyLayerStack.getFilterList(), + bodyLayerStack.getGlazedListsEventLayer(), + bodyLayerStack.getSortedList(), + columnPropertyAccessor, + columnHeaderLayer, + columnHeaderDataProvider, + configRegistry); + + // build the row header layer + IDataProvider rowHeaderDataProvider = + new DefaultRowHeaderDataProvider(bodyLayerStack.getBodyDataProvider()); + DataLayer rowHeaderDataLayer = + new DefaultRowHeaderDataLayer(rowHeaderDataProvider); + ILayer rowHeaderLayer = + new RowHeaderLayer( + rowHeaderDataLayer, + bodyLayerStack, + bodyLayerStack.getSelectionLayer()); + + // build the corner layer + IDataProvider cornerDataProvider = + new DefaultCornerDataProvider( + columnHeaderDataProvider, + rowHeaderDataProvider); + DataLayer cornerDataLayer = + new DataLayer(cornerDataProvider); + ILayer cornerLayer = + new CornerLayer( + cornerDataLayer, + rowHeaderLayer, + filterRowHeaderLayer); + + // build the grid layer + GridLayer gridLayer = + new GridLayer( + bodyLayerStack, + filterRowHeaderLayer, + rowHeaderLayer, + cornerLayer); + + // turn the auto configuration off as we want to add our header menu + // configuration + NatTable natTable = new NatTable(container, gridLayer, false); + + // as the autoconfiguration of the NatTable is turned off, we have to + // add the DefaultNatTableStyleConfiguration and the ConfigRegistry + // manually + natTable.setConfigRegistry(configRegistry); + natTable.addConfiguration(new DefaultNatTableStyleConfiguration()); + + natTable.addConfiguration(new HeaderMenuConfiguration(natTable) { + @Override + protected PopupMenuBuilder createCornerMenu(NatTable natTable) { + return super.createCornerMenu(natTable) + .withStateManagerMenuItemProvider(); + } + + @Override + protected PopupMenuBuilder createColumnHeaderMenu(NatTable natTable) { + return super.createColumnHeaderMenu(natTable).withInspectLabelsMenuItem(); + } + }); + + natTable.addConfiguration(new DebugMenuConfiguration(natTable)); + + natTable.addConfiguration(new AbstractRegistryConfiguration() { + + @Override + public void configureRegistry(IConfigRegistry configRegistry) { + configRegistry.registerConfigAttribute( + EditConfigAttributes.CELL_EDITABLE_RULE, + IEditableRule.ALWAYS_EDITABLE); + } + + }); + + natTable.configure(); + + natTable.registerCommandHandler( + new DisplayPersistenceDialogCommandHandler(natTable)); + + GridDataFactory.fillDefaults().grab(true, true).applyTo(natTable); + + Composite buttonPanel = new Composite(container, SWT.NONE); + buttonPanel.setLayout(new RowLayout()); + GridDataFactory.fillDefaults().grab(true, false).applyTo(buttonPanel); + + Button flattenDescriptionButton = new Button(buttonPanel, SWT.CHECK); + flattenDescriptionButton.setSelection(false); + flattenDescriptionButton.setText("Flatten Description"); + flattenDescriptionButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + boolean isFlatten = flattenDescriptionButton.getSelection(); + // apply a custom map function when flattening or remove it if + // not + filterRowHeaderLayer.getComboBoxDataProvider().setCustomMapper(2, + isFlatten ? ComboBoxFilterUtils.DEFAULT_LIST_VALUE_MAP_FUNCTION : null); + // toggle flattening + filterRowHeaderLayer.getComboBoxDataProvider().setFlattenCollectionValues(2, isFlatten); + } + }); + + Button flattenFoodDrinksButton = new Button(buttonPanel, SWT.CHECK); + flattenFoodDrinksButton.setSelection(false); + flattenFoodDrinksButton.setText("Flatten Food && Drinks"); + flattenFoodDrinksButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + boolean isFlatten = flattenFoodDrinksButton.getSelection(); + filterRowHeaderLayer.getComboBoxDataProvider().setFlattenCollectionValues(10, isFlatten); + filterRowHeaderLayer.getComboBoxDataProvider().setFlattenCollectionValues(11, isFlatten); + } + }); + + Button categorizeFoodButton = new Button(buttonPanel, SWT.CHECK); + Button addCategoriesButton = new Button(buttonPanel, SWT.CHECK); + categorizeFoodButton.setSelection(false); + categorizeFoodButton.setText("Categorize Food"); + categorizeFoodButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + boolean selected = categorizeFoodButton.getSelection(); + filterRowHeaderLayer.getComboBoxDataProvider().setCategoryValueMapper(10, + selected ? _6038_ExtendedExcelLikeFilterRowExample.this.foodCategoryMapper : null); + + addCategoriesButton.setEnabled(selected); + } + }); + + addCategoriesButton.setSelection(false); + addCategoriesButton.setEnabled(false); + addCategoriesButton.setText("Replace Food Values with Categories"); + addCategoriesButton.addSelectionListener(new SelectionAdapter() { + @Override + public void widgetSelected(SelectionEvent e) { + boolean selected = addCategoriesButton.getSelection(); + filterRowHeaderLayer.getComboBoxDataProvider().setCategoriesOnly(10, selected); + } + }); + + return container; + } + + /** + * Always encapsulate the body layer stack in an AbstractLayerTransform to + * ensure that the index transformations are performed in later commands. + * + * @param + */ + class BodyLayerStack extends AbstractLayerTransform { + + private final SortedList sortedList; + private final FilterList filterList; + + private final IDataProvider bodyDataProvider; + private final DataLayer bodyDataLayer; + private final GlazedListsEventLayer glazedListsEventLayer; + + private final SelectionLayer selectionLayer; + + public BodyLayerStack(List values, IColumnPropertyAccessor columnPropertyAccessor) { + // wrapping of the list to show into GlazedLists + // see http://publicobject.com/glazedlists/ for further information + EventList eventList = GlazedLists.eventList(values); + TransformedList rowObjectsGlazedList = GlazedLists.threadSafeList(eventList); + + // use the SortedList constructor with 'null' for the Comparator + // because the Comparator will be set by configuration + this.sortedList = new SortedList<>(rowObjectsGlazedList, null); + // wrap the SortedList with the FilterList + this.filterList = new FilterList<>(this.sortedList); + + this.bodyDataProvider = + new ListDataProvider<>(this.filterList, columnPropertyAccessor); + this.bodyDataLayer = new DataLayer(getBodyDataProvider()); + + // layer for event handling of GlazedLists and PropertyChanges + this.glazedListsEventLayer = + new GlazedListsEventLayer<>(this.bodyDataLayer, this.filterList); + + this.selectionLayer = new SelectionLayer(getGlazedListsEventLayer()); + ViewportLayer viewportLayer = new ViewportLayer(getSelectionLayer()); + + FreezeLayer freezeLayer = new FreezeLayer(this.selectionLayer); + CompositeFreezeLayer compositeFreezeLayer = + new CompositeFreezeLayer(freezeLayer, viewportLayer, this.selectionLayer); + + setUnderlyingLayer(compositeFreezeLayer); + } + + public SelectionLayer getSelectionLayer() { + return this.selectionLayer; + } + + public SortedList getSortedList() { + return this.sortedList; + } + + public FilterList getFilterList() { + return this.filterList; + } + + public IDataProvider getBodyDataProvider() { + return this.bodyDataProvider; + } + + public DataLayer getBodyDataLayer() { + return this.bodyDataLayer; + } + + public GlazedListsEventLayer getGlazedListsEventLayer() { + return this.glazedListsEventLayer; + } + } + +} \ No newline at end of file diff --git a/org.eclipse.nebula.widgets.nattable.extension.e4.feature/feature.xml b/org.eclipse.nebula.widgets.nattable.extension.e4.feature/feature.xml index db9c1ab8b..bb60bb31e 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.e4.feature/feature.xml +++ b/org.eclipse.nebula.widgets.nattable.extension.e4.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.nebula.widgets.nattable.extension.e4/META-INF/MANIFEST.MF b/org.eclipse.nebula.widgets.nattable.extension.e4/META-INF/MANIFEST.MF index 90f8fe57b..214934ca4 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.e4/META-INF/MANIFEST.MF +++ b/org.eclipse.nebula.widgets.nattable.extension.e4/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: NatTable extension for Eclipse 4 Bundle-SymbolicName: org.eclipse.nebula.widgets.nattable.extension.e4;singleton:=true -Bundle-Version: 2.6.0.qualifier +Bundle-Version: 2.7.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-17 Require-Bundle: org.eclipse.swt;bundle-version="3.103.0", org.eclipse.e4.ui.css.core;bundle-version="0.11.0", @@ -39,8 +39,8 @@ Import-Package: org.eclipse.e4.core.di.annotations, org.slf4j;version="1.7.2", org.w3c.dom Bundle-ActivationPolicy: lazy -Export-Package: org.eclipse.nebula.widgets.nattable.extension.e4.css;version="2.6.0", - org.eclipse.nebula.widgets.nattable.extension.e4.painterfactory;version="2.6.0", - org.eclipse.nebula.widgets.nattable.extension.e4.selection;version="2.6.0" +Export-Package: org.eclipse.nebula.widgets.nattable.extension.e4.css;version="2.7.0", + org.eclipse.nebula.widgets.nattable.extension.e4.painterfactory;version="2.7.0", + org.eclipse.nebula.widgets.nattable.extension.e4.selection;version="2.7.0" Automatic-Module-Name: org.eclipse.nebula.widgets.nattable.extension.e4 Bundle-Vendor: Eclipse Nebula NatTable diff --git a/org.eclipse.nebula.widgets.nattable.extension.e4/pom.xml b/org.eclipse.nebula.widgets.nattable.extension.e4/pom.xml index 028fe69e7..a751c4d9d 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.e4/pom.xml +++ b/org.eclipse.nebula.widgets.nattable.extension.e4/pom.xml @@ -5,7 +5,7 @@ org.eclipse.nebula.widgets.nattable parent - 2.6.0-SNAPSHOT + 2.7.0-SNAPSHOT ../pom.xml @@ -72,7 +72,7 @@ org.eclipse.nebula.widgets.nattable org.eclipse.nebula.widgets.nattable.core - 2.6.0-SNAPSHOT + 2.7.0-SNAPSHOT \ No newline at end of file diff --git a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.feature/feature.xml b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.feature/feature.xml index 197e4274c..1a25af1d3 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.feature/feature.xml +++ b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/.classpath b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/.classpath index c152f3e04..cea3fedde 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/.classpath +++ b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/.classpath @@ -1,7 +1,11 @@ - - + + + + + + diff --git a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/.settings/org.eclipse.jdt.core.prefs index 52b8c07c9..12dfdfbb5 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/.settings/org.eclipse.jdt.core.prefs @@ -1,13 +1,13 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 -org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.compliance=17 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.compiler.source=17 org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 diff --git a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/META-INF/MANIFEST.MF b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/META-INF/MANIFEST.MF index 11b338a3b..b65f264a8 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/META-INF/MANIFEST.MF +++ b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/META-INF/MANIFEST.MF @@ -2,9 +2,9 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: NatTable GlazedLists Extensions Test Bundle-SymbolicName: org.eclipse.nebula.widgets.nattable.extension.glazedlists.test -Bundle-Version: 2.6.0.qualifier +Bundle-Version: 2.7.0.qualifier Fragment-Host: org.eclipse.nebula.widgets.nattable.extension.glazedlists -Bundle-RequiredExecutionEnvironment: JavaSE-11 +Bundle-RequiredExecutionEnvironment: JavaSE-17 Import-Package: org.eclipse.jface.viewers, org.eclipse.nebula.widgets.nattable.data.command, org.eclipse.nebula.widgets.nattable.datachange, diff --git a/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/filterrow/ComboBoxGlazedListsFilterStrategyFlattenedCollectionsTest.java b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/filterrow/ComboBoxGlazedListsFilterStrategyFlattenedCollectionsTest.java new file mode 100644 index 000000000..401bd3e09 --- /dev/null +++ b/org.eclipse.nebula.widgets.nattable.extension.glazedlists.test/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/filterrow/ComboBoxGlazedListsFilterStrategyFlattenedCollectionsTest.java @@ -0,0 +1,570 @@ +/******************************************************************************* + * Copyright (c) 2025 Dirk Fauth. + * + * This program and the accompanying materials are made + * available under the terms of the Eclipse Public License 2.0 + * which is available at https://www.eclipse.org/legal/epl-2.0/ + * + * SPDX-License-Identifier: EPL-2.0 + * + * Contributors: + * Dirk Fauth - initial API and implementation + ******************************************************************************/ +package org.eclipse.nebula.widgets.nattable.extension.glazedlists.filterrow; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertIterableEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.stream.Collectors; + +import org.eclipse.nebula.widgets.nattable.config.ConfigRegistry; +import org.eclipse.nebula.widgets.nattable.config.DefaultNatTableStyleConfiguration; +import org.eclipse.nebula.widgets.nattable.data.IColumnAccessor; +import org.eclipse.nebula.widgets.nattable.data.ListDataProvider; +import org.eclipse.nebula.widgets.nattable.data.ReflectiveColumnPropertyAccessor; +import org.eclipse.nebula.widgets.nattable.dataset.person.ExtendedPersonWithAddress; +import org.eclipse.nebula.widgets.nattable.dataset.person.Person; +import org.eclipse.nebula.widgets.nattable.dataset.person.PersonService; +import org.eclipse.nebula.widgets.nattable.edit.EditConstants; +import org.eclipse.nebula.widgets.nattable.extension.glazedlists.fixture.DataLayerFixture; +import org.eclipse.nebula.widgets.nattable.filterrow.FilterRowDataProvider; +import org.eclipse.nebula.widgets.nattable.filterrow.combobox.ComboBoxFilterRowConfiguration; +import org.eclipse.nebula.widgets.nattable.filterrow.combobox.ComboBoxFilterUtils; +import org.eclipse.nebula.widgets.nattable.filterrow.combobox.FilterRowCategoryValueMapper; +import org.eclipse.nebula.widgets.nattable.filterrow.combobox.FilterRowComboBoxDataProvider; +import org.eclipse.nebula.widgets.nattable.filterrow.config.DefaultFilterRowConfiguration; +import org.eclipse.nebula.widgets.nattable.filterrow.config.FilterRowConfigAttributes; +import org.eclipse.nebula.widgets.nattable.layer.DataLayer; +import org.eclipse.nebula.widgets.nattable.layer.cell.ColumnLabelAccumulator; +import org.eclipse.nebula.widgets.nattable.style.DisplayMode; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; + +import ca.odell.glazedlists.EventList; +import ca.odell.glazedlists.FilterList; +import ca.odell.glazedlists.GlazedLists; + +public class ComboBoxGlazedListsFilterStrategyFlattenedCollectionsTest { + + private static EventList baseCollection; + private FilterList filterList; + private DataLayer bodyDataLayer; + + private ConfigRegistry configRegistry; + private DataLayerFixture columnHeaderLayer; + private FilterRowComboBoxDataProvider comboBoxDataProvider; + private ComboBoxGlazedListsFilterStrategy filterStrategy; + private FilterRowDataProvider dataProvider; + + private static String[] personPropertyNames = { + "firstName", + "lastName", + "gender", + "married", + "birthday", + "description", + "password", + "favouriteFood", + "favouriteDrinks" }; + + private static FilterRowCategoryValueMapper categoryValueMapper = new FilterRowCategoryValueMapper() { + + @Override + public List valuesToCategories(List values) { + return values.stream().map(value -> { + if (value != null) { + switch (value) { + case "Burger", "Fries" -> { + return "American Food"; + } + case "Pizza", "Pasta", "Salad" -> { + return "Italian Food"; + } + case "Fish", "Ham", "Sausages", "Vegetables" -> { + return "British Food"; + } + } + } + return null; + }).distinct().collect(Collectors.toList()); + } + + @Override + public Collection resolveCategories(Collection valuesWithCategories) { + return valuesWithCategories.stream().map(category -> { + switch (category) { + case "American Food" -> { + return Arrays.asList("Burger", "Fries"); + } + case "Italian Food" -> { + return Arrays.asList("Pasta", "Pizza", "Salad"); + } + case "British Food" -> { + return Arrays.asList("Fish", "Ham", "Sausages", "Vegetables"); + } + } + return Arrays.asList(category); + }).flatMap(List::stream).distinct().collect(Collectors.toList()); + } + + }; + + @BeforeAll + public static void init() { + // initialize the collection with a big amount of values + baseCollection = GlazedLists.eventList(createFixedExtendedPersonsWithAddress()); + for (int i = 1; i < 100; i++) { + baseCollection.addAll(createFixedExtendedPersonsWithAddress()); + } + } + + private static List createFixedExtendedPersonsWithAddress() { + List persons = new ArrayList<>(); + List fixedPersons = PersonService.getFixedPersons(); + for (int i = 0; i < fixedPersons.size(); i++) { + Person person = fixedPersons.get(i); + int modulo = i % 6; + // description values with a space after the comma + String description = ""; + switch (modulo) { + case 0 -> description = "One"; + case 1 -> description = "One, Two"; + case 2 -> description = "One, Two, Three"; + case 3 -> description = "One, Three, Five"; + case 4 -> description = "Two, Four, Six"; + case 5 -> description = "Two, Three, Six"; + } + + // password values without a space after the comma + String password = ""; + switch (modulo) { + case 0 -> password = "One"; + case 1 -> password = "One,Two"; + case 2 -> password = "One,Two,Three"; + case 3 -> password = "One,Three,Five"; + case 4 -> password = "Two,Four,Six"; + case 5 -> password = "Two,Three,Six"; + } + + List favouriteFood = null; + switch (modulo) { + case 0 -> favouriteFood = Arrays.asList("Pizza", "Burger"); + case 1 -> favouriteFood = Arrays.asList("Salad", "Vegetables"); + case 2 -> favouriteFood = Arrays.asList("Pasta", "Salad"); + case 3 -> favouriteFood = Arrays.asList("Pizza", "Pasta", "Salad"); + case 4 -> favouriteFood = Arrays.asList("Fries", "Burger"); + case 5 -> favouriteFood = Arrays.asList("Ham", "Sausages", "Fish"); + } + + persons.add(new ExtendedPersonWithAddress(person, PersonService.createAddress(), + password, description, 1000.0, + favouriteFood, + Arrays.asList("Water", "Soda", "Beer"))); + } + return persons; + } + + @BeforeEach + public void setup() { + this.filterList = new FilterList<>(GlazedLists.eventList(baseCollection)); + + this.configRegistry = new ConfigRegistry(); + + new DefaultNatTableStyleConfiguration().configureRegistry(this.configRegistry); + new DefaultFilterRowConfiguration().configureRegistry(this.configRegistry); + new ComboBoxFilterRowConfiguration().configureRegistry(this.configRegistry); + + this.columnHeaderLayer = new DataLayerFixture(8, 2, 100, 50); + + IColumnAccessor bodyDataColumnAccessor = new ReflectiveColumnPropertyAccessor<>(personPropertyNames); + this.bodyDataLayer = new DataLayer(new ListDataProvider<>(this.filterList, bodyDataColumnAccessor)); + this.comboBoxDataProvider = new GlazedListsFilterRowComboBoxDataProvider<>( + this.bodyDataLayer, + baseCollection, + bodyDataColumnAccessor); + + this.filterStrategy = new ComboBoxGlazedListsFilterStrategy<>( + this.comboBoxDataProvider, + this.filterList, + bodyDataColumnAccessor, + this.configRegistry); + this.dataProvider = new FilterRowDataProvider<>( + this.filterStrategy, + this.columnHeaderLayer, + this.columnHeaderLayer.getDataProvider(), this.configRegistry); + + for (int i = 0; i < this.dataProvider.getColumnCount(); i++) { + this.dataProvider.getFilterIndexToObjectMap().put(i, EditConstants.SELECT_ALL_ITEMS_VALUE); + } + this.filterStrategy.applyFilter(this.dataProvider.getFilterIndexToObjectMap()); + + // flatten the values for description, password, favouriteFood and + // favouriteDrinks + // columns + this.comboBoxDataProvider.setFlattenCollectionValues(5, true); + this.comboBoxDataProvider.setFlattenCollectionValues(6, true); + this.comboBoxDataProvider.setFlattenCollectionValues(7, true); + this.comboBoxDataProvider.setFlattenCollectionValues(8, true); + + // configure the mapping function for description and password column + this.comboBoxDataProvider.setCustomMapper(5, ComboBoxFilterUtils.DEFAULT_LIST_VALUE_MAP_FUNCTION); + this.comboBoxDataProvider.setCustomMapper(6, ComboBoxFilterUtils.DEFAULT_LIST_VALUE_MAP_FUNCTION); + } + + @Test + public void shouldFlattenDescription() { + List allValues = Arrays.asList("Five", "Four", "One", "Six", "Three", "Two"); + assertEquals(allValues, this.comboBoxDataProvider.getAllValues(5)); + + // disable flattening and check values again + this.comboBoxDataProvider.setFlattenCollectionValues(5, false); + this.comboBoxDataProvider.setCustomMapper(5, null); + + List nonFlattenedValues = Arrays.asList( + "One", + "One, Three, Five", + "One, Two", + "One, Two, Three", + "Two, Four, Six", + "Two, Three, Six"); + assertEquals(nonFlattenedValues, this.comboBoxDataProvider.getAllValues(5)); + } + + @Test + public void shouldFlattenPassword() { + List allValues = Arrays.asList("Five", "Four", "One", "Six", "Three", "Two"); + assertEquals(allValues, this.comboBoxDataProvider.getAllValues(6)); + + // disable flattening and check values again + this.comboBoxDataProvider.setFlattenCollectionValues(6, false); + this.comboBoxDataProvider.setCustomMapper(6, null); + + List nonFlattenedValues = Arrays.asList( + "One", + "One,Three,Five", + "One,Two", + "One,Two,Three", + "Two,Four,Six", + "Two,Three,Six"); + assertEquals(nonFlattenedValues, this.comboBoxDataProvider.getAllValues(6)); + } + + @Test + public void shouldFlattenFood() { + List allValues = Arrays.asList("Burger", "Fish", "Fries", "Ham", "Pasta", "Pizza", "Salad", "Sausages", "Vegetables"); + assertEquals(allValues, this.comboBoxDataProvider.getAllValues(7)); + + // disable flattening and check values again + this.comboBoxDataProvider.setFlattenCollectionValues(7, false); + + List> nonFlattenedValues = Arrays.asList( + Arrays.asList("Pizza", "Burger"), + Arrays.asList("Salad", "Vegetables"), + Arrays.asList("Pasta", "Salad"), + Arrays.asList("Pizza", "Pasta", "Salad"), + Arrays.asList("Fries", "Burger"), + Arrays.asList("Ham", "Sausages", "Fish")); + assertTrue(this.comboBoxDataProvider.getAllValues(7).containsAll(nonFlattenedValues), "Not all flattened values contained in all values"); + assertTrue(nonFlattenedValues.containsAll(this.comboBoxDataProvider.getAllValues(7)), "Not all values contained in flattened values"); + } + + @Test + public void shouldConfigureFlatten() { + // check if default is false in if no configuration is set + assertFalse(this.comboBoxDataProvider.isFlattenCollectionValues(4)); + + // configure flattening programmatically to enable flatten + this.comboBoxDataProvider.setFlattenCollectionValues(4, true); + + // check that the flattening is enabled + assertTrue(this.comboBoxDataProvider.isFlattenCollectionValues(4)); + + // disable flattening again + this.comboBoxDataProvider.setFlattenCollectionValues(4, false); + + // check that the flattening is disabled + assertFalse(this.comboBoxDataProvider.isFlattenCollectionValues(4)); + + // provide a category value mapper which should + // enable the flattening automatically again + this.comboBoxDataProvider.setCategoryValueMapper(4, new FilterRowCategoryValueMapper() { + + @Override + public List valuesToCategories(List values) { + return values; + } + + @Override + public Collection resolveCategories(Collection valuesWithCategories) { + return valuesWithCategories; + } + + }); + + // check that the flattening is enabled + assertTrue(this.comboBoxDataProvider.isFlattenCollectionValues(4)); + } + + @Test + public void shouldConfigureFlattenWithConfigRegistry() { + // configure the labels on the column header + this.columnHeaderLayer.setConfigLabelAccumulator(new ColumnLabelAccumulator()); + // enable ConfigRegistry handling in the data provider + this.comboBoxDataProvider.configureConfigRegistryAccess(this.columnHeaderLayer, this.configRegistry); + + // check if default is false in if no configuration is set + assertFalse(this.comboBoxDataProvider.isFlattenCollectionValues(4)); + + // configure flattening programmatically to enable flatten + this.comboBoxDataProvider.setFlattenCollectionValues(4, true); + + // check that the flattening is enabled + assertTrue(this.comboBoxDataProvider.isFlattenCollectionValues(4)); + + // disable flattening via ConfigRegistry + this.configRegistry.registerConfigAttribute( + FilterRowConfigAttributes.FLATTEN_COLLECTION_VALUES, + Boolean.FALSE, + DisplayMode.NORMAL, + ColumnLabelAccumulator.COLUMN_LABEL_PREFIX + 4); + + // check that flattening is disabled + assertFalse(this.comboBoxDataProvider.isFlattenCollectionValues(4)); + + // provide a category value mapper via ConfigRegistry which should + // enable the flattening automatically again + this.configRegistry.registerConfigAttribute( + FilterRowConfigAttributes.CATEGORY_VALUE_MAPPER, + new FilterRowCategoryValueMapper() { + + @Override + public List valuesToCategories(List values) { + return values; + } + + @Override + public Collection resolveCategories(Collection valuesWithCategories) { + return valuesWithCategories; + } + + }, + DisplayMode.NORMAL, + ColumnLabelAccumulator.COLUMN_LABEL_PREFIX + 4); + + // check that the flattening is enabled + assertTrue(this.comboBoxDataProvider.isFlattenCollectionValues(4)); + } + + @Test + public void shouldConfigureFlattenViaConfigurationAttribute() { + List allValues = Arrays.asList("Five", "Four", "One", "Six", "Three", "Two"); + List nonFlattenedValues = Arrays.asList( + "One", + "One, Three, Five", + "One, Two", + "One, Two, Three", + "Two, Four, Six", + "Two, Three, Six"); + + // disable flattening programmatically + this.comboBoxDataProvider.setFlattenCollectionValues(5, false); + this.comboBoxDataProvider.setCustomMapper(5, null); + + // check that now no flattening is done + assertEquals(nonFlattenedValues, this.comboBoxDataProvider.getAllValues(5)); + + // configure the labels on the column header + this.columnHeaderLayer.setConfigLabelAccumulator(new ColumnLabelAccumulator()); + + // enable ConfigRegistry handling in the data provider + this.comboBoxDataProvider.configureConfigRegistryAccess(this.columnHeaderLayer, this.configRegistry); + // enable flattening via configuration attributes + this.configRegistry.registerConfigAttribute( + FilterRowConfigAttributes.LIST_VALUE_MAP_FUNCTION, + ComboBoxFilterUtils.DEFAULT_LIST_VALUE_MAP_FUNCTION, + DisplayMode.NORMAL, + ColumnLabelAccumulator.COLUMN_LABEL_PREFIX + 5); + this.configRegistry.registerConfigAttribute( + FilterRowConfigAttributes.FLATTEN_COLLECTION_VALUES, + Boolean.TRUE, + DisplayMode.NORMAL, + ColumnLabelAccumulator.COLUMN_LABEL_PREFIX + 5); + + // after changing the configuration via ConfigRegistry we need to clear + // the cache manually + this.comboBoxDataProvider.setFilterCollection(baseCollection, this.columnHeaderLayer); + + assertEquals(allValues, this.comboBoxDataProvider.getAllValues(5)); + + // remove the configuration again and check that flattening is disabled + // again + this.configRegistry.unregisterConfigAttribute( + FilterRowConfigAttributes.LIST_VALUE_MAP_FUNCTION, + DisplayMode.NORMAL, + ColumnLabelAccumulator.COLUMN_LABEL_PREFIX + 5); + this.configRegistry.unregisterConfigAttribute( + FilterRowConfigAttributes.FLATTEN_COLLECTION_VALUES, + DisplayMode.NORMAL, + ColumnLabelAccumulator.COLUMN_LABEL_PREFIX + 5); + + // after changing the configuration via ConfigRegistry we need to clear + // the cache manually + this.comboBoxDataProvider.setFilterCollection(baseCollection, this.columnHeaderLayer); + + // check that now no flattening is done + assertEquals(nonFlattenedValues, this.comboBoxDataProvider.getAllValues(5)); + } + + @Test + public void shouldFilterForDescription() { + assertEquals(1800, this.filterList.size()); + + this.dataProvider.setDataValue(5, 1, Arrays.asList("Five")); + + assertEquals(300, this.filterList.size()); + + for (var person : this.filterList) { + assertEquals(true, person.getDescription().contains("Five")); + } + assertEquals("One, Three, Five", this.filterList.get(0).getDescription()); + + this.dataProvider.setDataValue(5, 1, Arrays.asList("Three", "Five")); + + assertEquals(900, this.filterList.size()); + + // just check once, works because of the modulo based data setup + assertEquals("One, Two, Three", this.filterList.get(0).getDescription()); + assertEquals("One, Three, Five", this.filterList.get(1).getDescription()); + assertEquals("Two, Three, Six", this.filterList.get(2).getDescription()); + } + + @Test + public void shouldFilterForPassword() { + assertEquals(1800, this.filterList.size()); + + this.dataProvider.setDataValue(6, 1, Arrays.asList("Five")); + + assertEquals(300, this.filterList.size()); + + for (var person : this.filterList) { + assertEquals(true, person.getPassword().contains("Five")); + } + assertEquals("One,Three,Five", this.filterList.get(0).getPassword()); + + this.dataProvider.setDataValue(6, 1, Arrays.asList("Three", "Five")); + + assertEquals(900, this.filterList.size()); + + // just check once, works because of the modulo based data setup + assertEquals("One,Two,Three", this.filterList.get(0).getPassword()); + assertEquals("One,Three,Five", this.filterList.get(1).getPassword()); + assertEquals("Two,Three,Six", this.filterList.get(2).getPassword()); + } + + @Test + public void shouldFilterForFood() { + assertEquals(1800, this.filterList.size()); + + this.dataProvider.setDataValue(7, 1, Arrays.asList("Pizza", "Burger")); + + assertEquals(900, this.filterList.size()); + + // just check once, works because of the modulo based data setup + assertIterableEquals(Arrays.asList("Pizza", "Burger"), this.filterList.get(0).getFavouriteFood()); + assertIterableEquals(Arrays.asList("Pizza", "Pasta", "Salad"), this.filterList.get(1).getFavouriteFood()); + assertIterableEquals(Arrays.asList("Fries", "Burger"), this.filterList.get(2).getFavouriteFood()); + } + + @Test + public void shouldResetFilterinSameOrder() { + this.dataProvider.setDataValue(5, 1, Arrays.asList("Six")); + this.dataProvider.setDataValue(7, 1, Arrays.asList("Ham", "Sausages")); + assertEquals(300, this.filterList.size()); + + // this will imply to select all values + this.dataProvider.setDataValue(7, 1, this.comboBoxDataProvider.getValues(7, 0)); + assertEquals(600, this.filterList.size()); + + // setting null should be the same as selecting all + this.dataProvider.setDataValue(5, 1, null); + assertEquals(1800, this.filterList.size()); + } + + @Test + public void shouldResetFilterinDifferentOrder() { + this.dataProvider.setDataValue(5, 1, Arrays.asList("Six")); + this.dataProvider.setDataValue(7, 1, Arrays.asList("Ham", "Sausages")); + assertEquals(300, this.filterList.size()); + + this.dataProvider.setDataValue(5, 1, this.comboBoxDataProvider.getValues(5, 0)); + assertEquals(300, this.filterList.size()); + + this.dataProvider.setDataValue(7, 1, this.comboBoxDataProvider.getValues(7, 0)); + assertEquals(1800, this.filterList.size()); + } + + @Test + public void shouldFilterAll() { + this.dataProvider.setDataValue(5, 1, new ArrayList<>()); + assertEquals(0, this.filterList.size()); + } + + @Test + public void shouldAddCategories() { + this.comboBoxDataProvider.setCategoryValueMapper(7, categoryValueMapper); + + List allValues = Arrays.asList("American Food", "British Food", "Italian Food", "Burger", "Fish", "Fries", "Ham", "Pasta", "Pizza", "Salad", "Sausages", "Vegetables"); + assertEquals(allValues, this.comboBoxDataProvider.getAllValues(7)); + } + + @Test + public void shouldReplaceValuesWithCategories() { + this.comboBoxDataProvider.setCategoryValueMapper(7, categoryValueMapper); + this.comboBoxDataProvider.setCategoriesOnly(7, true); + + List allValues = Arrays.asList("American Food", "British Food", "Italian Food"); + assertEquals(allValues, this.comboBoxDataProvider.getAllValues(7)); + } + + @Test + public void shouldHandleNullWithCategories() { + this.comboBoxDataProvider.setCategoryValueMapper(7, categoryValueMapper); + + // set one value explicitly to null + List favouriteFood0 = baseCollection.get(0).getFavouriteFood(); + baseCollection.get(0).setFavouriteFood(null); + + // set one value to something that is not mapped which results in a null + // category + List favouriteFood1 = baseCollection.get(1).getFavouriteFood(); + baseCollection.get(1).setFavouriteFood(Arrays.asList("Sushi")); + + List allValues = Arrays.asList(null, "American Food", "British Food", "Italian Food", "Burger", "Fish", "Fries", "Ham", "Pasta", "Pizza", "Salad", "Sausages", "Sushi", "Vegetables"); + assertEquals(allValues, this.comboBoxDataProvider.getAllValues(7)); + + baseCollection.get(0).setFavouriteFood(favouriteFood0); + baseCollection.get(1).setFavouriteFood(favouriteFood1); + } + + @Test + public void shouldFilterForCategories() { + this.comboBoxDataProvider.setCategoryValueMapper(7, categoryValueMapper); + + assertEquals(1800, this.filterList.size()); + + this.dataProvider.setDataValue(7, 1, Arrays.asList("British Food")); + + assertEquals(600, this.filterList.size()); + + // just check once, works because of the modulo based data setup + assertIterableEquals(Arrays.asList("Salad", "Vegetables"), this.filterList.get(0).getFavouriteFood()); + assertIterableEquals(Arrays.asList("Ham", "Sausages", "Fish"), this.filterList.get(1).getFavouriteFood()); + } +} diff --git a/org.eclipse.nebula.widgets.nattable.extension.glazedlists/.classpath b/org.eclipse.nebula.widgets.nattable.extension.glazedlists/.classpath index 4a00becd8..81fe078c2 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.glazedlists/.classpath +++ b/org.eclipse.nebula.widgets.nattable.extension.glazedlists/.classpath @@ -1,10 +1,6 @@ - - - - - + diff --git a/org.eclipse.nebula.widgets.nattable.extension.glazedlists/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.nebula.widgets.nattable.extension.glazedlists/.settings/org.eclipse.jdt.core.prefs index 57174e334..c9c0d2f43 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.glazedlists/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.nebula.widgets.nattable.extension.glazedlists/.settings/org.eclipse.jdt.core.prefs @@ -10,9 +10,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nul org.eclipse.jdt.core.compiler.annotation.nullable.secondary= org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve -org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.compliance=17 org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate @@ -114,7 +114,7 @@ org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.compiler.source=17 org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 diff --git a/org.eclipse.nebula.widgets.nattable.extension.glazedlists/META-INF/MANIFEST.MF b/org.eclipse.nebula.widgets.nattable.extension.glazedlists/META-INF/MANIFEST.MF index 188c8bdaf..2ac90192f 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.glazedlists/META-INF/MANIFEST.MF +++ b/org.eclipse.nebula.widgets.nattable.extension.glazedlists/META-INF/MANIFEST.MF @@ -2,18 +2,18 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: NatTable extension for GlazedLists Bundle-SymbolicName: org.eclipse.nebula.widgets.nattable.extension.glazedlists -Bundle-Version: 2.6.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-11 -Export-Package: org.eclipse.nebula.widgets.nattable.extension.glazedlists;version="2.6.0", - org.eclipse.nebula.widgets.nattable.extension.glazedlists.data.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.extension.glazedlists.filterrow;version="2.6.0", - org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy;version="2.6.0", - org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.action;version="2.6.0", - org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.command;version="2.6.0", - org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.summary;version="2.6.0", - org.eclipse.nebula.widgets.nattable.extension.glazedlists.hideshow;version="2.6.0", - org.eclipse.nebula.widgets.nattable.extension.glazedlists.hierarchical;version="2.6.0", - org.eclipse.nebula.widgets.nattable.extension.glazedlists.tree;version="2.6.0" +Bundle-Version: 2.7.0.qualifier +Bundle-RequiredExecutionEnvironment: JavaSE-17 +Export-Package: org.eclipse.nebula.widgets.nattable.extension.glazedlists;version="2.7.0", + org.eclipse.nebula.widgets.nattable.extension.glazedlists.data.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.extension.glazedlists.filterrow;version="2.7.0", + org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy;version="2.7.0", + org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.action;version="2.7.0", + org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.command;version="2.7.0", + org.eclipse.nebula.widgets.nattable.extension.glazedlists.groupBy.summary;version="2.7.0", + org.eclipse.nebula.widgets.nattable.extension.glazedlists.hideshow;version="2.7.0", + org.eclipse.nebula.widgets.nattable.extension.glazedlists.hierarchical;version="2.7.0", + org.eclipse.nebula.widgets.nattable.extension.glazedlists.tree;version="2.7.0" Import-Package: ca.odell.glazedlists;version="[1.11.0,2.0.0)", ca.odell.glazedlists.event;version="[1.11.0,2.0.0)", ca.odell.glazedlists.gui;version="[1.11.0,2.0.0)", @@ -21,6 +21,7 @@ Import-Package: ca.odell.glazedlists;version="[1.11.0,2.0.0)", ca.odell.glazedlists.util.concurrent;version="[1.11.0,2.0.0)", org.apache.commons.codec;version="[1.3.0,2.0.0)", org.apache.commons.codec.binary;version="[1.3.0,2.0.0)", + org.eclipse.collections.api.map.primitive;version="11.1.0", org.eclipse.nebula.widgets.nattable;version="[2.6.0,3.0.0)", org.eclipse.nebula.widgets.nattable.blink;version="[2.6.0,3.0.0)", org.eclipse.nebula.widgets.nattable.command;version="[2.6.0,3.0.0)", diff --git a/org.eclipse.nebula.widgets.nattable.extension.glazedlists/pom.xml b/org.eclipse.nebula.widgets.nattable.extension.glazedlists/pom.xml index 62d349cc4..84912b413 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.glazedlists/pom.xml +++ b/org.eclipse.nebula.widgets.nattable.extension.glazedlists/pom.xml @@ -5,7 +5,7 @@ org.eclipse.nebula.widgets.nattable parent - 2.6.0-SNAPSHOT + 2.7.0-SNAPSHOT ../pom.xml @@ -62,7 +62,7 @@ org.eclipse.nebula.widgets.nattable org.eclipse.nebula.widgets.nattable.core - 2.6.0-SNAPSHOT + 2.7.0-SNAPSHOT \ No newline at end of file diff --git a/org.eclipse.nebula.widgets.nattable.extension.glazedlists/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/filterrow/ComboBoxGlazedListsFilterStrategy.java b/org.eclipse.nebula.widgets.nattable.extension.glazedlists/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/filterrow/ComboBoxGlazedListsFilterStrategy.java index f19645711..bd71b5d0c 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.glazedlists/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/filterrow/ComboBoxGlazedListsFilterStrategy.java +++ b/org.eclipse.nebula.widgets.nattable.extension.glazedlists/src/org/eclipse/nebula/widgets/nattable/extension/glazedlists/filterrow/ComboBoxGlazedListsFilterStrategy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013, 2024 Dirk Fauth and others. + * Copyright (c) 2013, 2025 Dirk Fauth and others. * * This program and the accompanying materials are made * available under the terms of the Eclipse Public License 2.0 @@ -32,6 +32,7 @@ import org.eclipse.nebula.widgets.nattable.edit.EditConstants; import org.eclipse.nebula.widgets.nattable.extension.glazedlists.GlazedListsLockHelper; import org.eclipse.nebula.widgets.nattable.filterrow.combobox.ComboBoxFilterUtils; +import org.eclipse.nebula.widgets.nattable.filterrow.combobox.FilterRowCategoryValueMapper; import org.eclipse.nebula.widgets.nattable.filterrow.combobox.FilterRowComboBoxDataProvider; import org.eclipse.nebula.widgets.nattable.layer.cell.LayerCell; import org.eclipse.nebula.widgets.nattable.util.ObjectUtils; @@ -178,7 +179,7 @@ public void applyFilter(Map filterIndexToObjectMap) { * This implementation is able to handle Collections and will generate a * regular expression containing all values in the Collection. */ - @SuppressWarnings("rawtypes") + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override protected String getStringFromColumnObject(final int columnIndex, final Object object) { final IDisplayConverter displayConverter = this.configRegistry.getConfigAttribute( @@ -189,6 +190,13 @@ protected String getStringFromColumnObject(final int columnIndex, final Object o if (object instanceof Collection) { Collection valueCollection = (Collection) object; StringJoiner joiner = new StringJoiner("|", "(", ")"); //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$ + + FilterRowCategoryValueMapper categoryValueMapper = this.comboBoxDataProvider.getCategoryValueMapper(columnIndex); + if (categoryValueMapper != null) { + // map categories back to values for filtering + valueCollection = categoryValueMapper.resolveCategories(valueCollection); + } + for (Object value : valueCollection) { String convertedValue = displayConverter.canonicalToDisplayValue( new LayerCell(null, columnIndex, 0), @@ -198,7 +206,13 @@ protected String getStringFromColumnObject(final int columnIndex, final Object o // for an empty String add the regular expression for empty // String joiner.add("^$"); //$NON-NLS-1$ + } else if (this.comboBoxDataProvider.isFlattenCollectionValues(columnIndex)) { + // for a flattened collection we need to match the value in + // the string representation of the collection + joiner.add(getFlattenedCollectionPatternPrefix() + Pattern.quote(convertedValue) + getFlattenedCollectionPatternSuffix()); } else { + // normal case, just add the quoted value to search for the + // exact match joiner.add(Pattern.quote(convertedValue)); } } @@ -239,4 +253,34 @@ protected boolean hasComboBoxFilterEditorRegistered() { } return false; } + + /** + * Returns the pattern prefix for the regular expression when filtering for + * flattened collection values. By default this is ".*?(?<=^|,|\[|\s)" to + * match values in a comma-separated list that may have spaces around them + * or start with a bracket. + * + * @return The pattern prefix for the regular expression when filtering for + * flattened collection values. + * + * @since 2.7 + */ + protected String getFlattenedCollectionPatternPrefix() { + return ".*?(?<=^|,|\\[|\\s)"; //$NON-NLS-1$ + } + + /** + * Returns the pattern suffix for the regular expression when filtering for + * flattened collection values. By default this is "(?=,|\]|\s|$).*?" to + * match values in a comma-separated list that may have spaces around them + * or end with a bracket. + * + * @return The pattern suffix for the regular expression when filtering for + * flattened collection values. + * + * @since 2.7 + */ + protected String getFlattenedCollectionPatternSuffix() { + return "(?=,|\\]|\\s|$).*?"; //$NON-NLS-1$ + } } diff --git a/org.eclipse.nebula.widgets.nattable.extension.nebula.feature/feature.xml b/org.eclipse.nebula.widgets.nattable.extension.nebula.feature/feature.xml index f8ee8d1e2..bd0a6e99c 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.nebula.feature/feature.xml +++ b/org.eclipse.nebula.widgets.nattable.extension.nebula.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.nebula.widgets.nattable.extension.nebula.test/.classpath b/org.eclipse.nebula.widgets.nattable.extension.nebula.test/.classpath index f11564569..a4f9f5e4f 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.nebula.test/.classpath +++ b/org.eclipse.nebula.widgets.nattable.extension.nebula.test/.classpath @@ -1,11 +1,7 @@ - - - - - - + + diff --git a/org.eclipse.nebula.widgets.nattable.extension.nebula.test/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.nebula.widgets.nattable.extension.nebula.test/.settings/org.eclipse.jdt.core.prefs index 7adc0fb9a..d4540a53f 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.nebula.test/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.nebula.widgets.nattable.extension.nebula.test/.settings/org.eclipse.jdt.core.prefs @@ -1,10 +1,10 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 -org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.compliance=17 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.compiler.source=17 diff --git a/org.eclipse.nebula.widgets.nattable.extension.nebula.test/META-INF/MANIFEST.MF b/org.eclipse.nebula.widgets.nattable.extension.nebula.test/META-INF/MANIFEST.MF index 3085bf961..e15a3df5b 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.nebula.test/META-INF/MANIFEST.MF +++ b/org.eclipse.nebula.widgets.nattable.extension.nebula.test/META-INF/MANIFEST.MF @@ -2,12 +2,12 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: NatTable Nebula Extension Test Bundle-SymbolicName: org.eclipse.nebula.widgets.nattable.extension.nebula.test -Bundle-Version: 2.6.0.qualifier +Bundle-Version: 2.7.0.qualifier Bundle-Vendor: Eclipse Nebula NatTable Fragment-Host: org.eclipse.nebula.widgets.nattable.extension.nebula Import-Package: org.apache.commons.text;version="[1.12.0,2.0.0)" Automatic-Module-Name: org.eclipse.nebula.widgets.nattable.extension.nebula.test -Bundle-RequiredExecutionEnvironment: JavaSE-11 +Bundle-RequiredExecutionEnvironment: JavaSE-17 Require-Bundle: junit-jupiter-api;bundle-version="5.10.0", junit-jupiter-engine;bundle-version="5.10.0", junit-platform-commons;bundle-version="1.10.0", diff --git a/org.eclipse.nebula.widgets.nattable.extension.nebula/META-INF/MANIFEST.MF b/org.eclipse.nebula.widgets.nattable.extension.nebula/META-INF/MANIFEST.MF index 0cadff914..25ace504f 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.nebula/META-INF/MANIFEST.MF +++ b/org.eclipse.nebula.widgets.nattable.extension.nebula/META-INF/MANIFEST.MF @@ -2,10 +2,10 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: NatTable extension for Nebula widgets Bundle-SymbolicName: org.eclipse.nebula.widgets.nattable.extension.nebula -Bundle-Version: 2.6.0.qualifier +Bundle-Version: 2.7.0.qualifier Bundle-RequiredExecutionEnvironment: JavaSE-17 -Export-Package: org.eclipse.nebula.widgets.nattable.extension.nebula.cdatetime;version="2.6.0", - org.eclipse.nebula.widgets.nattable.extension.nebula.richtext;version="2.6.0" +Export-Package: org.eclipse.nebula.widgets.nattable.extension.nebula.cdatetime;version="2.7.0", + org.eclipse.nebula.widgets.nattable.extension.nebula.richtext;version="2.7.0" Import-Package: org.apache.commons.lang3;version="[3.14.0,4.0.0)", org.apache.commons.text;version="[1.12.0,2.0.0)", org.eclipse.collections.api;version="11.1.0", diff --git a/org.eclipse.nebula.widgets.nattable.extension.nebula/pom.xml b/org.eclipse.nebula.widgets.nattable.extension.nebula/pom.xml index 6958efa81..0b6a11505 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.nebula/pom.xml +++ b/org.eclipse.nebula.widgets.nattable.extension.nebula/pom.xml @@ -5,7 +5,7 @@ org.eclipse.nebula.widgets.nattable parent - 2.6.0-SNAPSHOT + 2.7.0-SNAPSHOT ../pom.xml @@ -69,7 +69,7 @@ org.eclipse.nebula.widgets.nattable org.eclipse.nebula.widgets.nattable.core - 2.6.0-SNAPSHOT + 2.7.0-SNAPSHOT \ No newline at end of file diff --git a/org.eclipse.nebula.widgets.nattable.extension.poi.feature/feature.xml b/org.eclipse.nebula.widgets.nattable.extension.poi.feature/feature.xml index 4f1055921..0d4d29f9c 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.poi.feature/feature.xml +++ b/org.eclipse.nebula.widgets.nattable.extension.poi.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/org.eclipse.nebula.widgets.nattable.extension.poi/.classpath b/org.eclipse.nebula.widgets.nattable.extension.poi/.classpath index e801ebfb4..81fe078c2 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.poi/.classpath +++ b/org.eclipse.nebula.widgets.nattable.extension.poi/.classpath @@ -1,6 +1,6 @@ - + diff --git a/org.eclipse.nebula.widgets.nattable.extension.poi/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.nebula.widgets.nattable.extension.poi/.settings/org.eclipse.jdt.core.prefs index 390507c06..6b8688a0f 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.poi/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.nebula.widgets.nattable.extension.poi/.settings/org.eclipse.jdt.core.prefs @@ -1,7 +1,7 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 -org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.compliance=17 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.autoboxing=ignore @@ -77,7 +77,7 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.release=enabled -org.eclipse.jdt.core.compiler.source=11 +org.eclipse.jdt.core.compiler.source=17 org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 diff --git a/org.eclipse.nebula.widgets.nattable.extension.poi/META-INF/MANIFEST.MF b/org.eclipse.nebula.widgets.nattable.extension.poi/META-INF/MANIFEST.MF index 9326d77b7..2c5ec7c8f 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.poi/META-INF/MANIFEST.MF +++ b/org.eclipse.nebula.widgets.nattable.extension.poi/META-INF/MANIFEST.MF @@ -2,9 +2,9 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: NatTable extension for Apache POI Bundle-SymbolicName: org.eclipse.nebula.widgets.nattable.extension.poi -Bundle-Version: 2.6.0.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-11 -Export-Package: org.eclipse.nebula.widgets.nattable.extension.poi;version="2.6.0" +Bundle-Version: 2.7.0.qualifier +Bundle-RequiredExecutionEnvironment: JavaSE-17 +Export-Package: org.eclipse.nebula.widgets.nattable.extension.poi;version="2.7.0" Import-Package: com.zaxxer.sparsebits;version="[1.3.0,2.0.0)", org.apache.commons.compress.archivers.zip;version="[1.26.0,2.0.0)", org.apache.commons.io.output;version="[2.16.0,3.0.0)", diff --git a/org.eclipse.nebula.widgets.nattable.extension.poi/pom.xml b/org.eclipse.nebula.widgets.nattable.extension.poi/pom.xml index 9c31156f1..14659bb54 100644 --- a/org.eclipse.nebula.widgets.nattable.extension.poi/pom.xml +++ b/org.eclipse.nebula.widgets.nattable.extension.poi/pom.xml @@ -5,7 +5,7 @@ org.eclipse.nebula.widgets.nattable parent - 2.6.0-SNAPSHOT + 2.7.0-SNAPSHOT ../pom.xml @@ -63,7 +63,7 @@ org.eclipse.nebula.widgets.nattable org.eclipse.nebula.widgets.nattable.core - 2.6.0-SNAPSHOT + 2.7.0-SNAPSHOT \ No newline at end of file diff --git a/org.eclipse.nebula.widgets.nattable.test.performance/.classpath b/org.eclipse.nebula.widgets.nattable.test.performance/.classpath index b629a6a2a..a4f9f5e4f 100644 --- a/org.eclipse.nebula.widgets.nattable.test.performance/.classpath +++ b/org.eclipse.nebula.widgets.nattable.test.performance/.classpath @@ -1,7 +1,7 @@ - + diff --git a/org.eclipse.nebula.widgets.nattable.test.performance/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.nebula.widgets.nattable.test.performance/.settings/org.eclipse.jdt.core.prefs index 76aa92aea..12dfdfbb5 100644 --- a/org.eclipse.nebula.widgets.nattable.test.performance/.settings/org.eclipse.jdt.core.prefs +++ b/org.eclipse.nebula.widgets.nattable.test.performance/.settings/org.eclipse.jdt.core.prefs @@ -1,12 +1,16 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 +org.eclipse.jdt.core.compiler.compliance=17 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=17 org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 @@ -14,19 +18,22 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_c org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_assignment=16 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 org.eclipse.jdt.core.formatter.alignment_for_expressions_in_for_loop_header=0 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 org.eclipse.jdt.core.formatter.alignment_for_parameterized_type_references=0 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 @@ -115,11 +122,12 @@ org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=do not ins org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=do not insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=do not insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert @@ -150,6 +158,8 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert @@ -174,13 +184,17 @@ org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert @@ -228,6 +242,8 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do no org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert @@ -264,9 +280,12 @@ org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not inser org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert @@ -302,8 +321,12 @@ org.eclipse.jdt.core.formatter.tabulation.char=space org.eclipse.jdt.core.formatter.tabulation.size=4 org.eclipse.jdt.core.formatter.use_on_off_tags=false org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false +org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true org.eclipse.jdt.core.formatter.wrap_before_assignment_operator=false -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true org.eclipse.jdt.core.formatter.wrap_before_conditional_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true diff --git a/org.eclipse.nebula.widgets.nattable.test.performance/META-INF/MANIFEST.MF b/org.eclipse.nebula.widgets.nattable.test.performance/META-INF/MANIFEST.MF index 5cae8c42f..83a0ee0a7 100644 --- a/org.eclipse.nebula.widgets.nattable.test.performance/META-INF/MANIFEST.MF +++ b/org.eclipse.nebula.widgets.nattable.test.performance/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: NatTable Performance Tests Bundle-SymbolicName: org.eclipse.nebula.widgets.nattable.test.performance Bundle-Version: 1.1.1.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-17 Import-Package: ca.odell.glazedlists, org.eclipse.collections.api;version="10.1.0", org.eclipse.collections.api.collection.primitive;version="10.1.0", diff --git a/org.eclipse.nebula.widgets.nattable.updatesite/pom.xml b/org.eclipse.nebula.widgets.nattable.updatesite/pom.xml index d3bd7f255..438aee490 100644 --- a/org.eclipse.nebula.widgets.nattable.updatesite/pom.xml +++ b/org.eclipse.nebula.widgets.nattable.updatesite/pom.xml @@ -7,7 +7,7 @@ parent org.eclipse.nebula.widgets.nattable - 2.6.0-SNAPSHOT + 2.7.0-SNAPSHOT .. diff --git a/pom.xml b/pom.xml index 2a12cbba7..1c51a16ad 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.eclipse.nebula.widgets.nattable parent - 2.6.0-SNAPSHOT + 2.7.0-SNAPSHOT pom @@ -68,14 +68,14 @@ 1.5.2 ${project.version} - 11 + 17 UTF-8 0.8.5 ${project.basedir}/../org.eclipse.nebula.widgets.nattable.updatesite/target/site/jacoco-aggregate/jacoco.xml ${project.basedir}/../${project.artifactId}.test/target/surefire-reports/ - 11 + 17