use of org.erlide.debug.ui.views.InterpretedModuleListContentProvider in project erlide_eclipse by erlang.
the class DebugTab method createControl.
/**
* @wbp.parser.entryPoint
*/
@Override
public void createControl(final Composite parent) {
final Composite comp = new Composite(parent, SWT.NONE);
setControl(comp);
final GridLayout topLayout = new GridLayout();
comp.setLayout(topLayout);
distributedDebugCheck = createCheckButton(comp, "Debug all connected nodes");
final Group attachGroup = SWTUtil.createGroup(comp, "Auto Attach", 1, GridData.FILL_BOTH);
attachGroup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false));
attachOnFirstCallCheck = createCheckButton(attachGroup, "First &call");
attachOnBreakpointCheck = createCheckButton(attachGroup, "&Breakpoint");
attachOnExitCheck = createCheckButton(attachGroup, "E&xit");
distributedDebugCheck.addSelectionListener(fBasicSelectionListener);
attachOnFirstCallCheck.addSelectionListener(fBasicSelectionListener);
attachOnBreakpointCheck.addSelectionListener(fBasicSelectionListener);
attachOnExitCheck.addSelectionListener(fBasicSelectionListener);
final Group interpretedModulesGroup = new Group(comp, SWT.NONE);
final GridData gd_interpretedModulesGroup = new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1);
gd_interpretedModulesGroup.widthHint = 387;
interpretedModulesGroup.setLayoutData(gd_interpretedModulesGroup);
interpretedModulesGroup.setText("Interpreted modules");
interpretedModulesGroup.setLayout(new GridLayout(2, false));
// final Label anyModuleHavingLabel = new Label(interpretedModulesGroup,
// SWT.WRAP);
// anyModuleHavingLabel.setLayoutData(new GridData(279, SWT.DEFAULT));
// anyModuleHavingLabel
// .setText("Any module having breakpoints enabled will be dynamically added to
// the list.\n\nThis widget is disabled for now, it takes 100%CPU for large
// projects. If you need to use \"attach on first call\" or \"attach on exit\",
// please mark the modules by setting a dummy breakpoint in them. Sorry for the
// inconvenience!");
listViewer = new ListViewer(interpretedModulesGroup, SWT.BORDER | SWT.MULTI);
listViewer.addSelectionChangedListener(event -> {
final ISelection selection = event.getSelection();
removeButton.setEnabled(!selection.isEmpty());
});
// checkboxTreeViewer.addCheckStateListener(new ICheckStateListener() {
// @Override
// @SuppressWarnings("synthetic-access")
// public void checkStateChanged(final CheckStateChangedEvent event) {
// final DebugTreeItem dti = (DebugTreeItem) event.getElement();
// checkboxTreeViewer.setGrayed(dti, false);
// final boolean checked = event.getChecked();
// setSubtreeChecked(dti, checked);
// // checkUpwards(checkboxTreeViewer, dti, checked, false);
// updateLaunchConfigurationDialog();
// }
//
// });
listViewer.setLabelProvider(new ModuleItemLabelProvider());
contentProvider = new InterpretedModuleListContentProvider();
listViewer.setContentProvider(contentProvider);
final Control control = listViewer.getControl();
final GridData gd_list = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 3);
gd_list.minimumWidth = 250;
gd_list.minimumHeight = 120;
gd_list.widthHint = 256;
gd_list.heightHint = 220;
control.setLayoutData(gd_list);
addButton = createPushButton(interpretedModulesGroup, "Add...", null);
addButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
final List<IErlModule> result = DebugTab.getModulesFromAddModulesDialog(getShell());
contentProvider.addModules(result);
listViewer.refresh();
updateLaunchConfigurationDialog();
}
});
removeButton = createPushButton(interpretedModulesGroup, "Remove", null);
removeButton.setEnabled(false);
removeButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
final IStructuredSelection selection = (IStructuredSelection) listViewer.getSelection();
for (final Object o : selection.toArray()) {
contentProvider.removeModule((IErlModule) o);
}
listViewer.refresh();
updateLaunchConfigurationDialog();
}
});
}
Aggregations