public StructureViewTreeElement[] getChildren() {
if (children == null) {
if (datasetEditor.isDisposed()) {
return EMPTY_ARRAY;
}
DBDataset dataset = datasetEditor.getDataset();
if (treeNode instanceof DBObjectBundle) {
DatasetEditorStructureViewElement schemaStructureElement =
new DatasetEditorStructureViewElement(dataset.getSchema(), datasetEditor);
children = new StructureViewTreeElement[] {schemaStructureElement};
}
else if (treeNode instanceof DBSchema) {
DatasetEditorStructureViewElement datasetStructureElement =
new DatasetEditorStructureViewElement(dataset, datasetEditor);
children = new StructureViewTreeElement[] {datasetStructureElement};
}
else if (treeNode instanceof DBDataset) {
List<DBColumn> columns = dataset.getColumns();
children = new StructureViewTreeElement[columns.size()];
for (int i=0; i<children.length; i++) {
children[i] = new DatasetEditorStructureViewElement(columns.get(i), datasetEditor);
}
Arrays.sort(children);