Hi,
Could you improve in the next version of DialogComponentColumnNameSelection to support database connections (and maybe other porttypes having DataTableSpecs).
The proposed change would be something similar:
Creating a method like this:
private static DataTableSpec getTableSpec(final PortObjectSpec lastTableSpec) {
final DataTableSpec spec = lastTableSpec instanceof DataTableSpec ? (DataTableSpec) lastTableSpec
: lastTableSpec instanceof DatabasePortObjectSpec ? ((DatabasePortObjectSpec) lastTableSpec).getDataTableSpec() : null;
return spec; }
or if you have an interface (for example HasDataTable) to access the inner DataTableSpecs:
private static <T extends PortObjectSpec & HasDataTable> DataTableSpec getTableSpec(final PortObjectSpec lastTableSpec) {
final DataTableSpec spec = lastTableSpec.getDataTableSpec();
return spec;
}
And change checkConfigurabilityBeforeLoad to use
spec = getTableSpec(getLastTableSpec(m_specIndex));
instead of
spec = (DataTableSpec)specs[m_specIndex];
And also change updateComponent's
final DataTableSpec spec =
(DataTableSpec)getLastTableSpec(m_specIndex);
to
final DataTableSpec spec = getTableSpec(getLastTableSpec(m_specIndex));
Thanks, gabor