IWorkbenchPart workbenchPart = editorReference.getPart(true);
if (workbenchPart == null) {
return false;
}
ComponentEditor componentEditor = (ComponentEditor) workbenchPart;
ComponentEditorInput componentEditorInput = componentEditor.getComponentEditorInput();
return componentEditorInput.equals(editorInput);
}
if (!(editorInput instanceof FileEditorInput)) {
return false;
}
IFile inputFile = ResourceUtil.getFile(editorInput);
if (inputFile == null) {
return false;
}
String extension = inputFile.getFileExtension();
if (extension == null) {
return false;
}
if (!this.canHandleExtension(extension)) {
return false;
}
// IEditorInput editorReferenceEditorInput = null;
// expensive: call it as late as possible
IWorkbenchPart workbenchPart = editorReference.getPart(true);
if (workbenchPart == null) {
return false;
}
if (!(workbenchPart instanceof ComponentEditor)) {
return false;
}
ComponentEditor componentEditor = (ComponentEditor) workbenchPart;
ComponentEditorInput componentEditorInput = componentEditor.getComponentEditorInput();
// if(editorReferenceEditorInput == null) {
// return false;
// }
// if(!(editorReferenceEditorInput instanceof ComponentEditorInput)) {
// return false;
// }
// ComponentEditorInput componentEditorInput =
// (ComponentEditorInput)editorReferenceEditorInput;
IEditorInput[] editorInputArray = componentEditorInput.getInput();
for (int i = 0; i < editorInputArray.length; i++) {
IFile inputFileFromEditor = ResourceUtil.getFile(editorInputArray[i]);
if (inputFileFromEditor == null) {
continue;
}