Reputation: 975
I have been working with JPanels and such to build my GUI's. where I work now they use SWT to build their GUI's. I have a composite that I've added a sash to which splits the sash vertically or horizontally based on some attributes of my template. My question is how in SWT do you split a sashForm and make it scrollable on either side of the split. So if i split the sashForm Vertically I would want the ability to scroll on either side of the split individually. Is this possible in SWT? If it is an example of how to do so would be greatly appreciated. Below is the general Idea of the code im working with. Because it is work related I can not provide all code to be reviewed. The class this method is in extends Composite.
private void createContent() {
this.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
this.setLayout(stackLayout);
for (DVTemplate dvTemplate : loadableTemplates) {
for (CompositeTemplate template : dvTemplate.templateList) {
Composite templateComposite;
Composite parentComposite = this;
if (!isEmpty(template.parentComposite)) {
parentComposite = compositeMap
.get(template.parentComposite);
}
if (isEmpty(template.sashStyle)) {
templateComposite = new DataVisualizationComposite(
parentComposite, template.style, template.name,
DataVisualizationComposite.DataVisualization.EMPTY,
template.parentTemplate, true, false);
} else {
if ("HORIZONTAL".equals(template.sashStyle)) {
templateComposite = new SashForm(parentComposite,
SWT.HORIZONTAL);
} else {
templateComposite = new SashForm(parentComposite,
SWT.VERTICAL);
}
}
}
}
}
Upvotes: 0
Views: 658
Reputation: 9474
Add a ScrolledComposite (or some widget that natively supports scrolling - e.g. table or tree) as a sash child.
Upvotes: 4