Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 131915 Details for
Bug 271787
[compare] CompilationUnitEditorAdapter creation flow should be more like a flow of a standalone editor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch v02
clipboard.txt (text/plain), 4.59 KB, created by
Tomasz Zarna
on 2009-04-15 07:45:35 EDT
(
hide
)
Description:
Patch v02
Filename:
MIME Type:
Creator:
Tomasz Zarna
Created:
2009-04-15 07:45:35 EDT
Size:
4.59 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.jdt.ui >Index: ui/org/eclipse/jdt/internal/ui/compare/JavaMergeViewer.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/compare/JavaMergeViewer.java,v >retrieving revision 1.30 >diff -u -r1.30 JavaMergeViewer.java >--- ui/org/eclipse/jdt/internal/ui/compare/JavaMergeViewer.java 15 Apr 2009 08:01:49 -0000 1.30 >+++ ui/org/eclipse/jdt/internal/ui/compare/JavaMergeViewer.java 15 Apr 2009 11:25:53 -0000 >@@ -40,6 +40,7 @@ > import org.eclipse.jface.text.source.CompositeRuler; > import org.eclipse.jface.text.source.ISourceViewer; > import org.eclipse.jface.text.source.SourceViewer; >+import org.eclipse.jface.text.source.SourceViewerConfiguration; > > import org.eclipse.ui.IEditorInput; > import org.eclipse.ui.IEditorSite; >@@ -273,8 +274,12 @@ > CompilationUnitEditorAdapter editor= (CompilationUnitEditorAdapter)fEditor.get(sourceViewer); > try { > editor.init((IEditorSite)editor.getSite(), editorInput); >+ editor.createPartControl(sourceViewer); > editor.createActions(); >- configuration= new JavaSourceViewerConfiguration(tools.getColorManager(), fPreferenceStore, editor, getDocumentPartitioning()); >+// configuration= new JavaSourceViewerConfiguration(tools.getColorManager(), fPreferenceStore, editor, getDocumentPartitioning()); >+ SourceViewerConfiguration svc= editor.getJavaSourceViewerConfiguration(); >+ Assert.isTrue(svc instanceof JavaSourceViewerConfiguration); >+ configuration= (JavaSourceViewerConfiguration)svc; > } catch (PartInitException e) { > JavaPlugin.log(e); > } >@@ -473,12 +478,9 @@ > protected SourceViewer createSourceViewer(Composite parent, int textOrientation) { > SourceViewer sourceViewer; > if (getSite() != null) { >- CompilationUnitEditorAdapter editor= new CompilationUnitEditorAdapter(textOrientation); >- editor.createPartControl(parent); >+ CompilationUnitEditorAdapter editor= new CompilationUnitEditorAdapter(); >+ sourceViewer = editor.createJavaSourceViewer(parent, textOrientation); > >- ISourceViewer iSourceViewer= editor.getViewer(); >- Assert.isTrue(iSourceViewer instanceof SourceViewer); >- sourceViewer= (SourceViewer)iSourceViewer; > if (fEditor == null) > fEditor= new HashMap(3); > fEditor.put(sourceViewer, editor); >@@ -525,15 +527,8 @@ > > private class CompilationUnitEditorAdapter extends CompilationUnitEditor { > private boolean fInputSet = false; >- private int fTextOrientation; > private boolean fEditable; > >- CompilationUnitEditorAdapter(int textOrientation) { >- super(); >- fTextOrientation = textOrientation; >- // TODO: has to be set here >- setPreferenceStore(createChainedPreferenceStore(null)); >- } > private void setEditable(boolean editable) { > fEditable= editable; > } >@@ -551,11 +546,23 @@ > } > // else do nothing, we will create actions later, when input is available > } >- public void createPartControl(Composite composite) { >- SourceViewer sourceViewer= createJavaSourceViewer(composite, new CompositeRuler(), null, false, fTextOrientation | SWT.H_SCROLL | SWT.V_SCROLL, createChainedPreferenceStore(null)); >+ /** >+ * Tries to mimic what takes place in >+ * <code>AbstractTextEditor#createPartControl(Composite)</code>. Instead of creating an >+ * editor part it sets previously created source viewer and configures it. >+ * >+ * @param sourceViewer the source viewer to set >+ * @see org.eclipse.ui.texteditor.AbstractTextEditor#createPartControl(Composite) >+ * @see #createJavaSourceViewer(Composite, int) >+ */ >+ public void createPartControl(SourceViewer sourceViewer) { > setSourceViewer(this, sourceViewer); >+ getSourceViewer().configure(getSourceViewerConfiguration()); > getSelectionProvider().addSelectionChangedListener(getSelectionChangedListener()); > } >+ protected SourceViewer createJavaSourceViewer(Composite parent, int textOrientation) { >+ return createJavaSourceViewer(parent, new CompositeRuler(), null, false, textOrientation | SWT.H_SCROLL | SWT.V_SCROLL, createChainedPreferenceStore(null)); >+ } > protected void doSetInput(IEditorInput input) throws CoreException { > super.doSetInput(input); > // the editor input has been explicitly set >@@ -577,6 +584,9 @@ > public void close(boolean save) { > getDocumentProvider().disconnect(getEditorInput()); > } >+ protected SourceViewerConfiguration getJavaSourceViewerConfiguration() { >+ return getSourceViewerConfiguration(); >+ } > } > > // no setter to private field AbstractTextEditor.fSourceViewer
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 271787
:
131400
| 131915 |
131916
|
132601
|
132602