|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.cdt.internal.ui.wizards.dialogfields.DialogField
org.eclipse.cdt.internal.ui.wizards.dialogfields.ListDialogField
public class ListDialogField
A list with a button bar. Typical buttons are 'Add', 'Remove', 'Up' and 'Down'. List model is independend of widget creation. DialogFields controls are: Label, List and Composite containing buttons.
Nested Class Summary | |
---|---|
static class |
ListDialogField.ColumnsDescription
|
Constructor Summary | |
---|---|
ListDialogField(IListAdapter adapter,
java.lang.String[] buttonLabels,
org.eclipse.jface.viewers.IBaseLabelProvider lprovider)
Creates the ListDialogField . |
Method Summary | |
---|---|
void |
addElement(java.lang.Object element)
Adds an element at the end of the list. |
void |
addElements(java.util.List elements)
Adds elements at the end of the list. |
void |
dialogFieldChanged()
Programatical invocation of a dialog field change. |
org.eclipse.swt.widgets.Control[] |
doFillIntoGrid(org.eclipse.swt.widgets.Composite parent,
int nColumns)
Creates all controls of the dialog field and fills it to a composite. |
void |
enableButton(int index,
boolean enable)
Sets a button enabled or disabled. |
org.eclipse.swt.widgets.Composite |
getButtonBox(org.eclipse.swt.widgets.Composite parent)
Returns the composite containing the buttons. |
java.lang.Object |
getElement(int index)
Gets the elements shown at the given index. |
java.util.List |
getElements()
Gets the elements shown in the list. |
int |
getIndexOfElement(java.lang.Object elem)
Gets the index of an element in the list or -1 if element is not in list. |
org.eclipse.swt.widgets.Control |
getListControl(org.eclipse.swt.widgets.Composite parent)
Returns the list control. |
int |
getNumberOfControls()
Returns the number of columns of the dialog field. |
java.util.List |
getSelectedElements()
Returns the selected elements. |
int |
getSize()
Gets the number of elements |
org.eclipse.jface.viewers.TableViewer |
getTableViewer()
Returns the internally used table viewer. |
void |
insertElementAt(java.lang.Object element,
int index)
Adds an element at a position. |
void |
postSetSelection(org.eclipse.jface.viewers.ISelection selection)
|
void |
refresh()
Refreshes the table. |
void |
removeAllElements()
Adds an element at a position. |
void |
removeElement(java.lang.Object element)
Removes an element from the list. |
void |
removeElements(java.util.List elements)
Removes elements from the list. |
void |
replaceElement(java.lang.Object oldElement,
java.lang.Object newElement)
Replace an element. |
void |
selectElements(org.eclipse.jface.viewers.ISelection selection)
|
void |
selectFirstElement()
|
void |
setButtonsMinWidth(int minWidth)
Sets the minimal width of the buttons. |
void |
setDownButtonIndex(int downButtonIndex)
Sets the index of the 'down' button in the button label array passed in the constructor. |
void |
setElements(java.util.List elements)
Sets the elements shown in the list. |
void |
setRemoveButtonIndex(int removeButtonIndex)
Sets the index of the 'remove' button in the button label array passed in the constructor. |
void |
setTableColumns(ListDialogField.ColumnsDescription column)
|
void |
setUpButtonIndex(int upButtonIndex)
Sets the index of the 'up' button in the button label array passed in the constructor. |
void |
setViewerComparator(org.eclipse.jface.viewers.ViewerComparator viewerComparator)
Sets the viewerComparator. |
Methods inherited from class org.eclipse.cdt.internal.ui.wizards.dialogfields.DialogField |
---|
createEmptySpace, createEmptySpace, getLabelControl, isEnabled, postSetFocusOnDialogField, setDialogFieldListener, setEnabled, setFocus, setLabelText |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ListDialogField(IListAdapter adapter, java.lang.String[] buttonLabels, org.eclipse.jface.viewers.IBaseLabelProvider lprovider)
ListDialogField
.
adapter
- A listener for button invocation, selection changes. Can
be null
.buttonLabels
- The labels of all buttons: null
is a valid array entry and
marks a separator.lprovider
- The label provider to render the table entriesMethod Detail |
---|
public void setRemoveButtonIndex(int removeButtonIndex)
public void setUpButtonIndex(int upButtonIndex)
public void setDownButtonIndex(int downButtonIndex)
public void setViewerComparator(org.eclipse.jface.viewers.ViewerComparator viewerComparator)
viewerComparator
- The viewerComparator to setpublic void setTableColumns(ListDialogField.ColumnsDescription column)
public org.eclipse.swt.widgets.Control[] doFillIntoGrid(org.eclipse.swt.widgets.Composite parent, int nColumns)
DialogField
MGridLayout
as
layout.
The dialog field will adjust its controls' spans to the number of columns given.
To be reimplemented by dialog field implementors.
doFillIntoGrid
in class DialogField
public int getNumberOfControls()
DialogField
getNumberOfControls
in class DialogField
public void setButtonsMinWidth(int minWidth)
public org.eclipse.swt.widgets.Control getListControl(org.eclipse.swt.widgets.Composite parent)
parent
- the parent composite when called the first time, or null
after.public org.eclipse.jface.viewers.TableViewer getTableViewer()
public org.eclipse.swt.widgets.Composite getButtonBox(org.eclipse.swt.widgets.Composite parent)
parent
- the parent composite when called the first time, or null
after.public void dialogFieldChanged()
DialogField
dialogFieldChanged
in class DialogField
public void enableButton(int index, boolean enable)
public void setElements(java.util.List elements)
public java.util.List getElements()
public java.lang.Object getElement(int index)
public int getIndexOfElement(java.lang.Object elem)
public void replaceElement(java.lang.Object oldElement, java.lang.Object newElement) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void addElement(java.lang.Object element)
public void addElements(java.util.List elements)
public void insertElementAt(java.lang.Object element, int index)
public void removeAllElements()
public void removeElement(java.lang.Object element) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void removeElements(java.util.List elements)
public int getSize()
public void selectElements(org.eclipse.jface.viewers.ISelection selection)
public void selectFirstElement()
public void postSetSelection(org.eclipse.jface.viewers.ISelection selection)
public void refresh()
public java.util.List getSelectedElements()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |