Java Doc for CellLayout.java in  » IDE-Eclipse » ui-workbench » org » eclipse » ui » internal » 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 » ui workbench » org.eclipse.ui.internal.layout 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.eclipse.ui.internal.layout.CellLayout

CellLayout
public class CellLayout extends Layout (Code)

Instance of this class lay out the control children of a Composite in a grid, using a simple set of rules and a simple API. This class is intended to be more predictable than GridLayout and easier to use than FormLayout, while retaining most of the power of both.

The power of a CellLayout lies in the ability to control the size and resizing properties of each row and column. Unlike other layout classes, complex layouts can be created without attaching any layout data to individual controls in the layout.

The various subclasses of IColumnInfo can be used to create columns with fixed width, columns whose width is computed from child controls, or width that grows in proportion to the size of other columns. Layouts can be given a default IColumnInfo that will be used to set the size of any column whose properties have not been explicitly set. This is useful for creating layouts where most or all columns have the same properties. Similarly, the subclasses of IRowInfo can be used to control the height of individual rows.

For a finer grain of control, CellData objects can be attached to individual controls in the layout. These objects serve a similar function as GridData objects serve for GridLayout. They allow controls to span multiple rows or columns, set the justification of the control within its cell, and allow the user to override the preferred size of the control.

In many cases, it is not necessary to attach any layout data to controls in the layout, since the controls can be arranged based on the properties of rows and columns. However, layout data may be attached to individual controls to allow them to span multiple columns or to control their justification within their cell.

All the set methods in this class return this, allowing a layout to be created and initialized in a single line of code. For example:

Composite myControl = new Composite(parent, SWT.NONE); myControl.setLayout(new CellLayout(2).setMargins(10,10).setSpacing(5,5));
since:
   3.0


Field Summary
public static  intcacheHits
    
public static  intcacheMisses
    
 inthorizontalSpacing
     horizontalSpacing specifies the number of pixels between the right edge of one cell and the left edge of its neighbouring cell to the right.
public  intmarginHeight
     marginHeight specifies the number of pixels of vertical margin that will be placed along the top and bottom edges of the layout.
public  intmarginWidth
     marginWidth specifies the number of pixels of horizontal margin that will be placed along the left and right edges of the layout.
 intverticalSpacing
     verticalSpacing specifies the number of pixels between the bottom edge of one cell and the top edge of its neighbouring cell underneath.

Constructor Summary
public  CellLayout(int numCols)
    

Method Summary
public  booleancanGrow(Composite composite, boolean horizontally)
    
 intcomputeControlSize(int control, int constraint, boolean computingHeight)
     Computes one dimension of a control's size
Parameters:
  control - the index of the control being computed
Parameters:
  constraint - the other dimension of the control's size, or SWT.DEFAULT if unknown
Parameters:
  computingHeight - if true, this method returns a height.
 int[]computeMinSizes(int[] constraints, boolean computingRows)
    
protected  PointcomputeSize(Composite composite, int wHint, int hHint, boolean flushCache)
    
 int[]computeSizes(int[] constraints, int availableSpace, boolean computingRows)
    
public  intgetColumns()
    
 intgetDynamicSize(int[] constraints, int[] fixedSizes, boolean computingRows)
    
 intgetGrowthRatio(int start, int length, boolean computingRows)
    
public  PointgetMargins()
     Returns the size of the margins around the outside of the layout.
public  PointgetSpacing()
    
protected  intgetSpan(int controlId, boolean isRow)
    
protected  voidlayout(Composite composite, boolean flushCache)
    
 intpreferredSize(int[] constraints, boolean computingRows)
     Computes one dimension of the preferred size of the layout.
Parameters:
  hint - contains the result if already known, or SWT.DEFAULT if it needs to be computed
Parameters:
  constraints - contains constraints along the other dimension, or SWT.DEFAULT if none.
public  CellLayoutsetColumn(int colNum, Row info)
     Sets the column info for the given column number (the leftmost column is column 0). This replaces any existing info for the column.
public  CellLayoutsetDefaultColumn(Row info)
     Sets the default column settings.
public  CellLayoutsetDefaultRow(Row info)
     Sets the default row settings for this layout.
public  CellLayoutsetMargins(int marginWidth, int marginHeight)
     Sets the size of the margin around the outside of the layout.
public  CellLayoutsetMargins(Point newMargins)
     Sets the size of the margin around the outside of the layout.
public  CellLayoutsetRow(int rowNum, Row info)
     Sets the row info for the given rows.
public  CellLayoutsetSpacing(int horizontalSpacing, int verticalSpacing)
    
public  CellLayoutsetSpacing(Point newSpacing)
    
static  intsumOfSizes(int[] input)
     Computes the sum of all integers in the given array.
static  intsumOfSizes(int[] input, int start, int length)
    

Field Detail
cacheHits
public static int cacheHits(Code)



cacheMisses
public static int cacheMisses(Code)



horizontalSpacing
int horizontalSpacing(Code)
horizontalSpacing specifies the number of pixels between the right edge of one cell and the left edge of its neighbouring cell to the right. The default value is 5.



marginHeight
public int marginHeight(Code)
marginHeight specifies the number of pixels of vertical margin that will be placed along the top and bottom edges of the layout. The default value is 0.



