use of com.devonfw.cobigen.eclipse.wizard.common.control.ButtonListener in project cobigen by devonfw.
the class SelectFilesPage method createControl.
@Override
public void createControl(Composite parent) {
Composite container = new Composite(parent, SWT.FILL);
container.setLayout(new GridLayout());
SashForm sash = new SashForm(container, SWT.HORIZONTAL);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.grabExcessHorizontalSpace = true;
gd.grabExcessVerticalSpace = true;
sash.setLayoutData(gd);
Composite containerLeft = new Composite(sash, SWT.FILL);
containerLeft.setLayout(new GridLayout(1, false));
Label label = new Label(containerLeft, SWT.NONE);
label.setText("Filter (increments):");
this.incrementSelector = new CustomizedCheckboxTreeViewer(containerLeft);
this.incrementSelector.setContentProvider(new SelectIncrementContentProvider());
this.incrementSelector.setInput(this.cobigenWrapper.getAllIncrements());
gd = new GridData(GridData.FILL_BOTH);
gd.grabExcessVerticalSpace = true;
this.incrementSelector.getTree().setLayoutData(gd);
this.incrementSelector.expandAll();
this.containerRight = new Composite(sash, SWT.FILL);
this.containerRight.setLayout(new GridLayout(1, false));
boolean initiallyCustomizable = false;
buildResourceTreeViewer(initiallyCustomizable);
CheckStateListener checkListener = new CheckStateListener(this.cobigenWrapper, this, this.batch);
this.incrementSelector.addCheckStateListener(checkListener);
sash.setWeights(new int[] { 1, 3 });
this.rememberSelection = new Button(container, SWT.CHECK);
this.rememberSelection.setText("Remember my selection");
gd = new GridData();
gd.horizontalAlignment = SWT.BEGINNING;
this.rememberSelection.setLayoutData(gd);
this.rememberSelection.addSelectionListener(checkListener);
Button but = new Button(container, SWT.PUSH);
but.setText("Customize");
gd = new GridData();
gd.horizontalAlignment = SWT.END;
but.setLayoutData(gd);
but.addListener(SWT.Selection, new ButtonListener(initiallyCustomizable, this));
setControl(container);
loadSelection();
}
Aggregations