use of net.sourceforge.usbdm.deviceEditor.model.TabModel in project usbdm-eclipse-plugins by podonoghue.
the class SectionEditor method setModel.
public void setModel(BaseModel model) {
if (fSectionModel == model) {
return;
}
fSectionModel = (SectionModel) model;
for (Object child : fSectionModel.getChildren()) {
BaseModel pageModel = (BaseModel) child;
if (pageModel instanceof TreeViewModel) {
TreeEditor treeEditor = new TreeEditor() {
@Override
protected TreeColumnInformation[] getColumnInformation(TreeViewer viewer) {
final TreeColumnInformation[] fColumnInformation = { new TreeColumnInformation("Property", 350, new NameColumnLabelProvider(), null), new TreeColumnInformation("Value", 450, new ValueColumnLabelProvider(), new ValueColumnEditingSupport(viewer)), new TreeColumnInformation("Description", 550, new DescriptionColumnLabelProvider(), new DescriptionColumnEditingSupport(viewer)) };
return fColumnInformation;
}
};
Control treeControl = treeEditor.createControl(tabArea);
treeControl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
treeEditor.setModel((TreeViewModel) pageModel);
} else if (pageModel instanceof TabModel) {
TabbedEditor tabEditor = new TabbedEditor();
Control treeControl = tabEditor.createControl(tabArea);
treeControl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
tabEditor.setModel(pageModel);
}
}
}
Aggregations