marginWidth
public int marginWidth(Code)
marginWidth specifies the number of pixels of horizontal margin that will be placed along the left and right edges of the layout. The default value is 0.



verticalSpacing
int verticalSpacing(Code)
verticalSpacing specifies the number of pixels between the bottom edge of one cell and the top edge of its neighbouring cell underneath. The default value is 5.




Constructor Detail
CellLayout
public CellLayout(int numCols)(Code)
Creates the layout
Parameters:
  numCols - the number of columns in this layout, or 0 indicating that the whole layout should be on one row.




Method Detail
canGrow
public boolean canGrow(Composite composite, boolean horizontally)(Code)



computeControlSize
int computeControlSize(int control, int constraint, boolean computingHeight)(Code)
Computes one dimension of a control's size
Parameters:
  control - the index of the control being computed
Parameters:
  constraint - the other dimension of the control's size, or SWT.DEFAULT if unknown
Parameters:
  computingHeight - if true, this method returns a height. Else it returns a width the preferred height or width of the control, in pixels



computeMinSizes
int[] computeMinSizes(int[] constraints, boolean computingRows)(Code)



computeSize
protected Point computeSize(Composite composite, int wHint, int hHint, boolean flushCache)(Code)



computeSizes
int[] computeSizes(int[] constraints, int availableSpace, boolean computingRows)(Code)



getColumns
public int getColumns()(Code)



getDynamicSize
int getDynamicSize(int[] constraints, int[] fixedSizes, boolean computingRows)(Code)
Returns the preferred dynamic width of the layout
Parameters:
  constraints -
Parameters:
  fixedSizes -
Parameters:
  computingRows -



getGrowthRatio
int getGrowthRatio(int start, int length, boolean computingRows)(Code)
Returns the relative amount that a control starting on the given row and spanning the given length will contribute
Parameters:
  start -
Parameters:
  length -
Parameters:
  computingRows -



getMargins
public Point getMargins()(Code)
Returns the size of the margins around the outside of the layout. the size of the outer margins, in pixels.



getSpacing
public Point getSpacing()(Code)
Returns the amount of empty space between adjacent cells a point (x,y) corresponding to the number of pixels of emptyspace between adjacent columns and rows respectively



getSpan
protected int getSpan(int controlId, boolean isRow)(Code)



layout
protected void layout(Composite composite, boolean flushCache)(Code)



preferredSize
int preferredSize(int[] constraints, boolean computingRows)(Code)
Computes one dimension of the preferred size of the layout.
Parameters:
  hint - contains the result if already known, or SWT.DEFAULT if it needs to be computed
Parameters:
  constraints - contains constraints along the other dimension, or SWT.DEFAULT if none. Forexample, if we are computing the preferred row sizes, this would be an array of known column sizes.
Parameters:
  computingRows - if true, this method returns the height (pixels). Otherwise, it returns thewidth (pixels).



setColumn
public CellLayout setColumn(int colNum, Row info)(Code)
Sets the column info for the given column number (the leftmost column is column 0). This replaces any existing info for the column. Note that more than one column are allowed to share the same IColumnInfo instance if they have identical properties.
Parameters:
  colNum - the column number to modify
Parameters:
  info - the properties of the column, or null if this column should use thedefault properties



setDefaultColumn
public CellLayout setDefaultColumn(Row info)(Code)
Sets the default column settings. All columns will use these settings unless they have been explicitly assigned custom settings by setColumn.
Parameters:
  info - the properties of all default columns
See Also:   setColumn



setDefaultRow
public CellLayout setDefaultRow(Row info)(Code)
Sets the default row settings for this layout. Unless this is overridden for an individual row, all rows will use the default settings.
Parameters:
  info - the row info object that should be used to set the sizeof rows, by default.



setMargins
public CellLayout setMargins(int marginWidth, int marginHeight)(Code)
Sets the size of the margin around the outside of the layout.
Parameters:
  marginWidth - the size of the margin around the top and bottom of the layout
Parameters:
  marginHeight - the size of the margin on the left and rightof the layout.



setMargins
public CellLayout setMargins(Point newMargins)(Code)
Sets the size of the margin around the outside of the layout.
Parameters:
  newMargins - point indicating the size of the horizontal and verticalmargins, in pixels.



setRow
public CellLayout setRow(int rowNum, Row info)(Code)
Sets the row info for the given rows. The topmost row is row 0. Multiple rows are allowed to share the same RowInfo instance.
Parameters:
  rowNum - the row number to set
Parameters:
  info - the row info that will control the sizing of the given row,or null if the row should use the default settings for this layout.



setSpacing
public CellLayout setSpacing(int horizontalSpacing, int verticalSpacing)(Code)
Sets the amount empty space between cells
Parameters:
  newSpacing - a point (x,y) corresponding to the number of pixels ofempty space between adjacent columns and rows respectively



setSpacing
public CellLayout setSpacing(Point newSpacing)(Code)
Sets the amount empty space between cells
Parameters:
  newSpacing - a point (x,y) corresponding to the number of pixels ofempty space between adjacent columns and rows respectively



sumOfSizes
static int sumOfSizes(int[] input)(Code)
Computes the sum of all integers in the given array. If any of the entries are SWT.DEFAULT, the result is SWT.DEFAULT.



sumOfSizes
static int sumOfSizes(int[] input, int start, int length)(Code)



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