Search in sources :

Example 1 with ButtonListener

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();
}
Also used : ButtonListener(com.devonfw.cobigen.eclipse.wizard.common.control.ButtonListener) SashForm(org.eclipse.swt.custom.SashForm) GridLayout(org.eclipse.swt.layout.GridLayout) SelectIncrementContentProvider(com.devonfw.cobigen.eclipse.wizard.common.model.SelectIncrementContentProvider) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) CheckStateListener(com.devonfw.cobigen.eclipse.wizard.common.control.CheckStateListener) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) CustomizedCheckboxTreeViewer(com.devonfw.cobigen.eclipse.wizard.common.widget.CustomizedCheckboxTreeViewer)

Aggregations

ButtonListener (com.devonfw.cobigen.eclipse.wizard.common.control.ButtonListener)1 CheckStateListener (com.devonfw.cobigen.eclipse.wizard.common.control.CheckStateListener)1 SelectIncrementContentProvider (com.devonfw.cobigen.eclipse.wizard.common.model.SelectIncrementContentProvider)1 CustomizedCheckboxTreeViewer (com.devonfw.cobigen.eclipse.wizard.common.widget.CustomizedCheckboxTreeViewer)1 SashForm (org.eclipse.swt.custom.SashForm)1 GridData (org.eclipse.swt.layout.GridData)1 GridLayout (org.eclipse.swt.layout.GridLayout)1 Button (org.eclipse.swt.widgets.Button)1 Composite (org.eclipse.swt.widgets.Composite)1 Label (org.eclipse.swt.widgets.Label)1