X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.district.imports.ui%2Fsrc%2Forg%2Fsimantics%2Fdistrict%2Fimports%2Fui%2FCSVImportWizardPage.java;h=71017b321b90d9486974021f75d01ca4a764b517;hb=8034693a5c86d690649a70a62709d29c3fa197aa;hp=85eeb942d13af1dd470deaf9795fc35e710f85ec;hpb=31bcbe46c93a576cd6ade673a745ea9cb28672da;p=simantics%2Fdistrict.git diff --git a/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizardPage.java b/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizardPage.java index 85eeb942..71017b32 100644 --- a/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizardPage.java +++ b/org.simantics.district.imports.ui/src/org/simantics/district/imports/ui/CSVImportWizardPage.java @@ -44,6 +44,7 @@ public class CSVImportWizardPage extends WizardPage implements FileSelectionList private Combo delimiterCombo; private TableColumnLayout tableColumnLayout; private TableViewer tableViewer; + private Composite tableComposite; protected CSVImportWizardPage(CSVImportModel model) { super("Import CSV Data"); @@ -94,37 +95,15 @@ public class CSVImportWizardPage extends WizardPage implements FileSelectionList }); - Composite tableComposite = new Composite(composite, SWT.BORDER); - TreeColumnLayout treeColumnLayout = new TreeColumnLayout(); - tableComposite.setLayout(treeColumnLayout); - - tableViewer = new TableViewer(tableComposite, SWT.V_SCROLL | SWT.H_SCROLL); - ColumnViewerToolTipSupport.enableFor(tableViewer); - tableViewer.setContentProvider(new IContentProvider() { - - @Override - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - - } - - @Override - public void dispose() { - - } - }); - - Table table = tableViewer.getTable(); - table.setHeaderVisible(true); - table.setLinesVisible(true); - - headerTable = new Table(tableComposite, SWT.NONE); - headerTable.setHeaderVisible(true); - headerTable.setLinesVisible(true); - GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(tableComposite); + tableComposite = new Composite(composite, SWT.BORDER); + tableColumnLayout = new TableColumnLayout(); + tableComposite.setLayout(tableColumnLayout); + + updateHeaders(); setControl(composite); - updateHeaders(); + setPageComplete(false); } @@ -147,7 +126,12 @@ public class CSVImportWizardPage extends WizardPage implements FileSelectionList } private void updateHeaders() { - headerTable.setRedraw(false); + if (headerTable != null) + headerTable.dispose(); + headerTable = new Table(tableComposite, SWT.NONE); + headerTable.setHeaderVisible(true); + headerTable.setLinesVisible(true); + GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL).applyTo(tableComposite); for (int i = 0; i < headerTable.getColumns().length; i++) { TableColumn column = headerTable.getColumns()[i]; column.dispose(); @@ -179,7 +163,6 @@ public class CSVImportWizardPage extends WizardPage implements FileSelectionList } catch (IOException e) { setErrorMessage(e.getMessage()); } - headerTable.setRedraw(true); } }