private String getFileName(TextChange change) { Object modifiedElement= change.getModifiedElement(); if (modifiedElement instanceof IFile) { return ((IFile) modifiedElement).getName(); } else if (modifiedElement instanceof ICompilationUnit) { return ((ICompilationUnit) modifiedElement).getElementName(); } return null; } }
private String getFileName(TextChange change) { Object modifiedElement= change.getModifiedElement(); if (modifiedElement instanceof IFile) { return ((IFile) modifiedElement).getName(); } else if (modifiedElement instanceof ICompilationUnit) { return ((ICompilationUnit) modifiedElement).getElementName(); } return null; } }
private void addToTextChangeMap(Change change) { if (change instanceof TextChange) { Object element= ((TextChange)change).getModifiedElement(); if (element != null) { fTextChangeMap.put(element, change); } // check if we have a subclass of TextFileChange. If so also put the change // under the file resource into the hash table if possible. if (change instanceof TextFileChange && !change.getClass().equals(TextFileChange.class)) { IFile file= ((TextFileChange)change).getFile(); fTextChangeMap.put(file, change); } } else if (change instanceof CompositeChange) { Change[] children= ((CompositeChange)change).getChildren(); for (int i= 0; i < children.length; i++) { addToTextChangeMap(children[i]); } } } }
private void addToTextChangeMap(Change change) { if (change instanceof TextChange) { Object element= ((TextChange) change).getModifiedElement(); if (element != null) { fTextChangeMap.put(element, (TextChange) change); } // check if we have a subclass of TextFileChange. If so also put the change // under the file resource into the hash table if possible. if (change instanceof TextFileChange && !change.getClass().equals(TextFileChange.class)) { TextFileChange textFileChange= (TextFileChange) change; IFile file= textFileChange.getFile(); fTextChangeMap.put(file, textFileChange); } } else if (change instanceof CompositeChange) { Change[] children= ((CompositeChange) change).getChildren(); for (int i= 0; i < children.length; i++) { addToTextChangeMap(children[i]); } } } }
private void addToTextChangeMap(Change change) { if (change instanceof TextChange) { Object element= ((TextChange) change).getModifiedElement(); if (element != null) { fTextChangeMap.put(element, (TextChange) change); } // check if we have a subclass of TextFileChange. If so also put the change // under the file resource into the hash table if possible. if (change instanceof TextFileChange && !change.getClass().equals(TextFileChange.class)) { TextFileChange textFileChange= (TextFileChange) change; IFile file= textFileChange.getFile(); fTextChangeMap.put(file, textFileChange); } } else if (change instanceof CompositeChange) { Change[] children= ((CompositeChange) change).getChildren(); for (int i= 0; i < children.length; i++) { addToTextChangeMap(children[i]); } } } }