butChooseArch.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
}
public void widgetSelected(SelectionEvent e) {
ResourceSelectionDialog dlg = new ResourceSelectionDialog(comp
.getShell(), ResourcesPlugin.getWorkspace().getRoot(),
"Please select an Acme File");
dlg.setBlockOnOpen(true);
dlg.setHelpAvailable(false);
dlg.setMessage("Select the Acme file that describes"
+ " the architecture of the project");
if (dlg.open() == ResourceSelectionDialog.OK) {
for (Object obj : dlg.getResult()) {
if (obj instanceof IFile) {
IFile file = (IFile) obj;
if (file.getFileExtension() != null) {
for (AdlType type : adlTypes) {
if (file.getName() != null &&
file.getName().endsWith(type.filenameEnding)) {
acmeFileText.setText(file.getFullPath()
.toString());
}
}
}
}
}
}
}
});
Label supportedFormats = new Label(comp, SWT.NONE);
String supportedFormatsText = "The following architecture description formats are supported:";
for (AdlType type : adlTypes) {
supportedFormatsText += "\n" + type.name + " (*." + type.filenameEnding + ")";
}
supportedFormats.setText(supportedFormatsText);
gd = new GridData();
gd.horizontalSpan = 3;
supportedFormats.setLayoutData(gd);
// Architecture Mapping selection...
butArchMappingPresent = new Button(comp, SWT.CHECK);
butArchMappingPresent.setText("Use architecture mapping file");
gd = new GridData();
gd.verticalIndent = 15;
gd.horizontalSpan = 3;
butArchMappingPresent.setLayoutData(gd);
butArchMappingPresent.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
}
public void widgetSelected(SelectionEvent e) {
boolean selected = butArchMappingPresent.getSelection();
butChooseArchMapping.setEnabled(selected);
archMappingFileText.setEnabled(selected);
}
});
Label archMappingLabel = new Label(comp, SWT.NONE);
archMappingLabel.setText("Architecture mapping:");
archMappingFileText = new Text(comp, SWT.BORDER);
archMappingFileText.setText(pref.getArchitectureMappingFilename());
gd = new GridData();
gd.grabExcessHorizontalSpace = true;
gd.horizontalAlignment = SWT.FILL;
archMappingFileText.setLayoutData(gd);
butChooseArchMapping = new Button(comp, SWT.NONE);
butChooseArchMapping.setText("Choose Architecture Mapping...");
butChooseArchMapping.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent e) {
}
public void widgetSelected(SelectionEvent e) {
ResourceSelectionDialog dlg = new ResourceSelectionDialog(comp
.getShell(), ResourcesPlugin.getWorkspace().getRoot(),
"Please select an Architecture Mapping File");
dlg.setBlockOnOpen(true);
dlg.setHelpAvailable(false);
dlg.setMessage("Select the Architecture Mapping file that maps"
+ " the architecture to the implementation");
if (dlg.open() == ResourceSelectionDialog.OK) {
for (Object obj : dlg.getResult()) {
if (obj instanceof IFile) {
IFile file = (IFile) obj;
if (file.getFileExtension() != null
&& file.getFileExtension().equals("xml")) {
archMappingFileText.setText(file.getFullPath()