Class ViewForm
 Note that although this class is a subclass of Composite, it
 does not make sense to set a layout on it.
 
- Styles:
- BORDER, FLAT
- Events:
- (None)
IMPORTANT: This class is not intended to be subclassed.
- 
Field SummaryFieldsModifier and TypeFieldDescriptioninthorizontalSpacing specifies the number of pixels between the right edge of one cell and the left edge of its neighbouring cell to the right.intmarginHeight specifies the number of pixels of vertical margin that will be placed along the top and bottom edges of the form.intmarginWidth specifies the number of pixels of horizontal margin that will be placed along the left and right edges of the form.intverticalSpacing specifies the number of pixels between the bottom edge of one cell and the top edge of its neighbouring cell underneath.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected voidChecks that this class can be subclassed.computeTrim(int x, int y, int width, int height) Given a desired client area for the receiver (as described by the arguments), returns the bounding rectangle which would be required to produce that client area.Returns a rectangle which describes the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings").Returns the content area.Returns Control that appears in the top center of the pane.Returns the Control that appears in the top left corner of the pane.Returns the control in the top right corner of the pane.voidsetBorderVisible(boolean show) Specify whether the border should be displayed or not.voidsetContent(Control content) Sets the content.voidSets the layout which is associated with the receiver to be the argument which may be null.voidsetTopCenter(Control topCenter) Set the control that appears in the top center of the pane.voidsetTopCenterSeparate(boolean show) If true, the topCenter will always appear on a separate line by itself, otherwise the topCenter will appear in the top row if there is room and will be moved to the second row if required.voidSet the control that appears in the top left corner of the pane.voidSet the control that appears in the top right corner of the pane.Methods inherited from class org.eclipse.swt.widgets.Compositechanged, computeSize, getAdapter, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayoutDeferred, setTabListMethods inherited from class org.eclipse.swt.widgets.ScrollablegetHorizontalBar, getVerticalBarMethods inherited from class org.eclipse.swt.widgets.ControladdControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addTouchListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getShell, getSize, getToolTipText, getTouchEnabled, getVisible, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCursor, setData, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setSize, setSize, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, updateMethods inherited from class org.eclipse.swt.widgets.WidgetaddDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, toString
- 
Field Details- 
marginWidthpublic int marginWidthmarginWidth specifies the number of pixels of horizontal margin that will be placed along the left and right edges of the form. The default value is 0.
- 
marginHeightpublic int marginHeightmarginHeight specifies the number of pixels of vertical margin that will be placed along the top and bottom edges of the form. The default value is 0.
- 
horizontalSpacingpublic int horizontalSpacinghorizontalSpacing 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 1.
- 
verticalSpacingpublic int verticalSpacingverticalSpacing 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 1.
 
- 
- 
Constructor Details- 
ViewFormConstructs a new instance of this class given its parent and a style value describing its behavior and appearance.The style value is either one of the style constants defined in class SWTwhich is applicable to instances of this class, or must be built by bitwise OR'ing together (that is, using theint"|" operator) two or more of thoseSWTstyle constants. The class description lists the style constants that are applicable to the class. Style bits are also inherited from superclasses.- Parameters:
- parent- a widget which will be the parent of the new instance (cannot be null)
- style- the style of widget to construct
- Throws:
- IllegalArgumentException-- ERROR_NULL_ARGUMENT - if the parent is null
 
- SWTException-- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the parent
 
- See Also:
 
 
- 
- 
Method Details- 
checkSubclassprotected void checkSubclass()Description copied from class:WidgetChecks that this class can be subclassed.The SWT class library is intended to be subclassed only at specific, controlled points (most notably, CompositeandCanvaswhen implementing new widgets). This method enforces this rule unless it is overridden.IMPORTANT: By providing an implementation of this method that allows a subclass of a class which does not normally allow subclassing to be created, the implementer agrees to be fully responsible for the fact that any such subclass will likely fail between SWT releases and will be strongly platform specific. No support is provided for user-written classes which are implemented in this fashion. The ability to subclass outside of the allowed SWT classes is intended purely to enable those not on the SWT development team to implement patches in order to get around specific limitations in advance of when those limitations can be addressed by the team. Subclassing should not be attempted without an intimate and detailed understanding of the hierarchy. - Overrides:
- checkSubclassin class- Widget
 
