|
HOME | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--com.ultraswing.CPanel | +--com.ultraswing.CSplitPane | +--com.ultraswing.CListReportCtrl
This class is an component embedded in CListView
container. It provides a table like
interface similar to the Outlook's message list. This component can't be created directly, you need to
create a CListView
instance, then get this object from CListView
instance.
Usage example:
CListView listview = new CListView(); CListReportCtrl ctrl = listview.getReportCtrl(); ctrl.setSortEnabled(true); ctrl.setHorizontalScrollBarEnabled(true); ctrl.addColumnHeader("Name", SwingConstants.LEFT, 120); ctrl.addItem("1GB", null, SwingConstants.RIGHT);
CListView
,
Serialized FormField Summary | |
static int |
MULTIPLE_SELECTION
Allows multiple selection |
static int |
SINGLE_SELECTION
Only one selection is allowed at a time |
Fields inherited from class com.ultraswing.CSplitPane |
HORIZONTAL_SPLIT, VERTICAL_SPLIT |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Method Summary | |
void |
addColumnHeader(String text)
Adds column header text |
void |
addColumnHeader(String text,
Icon icon,
int alignment,
int width)
Adds column header text |
void |
addColumnHeader(String text,
int alignment)
Adds column header text |
void |
addColumnHeader(String text,
int alignment,
int width)
Adds column header text |
void |
addEmptyItem()
Adds an empty item |
void |
addEventListener(CListReportCtrlEventListener listener)
Adds an event listener |
void |
addItem(JComponent item,
int alignment)
Adds an item |
void |
addItem(String text,
Icon icon)
Adds an item |
void |
addItem(String text,
Icon icon,
int alignment)
Adds an item |
void |
clearSelection()
Deselects all selected rows. |
void |
deselectAllRows(int exclude)
Deselects all selected rows except for the passed exclude |
void |
deselectRow(int row)
Deselects passed row |
void |
disableAlternate()
Disables alternate coloring |
void |
ensureVisible(int rowIndex)
Ensures that the passed row is visible |
Component |
getCellAt(int row,
int column)
|
Component |
getCellAt(int row,
String columnName)
|
Dimension |
getMinimumSize()
|
Dimension |
getPreferredSize()
|
int |
getRowCount()
Returns number of rows |
int |
getSelectedRow()
Returns the index of first occurrence of selected row |
int |
getSelectedRowCount()
Returns the number of selected rows |
int[] |
getSelectedRows()
Returns the select rows in an integer array |
int |
getSelectionMode()
Returns the selection mode. |
boolean |
hasFocus()
|
boolean |
isDroppable(Component comp)
Tests if the passed comp can be dropped into this pane |
boolean |
isHorizontalScrollBarEnabled()
Tests if the horizontal scroll bar is enabled |
int |
isRowVisible(int index)
|
protected void |
notifyListeners(CListReportCtrlEvent event)
|
protected void |
onResize()
NOTE: enableEvents(ComponentEvent.COMPONENT_RESIZED); should be called to enable resize event |
void |
removeEventListener(CListReportCtrlEventListener listener)
Removes an event listener |
void |
scrollOneRow(boolean goDown)
Scrolls one row |
void |
selectRow(int index,
boolean select)
Select or deselect the passed row |
void |
setAlternate(Color c1,
Color c2,
boolean isRowAlternate)
Alternates colors for rows or columns. |
void |
setColorSortColumn(boolean b,
Color c)
Turns the coloring of the sorted column on or off. |
Color |
setColumnColor(int index,
Color color)
Sets the background color of column at specified index. |
void |
setFixedWidth(int index,
boolean b)
Sets a column's width to be fixed or not |
void |
setHorizontalScrollBarEnabled(boolean b)
If passed b is true, horizontal scroll bar will be enabled |
Color |
setRowColor(int index,
Color color)
Sets the background color of row at specified index. |
void |
setSelectionMode(int selectionMode)
Determines whether single-item or multiple-item selections are allowed. |
void |
setSortEnabled(boolean b)
If passed b is true, sorting will be enabled |
void |
setSortEnabled(int columnIndex,
boolean b)
If passed b is true, sorting will be enabled for the passed
columnIndex |
Methods inherited from class com.ultraswing.CSplitPane |
addFirst, addFirst, addLast, addLast, addPane, addPane, addPaneAfter, addPaneAfter, addPaneBefore, addPaneBefore, getComponentAt, getComponentAt, getCurrentWeight, getDividerSize, getNext, getOrientation, getPaneCount, getPanes, getPrevious, getTotalWeight, getWeight, isRemoveFromParent, removePane, setDividerSize, setDividerTransparent, setRemoveFromParent, updateWeight |
Methods inherited from class com.ultraswing.CPanel |
contains, getPrefferedSize, paintBorder, processComponentEvent, setBackground, setBackgroundImage, setGradientBackground |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int MULTIPLE_SELECTION
public static final int SINGLE_SELECTION
Method Detail |
public void addEventListener(CListReportCtrlEventListener listener)
public void removeEventListener(CListReportCtrlEventListener listener)
protected void notifyListeners(CListReportCtrlEvent event)
public void setSelectionMode(int selectionMode)
selectionMode
values are allowed:
ListSelectionModel.SINGLE_SELECTION
Only one list index can be selected at a time. In this
mode the setSelectionInterval
and
addSelectionInterval
methods are equivalent, and only the second index
argument is used.
ListSelectionModel.MULTIPLE_SELECTION
In this mode, there's no restriction on what can be selected.
This is the default.
selectionMode
- an integer specifying the type of selections
that are permissiblegetSelectionMode()
public int getSelectionMode()
public boolean isDroppable(Component comp)
isDroppable
in class CSplitPane
public void setHorizontalScrollBarEnabled(boolean b)
b
is true, horizontal scroll bar will be enabled
public boolean isHorizontalScrollBarEnabled()
public void setFixedWidth(int index, boolean b)
index
- initial column indexpublic boolean hasFocus()
hasFocus
in class Component
public void scrollOneRow(boolean goDown)
goDown
- true, scroll down; false, scroll uppublic int isRowVisible(int index)
public void ensureVisible(int rowIndex)
public void selectRow(int index, boolean select)
index
- row indexselect
- true to select this row; false to deselect itpublic void clearSelection()
public void deselectAllRows(int exclude)
exclude
exclude
- the index of row to be excluded from deselectingpublic void deselectRow(int row)
row
- row indexpublic Component getCellAt(int row, int column)
row
- current row index on screencolumn
- current column index on screenpublic Component getCellAt(int row, String columnName)
columnName
- column namerow
- current row index on screenpublic int getSelectedRow()
public int getSelectedRowCount()
public int[] getSelectedRows()
public void addColumnHeader(String text)
text
- column header textpublic void addColumnHeader(String text, int alignment)
alignment
- One of the following constants defined in SwingConstants: LEFT, CENTER
(the default for image-only labels), RIGHT, LEADING (the default for text-only labels) or TRAILINGpublic void addColumnHeader(String text, int alignment, int width)
width
- width of this column, in pixelsalignment
- One of the following constants defined in SwingConstants: LEFT, CENTER
(the default for image-only labels), RIGHT, LEADING (the default for text-only labels) or TRAILINGpublic void addColumnHeader(String text, Icon icon, int alignment, int width)
icon
- the icon object on the left sidewidth
- width of this column, in pixelsalignment
- One of the following constants defined in SwingConstants: LEFT, CENTER
(the default for image-only labels), RIGHT, LEADING (the default for text-only labels) or TRAILINGpublic void setSortEnabled(boolean b)
b
is true, sorting will be enabled
public void setSortEnabled(int columnIndex, boolean b)
b
is true, sorting will be enabled for the passed
columnIndex
columnIndex
- initial column indexpublic void setColorSortColumn(boolean b, Color c)
public void setAlternate(Color c1, Color c2, boolean isRowAlternate)
c1
- The color for row/column where row/column number is evenc2
- The color for row/column where row/column number is oddisRowAlternate
- Alternates colors on rows (true) or columns (false)public void disableAlternate()
public Color setColumnColor(int index, Color color)
index
- initial column index
public Color setRowColor(int index, Color color)
public void addItem(String text, Icon icon)
text
- new item's text stringicon
- new item's icon objectpublic void addItem(String text, Icon icon, int alignment)
text
- new item's text stringicon
- new item's icon objectalignment
- possible values are {SwingConstants.LEFT, SwingConstants.CENTER, SwingConstants.RIGHT}public void addEmptyItem()
public void addItem(JComponent item, int alignment)
item
- new item objectalignment
- possible values are {SwingConstants.LEFT, SwingConstants.CENTER, SwingConstants.RIGHT}public int getRowCount()
protected void onResize()
CPanel
onResize
in class CPanel
public Dimension getMinimumSize()
getMinimumSize
in class JComponent
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
|
HOME | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |