use of org.erlide.cover.runtime.launch.LaunchType in project erlide_eclipse by erlang.
the class CoverMainTab method initializeFrom.
@Override
public void initializeFrom(final ILaunchConfiguration config) {
try {
final String projectName = config.getAttribute(ICoverAttributes.PROJECT, "");
projectMBr.setText(projectName);
if (projectName != null && !projectName.isEmpty()) {
final IErlProject p = ErlangEngine.getInstance().getModel().getErlangProject(ResourcesPlugin.getWorkspace().getRoot().getProject(projectName));
if (p != null) {
moduleDialog.setElements(createModuleArray(p));
}
}
} catch (final CoreException e) {
projectMBr.setText("");
}
try {
moduleBr.setText(config.getAttribute(ICoverAttributes.MODULE, ""));
} catch (final CoreException e) {
moduleBr.setText("");
}
try {
fileBr.setText(config.getAttribute(ICoverAttributes.FILE, ""));
} catch (final CoreException e) {
fileBr.setText("");
}
try {
final String type = config.getAttribute(ICoverAttributes.TYPE, LaunchType.MODULE.toString());
final LaunchType typeT = LaunchType.valueOf(type);
switch(typeT) {
case MODULE:
singleRadio.setSelection(true);
projectMBr.setEnabled(true);
moduleBr.setEnabled(true);
fileBr.setEnabled(false);
break;
case ALL:
allRadio.setSelection(true);
projectMBr.setEnabled(false);
moduleBr.setEnabled(false);
fileBr.setEnabled(true);
break;
default:
singleRadio.setSelection(true);
projectMBr.setEnabled(true);
moduleBr.setEnabled(true);
fileBr.setEnabled(false);
break;
}
} catch (final CoreException e) {
singleRadio.setSelection(true);
}
String combo;
try {
combo = config.getAttribute(ICoverAttributes.COMBO, FrameworkType.EUNIT.getRepr());
final int idx = testCombo.indexOf(combo);
testCombo.select(idx);
} catch (final CoreException e) {
testCombo.select(0);
}
}
use of org.erlide.cover.runtime.launch.LaunchType in project erlide_eclipse by erlang.
the class CoverMainTab method performApply.
@Override
public void performApply(final ILaunchConfigurationWorkingCopy config) {
LaunchType type;
if (allRadio.getSelection()) {
type = LaunchType.ALL;
} else {
type = LaunchType.MODULE;
}
config.setAttribute(ICoverAttributes.PROJECT, projectMBr.getText());
config.setAttribute(ICoverAttributes.MODULE, moduleBr.getText());
config.setAttribute(ICoverAttributes.FILE, fileBr.getText());
config.setAttribute(ICoverAttributes.TYPE, type.toString());
config.setAttribute(ICoverAttributes.COMBO, testCombo.getText());
}
Aggregations