Search in sources :

Example 1 with ExpressionCheckButtonListener

use of org.erlide.wrangler.refactoring.ui.ExpressionCheckButtonListener in project erlide_eclipse by erlang.

the class SelectionInputPage method createControl.

@Override
public void createControl(final Composite parent) {
    composite = new Composite(parent, SWT.NONE);
    inputLabel = new Label(composite, SWT.LEFT);
    inputLabel.setText(labelText);
    final GridData gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.horizontalSpan = 2;
    inputLabel.setLayoutData(gridData);
    checkButtons = new HashMap<>();
    Button b;
    GridData gd;
    final IDocument doc = ((IErlMemberSelection) GlobalParameters.getWranglerSelection()).getDocument();
    for (final IErlRange r : refactoring.getPositions()) {
        b = new Button(composite, SWT.CHECK);
        b.setText(WranglerUtils.getTextFromEditor(r, doc) + " at " + r.toString());
        gd = new GridData();
        gd.horizontalAlignment = GridData.FILL;
        gd.horizontalSpan = 2;
        gd.grabExcessHorizontalSpace = true;
        b.setLayoutData(gd);
        checkButtons.put(b, r);
        final ExpressionCheckButtonListener l = new ExpressionCheckButtonListener(checkButtons);
        b.addMouseTrackListener(l);
    }
    final GridLayout layout = new GridLayout();
    layout.numColumns = 2;
    composite.setLayout(layout);
    setControl(composite);
}
Also used : IErlRange(org.erlide.wrangler.refactoring.util.IErlRange) ExpressionCheckButtonListener(org.erlide.wrangler.refactoring.ui.ExpressionCheckButtonListener) GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) Button(org.eclipse.swt.widgets.Button) IErlMemberSelection(org.erlide.wrangler.refactoring.selection.IErlMemberSelection) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) IDocument(org.eclipse.jface.text.IDocument)

Aggregations

IDocument (org.eclipse.jface.text.IDocument)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 IErlMemberSelection (org.erlide.wrangler.refactoring.selection.IErlMemberSelection)1 ExpressionCheckButtonListener (org.erlide.wrangler.refactoring.ui.ExpressionCheckButtonListener)1 IErlRange (org.erlide.wrangler.refactoring.util.IErlRange)1