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 67301 Details for
Bug 186862
Make ToolbarLayout extensible
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 ToolbarLayout
patch.txt (text/plain), 2.71 KB, created by
Pratik Shah
on 2007-05-15 15:00:23 EDT
(
hide
)
Description:
Patch for ToolbarLayout
Filename:
MIME Type:
Creator:
Pratik Shah
Created:
2007-05-15 15:00:23 EDT
Size:
2.71 KB
patch
obsolete
>Index: src/org/eclipse/draw2d/ToolbarLayout.java >=================================================================== >RCS file: /cvsroot/tools/org.eclipse.draw2d/src/org/eclipse/draw2d/ToolbarLayout.java,v >retrieving revision 1.23 >diff -u -r1.23 ToolbarLayout.java >--- src/org/eclipse/draw2d/ToolbarLayout.java 29 Mar 2005 23:58:01 -0000 1.23 >+++ src/org/eclipse/draw2d/ToolbarLayout.java 15 May 2007 18:58:12 -0000 >@@ -1,5 +1,5 @@ > /******************************************************************************* >- * Copyright (c) 2000, 2005 IBM Corporation and others. >+ * Copyright (c) 2000, 2007 IBM Corporation and others. > * All rights reserved. This program and the accompanying materials > * are made available under the terms of the Eclipse Public License v1.0 > * which accompanies this distribution, and is available at >@@ -92,8 +92,8 @@ > int height = 0, width = 0; > for (int i = 0; i < children.size(); i++) { > child = (IFigure)children.get(i); >- childSize = transposer.t(preferred ? child.getPreferredSize(wHint, hHint) >- : child.getMinimumSize(wHint, hHint)); >+ childSize = transposer.t(preferred ? getChildPreferredSize(child, wHint, hHint) >+ : getChildMinimumSize(child, wHint, hHint)); > height += childSize.height; > width = Math.max(width, childSize.width); > } >@@ -185,6 +185,28 @@ > } > > /** >+ * @param child the figure whose minimum size is to be determined >+ * @param wHint the width hint >+ * @param hHint the height hint >+ * @return the given figure's minimum size >+ * @since 3.3 >+ */ >+protected Dimension getChildMinimumSize(IFigure child, int wHint, int hHint) { >+ return child.getMinimumSize(wHint, hHint); >+} >+ >+/** >+ * @param child the figure whose preferred size is to be determined >+ * @param wHint the width hint >+ * @param hHint the height hint >+ * @return given figure's preferred size >+ * @since 3.3 >+ */ >+protected Dimension getChildPreferredSize(IFigure child, int wHint, int hHint) { >+ return child.getPreferredSize(wHint, hHint); >+} >+ >+/** > * Returns the minor aligment of the layout. Minor minor axis is the axis perpindicular > * to the overall orientation set in the contructor. > * @return the minor aligment >@@ -276,8 +298,8 @@ > for (int i = 0; i < numChildren; i++) { > child = (IFigure)children.get(i); > >- prefSizes[i] = transposer.t(child.getPreferredSize(wHint, hHint)); >- minSizes[i] = transposer.t(child.getMinimumSize(wHint, hHint)); >+ prefSizes[i] = transposer.t(getChildPreferredSize(child, wHint, hHint)); >+ minSizes[i] = transposer.t(getChildMinimumSize(child, wHint, hHint)); > > totalHeight += prefSizes[i].height; > totalMinHeight += minSizes[i].height;
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 186862
:
67119
|
67301