use of org.erlide.wrangler.refactoring.core.SimpleWranglerRefactoring in project erlide_eclipse by erlang.
the class ComboInputPage method createControl.
@Override
public void createControl(final Composite parent) {
composite = new Composite(parent, SWT.NONE);
inputLabel = new Label(composite, SWT.LEFT);
inputLabel.setText(labelText);
// GridData gridData = new GridData();
// gridData.horizontalAlignment = GridData.FILL;
// gridData.horizontalSpan = 2;
// inputLabel.setLayoutData(gridData);
selectionList = new Combo(composite, SWT.DROP_DOWN);
for (final String s : moduleNames) {
selectionList.add(s);
}
// gridData = new GridData();
// gridData.horizontalAlignment = GridData.FILL;
// gridData.horizontalSpan = 2;
// selectionList.setLayoutData(gridData);
// GridLayout layout = new GridLayout();
final RowLayout layout = new RowLayout();
layout.spacing = 5;
layout.center = true;
composite.setLayout(layout);
setControl(composite);
selectionList.addSelectionListener(new SelectionListener() {
@Override
public void widgetDefaultSelected(final SelectionEvent e) {
}
@Override
@SuppressWarnings("synthetic-access")
public void widgetSelected(final SelectionEvent e) {
((SimpleOneStepWranglerRefactoring) getRefactoring()).setUserInput(selectionList.getText());
setPageComplete(true);
}
});
final IValidator validator = new AtomValidator();
selectionList.addModifyListener(e -> {
if (validator.isValid(selectionList.getText())) {
((SimpleWranglerRefactoring) getRefactoring()).setUserInput(selectionList.getText());
setErrorMessage(null);
setPageComplete(true);
} else {
setPageComplete(false);
setErrorMessage("Module name must be a a valid atom!");
}
});
}
use of org.erlide.wrangler.refactoring.core.SimpleWranglerRefactoring in project erlide_eclipse by erlang.
the class SimpleInputPage method createControl.
@Override
public void createControl(final Composite parent) {
composite = new Composite(parent, SWT.NONE);
inputLabel = new Label(composite, SWT.LEFT);
inputLabel.setText(labelText);
GridData gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.horizontalSpan = 2;
inputLabel.setLayoutData(gridData);
inputText = new Text(composite, SWT.NONE);
gridData = new GridData();
gridData.horizontalAlignment = GridData.FILL;
gridData.horizontalSpan = 2;
gridData.grabExcessHorizontalSpace = true;
inputText.setLayoutData(gridData);
final GridLayout layout = new GridLayout();
layout.numColumns = 2;
composite.setLayout(layout);
setControl(composite);
inputText.addModifyListener(e -> isInputValid());
inputText.setText(defaultInput);
inputText.setFocus();
inputText.setSelection(0, defaultInput.length());
((SimpleWranglerRefactoring) getRefactoring()).setUserInput(inputText.getText());
}
Aggregations