Java Doc for GridLayoutFactory.java in  » IDE-Eclipse » jface » org » eclipse » jface » layout » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » IDE Eclipse » jface » org.eclipse.jface.layout 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.eclipse.jface.layout.GridLayoutFactory

GridLayoutFactory
final public class GridLayoutFactory (Code)
GridLayoutFactory creates and initializes grid layouts. There are two ways to use GridLayoutFactory. Normally, it is used as a shorthand for writing "new GridLayout()" and initializing a bunch of fields. In this case the main benefit is a more concise syntax and the ability to create more than one identical GridLayout from the same factory. Changing a property of the factory will affect future layouts created by the factory, but has no effect on layouts that have already been created.

GridLayoutFactory can also generate grid data for all the controls in a layout. This is done with the generateLayout method. To use this feature:

  1. Create the composite
  2. Create all the controls in the composite
  3. Call generateLayout

The order here is important. generateLayout must be called after all the child controls have been created. generateLayout will not change any layout data that has already been attached to a child control and it will not recurse into nested composites.


since:
   3.2




Method Summary
public  voidapplyTo(Composite c)
     Creates a new GridLayout and attaches it to the given composite.
public  GridLayoutFactorycopy()
     Creates a copy of the reciever.
public static  GridLayoutcopyLayout(GridLayout l)
    
public  GridLayoutcreate()
     Creates a new GridLayout, and initializes it with values from the factory.
public static  GridLayoutFactorycreateFrom(GridLayout l)
     Creates a factory that creates copies of the given layout.
public  GridLayoutFactoryequalWidth(boolean equal)
    
public  GridLayoutFactoryextendedMargins(int left, int right, int top, int bottom)
     Sets the margins for layouts created with this factory.
public  GridLayoutFactoryextendedMargins(Rectangle differenceRect)
     Sets the margins for layouts created with this factory.
public static  GridLayoutFactoryfillDefaults()
     Creates a GridLayoutFactory that creates GridLayouts with no margins and default dialog spacing.
public  voidgenerateLayout(Composite c)
     Applies this layout to the given composite, and attaches default GridData to all immediate children that don't have one.
public  GridLayoutFactorymargins(Point margins)
     Sets the margins for layouts created with this factory.
public  GridLayoutFactorymargins(int width, int height)
     Sets the margins for layouts created with this factory.
public  GridLayoutFactorynumColumns(int numColumns)
    
public  GridLayoutFactoryspacing(int hSpacing, int vSpacing)
     Sets the spacing for layouts created with this factory.
public  GridLayoutFactoryspacing(Point spacing)
     Sets the spacing for layouts created with this factory.
public static  GridLayoutFactoryswtDefaults()
     Creates a GridLayoutFactory that creates GridLayouts with the default SWT values.



Method Detail
applyTo
public void applyTo(Composite c)(Code)
Creates a new GridLayout and attaches it to the given composite. Does not create the GridData of any of the controls in the composite.
Parameters:
  c - composite whose layout will be set
See Also:   GridLayoutFactory.generateLayout
See Also:   GridLayoutFactory.create
See Also:   GridLayoutFactory



copy
public GridLayoutFactory copy()(Code)
Creates a copy of the reciever. a copy of the reciever



copyLayout
public static GridLayout copyLayout(GridLayout l)(Code)
Copies the given GridLayout instance
Parameters:
  l - layout to copy a new GridLayout



create
public GridLayout create()(Code)
Creates a new GridLayout, and initializes it with values from the factory. a new initialized GridLayout.
See Also:   GridLayoutFactory.applyTo



createFrom
public static GridLayoutFactory createFrom(GridLayout l)(Code)
Creates a factory that creates copies of the given layout.
Parameters:
  l - layout to copy a new GridLayoutFactory instance that creates copies of the given layout



equalWidth
public GridLayoutFactory equalWidth(boolean equal)(Code)
Sets whether the columns should be forced to be equal width
Parameters:
  equal - true iff the columns should be forced to be equal width this



extendedMargins
public GridLayoutFactory extendedMargins(int left, int right, int top, int bottom)(Code)
Sets the margins for layouts created with this factory. The margins specify the number of pixels of horizontal and vertical margin that will be placed along the left, right, top, and bottom edges of the layout. Note that thes margins will be added to the ones specified by GridLayoutFactory.margins(int,int) .
Parameters:
  left - left margin size (pixels)
Parameters:
  right - right margin size (pixels)
Parameters:
  top - top margin size (pixels)
Parameters:
  bottom - bottom margin size (pixels) this
See Also:   GridLayoutFactory.spacing(Point)
See Also:   GridLayoutFactory.spacing(int,int)
since:
   3.3



extendedMargins
public GridLayoutFactory extendedMargins(Rectangle differenceRect)(Code)
Sets the margins for layouts created with this factory. The margins specify the number of pixels of horizontal and vertical margin that will be placed along the left, right, top, and bottom edges of the layout. Note that thes margins will be added to the ones specified by GridLayoutFactory.margins(int,int) .
 // Construct a GridLayout whose left, right, top, and bottom 
 // margin sizes are 10, 5, 0, and 15 respectively
 Rectangle margins = Geometry.createDiffRectangle(10,5,0,15);
 GridLayoutFactory.fillDefaults().extendedMargins(margins).applyTo(composite1);
 

Parameters:
  differenceRect - rectangle which, when added to the client area of thelayout, returns the outer area of the layout. The x and y values ofthe rectangle correspond to the position of the bounds of the layout with respect to the client area. They should be negative. The width and height correspond to the relative size of the boundsof the layout with respect to the client area, and should be positive. this
See Also:   GridLayoutFactory.spacing(Point)
See Also:   GridLayoutFactory.spacing(int,int)
since:
   3.3



fillDefaults
public static GridLayoutFactory fillDefaults()(Code)
Creates a GridLayoutFactory that creates GridLayouts with no margins and default dialog spacing.

Initial values are:

  • numColumns(1)
  • margins(0,0)
  • extendedMargins(0,0,0,0)
  • spacing(LayoutConstants.getSpacing())
  • equalWidth(false)
a GridLayoutFactory that creates GridLayouts as though created withtheir default constructor
See Also:   GridLayoutFactory.swtDefaults



generateLayout
public void generateLayout(Composite c)(Code)
Applies this layout to the given composite, and attaches default GridData to all immediate children that don't have one. The layout is generated using heuristics based on the widget types. In most cases, it will create exactly the same layout that would have been hardcoded by the programmer. In any situation where it does not produce the desired layout, the GridData for any child can be overridden by attaching the layout data before calling this method. In these cases, the special-case layout data can be hardcoded and the algorithm can supply defaults to the rest.

This must be called AFTER all of the child controls have been created and their layouts attached. This method will attach a layout to the given composite. If any new children are created after calling this method, their GridData must be created manually. The algorithm does not recurse into child composites. To generate all the layouts in a widget hierarchy, the method must be called bottom-up for each Composite.

All controls are made to span a single cell. The algorithm tries to classify controls into one of the following categories:

  • Pushbuttons: Set to a constant size large enough to fit their text and no smaller than the default button size.
  • Wrapping with text (labels, read-only text boxes, etc.): override the preferred horizontal size with the default wrapping point, fill horizontally, grab horizontal space, keep the preferred vertical size
  • Wrapping without text (toolbars, coolbars, etc.): fill align, don't grab, use the preferred size
  • Horizontally scrolling controls (anything with horizontal scrollbars or where the user edits text and can cursor through it from left-to-right): override the preferred horizontal size with a constant, grab horizontal, fill horizontal.
  • Vertically scrolling controls (anything with vertical scrollbars or where the user edits text and can cursor through it up and down): override the preferred vertical size with a constant, grab vertical, fill vertical
  • Nested layouts: fill align both directions, grab along any dimension if the layout would be able to expand along that dimension.
  • Non-wrapping non-scrollable read-only text: fill horizontally, center vertically, default size, don't grab
  • Non-wrapping non-scrollable non-text: fill both, default size, don't grab

Parameters:
  c - composite whose layout will be generated



margins
public GridLayoutFactory margins(Point margins)(Code)
Sets the margins for layouts created with this factory. The margins are the distance between the outer cells and the edge of the layout.
Parameters:
  margins - margin size (pixels) this
See Also:   GridLayoutFactory.spacing(Point)
See Also:   GridLayoutFactory.spacing(int,int)



margins
public GridLayoutFactory margins(int width, int height)(Code)
Sets the margins for layouts created with this factory. The margins specify the number of pixels of horizontal and vertical margin that will be placed along the left/right and top/bottom edges of the layout. Note that thes margins will be added to the ones specified by GridLayoutFactory.extendedMargins(int,int,int,int) .
Parameters:
  width - margin width (pixels)
Parameters:
  height - margin height (pixels) this
See Also:   GridLayoutFactory.spacing(Point)
See Also:   GridLayoutFactory.spacing(int,int)



numColumns
public GridLayoutFactory numColumns(int numColumns)(Code)
Sets the number of columns in the layout
Parameters:
  numColumns - number of columns in the layout this



spacing
public GridLayoutFactory spacing(int hSpacing, int vSpacing)(Code)
Sets the spacing for layouts created with this factory. The spacing is the distance between cells within the layout.
Parameters:
  hSpacing - horizontal spacing (pixels)
Parameters:
  vSpacing - vertical spacing (pixels) this
See Also:   GridLayoutFactory.margins(Point)
See Also:   GridLayoutFactory.margins(int,int)



spacing
public GridLayoutFactory spacing(Point spacing)(Code)
Sets the spacing for layouts created with this factory. The spacing is the distance between cells within the layout.
Parameters:
  spacing - space between controls in the layout (pixels) this
See Also:   GridLayoutFactory.margins(Point)
See Also:   GridLayoutFactory.margins(int,int)



swtDefaults
public static GridLayoutFactory swtDefaults()(Code)
Creates a GridLayoutFactory that creates GridLayouts with the default SWT values.

Initial values are:

  • numColumns(1)
  • margins(5,5)
  • extendedMargins(0,0,0,0)
  • spacing(5,5)
  • equalWidth(false)
a GridLayoutFactory that creates GridLayouts as though created withtheir default constructor
See Also:   GridLayoutFactory.fillDefaults



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.