mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-02 05:45:58 +02:00
Fix for PR 59081
This commit is contained in:
parent
125213c8be
commit
0b7e5958f2
6 changed files with 35 additions and 9 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2004-04-20 Alain Magloire
|
||||||
|
|
||||||
|
Fix for PR 59081
|
||||||
|
|
||||||
|
* model/org/eclipse/cdt/internal/core/model/Openable.java
|
||||||
|
|
||||||
2004-04-19 Alain Magloire
|
2004-04-19 Alain Magloire
|
||||||
|
|
||||||
Fix for PR 59098
|
Fix for PR 59098
|
||||||
|
|
|
@ -99,6 +99,18 @@ public abstract class Openable extends Parent implements IOpenable, IBufferChang
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This element is being closed. Do any necessary cleanup.
|
||||||
|
*/
|
||||||
|
protected void closing(Object info) throws CModelException {
|
||||||
|
if (info instanceof OpenableInfo) {
|
||||||
|
closeBuffer((OpenableInfo)info);
|
||||||
|
} else {
|
||||||
|
closeBuffer(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Builds this element's structure and properties in the given
|
* Builds this element's structure and properties in the given
|
||||||
* info object, based on this element's current contents (i.e. buffer
|
* info object, based on this element's current contents (i.e. buffer
|
||||||
|
|
|
@ -1,3 +1,11 @@
|
||||||
|
2004-04-20 Alain Magloire
|
||||||
|
|
||||||
|
Fix for PR 59081
|
||||||
|
|
||||||
|
* src/org/eclipse/cdt/internal/ui/editor/CDocumentProvider.java
|
||||||
|
* src/org/eclipse/cdt/internal/ui/editor/CEditor.java
|
||||||
|
* src/org/eclipse/cdt/internal/ui/editor/DocumentAdapter.java
|
||||||
|
|
||||||
2004-04-20 David Inglis
|
2004-04-20 David Inglis
|
||||||
|
|
||||||
Enable wraping for build console
|
Enable wraping for build console
|
||||||
|
|
|
@ -95,7 +95,7 @@ public class CDocumentProvider extends TextFileDocumentProvider {
|
||||||
IFileEditorInput input = (IFileEditorInput)element;
|
IFileEditorInput input = (IFileEditorInput)element;
|
||||||
original = createTranslationUnit(input.getFile());
|
original = createTranslationUnit(input.getFile());
|
||||||
IBufferFactory factory = CUIPlugin.getDefault().getBufferFactory();
|
IBufferFactory factory = CUIPlugin.getDefault().getBufferFactory();
|
||||||
copy = (IWorkingCopy) original.getSharedWorkingCopy(getProgressMonitor(), factory);
|
copy = original.getSharedWorkingCopy(getProgressMonitor(), factory);
|
||||||
} else if (element instanceof ITranslationUnitEditorInput) {
|
} else if (element instanceof ITranslationUnitEditorInput) {
|
||||||
ITranslationUnitEditorInput input = (ITranslationUnitEditorInput)element;
|
ITranslationUnitEditorInput input = (ITranslationUnitEditorInput)element;
|
||||||
copy = new CFileElementWorkingCopy(input.getTranslationUnit());
|
copy = new CFileElementWorkingCopy(input.getTranslationUnit());
|
||||||
|
|
|
@ -17,7 +17,6 @@ import org.eclipse.cdt.core.model.ICElement;
|
||||||
import org.eclipse.cdt.core.model.ISourceRange;
|
import org.eclipse.cdt.core.model.ISourceRange;
|
||||||
import org.eclipse.cdt.core.model.ISourceReference;
|
import org.eclipse.cdt.core.model.ISourceReference;
|
||||||
import org.eclipse.cdt.core.model.ITranslationUnit;
|
import org.eclipse.cdt.core.model.ITranslationUnit;
|
||||||
import org.eclipse.cdt.core.model.IWorkingCopy;
|
|
||||||
import org.eclipse.cdt.internal.ui.IContextMenuConstants;
|
import org.eclipse.cdt.internal.ui.IContextMenuConstants;
|
||||||
import org.eclipse.cdt.internal.ui.editor.asm.AsmTextTools;
|
import org.eclipse.cdt.internal.ui.editor.asm.AsmTextTools;
|
||||||
import org.eclipse.cdt.internal.ui.search.actions.OpenDeclarationsAction;
|
import org.eclipse.cdt.internal.ui.search.actions.OpenDeclarationsAction;
|
||||||
|
@ -158,7 +157,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IS
|
||||||
public void propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent event) {
|
public void propertyChange(org.eclipse.core.runtime.Preferences.PropertyChangeEvent event) {
|
||||||
handlePreferencePropertyChanged(new org.eclipse.jface.util.PropertyChangeEvent(event.getSource(), event.getProperty(), event.getOldValue(), event.getNewValue()));
|
handlePreferencePropertyChanged(new org.eclipse.jface.util.PropertyChangeEvent(event.getSource(), event.getProperty(), event.getOldValue(), event.getNewValue()));
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Default constructor.
|
* Default constructor.
|
||||||
|
@ -200,7 +199,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IS
|
||||||
*/
|
*/
|
||||||
public IFile getInputFile() {
|
public IFile getInputFile() {
|
||||||
//IFileEditorInput editorInput = (IFileEditorInput)getEditorInput();
|
//IFileEditorInput editorInput = (IFileEditorInput)getEditorInput();
|
||||||
IEditorInput editorInput = (IEditorInput) getEditorInput();
|
IEditorInput editorInput = getEditorInput();
|
||||||
if (editorInput != null) {
|
if (editorInput != null) {
|
||||||
if ((editorInput instanceof IFileEditorInput)) {
|
if ((editorInput instanceof IFileEditorInput)) {
|
||||||
return ((IFileEditorInput) editorInput).getFile();
|
return ((IFileEditorInput) editorInput).getFile();
|
||||||
|
@ -545,7 +544,7 @@ public class CEditor extends TextEditor implements ISelectionChangedListener, IS
|
||||||
public void setOutlinePageInput(CContentOutlinePage page, IEditorInput input) {
|
public void setOutlinePageInput(CContentOutlinePage page, IEditorInput input) {
|
||||||
if (page != null) {
|
if (page != null) {
|
||||||
IWorkingCopyManager manager = CUIPlugin.getDefault().getWorkingCopyManager();
|
IWorkingCopyManager manager = CUIPlugin.getDefault().getWorkingCopyManager();
|
||||||
page.setInput((IWorkingCopy)manager.getWorkingCopy(input));
|
page.setInput(manager.getWorkingCopy(input));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -117,7 +117,7 @@ public class DocumentAdapter implements IBuffer, IDocumentListener {
|
||||||
public void setContents(char[] contents) {}
|
public void setContents(char[] contents) {}
|
||||||
|
|
||||||
public void setContents(String contents) {}
|
public void setContents(String contents) {}
|
||||||
};
|
}
|
||||||
|
|
||||||
|
|
||||||
/** NULL implementing <code>IBuffer</code> */
|
/** NULL implementing <code>IBuffer</code> */
|
||||||
|
@ -138,7 +138,8 @@ public class DocumentAdapter implements IBuffer, IDocumentListener {
|
||||||
fContents= contents;
|
fContents= contents;
|
||||||
Display.getDefault().syncExec(this);
|
Display.getDefault().syncExec(this);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes a document replace call in the ui thread.
|
* Executes a document replace call in the ui thread.
|
||||||
*/
|
*/
|
||||||
|
@ -162,7 +163,7 @@ public class DocumentAdapter implements IBuffer, IDocumentListener {
|
||||||
fText= text;
|
fText= text;
|
||||||
Display.getDefault().syncExec(this);
|
Display.getDefault().syncExec(this);
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
private static final boolean DEBUG_LINE_DELIMITERS= true;
|
private static final boolean DEBUG_LINE_DELIMITERS= true;
|
||||||
|
|
||||||
|
@ -320,7 +321,7 @@ public class DocumentAdapter implements IBuffer, IDocumentListener {
|
||||||
* @see org.eclipse.cdt.internal.core.model.IBuffer#getOwner()
|
* @see org.eclipse.cdt.internal.core.model.IBuffer#getOwner()
|
||||||
*/
|
*/
|
||||||
public IOpenable getOwner() {
|
public IOpenable getOwner() {
|
||||||
return (IOpenable) fOwner;
|
return fOwner;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue