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 11536 Details for
Bug 64043
[Workbench] Ctrl-tab in maximized editor causes NullPointerException
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch for Ctrl+Tab NPE
npe_64043_patch4.txt (text/plain), 6.29 KB, created by
Ines Khelifi
on 2004-06-03 10:43:57 EDT
(
hide
)
Description:
Patch for Ctrl+Tab NPE
Filename:
MIME Type:
Creator:
Ines Khelifi
Created:
2004-06-03 10:43:57 EDT
Size:
6.29 KB
patch
obsolete
>Index: Eclipse UI/org/eclipse/ui/internal/EditorAreaHelper.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorAreaHelper.java,v >retrieving revision 1.4 >diff -u -r1.4 EditorAreaHelper.java >--- Eclipse UI/org/eclipse/ui/internal/EditorAreaHelper.java 19 May 2004 06:57:46 -0000 1.4 >+++ Eclipse UI/org/eclipse/ui/internal/EditorAreaHelper.java 3 Jun 2004 14:09:14 -0000 >@@ -44,6 +44,8 @@ > this.page = page; > this.editorArea = new EditorSashContainer(IPageLayout.ID_EDITOR_AREA, page); > >+ this.editorArea.createControl(page.getClientComposite()); >+ > final Shell shell = page.getWorkbenchWindow().getShell(); > IHandler openEditorDropDownHandler = new AbstractHandler() { > >Index: Eclipse UI/org/eclipse/ui/internal/EditorManager.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/EditorManager.java,v >retrieving revision 1.42 >diff -u -r1.42 EditorManager.java >--- Eclipse UI/org/eclipse/ui/internal/EditorManager.java 2 Jun 2004 18:54:02 -0000 1.42 >+++ Eclipse UI/org/eclipse/ui/internal/EditorManager.java 3 Jun 2004 14:09:14 -0000 >@@ -51,6 +51,8 @@ > import org.eclipse.swt.graphics.ImageData; > import org.eclipse.swt.graphics.Point; > import org.eclipse.swt.program.Program; >+import org.eclipse.swt.widgets.Composite; >+import org.eclipse.swt.widgets.Control; > import org.eclipse.swt.widgets.Display; > import org.eclipse.swt.widgets.Shell; > import org.eclipse.ui.IEditorActionBarContributor; >@@ -939,7 +941,15 @@ > String workbookID = ref.getMemento().getString(IWorkbenchConstants.TAG_WORKBOOK); > editorPresentation.setActiveEditorWorkbookFromID(workbookID); > openInternalEditor(ref, desc, editorInput, false); >- ref.getPane().createChildControl(); >+ >+ Control ctrl = ref.getPane().getControl(); >+ if (ctrl == null) >+ ref.getPane().createControl((Composite)page.getEditorPresentation().getLayoutPart().getControl()); >+ else >+ ref.getPane().createChildControl(); >+ >+ >+ > // TODO commented during presentation refactor ((EditorPane)ref.getPane()).getWorkbook().updateEditorTab(ref); > } catch (PartInitException e) { > WorkbenchPlugin.log("Exception creating editor: " + e.getMessage()); //$NON-NLS-1$ >Index: Eclipse UI/org/eclipse/ui/internal/PartPane.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartPane.java,v >retrieving revision 1.51 >diff -u -r1.51 PartPane.java >--- Eclipse UI/org/eclipse/ui/internal/PartPane.java 27 May 2004 15:59:26 -0000 1.51 >+++ Eclipse UI/org/eclipse/ui/internal/PartPane.java 3 Jun 2004 14:09:14 -0000 >@@ -120,6 +120,10 @@ > if(control == null) > return; > >+ // Make sure the child control has not been created yet >+ if(control.getChildren().length != 0) >+ return; >+ > final Composite content = new Composite(control, SWT.NONE); > content.setLayout(new FillLayout()); > >Index: Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java,v >retrieving revision 1.25 >diff -u -r1.25 PartSashContainer.java >--- Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java 28 May 2004 16:53:22 -0000 1.25 >+++ Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java 3 Jun 2004 14:09:14 -0000 >@@ -177,6 +177,9 @@ > * Find the sashs around the specified part. > */ > public void findSashes(LayoutPart pane,PartPane.Sashes sashes) { >+ if(root == null) { >+ return; >+ } > LayoutTree part = root.find(pane); > if(part == null) > return; >@@ -365,8 +368,10 @@ > } > } > >- addChild(newRelationshipInfo); >- root.updateSashes(parent); >+ addChild(newRelationshipInfo); >+ if(root != null) { >+ root.updateSashes(parent); >+ } > resizeSashes(parent.getClientArea()); > } > /** >@@ -427,7 +432,9 @@ > child.createControl(parent); > } > >- root.updateSashes(parent); >+ if(root != null) { >+ root.updateSashes(parent); >+ } > active = true; > resizeSashes(parent.getClientArea()); > } >@@ -479,7 +486,9 @@ > * Dispose all sashs used in this perspective. > */ > public void disposeSashes() { >- root.disposeSashes(); >+ if(root != null) { >+ root.disposeSashes(); >+ } > } > /** > * Return the most bottom right part or null if none. >@@ -577,9 +586,12 @@ > return; > > children.remove(child); >- root = root.remove(child); >- if(root != null) >- root.updateSashes(parent); >+ if(root != null) { >+ root = root.remove(child); >+ if(root != null) { >+ root.updateSashes(parent); >+ } >+ } > childRemoved(child); > > if (active){ >@@ -595,15 +607,28 @@ > if (isZoomed()) > zoomOut(); > >- if (!isChild(oldChild))return; >- >+ if (!isChild(oldChild)) { >+ return; >+ } >+ >+ LayoutTree leaf = null; >+ if (root != null) { >+ leaf = root.find(oldChild); >+ } >+ >+ if (leaf == null) { >+ return; >+ } >+ > children.remove(oldChild); > children.add(newChild); >- >+ > childAdded(newChild); >- LayoutTree leaf = root.find(oldChild); >+ > leaf.setPart(newChild); >- root.updateSashes(parent); >+ if (root != null) { >+ root.updateSashes(parent); >+ } > > childRemoved(oldChild); > if (active){ >@@ -617,7 +642,9 @@ > } > private void resizeSashes(Rectangle parentSize) { > if (!active) return; >- root.setBounds(parentSize); >+ if (root != null) { >+ root.setBounds(parentSize); >+ } > } > /** > * @see LayoutPart#setBounds >@@ -696,7 +723,10 @@ > ILayoutContainer sourceContainer = isStackType(sourcePart) ? (ILayoutContainer)sourcePart : sourcePart.getContainer(); > > if (containerBounds.contains(position)) { >- targetPart = root.findPart(parent.toControl(position)); >+ >+ if (root != null) { >+ targetPart = root.findPart(parent.toControl(position)); >+ } > > if (targetPart != null) { > final Control targetControl = targetPart.getControl(); >@@ -887,6 +917,10 @@ > * @param buf > */ > public void describeLayout(StringBuffer buf) { >+ if (root == null) { >+ return; >+ } >+ > if (isZoomed()) { > buf.append("zoomed "); //$NON-NLS-1$ > root.describeLayout(buf);
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 64043
:
11229
| 11536