|
Eclipse Remote Application Platform | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.rap.rwt.template.Cell<T>
public abstract class Cell<T extends Cell>
Defines a region in a template. A cell can display a part of a connected data item. This part is selected by the bindingIndex.
For horizontal positioning, two of the the properties left, right, and width must be set. For vertical positioning, two properties out of top, bottom, and height are required.
Constructor Summary | |
---|---|
Cell(Template template,
java.lang.String type)
Constructs a new cell on the given template. |
Method Summary | |
---|---|
T |
setBackground(Color color)
Sets the background color for this cell. |
T |
setBindingIndex(int index)
Sets the index that is used to select the part (e.g. |
T |
setBottom(int offset)
Sets the bottom offset of the cell, i.e. |
T |
setFont(Font font)
Sets the font for this cell. |
T |
setForeground(Color color)
Sets the foreground color for this cell. |
T |
setHeight(int height)
Sets the height of the cell, i.e. |
T |
setHorizontalAlignment(int alignment)
Defines how the content of this cell should be positioned horizontally. |
T |
setLeft(int offset)
Sets the left offset of the cell, i.e. |
T |
setName(java.lang.String name)
Sets a name for this cell. |
T |
setRight(int offset)
Sets the right offset of the cell, i.e. |
T |
setSelectable(boolean selectable)
Enables cell selection. |
T |
setTop(int offset)
Sets the top offset of the cell, i.e. |
T |
setVerticalAlignment(int alignment)
Defines how the content of this cell should be positioned vertically. |
T |
setWidth(int width)
Sets the width of the cell, i.e. |
protected JsonObject |
toJson()
Creates a JSON representation of this cell. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Cell(Template template, java.lang.String type)
template
- the template that this cell will be part of, must not be null
type
- a unique type string to identify the cell type, must not be null
or
emptyMethod Detail |
---|
public T setName(java.lang.String name)
setSelectable(boolean)
,
Event.text
public T setBindingIndex(int index)
-1
indicates that the cell is not bound.
index
- the index of the part to display
public T setSelectable(boolean selectable)
true
, clicking this cell will not select the
item but still trigger a selection event on the control. This selection event will have its
detail field set to RWT.CELL
and it's text field set to the name
of this cell. The default is false
.
selectable
- true
to enable cell selection
setName(String)
,
RWT.CELL
public T setForeground(Color color)
color
- the foreground color, or null
to use the default
public T setBackground(Color color)
color
- the background color, or null
to use the default
public T setFont(Font font)
font
- a font, or null
to use the default
public T setLeft(int offset)
offset
- the left offset in px
java.lang.IllegalStateException
- if both right and width are already setpublic T setRight(int offset)
offset
- the right offset in px
java.lang.IllegalStateException
- if both left and width are already setpublic T setTop(int offset)
offset
- the top offset in px
java.lang.IllegalStateException
- if both bottom and height are already setpublic T setBottom(int offset)
offset
- the bottom offset in px
java.lang.IllegalStateException
- if both top and height are already setpublic T setWidth(int width)
SWT.DEFAULT
resets the width.
width
- the width in px, must not be negative
public T setHeight(int height)
SWT.DEFAULT
resets the width.
height
- the height in px, must not be negative
public T setHorizontalAlignment(int alignment)
alignment
- the horizontal alignment, must be one of: SWT.BEGINNING (or SWT.LEFT),
SWT.CENTER, SWT.END (or SWT.RIGHT)
public T setVerticalAlignment(int alignment)
alignment
- the horizontal alignment, must be one of: SWT.BEGINNING (or SWT.TOP),
SWT.CENTER, SWT.END (or SWT.BOTTOM)
protected JsonObject toJson()
protected JsonObject toJson() { JsonObject json = super.toJson(); json.add( "foo", getFoo() ); ... return json; }
|
Eclipse Remote Application Platform | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright (c) EclipseSource and others 2002, 2013. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0