public class GComponentList extends GPanel implements GClear, GReadWrite, GCondensedStatusInterface, GCondensedIsModifiedInterface
| Index | Class | Item | Constraint |
| 0 | GHeaderPanel | header | "newline , pushx , pushy , growx , growy" (see table below) |
| 1 | GLabel | spaceLabel | "newline , height 30" |
| Index | Class | Item | Constraint |
| 0, 0 | GEntryInt | totalNumberItemsEntry | 0, 0, 0, 0 =>
"newline , split 2" 0, 0, 0, 1 => (null) 0, 0, 1 => "skip 2 , width 50" |
| 0, 1 | GEntryInt | currentItemRankEntry | 0,
1, 0, 0 => "split 2" 0, 1, 0, 1 => (null) 0, 1, 1 => "width 50" |
| 0, 2 | GButton | decrButton | "alignx Right , height 20" |
| 0, 3 | GButton | incrButton | "height 20" |
| 0, 4 | GPopupList | menu | (null) |
GPanel.Panel, GPanel.ScrollBarVisibilityGComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.OperationNAME_ATTRIBUTE| Constructor and Description |
|---|
GComponentList()
Constructor by default
|
GComponentList(String name,
Class<?> classType,
boolean singleMode)
Constructor only with a class type.
|
GComponentList(String name,
GComponent byDefault,
boolean singleMode)
Constructor with a default object (used to initialize a new widget element of the list using
"clone" method).
|
GComponentList(String widgetId,
String name,
Class<?> classType,
boolean singleMode)
Constructor only with a class type.
|
GComponentList(String widgetId,
String name,
GComponent byDefault,
boolean singleMode)
Constructor with a default object (used to initialize a new widget element of the list using
"clone" method).
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int rank,
GComponent item)
Add an item to the list
|
void |
clear()
Called when the element is to be cleared, so it can perform the actions required to return to the last
saved/loaded values.
|
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.
|
void |
generic()
Abstract generic function that need to be implemented by the descendants.
|
int |
getCurrentItemRank()
Get the rank of the current item in the list.
|
GEntryInt |
getGEntryRealTotalNumberItems()
Getter for the total number of items entry int.
|
<T> ArrayList<T> |
getList()
Method returning a list of widgets.
|
GComponent |
getSubComponent(int position)
Gets the subcomponent occupying the position defined by position.
|
boolean |
isModified()
Gets the modification status of the component against the last set of values loaded or saved.
|
void |
read()
Implementaion of the routines that allow the component to be loaded from a configuration file.
|
void |
remove(int rank)
Remove an item in the list
|
void |
setCurrentElementNumber(int currentNumberOfItems)
Set the current number of items in the component list, if the value is not contained in
minNumberOfItems <= currentNumberOfItems <= maxNumberOfItems, nothing is done.
|
void |
setCurrentItemRank(int rank)
Set the rank of the current item in the list.
|
protected void |
setDefaultConstraints()
set the defaults constraints
|
void |
setDefaultItem(GComponent defaultItem)
Sets the default item for the list.
|
void |
setDisplayIsModifiedIndicatorAll(GComponent.DisplayIndicatorStatus displayIndicatorStatus)
Controls the display of the isModified indicator of all itmes in the list.
|
void |
setEditable(boolean flag)
Set the item to be editable or not.
|
void |
setEnabled(boolean flag)
Set the enable status of the component.
|
void |
setHeaderToListDistance(int separation)
Set separation between header and list in pixels.
|
void |
setLabels(String totalLabelString,
String currentLabelString,
String itemPrefixString)
Set the labels for: The entry field containing the total number of entries.
|
void |
setList(List<GComponent> list)
Method testing consistency between the widget list given as an argument and data type
classType.
|
void |
setMinMaxElementNumber(Integer minElementNumber,
Integer maxElementNumber)
Set the minimum and maximum number of items allowed in the component list.
|
void |
setWidgetId(String widgetId)
Sets the widget identifier of the component.
|
void |
updateCondensedStatus(GCondensedStatus condensedStatus)
Update a condensed status object with the status of one or more components.
|
void |
updateIsModified(GCondensedIsModified condensedIsModified)
Update a condensed isModified object with the status of one or more components.
|
void |
write()
Implementaion of the routines that allow the component to be saved to a configuration file.
|
clearConstraint, getClassConstraint, getComponent, getHorizontalScroll, getInnerDescendantClassConstraint, getJPanel, getJScrollPane, getLayoutConstraints, getStringClassConstraint, getVerticalScroll, mainClear, mainDisplay, processMouseWheelEvent, put, setClassConstraint, setColumnConstraints, setConstraint, setHorizontalScroll, setInnerDescendantClassConstraint, setLayoutConstraints, setMargins, setPanelConstraints, setPreferredSize, setRowConstraints, setUnitIncrement, setVerticalScroll, unputactivateConstraintsByType, attachCopyPasteMenu, attachCopyPasteMenu, beginOfElement, beginOfElement, beginOfElement, beginOfElement, clearAllInnerDescendantConstraint, clearInnerDescendantContraint, composeWidgetId, doDisplay, endOfElement, getCommentInConfigFile, getConstraint, getCurrentOperation, getDisplayIndicatorStatus, getDisplayIsModifiedIndicator, getElement, getGClassName, getGPanel, getGParent, getGUnitInConfigFile, getInnerDescendantConstraint, getName, getNameInConfigFile, getOperationSaveValue, getPathInConfigFile, getSimpleWidgetId, getStatus, getStringConstraint, getWidgetId, handleCopyPasteEvent, handleCopyPasteEvent, handleProcessEventException, isCopyPasteEvent, isEnabled, isForcedStatus, launchInvalidPositionException, mouseWheelMoved, parseSimpleConstraint, processGEvent, setBusyCursor, setCommentInConfigFile, setCopyPasteMenuEnabled, setCurrentOperation, setDataForConstraintsByType, setDisplayIsModifiedIndicator, setElement, setForcedStatus, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setName, setNameAndCommentInConfigFile, setNameInConfigFile, setPathInConfigFile, setStatus, setStringConstraint, setToolTipText, setWidth, setWindowBusyCursor, updateIsModifiedIndicator, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItempublic GComponentList()
public GComponentList(String name, Class<?> classType, boolean singleMode)
name - in the configuration file.classType - type of the class of the elements of the list.singleMode - flag to determine if "single widget mode" is selected or not.public GComponentList(String widgetId, String name, Class<?> classType, boolean singleMode)
widgetId - widget identifier.name - in the configuration file.classType - type of the class of the elements of the list.singleMode - flag to determine if "single widget mode" is selected or not.public GComponentList(String name, GComponent byDefault, boolean singleMode)
name - in the configuration file.byDefault - object used to initialize a new widget element of the list using "clone" method.singleMode - flag to determine if "single widget mode" is selected or not.public GComponentList(String widgetId, String name, GComponent byDefault, boolean singleMode)
widgetId - widget identifier.name - in the configuration file.byDefault - object used to initialize a new widget element of the list using "clone" method.singleMode - flag to determine if "single widget mode" is selected or not.protected final void setDefaultConstraints()
setDefaultConstraints in class GPanelpublic final void setWidgetId(String widgetId)
setWidgetId in class GComponentwidgetId - the widget identifier of the component.public void setMinMaxElementNumber(Integer minElementNumber, Integer maxElementNumber)
minElementNumber - minimum number of items, if null do not change the current value.maxElementNumber - maximum number of items, if null do not change the current value, if
-1 do limit the maximum number of items.public void setCurrentElementNumber(int currentNumberOfItems)
currentNumberOfItems - current number of items in the component list, if the value is not contained in
minNumberOfItems <= currentNumberOfItems <= maxNumberOfItems, nothing is done.public final void setHeaderToListDistance(int separation)
separation - in pixels.public void setDefaultItem(GComponent defaultItem)
defaultItem - item to be set as default one.public void updateCondensedStatus(GCondensedStatus condensedStatus)
condensedStatus.update(widget1, widget2, etc)updateCondensedStatus in interface GCondensedStatusInterfacecondensedStatus - the condensed status object to be updated.public void updateIsModified(GCondensedIsModified condensedIsModified)
condensedIsModified.update(widget1, widget2, etc)updateIsModified in interface GCondensedIsModifiedInterfacecondensedIsModified - the condensed isModified object to be updated.public void setEnabled(boolean flag)
GComponentsetEnabled in class GComponentflag - new enable status of the component.public void setEditable(boolean flag)
flag - if true the item is editable, otherwise not.public int getCurrentItemRank()
public void setList(List<GComponent> list) throws GComponentListException
list - list of widget (could be without elements but anyway instanced).GComponentListException - if the list is not compatible in size with the minimum and maximum of the
component.public void setLabels(String totalLabelString, String currentLabelString, String itemPrefixString)
totalLabelString - label for the field containing the total number of entries.currentLabelString - label for the field containing the current element number.itemPrefixString - prefix for each element's title.public void generic()
public void read()
throws GException
read in interface GReadWriteGException - in case of problem while reading the value from file.public void write()
throws GException
write in interface GReadWriteGException - in case of problem while writing the value to file.public void display()
throws GException
GDisplaydisplay in interface GDisplayGException - in case of problem while reading the value from file.public <T> ArrayList<T> getList()
T - Type of the items managed by the list.public GComponent getSubComponent(int position) throws GComponentException
getSubComponent in class GComponentposition - position of the requested component.GComponentException - in case the position argument is invalid.public GEntryInt getGEntryRealTotalNumberItems()
public boolean isModified()
isModified in class GComponentpublic void setDisplayIsModifiedIndicatorAll(GComponent.DisplayIndicatorStatus displayIndicatorStatus)
displayIndicatorStatus - if Always the modifiedStatusIndicator is always shown, if Never the
modifiedStatusIndicator is never shown, if Automatic the modifiedStatusIndicator
is shown as needed.public void add(int rank,
GComponent item)
rank - rankitem - itempublic void remove(int rank)
rank - rankpublic void setCurrentItemRank(int rank)
rank - the rank of the current item in the list.public void clear()
throws GException
GClearclear in interface GClearGException - in case of problem while clearing the values.Copyright © 2024. All rights reserved.