mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
2005-06-29 Alain Magloire
Fix PR 102159: NPE in the referencesSearchGroup: fillcontextMenu. * src/org/eclipse/cdt/internal/ui/editor/CEditor.java * src/org/eclipse/cdt/internal/ui/search/actions/ReferencesSearchGroup.java
This commit is contained in:
parent
288e94d28e
commit
7161893f55
3 changed files with 28 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2005-06-29 Alain Magloire
|
||||||
|
Fix PR 102159: NPE in the referencesSearchGroup: fillcontextMenu.
|
||||||
|
* src/org/eclipse/cdt/internal/ui/editor/CEditor.java
|
||||||
|
* src/org/eclipse/cdt/internal/ui/search/actions/ReferencesSearchGroup.java
|
||||||
|
|
||||||
2005-06-25 Alain Magloire
|
2005-06-25 Alain Magloire
|
||||||
Fix PR 98458: extra semicolon in namespace wizard class.
|
Fix PR 98458: extra semicolon in namespace wizard class.
|
||||||
* src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassCodeGenerator.java
|
* src/org/eclipse/cdt/internal/ui/wizards/classwizard/NewClassCodeGenerator.java
|
||||||
|
|
|
@ -236,6 +236,9 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IS
|
||||||
if (fProjectionModelUpdater != null) {
|
if (fProjectionModelUpdater != null) {
|
||||||
fProjectionModelUpdater.initialize();
|
fProjectionModelUpdater.initialize();
|
||||||
}
|
}
|
||||||
|
if (fCEditorErrorTickUpdater != null) {
|
||||||
|
fCEditorErrorTickUpdater.updateEditorImage(getInputCElement());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -247,8 +250,22 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IS
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the current input
|
* Returns the C element wrapped by this editors input.
|
||||||
* @return IFile Input file.
|
*
|
||||||
|
* @return the C element wrapped by this editors input.
|
||||||
|
* @since 3.0
|
||||||
|
*/
|
||||||
|
public ICElement getInputCElement () {
|
||||||
|
return CUIPlugin.getDefault().getWorkingCopyManager().getWorkingCopy(getEditorInput());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the current IFile input.
|
||||||
|
* This method will be remove after cdt-3.0.
|
||||||
|
* We can not guaranty that the input is an IFile, it may
|
||||||
|
* an external file. Clients should test for <code>null<code> or use getInputCElement()
|
||||||
|
* @deprecated use <code>CEditor.getInputCElement()</code>.
|
||||||
|
* @return IFile Input file or null if input is not and IFileEditorInput.
|
||||||
*/
|
*/
|
||||||
public IFile getInputFile() {
|
public IFile getInputFile() {
|
||||||
IEditorInput editorInput = getEditorInput();
|
IEditorInput editorInput = getEditorInput();
|
||||||
|
|
|
@ -83,8 +83,9 @@ public class ReferencesSearchGroup extends ActionGroup {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fEditor != null){
|
if (fEditor != null){
|
||||||
IFile fileInput= fEditor.getInputFile();
|
//IFile fileInput= fEditor.getInputFile();
|
||||||
ICDTIndexer indexer = CCorePlugin.getDefault().getCoreModel().getIndexManager().getIndexerForProject(fileInput.getProject());
|
ICElement celement = fEditor.getInputCElement();
|
||||||
|
ICDTIndexer indexer = CCorePlugin.getDefault().getCoreModel().getIndexManager().getIndexerForProject(celement.getCProject().getProject());
|
||||||
if (indexer != null){
|
if (indexer != null){
|
||||||
setReferenceMenuEnabled(indexer.getIndexerFeatures());
|
setReferenceMenuEnabled(indexer.getIndexerFeatures());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue