public class DefaultTableControlSWTCustomization extends Object implements TableViewerSWTCustomization
TableViewerSWTCustomization
.TableViewerSWTCustomization.ColumnDescription
Constructor and Description |
---|
DefaultTableControlSWTCustomization() |
Modifier and Type | Method and Description |
---|---|
void |
addColumn(TableViewerSWTCustomization.ColumnDescription columnDescription)
Adds a column to the table.
|
void |
createCompositeLayout(org.eclipse.swt.widgets.Composite parent)
Called to create the
composites . |
org.eclipse.jface.viewers.IContentProvider |
createContentProvider()
Returns the content provider to use.
|
Object |
createNewElement(org.eclipse.swt.widgets.Button button)
Gets called when a button is pressed which needs to create a new element which gets added to the list.
|
org.eclipse.jface.viewers.AbstractTableViewer |
createTableViewer(org.eclipse.swt.widgets.Composite parent)
Creates the
AbstractTableViewer . |
void |
fillButtonComposite(org.eclipse.swt.widgets.Composite buttonComposite,
org.eclipse.jface.viewers.AbstractTableViewer viewer)
This method is called to fill the given
Composite with all required buttons. |
Optional<org.eclipse.swt.widgets.Composite> |
getButtonComposite()
|
List<TableViewerSWTCustomization.ColumnDescription> |
getColumns()
Returns the column descriptions which will be used to create actual columns.
|
Optional<org.eclipse.jface.viewers.ViewerComparator> |
getComparator()
Returns the comparator to use.
|
org.eclipse.swt.dnd.DragSourceListener |
getDragListener(org.eclipse.jface.viewers.AbstractTableViewer tableViewer)
Returns the
DragSourceListener used to setup the
drag support for the viewer. |
int |
getDragOperations()
Returns the drag operations bits used to setup the
drag support for the viewer. |
org.eclipse.swt.dnd.Transfer[] |
getDragTransferTypes()
Returns the drag transfer types used to setup the
drag support for the viewer. |
org.eclipse.swt.dnd.DropTargetListener |
getDropListener(org.eclipse.jface.viewers.AbstractTableViewer tableViewer)
Returns the
DragSourceListener used to setup the
drop support for the viewer. |
int |
getDropOperations()
Returns the drag operations bits used to setup the
drop support for the viewer. |
org.eclipse.swt.dnd.Transfer[] |
getDropTransferTypes()
Returns the drag transfer types used to setup the
drop support for the viewer. |
Optional<org.eclipse.swt.widgets.Label> |
getTitleLabel()
|
Optional<List<org.eclipse.swt.widgets.Control>> |
getValidationControls()
|
org.eclipse.swt.widgets.Composite |
getViewerComposite()
|
boolean |
hasDND()
Whether DND support should be added to the table.
|
void |
setButtonBarBuilder(ButtonBarBuilder builder)
Allows the exchange the default
ButtonBarBuilder . |
void |
setContentProvider(org.eclipse.jface.viewers.IContentProvider provider)
Allows the exchange the default
IContentProvider . |
void |
setDND(DNDProvider provider)
Allows the exchange the default
DNDProvider . |
void |
setNewElementCreator(NewElementCreator<Object,org.eclipse.swt.widgets.Button> creator)
Allows the exchange the default
NewElementCreator . |
void |
setTableViewerCompositeBuilder(TableViewerCompositeBuilder builder)
Allows the exchange the default
TableViewerCompositeBuilder . |
void |
setTableViewerCreator(TableViewerCreator creator)
Allows the exchange the default
TableViewerCreator . |
void |
setViewerComparator(org.eclipse.jface.viewers.ViewerComparator comparator)
Allows the exchange the default
ViewerComparator . |
public void createCompositeLayout(org.eclipse.swt.widgets.Composite parent)
TableViewerCompositeBuilder
composites
.createCompositeLayout
in interface TableViewerCompositeBuilder
parent
- the parentpublic Optional<org.eclipse.swt.widgets.Label> getTitleLabel()
TableViewerCompositeBuilder
getTitleLabel
in interface TableViewerCompositeBuilder
Label
if availablepublic Optional<List<org.eclipse.swt.widgets.Control>> getValidationControls()
TableViewerCompositeBuilder
getValidationControls
in interface TableViewerCompositeBuilder
controls
.public Optional<org.eclipse.swt.widgets.Composite> getButtonComposite()
TableViewerCompositeBuilder
getButtonComposite
in interface TableViewerCompositeBuilder
Composite
for control-buttons
.public org.eclipse.swt.widgets.Composite getViewerComposite()
TableViewerCompositeBuilder
getViewerComposite
in interface TableViewerCompositeBuilder
Composite
for the TableViewer
.public org.eclipse.jface.viewers.AbstractTableViewer createTableViewer(org.eclipse.swt.widgets.Composite parent)
TableViewerCreator
AbstractTableViewer
.createTableViewer
in interface TableViewerCreator
parent
- the parent Composite
public Optional<org.eclipse.jface.viewers.ViewerComparator> getComparator()
TableViewerSWTCustomization
getComparator
in interface TableViewerSWTCustomization
ViewerComparator
which will be set on the viewer, if presentpublic org.eclipse.jface.viewers.IContentProvider createContentProvider()
TableViewerSWTCustomization
createContentProvider
in interface TableViewerSWTCustomization
IContentProvider
which will be set on the viewerpublic void fillButtonComposite(org.eclipse.swt.widgets.Composite buttonComposite, org.eclipse.jface.viewers.AbstractTableViewer viewer)
ButtonBarBuilder
Composite
with all required buttons.fillButtonComposite
in interface ButtonBarBuilder
buttonComposite
- the button barviewer
- the AbstractTableViewer
public Object createNewElement(org.eclipse.swt.widgets.Button button)
ButtonBarBuilder
createNewElement
in interface ButtonBarBuilder
createNewElement
in interface NewElementCreator<Object,org.eclipse.swt.widgets.Button>
button
- the button which was pressedpublic List<TableViewerSWTCustomization.ColumnDescription> getColumns()
TableViewerSWTCustomization
getColumns
in interface TableViewerSWTCustomization
ColumnDescriptions
public void setTableViewerCompositeBuilder(TableViewerCompositeBuilder builder)
TableViewerCompositeBuilder
.builder
- the TableViewerCompositeBuilder
public void setTableViewerCreator(TableViewerCreator creator)
TableViewerCreator
.creator
- the TableViewerCreator
public void setViewerComparator(org.eclipse.jface.viewers.ViewerComparator comparator)
ViewerComparator
.comparator
- the ViewerComparator
public void setContentProvider(org.eclipse.jface.viewers.IContentProvider provider)
IContentProvider
.provider
- the IContentProvider
public void setButtonBarBuilder(ButtonBarBuilder builder)
ButtonBarBuilder
.builder
- the ButtonBarBuilder
public void addColumn(TableViewerSWTCustomization.ColumnDescription columnDescription)
columnDescription
- the
ColumnDescription
public void setNewElementCreator(NewElementCreator<Object,org.eclipse.swt.widgets.Button> creator)
NewElementCreator
. This may only be used if the
button bar builder
was not exchanged.creator
- the NewElementCreator
public void setDND(DNDProvider provider)
DNDProvider
.provider
- the DNDProvider
public boolean hasDND()
DNDProvider
hasDND
in interface DNDProvider
true
if DND will be added, based on the other methods of this interface, or
false
if DND should not be addedpublic int getDragOperations()
DNDProvider
drag support
for the viewer.getDragOperations
in interface DNDProvider
public org.eclipse.swt.dnd.Transfer[] getDragTransferTypes()
DNDProvider
drag support
for the viewer.getDragTransferTypes
in interface DNDProvider
transfer types
public org.eclipse.swt.dnd.DragSourceListener getDragListener(org.eclipse.jface.viewers.AbstractTableViewer tableViewer)
DNDProvider
DragSourceListener
used to setup the
drag support
for the viewer.getDragListener
in interface DNDProvider
tableViewer
- the AbstractTableViewerpublic int getDropOperations()
DNDProvider
drop support
for the viewer.getDropOperations
in interface DNDProvider
public org.eclipse.swt.dnd.Transfer[] getDropTransferTypes()
DNDProvider
drop support
for the viewer.getDropTransferTypes
in interface DNDProvider
transfer types
public org.eclipse.swt.dnd.DropTargetListener getDropListener(org.eclipse.jface.viewers.AbstractTableViewer tableViewer)
DNDProvider
DragSourceListener
used to setup the
drop support
for the viewer.getDropListener
in interface DNDProvider
tableViewer
- the AbstractTableViewerCopyright © 2016. All rights reserved.