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 9446 Details for
Bug 56431
[ViewMgmt] Placeholder is lost when a multi-view instanced view is opened
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]
Updated patch. Fixes bugs and addresses questions/comments
pattern_matching_placeholders_patch_2.txt (text/plain), 11.30 KB, created by
Matthew Hatem
on 2004-04-13 14:04:40 EDT
(
hide
)
Description:
Updated patch. Fixes bugs and addresses questions/comments
Filename:
MIME Type:
Creator:
Matthew Hatem
Created:
2004-04-13 14:04:40 EDT
Size:
11.30 KB
patch
obsolete
>Index: Eclipse UI/org/eclipse/ui/internal/FolderLayout.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/FolderLayout.java,v >retrieving revision 1.15 >diff -u -r1.15 FolderLayout.java >--- Eclipse UI/org/eclipse/ui/internal/FolderLayout.java 16 Mar 2004 14:36:42 -0000 1.15 >+++ Eclipse UI/org/eclipse/ui/internal/FolderLayout.java 13 Apr 2004 17:54:05 -0000 >@@ -53,12 +53,15 @@ > return; > > // Get the view's label. >- IViewRegistry reg = WorkbenchPlugin.getDefault().getViewRegistry(); >- IViewDescriptor desc = reg.find(viewId); >- if (desc == null) { >- // cannot safely open the dialog so log the problem >- WorkbenchPlugin.log("Unable to find view label: " + viewId); //$NON-NLS-1$ >- return; >+ // @issue: why do we need to ask the registry for the view?? >+ if (viewId.indexOf("*") == -1) { //$NON-NLS-1$ >+ IViewRegistry reg = WorkbenchPlugin.getDefault().getViewRegistry(); >+ IViewDescriptor desc = reg.find(viewId); >+ if (desc == null) { >+ // cannot safely open the dialog so log the problem >+ WorkbenchPlugin.log("Unable to find view label: " + viewId); //$NON-NLS-1$ >+ return; >+ } > } > > // Create the placeholder. >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.17 >diff -u -r1.17 PartSashContainer.java >--- Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java 9 Apr 2004 19:48:41 -0000 1.17 >+++ Eclipse UI/org/eclipse/ui/internal/PartSashContainer.java 13 Apr 2004 17:54:05 -0000 >@@ -226,11 +226,30 @@ > * Adds the child using ratio and position attributes > * from the specified placeholder without replacing > * the placeholder >+ * >+ * FIXME: I believe there is a bug in computeRelation() >+ * when a part is positioned relative to the editorarea. >+ * We end up with a null relative and 0.0 for a ratio. > */ >-void addChildForPlaceholder(LayoutPart part, LayoutPart placeholder) { >- //FIXME we need to get the relation and ratio >- // from the placholder >- add(part, SWT.RIGHT, 0.5f, placeholder); >+void addChildForPlaceholder(LayoutPart child, LayoutPart placeholder) { >+ RelationshipInfo newRelationshipInfo = new RelationshipInfo(); >+ newRelationshipInfo.part = child; >+ if(root != null) { >+ findPosition(newRelationshipInfo); >+ } >+ >+ // find the relationship info for the placeholder >+ RelationshipInfo[] relationships = computeRelation(); >+ for (int i = 0; i < relationships.length; i ++) { >+ RelationshipInfo info = relationships[i]; >+ if (info.part == placeholder) { >+ newRelationshipInfo.ratio = info.ratio; >+ newRelationshipInfo.relationship = info.relationship; >+ newRelationshipInfo.relative = info.relative; >+ } >+ } >+ >+ addChild(newRelationshipInfo); > root.updateSashes(parent); > resizeSashes(parent.getClientArea()); > } >Index: Eclipse UI/org/eclipse/ui/internal/Perspective.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Perspective.java,v >retrieving revision 1.59 >diff -u -r1.59 Perspective.java >--- Eclipse UI/org/eclipse/ui/internal/Perspective.java 9 Apr 2004 19:48:41 -0000 1.59 >+++ Eclipse UI/org/eclipse/ui/internal/Perspective.java 13 Apr 2004 17:54:06 -0000 >@@ -484,7 +484,11 @@ > * @since 3.0 > */ > public boolean isFixedView(IViewReference ref) { >- return fixedViews.contains(ref.getId()); >+ // check for secondaryId >+ String id = ref.getId(); >+ if (ref.getSecondaryId() != null) >+ id += ":"+ref.getSecondaryId(); //$NON-NLS-1$ >+ return fixedViews.contains(id); > } > /** > * Returns true if a layout or perspective is fixed. >@@ -814,7 +818,10 @@ > ref.setPane(vp); > } > page.addPart(ref); >- if(pres.willPartBeVisible(ref.getId())) { >+ boolean willPartBeVisible = (secondaryId != null) ? >+ pres.willPartBeVisible(ref.getId(), secondaryId) : >+ pres.willPartBeVisible(ref.getId()); >+ if(willPartBeVisible) { > IStatus restoreStatus = viewFactory.restoreView((IViewReference)ref); > result.add(restoreStatus); > if(restoreStatus.getSeverity() == IStatus.OK) { >@@ -840,6 +847,7 @@ > // Get the view details. > IMemento childMem = views[x]; > String viewID = childMem.getString(IWorkbenchConstants.TAG_ID); >+ String secondaryId = childMem.getString(IWorkbenchConstants.TAG_SECONDARY_ID); > Float ratio = childMem.getFloat(IWorkbenchConstants.TAG_RATIO); > if (ratio == null) { > Integer viewWidth = childMem.getInteger(IWorkbenchConstants.TAG_WIDTH); >@@ -848,14 +856,16 @@ > else > ratio = new Float((float)viewWidth.intValue() / (float)getClientComposite().getSize().x); > } >+ // FIXME: this needs to work with mutliple view instances > mapFastViewToWidthRatio.put(viewID, ratio); > >- WorkbenchPartReference ref = (WorkbenchPartReference) viewFactory.getView(viewID); >+ WorkbenchPartReference ref = (WorkbenchPartReference) viewFactory.getView(viewID, secondaryId); > if(ref == null) { >- WorkbenchPlugin.log("Could not create view: '" + viewID + "'."); //$NON-NLS-1$ //$NON-NLS-2$ >+ String logId = (secondaryId!=null) ? viewID +":"+secondaryId : viewID; >+ WorkbenchPlugin.log("Could not create view: '" + logId + "'."); //$NON-NLS-1$ //$NON-NLS-2$ > result.add(new Status( > Status.ERROR,PlatformUI.PLUGIN_ID,0, >- WorkbenchMessages.format("Perspective.couldNotFind", new String[]{viewID}), //$NON-NLS-1$ >+ WorkbenchMessages.format("Perspective.couldNotFind", new String[]{logId}), //$NON-NLS-1$ > null)); > continue; > } >@@ -879,27 +889,9 @@ > IMemento childMem = views[x]; > String viewID = childMem.getString(IWorkbenchConstants.TAG_ID); > >- WorkbenchPartReference ref = (WorkbenchPartReference) viewFactory.getView(viewID); >- if(ref == null) { >- WorkbenchPlugin.log("Could not create view: '" + viewID + "'."); //$NON-NLS-1$ //$NON-NLS-2$ >- result.add(new Status( >- Status.ERROR,PlatformUI.PLUGIN_ID,0, >- WorkbenchMessages.format("Perspective.couldNotFind", new String[]{viewID}), //$NON-NLS-1$ >- null)); >- continue; >- } >- // Add to fixed view list because creating a view pane >- // will come back to check if its a fast view. We really >- // need to clean up this code. >- >- //@issue see directly above, also I don't think we need >- // to actually restore the view bleow, probably shouldn't >- // throw the error above either >- fixedViews.add(ref.getId()); >-// if(ref.getPane() == null) { >-// ref.setPane(new ViewPane((IViewReference)ref,page)); >-// } >-// page.addPart(ref); >+ // we don't really need to create a view here >+ // we are just adding it to a list >+ fixedViews.add(viewID); > } > } > >Index: Eclipse UI/org/eclipse/ui/internal/PerspectivePresentation.java >=================================================================== >RCS file: /home/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/PerspectivePresentation.java,v >retrieving revision 1.29 >diff -u -r1.29 PerspectivePresentation.java >--- Eclipse UI/org/eclipse/ui/internal/PerspectivePresentation.java 9 Apr 2004 19:48:41 -0000 1.29 >+++ Eclipse UI/org/eclipse/ui/internal/PerspectivePresentation.java 13 Apr 2004 17:54:06 -0000 >@@ -330,7 +330,10 @@ > * folder. > */ > public boolean willPartBeVisible(String partId) { >- LayoutPart part = findPart(partId); >+ return willPartBeVisible(partId, null); >+ } >+ public boolean willPartBeVisible(String partId, String secondaryId) { >+ LayoutPart part = findPart(partId, secondaryId); > if (part == null) > return false; > ILayoutContainer container = part.getContainer(); >@@ -742,28 +745,8 @@ > * Wild cards now supported. > */ > private LayoutPart findPart(String id) { >- // Check main window. >- LayoutPart part = findPart(id, mainLayout.getChildren()); >- if (part != null) >- return part; >- >- // Check each detached windows >- for (int i = 0, length = detachedWindowList.size(); i < length; i++) { >- DetachedWindow window = (DetachedWindow) detachedWindowList.get(i); >- part = findPart(id, window.getChildren()); >- if (part != null) >- return part; >- } >- for (int i = 0; i < detachedPlaceHolderList.size(); i++) { >- DetachedPlaceHolder holder = >- (DetachedPlaceHolder) detachedPlaceHolderList.get(i); >- part = findPart(id, holder.getChildren()); >- if (part != null) >- return part; >- } >- >- // Not found. >- return null; >+ String myNull = null; >+ return findPart(id, myNull); > } > /** > * Find the first part that matches the specified >@@ -772,21 +755,27 @@ > */ > private LayoutPart findPart(String primaryId, String secondaryId) { > // check main window. >- LayoutPart part = findPart(primaryId, secondaryId, mainLayout.getChildren()); >+ LayoutPart part = (secondaryId != null) ? >+ findPart(primaryId, secondaryId, mainLayout.getChildren()) : >+ findPart(primaryId, mainLayout.getChildren()); > if (part != null) > return part; > > // check each detached windows. > for (int i = 0, length = detachedWindowList.size(); i < length; i++) { > DetachedWindow window = (DetachedWindow) detachedWindowList.get(i); >- part = findPart(primaryId, secondaryId, window.getChildren()); >+ part = (secondaryId != null) ? >+ findPart(primaryId, secondaryId, window.getChildren()) : >+ findPart(primaryId, window.getChildren()); > if (part != null) > return part; > } > for (int i = 0; i < detachedPlaceHolderList.size(); i++) { > DetachedPlaceHolder holder = > (DetachedPlaceHolder) detachedPlaceHolderList.get(i); >- part = findPart(primaryId, secondaryId, holder.getChildren()); >+ part = (secondaryId != null) ? >+ findPart(primaryId, secondaryId, holder.getChildren()) : >+ findPart(primaryId, holder.getChildren()) ; > if (part != null) > return part; > } >@@ -809,8 +798,8 @@ > MatchingPart currentMatchingPart = null; > for (int i = 0, length = parts.length; i < length; i++) { > LayoutPart part = parts[i]; >+ // check for part equality, parts with secondary ids fail > if (part.getID().equals(id)) { >- // parts with a secondary id do not match in this case > if (part instanceof ViewPane) { > ViewPane pane = (ViewPane) part; > IViewReference ref = (IViewReference)pane.getPartReference(); >@@ -818,17 +807,17 @@ > continue; > } > return part; >- } >- else if (part.getID().indexOf(WILD_CARD) != -1) { >+ } >+ // check pattern matching placeholders >+ else if (part instanceof PartPlaceholder && part.getID().indexOf(WILD_CARD) != -1) { > StringMatcher sm = new StringMatcher(part.getID(), true, false); > MatchingPart matchingPart; > if (sm.match(id)) { > matchingPart = new MatchingPart(part.getID(), null, part); >- if (currentMatchingPart != null && >- matchingPart.pid.length() > currentMatchingPart.pid.length()) >- currentMatchingPart = matchingPart; >- else >+ if (currentMatchingPart == null) > currentMatchingPart = matchingPart; >+ else if (matchingPart.pid.length() > currentMatchingPart.pid.length()) >+ currentMatchingPart = matchingPart; > } > } > else if (part instanceof EditorArea) {
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 56431
:
9271
|
9272
|
9339
|
9340
|
9355
|
9446
|
9713