use of org.talend.repository.nosql.ui.provider.NoSQLSelectorTreeViewerProvider in project tbd-studio-se by Talend.
the class AbstractNoSQLRetrieveSchemaForm method addSchemaFields.
protected void addSchemaFields(Composite parent) {
// $NON-NLS-1$
Group schemaGroup = Form.createGroup(parent, 1, Messages.getString("AbstractNoSQLRetrieveSchemaForm.schemaGroup"));
Composite filterComposite = new Composite(schemaGroup, SWT.NONE);
GridLayout gridLayout = new GridLayout(2, false);
filterComposite.setLayout(gridLayout);
GridData filterCompGridData = new GridData(GridData.FILL_HORIZONTAL);
filterComposite.setLayoutData(filterCompGridData);
// $NON-NLS-1$
filterText = new LabelledText(filterComposite, Messages.getString("AbstractNoSQLRetrieveSchemaForm.nameFilter"), 1);
ScrolledComposite scrolledComposite = new ScrolledComposite(schemaGroup, SWT.H_SCROLL | SWT.V_SCROLL | SWT.NONE);
scrolledComposite.setExpandHorizontal(true);
scrolledComposite.setExpandVertical(true);
scrolledComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
schemaViewer = new ContainerCheckedTreeViewer(scrolledComposite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER | SWT.FULL_SELECTION) {
@Override
protected void doCheckStateChanged(Object element) {
super.doCheckStateChanged(element);
performCheckStateChanged((INoSQLSchemaNode) element);
}
};
schemaViewer.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
schemaViewer.setUseHashlookup(true);
schemaViewer.addFilter(new SchemaViewerFilter());
schemaTree = schemaViewer.getTree();
schemaTree.setHeaderVisible(true);
schemaTree.setLinesVisible(true);
scrolledComposite.setContent(schemaTree);
scrolledComposite.setMinSize(schemaTree.computeSize(SWT.DEFAULT, SWT.DEFAULT));
TreeColumnLayout tcLayout = new TreeColumnLayout();
scrolledComposite.setLayout(tcLayout);
TreeColumn column1 = new TreeColumn(schemaTree, SWT.LEFT);
// $NON-NLS-1$
column1.setText(Messages.getString("AbstractNoSQLRetrieveSchemaForm.name"));
column1.setWidth(300);
column1.setResizable(true);
tcLayout.setColumnData(column1, new ColumnWeightData(40, 150));
TreeColumn column2 = new TreeColumn(schemaTree, SWT.LEFT);
// $NON-NLS-1$
column2.setText(Messages.getString("AbstractNoSQLRetrieveSchemaForm.type"));
column2.setWidth(150);
column2.setResizable(true);
tcLayout.setColumnData(column2, new ColumnWeightData(25, 100));
TreeColumn column3 = new TreeColumn(schemaTree, SWT.LEFT);
// $NON-NLS-1$
column3.setText(Messages.getString("AbstractNoSQLRetrieveSchemaForm.colNum"));
column3.setWidth(130);
column3.setResizable(true);
tcLayout.setColumnData(column3, new ColumnWeightData(20, 50));
TreeColumn column4 = new TreeColumn(schemaTree, SWT.LEFT);
// $NON-NLS-1$
column4.setText(Messages.getString("AbstractNoSQLRetrieveSchemaForm.creationStauts"));
column4.setWidth(120);
column4.setResizable(true);
tcLayout.setColumnData(column4, new ColumnWeightData(15, 70));
try {
List<INoSQLSchemaNode> nodes = wizardPageProvider.createSchemaNodes(getConnection());
NoSQLSelectorTreeViewerProvider viewProvider = new NoSQLSelectorTreeViewerProvider();
schemaViewer.setContentProvider(viewProvider);
schemaViewer.setLabelProvider(viewProvider);
schemaViewer.setInput(nodes);
} catch (NoSQLExtractSchemaException e) {
ExceptionHandler.process(e);
}
}
Aggregations