Java Doc for TrimLayout.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.TrimLayout

TrimLayout
public class TrimLayout extends Layout implements ICachingLayout,ITrimManager(Code)
Lays out the children of a Composite. One control occupies the center of the composite, and any number of controls may be attached to the top, bottom, and sides. This is a common layout for application windows, which typically have a central work area and a number of small widgets (toolbars, status lines, etc.) attached to the edge.

Unlike most other SWT layouts, this layout does not require layout data to be attached to each child control. Instead, member functions on the Layout are used to control the positioning of controls within the layout.

The interface to this layout is intended to easily support drag-and-drop. Trim widgets can be added, removed, or inserted between other existing widgets and the layout will adjust accordingly. If one side of the layout contains no trim widgets, the central area will expand to reclaim the unused space.

This layout must be told about every widget that it is supposed to arrange. If the composite contains additional widgets, they will not be moved by the layout and may be arranged through other means.


since:
   3.0


Field Summary
final public static  IntegerBOTTOM_ID
     Trim area ID.
final public static  IntegerLEFT_ID
     Trim area ID.
final public static  IntegerNONTRIM_ID
     Trim area ID.
final public static  IntegerRIGHT_ID
     Trim area ID.
final public static  IntegerTOP_ID
     Trim area ID.

Constructor Summary
public  TrimLayout()
     Creates a new (initially empty) trim layout.

Method Summary
public  voidaddTrim(IWindowTrim control, int areaId)
    
public  voidaddTrim(IWindowTrim trim, int areaId, IWindowTrim beforeMe)
    
Parameters:
  trim - new window trim to be added
Parameters:
  areaId - the area ID
Parameters:
  beforeMe - if null, the control will be inserted as the last trim widgeton this side of the layout.
public  voidaddTrim(int areaId, IWindowTrim trim)
    
public  voidaddTrim(int areaId, IWindowTrim trim, IWindowTrim beforeMe)
    
protected  PointcomputeSize(Composite composite, int wHint, int hHint, boolean flushCache)
    
public  ListdisableTrim(IWindowTrim ignoreMe)
     Disables the controls associated with visible trim elements.
public  voidenableTrim(List disabledControls)
     Enables the controls in the list.
public  voidflush(Control dirtyControl)
    
public  voidforceLayout()
    
public  ListgetAllTrim()
    
public  int[]getAreaIds()
    
public  ListgetAreaTrim(int areaId)
    
public  ControlgetCenterControl()
    
public  intgetPreferredArea(String trimId)
    
public  IWindowTrimgetPreferredLocation(String trimId)
    
public  IWindowTrimgetTrim(String id)
    
public  TrimAreagetTrimArea(int areaId)
    
public  intgetTrimAreaId(Control trimControl)
     Returns the location of the given trim control.
public  RectanglegetTrimRect(Composite window, int areaId)
     Return a trim area rectangle.
protected  voidlayout(Composite composite, boolean flushCache)
    
public  voidremoveTrim(IWindowTrim toRemove)
    
public  voidsetCenterControl(Control center)
     Sets the widget that will occupy the central area of the layout.
public  voidsetMargins(int marginWidth, int marginHeight)
     Sets the empty space around the outside of the layout.
public  voidsetPreferredLocations(int areaId, List preferredLocations)
     Remember the persisted locations for the trim.
public  voidsetSpacing(int left, int right, int top, int bottom)
     Sets the empty space surrounding the center area.
public  voidsetTrimSize(int areaId, int size)
     Sets the trimSize (pixels) for the given side of the layout.
public  voidsetTrimVisible(IWindowTrim trim, boolean visible)
    
public  voidupdateAreaTrim(int id, List trim, boolean removeExtra)
    

Field Detail
BOTTOM_ID
final public static Integer BOTTOM_ID(Code)
Trim area ID.



LEFT_ID
final public static Integer LEFT_ID(Code)
Trim area ID.



NONTRIM_ID
final public static Integer NONTRIM_ID(Code)
Trim area ID.



RIGHT_ID
final public static Integer RIGHT_ID(Code)
Trim area ID.



TOP_ID
final public static Integer TOP_ID(Code)
Trim area ID.




Constructor Detail
TrimLayout
public TrimLayout()(Code)
Creates a new (initially empty) trim layout.




Method Detail
addTrim
public void addTrim(IWindowTrim control, int areaId)(Code)

Parameters:
  control - new window trim to be added
Parameters:
  areaId - the area ID
See Also:   TrimLayout.getAreaIds()



addTrim
public void addTrim(IWindowTrim trim, int areaId, IWindowTrim beforeMe)(Code)

Parameters:
  trim - new window trim to be added
Parameters:
  areaId - the area ID
