public class GList extends GComponent implements GDisplay, ListSelectionListener
GComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.Operation
NAME_ATTRIBUTE
Constructor and Description |
---|
GList()
Constructor without arguments.
|
GList(List<String> listOfAvailData)
Constructor with a predefined list as arguments.
|
GList(String widgetId)
Constructor with widgetId as arguments.
|
GList(String widgetId,
List<String> listOfAvailData)
Constructor with a widget Id and a predefined list as arguments.
|
Modifier and Type | Method and Description |
---|---|
void |
addElement(int index,
String element)
Method for adding an element in the list.
|
void |
addElements(List<String> list)
Method to add a list of elements (at the end of the current list).
|
void |
clear()
Removes all of the elements from this list.
|
boolean |
containsElement(String element)
Return true if the string element is found in the list
|
void |
display()
Called when the element is to be displayed, so it can perform the actions required for its display, and
the display of its inmmediate descendants.
|
Component |
getComponent()
Returns the low level Swing Component encapsulated by the class if any, otherwise returns
null.
|
JList |
getJList()
Returns the low level List Component encapsulated by the class if any, otherwise returns
null.
|
List<String> |
getListOfData()
Method returning the content of the complete list.
|
int[] |
getSelectedIndexes()
Method returning a table of the selected indexes.
|
List<String> |
getSelectedValues()
Method returning the list of selected values.
|
int |
getSize()
Method returning the content of the complete list.
|
void |
moveElementDown(int index)
Method to move down an element
|
void |
moveElementsDown(int[] indexes)
Method to move down a list of elements.
|
void |
moveElementsUp(int[] indexes)
Method to move up a list of elements.
|
void |
moveElementUp(int index)
Method to move up an element
|
void |
removeAllElements()
Method for removing all elements of the list.
|
void |
removeElement(int index)
Method for removing an element in the list.
|
void |
removeElements(int[] indexes)
Method for removing a list of elements.
|
void |
setEnabled(boolean b)
Set the enable status of the component.
|
void |
setIndexes(int[] indexes)
Method setting the indexes to be selected.
|
void |
setLayoutOrientation(int orientation)
Method allowing to define the list orientation.
|
void |
setListOfData(List<String> newListOfData)
Set the list of data
|
void |
setSelectionMode(int mode)
Method allowing to define the selection mode.
|
void |
setVisibleRowCount(int count)
Sets the visibleRowCount property
|
void |
valueChanged(ListSelectionEvent e) |
activateConstraintsByType, attachCopyPasteMenu, attachCopyPasteMenu, beginOfElement, beginOfElement, beginOfElement, beginOfElement, clearAllInnerDescendantConstraint, clearConstraint, clearInnerDescendantContraint, composeWidgetId, doDisplay, endOfElement, getCommentInConfigFile, getConstraint, getCurrentOperation, getDisplayIndicatorStatus, getDisplayIsModifiedIndicator, getElement, getGClassName, getGPanel, getGParent, getGUnitInConfigFile, getInnerDescendantConstraint, getName, getNameInConfigFile, getOperationSaveValue, getPathInConfigFile, getSimpleWidgetId, getStatus, getStringConstraint, getSubComponent, getWidgetId, handleCopyPasteEvent, handleCopyPasteEvent, handleProcessEventException, isCopyPasteEvent, isEnabled, isForcedStatus, isModified, launchInvalidPositionException, mouseWheelMoved, parseSimpleConstraint, processGEvent, processMouseWheelEvent, setBusyCursor, setCommentInConfigFile, setConstraint, setCopyPasteMenuEnabled, setCurrentOperation, setDataForConstraintsByType, setDefaultConstraints, setDisplayIsModifiedIndicator, setElement, setForcedStatus, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setName, setNameAndCommentInConfigFile, setNameInConfigFile, setPathInConfigFile, setStatus, setStringConstraint, setToolTipText, setWidgetId, setWidth, setWindowBusyCursor, updateIsModifiedIndicator, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem
public GList(String widgetId, List<String> listOfAvailData)
widgetId
- widget Id.listOfAvailData
- list of elements.public GList(List<String> listOfAvailData)
listOfAvailData
- list of elements.public GList()
public GList(String widgetId)
widgetId
- widget Id.public void display()
GDisplay
public Component getComponent()
GComponent
getComponent
in class GComponent
public void setSelectionMode(int mode)
mode
- selection mode: ListSelectionModel.SINGLE_SELECTION
ListSelectionModel.SINGLE_INTERVAL_SELECTION
ListSelectionModel.MULTIPLE_INTERVAL_SELECTION).public void setLayoutOrientation(int orientation)
orientation
- list orientation: JList.VERTICAL
JList.VERTICAL_WRAP
JList.HORIZONTAL_WRAPpublic void addElement(int index, String element)
index
- index where to include the elementelement
- element to includepublic void addElements(List<String> list)
list
- list of elements to add.public void removeAllElements()
public void removeElement(int index)
index
- index of the element to removepublic void removeElements(int[] indexes)
indexes
- table including indexes of elements to remove.public void moveElementUp(int index)
index
- index of the element to move.public void moveElementsUp(int[] indexes)
indexes
- table of indexes of the elements to move.public void moveElementDown(int index)
index
- index of the element to move.public void moveElementsDown(int[] indexes)
indexes
- table of indexes of the elements to move.public int[] getSelectedIndexes()
public void setIndexes(int[] indexes)
indexes
- table of indexes to be selected.public List<String> getSelectedValues()
public List<String> getListOfData()
public int getSize()
public void setEnabled(boolean b)
setEnabled
in class GComponent
b
- new enable status of the component.public void clear()
public boolean containsElement(String element)
element
- the element to findpublic void setListOfData(List<String> newListOfData)
newListOfData
- the new datapublic JList getJList()
public void setVisibleRowCount(int count)
count
- visible row countpublic void valueChanged(ListSelectionEvent e)
valueChanged
in interface ListSelectionListener
Copyright © 2024. All rights reserved.