use of org.knime.base.node.io.filereader.PreviewTableContentView in project knime-core by knime.
the class FixedWidthFRNodeDialog method createPreviewPanel.
/**
* @return jpanel with all the preview components
*/
private JPanel createPreviewPanel() {
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
panel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Preview"));
Box tableBox = Box.createHorizontalBox();
PreviewTableContentView ptcv = new PreviewTableContentView();
m_previewTableView = new TableView(ptcv);
tableBox.add(m_previewTableView);
panel.add(Box.createGlue());
panel.add(tableBox);
ptcv.addPropertyChangeListener(PreviewTableContentView.PROPERTY_SPEC_CHANGED, new PropertyChangeListener() {
@Override
public void propertyChange(final PropertyChangeEvent evt) {
m_colIdx = (int) evt.getNewValue();
m_colIdx = m_nodeSettings.getColIdxIncluded(m_colIdx);
if (m_colIdx < m_nodeSettings.getNumberOfColumns() - 1) {
// don't open edit dialog if clicked column equals
// remaining characters column
onEdit(m_colIdx);
}
}
});
return panel;
}
Aggregations