}
IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
IFile file = workspaceRoot.getFile(filePath);
final IEditorInput newInput = new FileEditorInput(file);
// Check if the editor is already open
IEditorMatchingStrategy matchingStrategy = getEditorDescriptor()
.getEditorMatchingStrategy();
IEditorReference[] editorRefs = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage()
.getEditorReferences();
for (int i = 0; i < editorRefs.length; i++) {
if (matchingStrategy.matches(editorRefs[i], newInput)) {
MessageDialog.openWarning(shell,
Messages.CismodelDiagramEditor_SaveAsErrorTitle,
Messages.CismodelDiagramEditor_SaveAsErrorMessage);
return;
}