| Summary: | MultiPageEditor wizard template misrepresents that updating form on pagechange is sufficient, it should use a document change listener | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Eclipse Project] PDE | Reporter: | Carl-Johan Sveningsson <cj> | ||||||
| Component: | UI | Assignee: | PDE-UI-Inbox <pde-ui-inbox> | ||||||
| Status: | CLOSED WONTFIX | QA Contact: | |||||||
| Severity: | normal | ||||||||
| Priority: | P3 | CC: | ankur_sharma, curtis.windatt.public, mjmeijer, remy.suen | ||||||
| Version: | 3.6 | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Whiteboard: | stalebug | ||||||||
| Attachments: |
|
||||||||
|
Description
Carl-Johan Sveningsson
FWDing to Platform UI The template project is generated from PDE's 'Plug-in Project' wizard. I believe they come from PDE's org.eclipse.pde.ui.templates bundle. http://dev.eclipse.org/viewcvs/index.cgi/pde/ui/org.eclipse.pde.ui.templates/templates_3.0/multiPageEditor/java/%24contributorClassName%24.java?view=log Any possibility of getting a patch? The templates are in the org.eclipse.pde.ui.templates project as Remy mentioned. The problem disappears when you change the method createPages() in /org.eclipse.pde.ui.templates/templates_3.0/multiPageEditor/java/$editorClassName$.java
as follows:
## add to class:
private final class MPEDocumentChangedListener implements IDocumentListener {
@Override
public void documentChanged(DocumentEvent event) {
sortWords();
}
@Override
public void documentAboutToBeChanged(DocumentEvent event) {
}
}
private IDocument document;
private MPEDocumentChangedListener mpeDocumentChangeListener;
## change methods createPages() and dispose():
/**
* Creates the pages of the multi-page editor.
*/
protected void createPages() {
createPage0();
createPage1();
createPage2();
document = editor.getDocumentProvider().getDocument(getEditorInput());
mpeDocumentChangeListener = new MPEDocumentChangedListener();
document.addDocumentListener(mpeDocumentChangeListener);
}
/**
* The <code>MultiPageEditorPart</code> implementation of this
* <code>IWorkbenchPart</code> method disposes all nested editors.
* Subclasses may extend.
*/
public void dispose() {
document.removeDocumentListener(mpeDocumentChangeListener);
ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
super.dispose();
}
Assign to me and I will provide patches.
Attaching Mylyn context
protected void createPages() {
createPage0();
createPage1();
createPage2();
IDocument document = editor.getDocumentProvider().getDocument(getEditorInput());
document.addDocumentListener(new IDocumentListener() {
@Override
public void documentChanged(DocumentEvent event) {
sortWords();
}
@Override
public void documentAboutToBeChanged(DocumentEvent event) {
}
});
}
But this may not be totally neat, maybe the listener should be removed on dispose as the document maybe shared between editors.
Attaching Mylyn context
Created attachment 253498 [details]
mylyn/context/zip
Created attachment 253502 [details]
MultiPageEditor Preview auto synchs to file open in TextEditor
Using a DocumentListener as per chat transcript.
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. |