@Override public void init(IEditorSite site, IEditorInput input) throws PartInitException { super.init(site, input); if (!(input instanceof IFileEditorInput)) { setPartName(input.getName()); model = new BMModel(); return; } IFileEditorInput fi = (IFileEditorInput) input; this.inputFile = fi.getFile(); setPartName(inputFile.getName()); IProject proj = inputFile.getProject(); AuroraMetaProject amp = new AuroraMetaProject(proj); try { amp.getAuroraProject(); } catch (ResourceNotFoundException e) { throw new PartInitException( "Meta Project:" + proj.getName() + " ,does not refers a Aurora Project."); } open(); }
private IProject getAuroraProject() throws ResourceNotFoundException { IFile file = designer.getInputFile(); IProject proj = file.getProject(); AuroraMetaProject amp = new AuroraMetaProject(proj); return amp.getAuroraProject(); }