Parameters:
  beforeMe - if null, the control will be inserted as the last trim widgeton this side of the layout. Otherwise, the control will beinserted before the given widget.
See Also:   TrimLayout.getAreaIds()



addTrim
public void addTrim(int areaId, IWindowTrim trim)(Code)



addTrim
public void addTrim(int areaId, IWindowTrim trim, IWindowTrim beforeMe)(Code)



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



disableTrim
public List disableTrim(IWindowTrim ignoreMe)(Code)
Disables the controls associated with visible trim elements. This is only used during long-running WorkbenchWindow operations to prevent users from changing the environment while the operation (i.e. a long-running editor 'save') is in progress. The expected life-cycle is to first call this this method to disable any visible trim (and caching the elements that had to be disabled) followed by a call to 'enableTrim' passing in the list returned from this method.
Parameters:
  ignoreMe - Since the current UI has a disable button in the StatusLinewe allow the caller to designate one piece of trim to ignore The list of trim controls that were disabled during this call



enableTrim
public void enableTrim(List disabledControls)(Code)
Enables the controls in the list. This list is expected to be a non-modified List as returned from a call to 'disableTrim'.
Parameters:
  disabledControls - The list of controls to enable



flush
public void flush(Control dirtyControl)(Code)



forceLayout
public void forceLayout()(Code)
Force a layout of the trim



getAllTrim
public List getAllTrim()(Code)



getAreaIds
public int[] getAreaIds()(Code)



getAreaTrim
public List getAreaTrim(int areaId)(Code)



getCenterControl
public Control getCenterControl()(Code)
Returns the control in the center of this layout the center area control.



getPreferredArea
public int getPreferredArea(String trimId)(Code)
If the given id has a cached location return its preferred side
Parameters:
  trimId - The id of the trim to be tested The areaId of a cached id or -1 if no cache info exists



getPreferredLocation
public IWindowTrim getPreferredLocation(String trimId)(Code)
If the given id has a cached location return an existing trim element that it should be placed before (if any)
Parameters:
  trimId - The id of the trim to be tested The trim to be inserted before or nullif no cached info exists



getTrim
public IWindowTrim getTrim(String id)(Code)



getTrimArea
public TrimArea getTrimArea(int areaId)(Code)
Return the trim area associated with the given id
Parameters:
  areaId - The id of the trim area to get The TrimArea or null if the id is not found



getTrimAreaId
public int getTrimAreaId(Control trimControl)(Code)
Returns the location of the given trim control. For example, returns SWT.LEFT if the control is docked on the left, SWT.RIGHT if docked on the right, etc. Returns SWT.DEFAULT if the given control is not a trim control.
Parameters:
  trimControl - control to query The area ID of this control. If the control is not part of ourtrim, return SWT.DEFAULT.
See Also:   TrimLayout.getAreaIds()



getTrimRect
public Rectangle getTrimRect(Composite window, int areaId)(Code)
Return a trim area rectangle.
Parameters:
  window - the window that has the trim
Parameters:
  areaId - the side it's on the area rectangle.
since:
   3.2
See Also:   TrimLayout.getAreaIds()



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



removeTrim
public void removeTrim(IWindowTrim toRemove)(Code)



setCenterControl
public void setCenterControl(Control center)(Code)
Sets the widget that will occupy the central area of the layout. Typically, this will be a composite that contains the main widgetry of the application.
Parameters:
  center - control that will occupy the center of the layout, or null ifnone



setMargins
public void setMargins(int marginWidth, int marginHeight)(Code)
Sets the empty space around the outside of the layout. This whitespace is located outside the trim widgets.
Parameters:
  marginWidth -
Parameters:
  marginHeight -



setPreferredLocations
public void setPreferredLocations(int areaId, List preferredLocations)(Code)
Remember the persisted locations for the trim. This allows the code to site the trim in its preferred (i.e. cached) location on creation
Parameters:
  areaId - The id of the trim area being defined
Parameters:
  preferredLocations - A list of trim ID's



setSpacing
public void setSpacing(int left, int right, int top, int bottom)(Code)
Sets the empty space surrounding the center area. This whitespace is located between the trim and the central widget.
Parameters:
  left - pixel width
Parameters:
  right - pixel width
Parameters:
  top - pixel width
Parameters:
  bottom - pixel width



setTrimSize
public void setTrimSize(int areaId, int size)(Code)
Sets the trimSize (pixels) for the given side of the layout. If SWT.DEFAULT, then the trim size will be computed from child controls.
Parameters:
  areaId - the area ID
Parameters:
  size - in pixels
See Also:   TrimLayout.getAreaIds()



setTrimVisible
public void setTrimVisible(IWindowTrim trim, boolean visible)(Code)



updateAreaTrim
public void updateAreaTrim(int id, List trim, boolean removeExtra)(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.