- 
computeTrimDescription copied from class:ScrollableGiven a desired client area for the receiver (as described by the arguments), returns the bounding rectangle which would be required to produce that client area.In other words, it returns a rectangle such that, if the receiver's bounds were set to that rectangle, the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings") would be the rectangle described by the arguments (relative to the receiver's parent). - Overrides:
- computeTrimin class- Scrollable
- Parameters:
- x- the desired x coordinate of the client area
- y- the desired y coordinate of the client area
- width- the desired width of the client area
- height- the desired height of the client area
- Returns:
- the required bounds to produce the given client area
- See Also:
 
- 
getClientAreaDescription copied from class:ScrollableReturns a rectangle which describes the area of the receiver which is capable of displaying data (that is, not covered by the "trimmings").- Overrides:
- getClientAreain class- Scrollable
- Returns:
- the client area
- See Also:
 
- 
getContentReturns the content area.- Returns:
- the control in the content area of the pane or null
 
- 
getTopCenterReturns Control that appears in the top center of the pane. Typically this is a toolbar.- Returns:
- the control in the top center of the pane or null
 
- 
getTopLeftReturns the Control that appears in the top left corner of the pane. Typically this is a label such as CLabel.- Returns:
- the control in the top left corner of the pane or null
 
- 
getTopRightReturns the control in the top right corner of the pane. Typically this is a Close button or a composite with a Menu and Close button.- Returns:
- the control in the top right corner of the pane or null
 
- 
setContentSets the content. Setting the content to null will remove it from the pane - however, the creator of the content must dispose of the content.- Parameters:
- content- the control to be displayed in the content area or null
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_INVALID_ARGUMENT - if the control is not a child of this ViewForm
 
 
- 
setLayoutSets the layout which is associated with the receiver to be the argument which may be null.Note: No Layout can be set on this Control because it already manages the size and position of its children. - Overrides:
- setLayoutin class- Composite
- Parameters:
- layout- the receiver's new layout or null
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
setTopCenterSet the control that appears in the top center of the pane. Typically this is a toolbar. The topCenter is optional. Setting the topCenter to null will remove it from the pane - however, the creator of the topCenter must dispose of the topCenter.- Parameters:
- topCenter- the control to be displayed in the top center or null
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_INVALID_ARGUMENT - if the control is not a child of this ViewForm
 
 
- 
setTopLeftSet the control that appears in the top left corner of the pane. Typically this is a label such as CLabel. The topLeft is optional. Setting the top left control to null will remove it from the pane - however, the creator of the control must dispose of the control.- Parameters:
- c- the control to be displayed in the top left corner or null
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_INVALID_ARGUMENT - if the control is not a child of this ViewForm
 
 
- 
setTopRightSet the control that appears in the top right corner of the pane. Typically this is a Close button or a composite with a Menu and Close button. The topRight is optional. Setting the top right control to null will remove it from the pane - however, the creator of the control must dispose of the control.- Parameters:
- c- the control to be displayed in the top right corner or null
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
- ERROR_INVALID_ARGUMENT - if the control is not a child of this ViewForm
 
 
- 
setBorderVisiblepublic void setBorderVisible(boolean show) Specify whether the border should be displayed or not.- Parameters:
- show- true if the border should be displayed
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
- 
setTopCenterSeparatepublic void setTopCenterSeparate(boolean show) If true, the topCenter will always appear on a separate line by itself, otherwise the topCenter will appear in the top row if there is room and will be moved to the second row if required.- Parameters:
- show- true if the topCenter will always appear on a separate line by itself
- Throws:
- SWTException-- ERROR_WIDGET_DISPOSED - if the receiver has been disposed
- ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver
 
 
 
-