|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTable
dsto.dfc.swing.table.DfcTable
public class DfcTable
DFC extended table component.
Nested Class Summary | |
---|---|
protected static class |
DfcTable.RectSelection
Represents a selection of rows, columns or a rectangular selection of cells. |
Nested classes/interfaces inherited from class javax.swing.JTable |
---|
JTable.AccessibleJTable, JTable.DropLocation, JTable.PrintMode |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
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 |
Constructor Summary | |
---|---|
DfcTable()
|
|
DfcTable(TableModel model)
|
Method Summary | |
---|---|
void |
addSelectionListener(SelectionListener l)
|
void |
cancelEditing()
|
Transferable |
cnpCopy()
Perform copy operation. |
Transferable |
cnpCut()
Perform cut operation. |
boolean |
cnpPaste(Transferable transferable)
Perform paste operation. |
void |
enableDragAndDrop()
|
void |
enableEditCellsByClass(TableColumn column)
Enable cell editor selection by class of value in cells of a column rather than by getColumnClass () of model. |
void |
enableRenderCellsByClass(TableColumn column)
Enable cell renderer selection by class of value in cells of a column rather than by getColumnClass () of model. |
void |
endDrag(DragSourceDropEvent e,
boolean moveData)
|
void |
executeDrop(DropTargetDropEvent e)
Execute a drop action. |
TableCellEditor |
getCellEditor(int row,
int col)
Override JTable's getCellEditor (). |
TableCellRenderer |
getCellRenderer(int row,
int col)
|
boolean |
getCnpCommandsEnabled()
|
CommandView |
getCommandView(String viewName)
Get the command view instance for a given view name. |
TableCellEditor |
getDefaultEditor(Class valueClass)
Override JTable getDefaultEditor () to provide editor mapping via interface as well as by class. |
DfcTableModel |
getDfcTableModel()
|
protected DfcTable.RectSelection |
getRectSelection()
Compute a rectangular selection from the current row and column selection models and the selection mode settings for the table. |
int |
getSupportedDragActions()
Return a mask of possible drag actions supported by this component eg DnDConstants.ACTION_COPY_OR_MOVE. |
int |
getSupportedDropActions()
Return a mask of actions supported by this component eg DnDConstants.ACTION_COPY_OR_MOVE. |
void |
hideDragUnderFeedback()
Remove any drag under feedback displayed by showDragUnderFeedback (). |
boolean |
isCnpCopyEnabled()
True if a copy operation is possible. |
boolean |
isCnpCutEnabled()
True if a cut operation is possible. |
boolean |
isCnpPasteEnabled(Transferable transferable)
True if a paste operation with a given transferable is possible. |
boolean |
isDragOK(DragGestureEvent e)
Return true if starting a drag in the given context is possible. |
boolean |
isDropOK(DropTargetDragEvent e)
Return true if a drop in the context in a DropTargetDragEvent is possible. |
void |
removeSelectionListener(SelectionListener l)
|
void |
scrollToBottom()
Ensure bottom part of table is visible. |
void |
scrollToRow(int row)
Ensure a given row is visible. |
void |
scrollToTop()
Ensure top part of table is visible. |
void |
setCnpCommandsEnabled(boolean newValue)
|
void |
setDefaultEditor(Class valueClass,
TableCellEditor editor)
Override JTable setDefaultEditor () to store interfaces in a separate table. |
void |
showDragUnderFeedback(boolean dropOK,
DropTargetDragEvent e)
Display any drag under (ie displayed under the mouse in the component) feedback. |
void |
sizeColumnsToFit()
Size all columns to best fit. |
int |
sizeColumnToFit(TableColumn column)
Auto size a column to the smallest width required to display all items, including the header. |
Transferable |
startDrag(DragGestureEvent e)
Start a drag operation. |
void |
stopEditing()
|
void |
tableChanged(TableModelEvent e)
TableModelListener interface implementation only: do not invoke directly. |
protected void |
updateCnpEnabled()
Update the settings of the cnpCopyEnabled and cnpCutEnabled properties. |
void |
valueChanged(ListSelectionEvent e)
Override of JTable's ListSelectionModelListener interface implementation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface dsto.dfc.util.PropertyEventSource |
---|
addPropertyChangeListener, removePropertyChangeListener |
Constructor Detail |
---|
public DfcTable()
public DfcTable(TableModel model)
Method Detail |
---|
public void enableDragAndDrop()
public DfcTableModel getDfcTableModel()
public void cancelEditing()
public void stopEditing()
public void sizeColumnsToFit()
sizeColumnToFit(javax.swing.table.TableColumn)
public int sizeColumnToFit(TableColumn column)
column
- The column to resize.
sizeColumnsToFit()
,
Tables.getBestColumnSize(javax.swing.JTable, javax.swing.table.TableColumn)
public void setCnpCommandsEnabled(boolean newValue)
public boolean getCnpCommandsEnabled()
public void enableRenderCellsByClass(TableColumn column)
public void enableEditCellsByClass(TableColumn column)
public TableCellEditor getCellEditor(int row, int col)
getCellEditor
in class JTable
public TableCellRenderer getCellRenderer(int row, int col)
getCellRenderer
in class JTable
public TableCellEditor getDefaultEditor(Class valueClass)
getDefaultEditor
in class JTable
public void setDefaultEditor(Class valueClass, TableCellEditor editor)
setDefaultEditor
in class JTable
getDefaultEditor(java.lang.Class)
public void scrollToRow(int row)
public void scrollToBottom()
public void scrollToTop()
public void addSelectionListener(SelectionListener l)
addSelectionListener
in interface SelectionEventSource
public void removeSelectionListener(SelectionListener l)
removeSelectionListener
in interface SelectionEventSource
public CommandView getCommandView(String viewName)
CommandSource
getCommandView
in interface CommandSource
viewName
- The name of the view to be retrieved. Usually one of
CommandView.MAIN_MENU_VIEW, CommandView.CONTEXT_MENU_VIEW or
CommandView.TOOLBAR_VIEW, but custom views may be supported also.
public boolean isCnpCopyEnabled()
CnpProvider
isCnpCopyEnabled
in interface CnpProvider
public boolean isCnpCutEnabled()
CnpProvider
isCnpCutEnabled
in interface CnpProvider
public boolean isCnpPasteEnabled(Transferable transferable)
CnpProvider
isCnpPasteEnabled
in interface CnpProvider
public Transferable cnpCopy() throws UnsupportedOperationException, CloneNotSupportedException
CnpProvider
cnpCopy
in interface CnpProvider
UnsupportedOperationException
- if copy operation not supported.
CloneNotSupportedException
- if the data could not be cloned.public Transferable cnpCut() throws UnsupportedOperationException, CloneNotSupportedException
CnpProvider
cnpCut
in interface CnpProvider
UnsupportedOperationException
- if cut operation not supported.
CloneNotSupportedException
- if the data could not be cloned.public boolean cnpPaste(Transferable transferable) throws UnsupportedOperationException, UnsupportedFlavorException, CloneNotSupportedException, IOException
CnpProvider
cnpPaste
in interface CnpProvider
transferable
- The data to be pasted.
UnsupportedOperationException
- if paste operation not supported.
UnsupportedFlavorException
- if transferable does not contain a
supported data flavor for pasting.
CloneNotSupportedException
- if the data could not be cloned.
IOException
- if IO exception occurs during data transfer.public int getSupportedDragActions()
DragComponent
DragComponent.isDragOK(java.awt.dnd.DragGestureEvent)
.
getSupportedDragActions
in interface DragComponent
public boolean isDragOK(DragGestureEvent e)
DragComponent
isDragOK
in interface DragComponent
e
- The drag context.public Transferable startDrag(DragGestureEvent e)
DragComponent
startDrag
in interface DragComponent
e
- The gesture that started the drag.
public void endDrag(DragSourceDropEvent e, boolean moveData)
endDrag
in interface DragComponent
public void executeDrop(DropTargetDropEvent e)
DropComponent
executeDrop
in interface DropComponent
public int getSupportedDropActions()
DropComponent
DropComponent.isDropOK(java.awt.dnd.DropTargetDragEvent)
.
getSupportedDropActions
in interface DropComponent
public boolean isDropOK(DropTargetDragEvent e)
DropComponent
isDropOK
in interface DropComponent
e
- The drop context.public void showDragUnderFeedback(boolean dropOK, DropTargetDragEvent e)
DropComponent
showDragUnderFeedback
in interface DropComponent
dropOK
- The value of isDropOK () when the mouse first
entered the component.e
- The drop context.public void hideDragUnderFeedback()
DropComponent
hideDragUnderFeedback
in interface DropComponent
public void valueChanged(ListSelectionEvent e)
valueChanged
in interface ListSelectionListener
valueChanged
in class JTable
public void tableChanged(TableModelEvent e)
tableChanged
in interface TableModelListener
tableChanged
in class JTable
protected final void updateCnpEnabled()
protected final DfcTable.RectSelection getRectSelection()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |