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 131400 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 v01
clipboard.txt (text/plain), 3.44 KB, created by
Tomasz Zarna
on 2009-04-09 10:38:15 EDT
(
hide
)
Description:
Patch v01
Filename:
MIME Type:
Creator:
Tomasz Zarna
Created:
2009-04-09 10:38:15 EDT
Size:
3.44 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.28 >diff -u -r1.28 JavaMergeViewer.java >--- ui/org/eclipse/jdt/internal/ui/compare/JavaMergeViewer.java 9 Mar 2009 17:31:56 -0000 1.28 >+++ ui/org/eclipse/jdt/internal/ui/compare/JavaMergeViewer.java 9 Apr 2009 14:38:38 -0000 >@@ -272,6 +272,7 @@ > 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()); > } catch (PartInitException e) { >@@ -468,10 +469,8 @@ > protected ISourceViewer createSourceViewer(Composite parent, int textOrientation) { > ISourceViewer sourceViewer; > if (getSite() != null) { >- CompilationUnitEditorAdapter editor= new CompilationUnitEditorAdapter(textOrientation); >- editor.createPartControl(parent); >- >- sourceViewer= editor.getViewer(); >+ CompilationUnitEditorAdapter editor= new CompilationUnitEditorAdapter(); >+ sourceViewer = editor.createJavaSourceViewer(parent, textOrientation); > > if (fEditor == null) > fEditor= new HashMap(3); >@@ -520,15 +519,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; > } >@@ -546,11 +538,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 ISourceViewer 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
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