private void loadContext(XMLizable thing) {
// try to load a context that has the types
if (isContextLoaded)
return;
String contextFile = null;
XMLInputSource input = null;
aeDescription = null;
openingContext = true;
try {
try {
contextFile = fileNeedingContext.getPersistentProperty(new QualifiedName(
AbstractSection.PLUGIN_ID, AbstractSection.IMPORTABLE_PART_CONTEXT));
} catch (CoreException e) {
throw new InternalErrorCDE("unexpected exception", e);
}
ContextForPartDialog dialog = new ContextForPartDialog(PlatformUI.getWorkbench().getDisplay()
.getShells()[0], // ok in Eclipse 3.0
getFile().getProject().getParent(), thing, getFile().getLocation(), this, contextFile);
dialog.setTitle("File specifying context for editing importable part");
if (dialog.open() == Window.CANCEL)
throw new MultilevelCancel();
contextFile = dialog.contextPath;
if (null == contextFile) {
Utility
.popMessage(
"Context Info",
"A context is required to edit this part. However no context was supplied. Editing will be cancelled",
Utility.INFORMATION);
throw new MultilevelCancel();
} else {
try {
input = new XMLInputSource(contextFile);
} catch (IOException e) {
showContextLoadFailureMessage(e, contextFile);
throw new MultilevelCancel();
}
if (null != input)