The PartMakeSpecialDialog
constructor has been changed to accept a new parameter label
. The new parameter
allows for customization of the dialogs label but the label is still defaulted to the title "Make/Change Special".
Old: public constructor(Window parent, PartSpecial original) {} New: public constructor(Window parent, PartSpecial original, str label=$specialsDialog) {}
The helper method generateSpecial()
has been introduced to streamline the process of creating PartSpecial
objects from dialog input.
return PartSpecial(partNumTF.text, descrTF.text, priceReplaceRB.currentState > 0, amountDF.value);
The helper method generateCustomSpecial()
has been introduced to streamline the process of creating custom PartSpecial
objects from dialog input.
In 16.5, the QueryDialogDataEnv
has changed it's backing data structures, replacing the str->Part parts
and int->str rowIDs
maps with a single QueryRowData[] queryRows
data sequence.
Cell highlighting has also been introduced in the QueryDialog
.
As a result, the following functions have been removed and added to QueryPartGridBuilderEnv
.
Removed: public str rowIdentifier(Object data) {} Added: public GridCell[] getRowCells(Object data) {} Added: public Brush getCellBrush(Object data, int columnIdx) {}
In 16.5, The QueryDialogDataEnv
has changed it's backing data structures, replacing the str->Part parts
and
int->str rowIDs
maps with a single QueryRowData[] queryRows
data sequence.
Old:
Part
instances
str->Part parts
int->str rowIDs
New:
QueryRowData
)QueryRowData[] queryRows
)As a result of this change, the following functions and fields were modified in the QueryDialogDataEnv
interface.
// Modified data fields Old: public str->Part parts; Old: public int->str rowIDs; New: public QueryRowData[] queryRows; // Modified data field accessors/manipulation Old: extend public Part[] setParts(Part[] value) {} Old: extend public int->str setRowIDs(int->str value) {} Old: extend public void buildParts() {} New: extend public void buildQueryRowData(Part[] parts=null) {} // Modified to new data structure (str id -> int row) Old: extend public PartSpecial getSpecial(str id) {} New: extend public PartSpecial getSpecial(int row) {} Old: extend public void putSpecial(str id, PartSpecial special) {} New: extend public void putSpecial(int row, PartSpecial special) {} Old: extend public void removeSpecial(str id) {} New: extend public void removeSpecial(int row) {} // Added helper functions New: extend public void refreshQueryRowData() {} New: extend public QueryRowData createPartRowData(Part part) {} New: extend public bool contains(PropObj propObj) {} New: extend public bool any() {} New: extend public bool empty() {} New: extend public QueryRowData getRowData(int row) {} NOTE: Things labelled as Old were removed interface and those labeled as New were added. The Old/New labels are utilized to clearly demonstrate the migration of changes.
In 16.5, the QueryDialogDataEnv
has changed it's backing data structures, replacing the str->Part parts
and int->str rowIDs
maps with a single QueryRowData[] queryRows
data sequence.
As a result, the extended type QueryPartRowData
has been created to represent a core Part
query dialog row.
/** * QueryPartRowData * * This class is responsible for managing * data for a Part row in a QueryDialog. */ public class QueryPartRowData extends QueryRowData { /** * Get the Part instance associated with this row. * @return The Part object associated with this row */ extend public Part part() { ... } /** * Get the special associated with this row. * @return The PartSpecial object associated with this row */ public PartSpecial getSpecial() { ... } /** * Assign a special to this row. * @special The PartSpecial object to associate with this row */ public void putSpecial(PartSpecial special) { ... } /** * Remove the special from this row. */ public void removeSpecial() { ... } }
In 16.5, The QueryDialogDataEnv
has changed it's backing data structures,
replacing the str->Part parts
and int->str rowIDs
maps with a single QueryRowData[] queryRows
data sequence.
View more documentation about this change in the section for cm.core.part.query.QueryDialogDataEnv
.
The following functions in the QueryDialogBehavior
have been updated to reflect the new index-based data retrieval versus the old key/id based retrieval.
They perform the same purposes with the only notable change being in buildGridWindow
which is documented further below.
Old: extend public int->str buildGridWindow(GridWindow grid, Part[] parts) {} New: extend public void buildGridWindow(GridWindow grid, Object rows) {} Old: extend public PartSpecial getSpecial(QueryDialog dialog, str id) {} New: extend public PartSpecial getSpecial(QueryDialog dialog, int row) {} Old: extend public void putSpecial(QueryDialog dialog, str id, PartSpecial special) {} New: extend public void putSpecial(QueryDialog dialog, int row, PartSpecial special) {} Old: extend public void removeSpecial(QueryDialog dialog, str id) {} New: extend public void removeSpecial(QueryDialog dialog, int row) {} Old: extend public GridCell[] getRowCells(QueryDialog dialog, str id) {} New: extend public GridCell[] getRowCells(QueryDialog dialog, int row) {} Old: extend public GridCell getCell(QueryDialog dialog, str columnLabel, str rowID) {} New: extend public GridCell getCell(QueryDialog dialog, str columnLabel, int row) {} Old: extend public DialogWindow getSpecialDialog(QueryDialog dialog, str id) {} New: extend public DialogWindow getSpecialDialog(QueryDialog dialog, int row) {}
The buildGridWindow
function no longer takes in a Part
sequence as a parameter and no longer returns an int->str
row-index to row-id map.
It now accepts a generic Object
type for its row building. It's return type has changed to void
with the reverted need for row IDs.
Old:
Part[] parts
as a parameterint->str
map of row-indexes to row-ids for caching on QueryDialogDataEnv
New:
Object
type for a row data parameterGridBuilder
s generic populateGridWindow
function which takes in an Object
QueryDialogDataEnv
GridBuilder
and it's populateGridWindow
interface
QueryDialogBehavior
on your PropObj
The following functions have been modified, added to, or removed from QueryDialogBehavior
in v16.5.
Added: extend public QueryRowData[] getQueryRows(QueryDialog dialog) {} Added: extend public QueryRowData getRowData(QueryDialog dialog, int row) {} Added: extend public Part getPart(QueryDialog dialog, int row) {} Added: extend public void openCustomSpecialDialog(QueryDialog dialog) {} Added: extend public DialogWindow getCustomSpecialDialog(QueryDialog dialog, int row) {} Removed: extend public bool containsSpecial(QueryDialog dialog) {} Removed: extend public int getRowIndex(QueryDialog dialog, str id) {}
QueryRowData
s in the dialogs QueryDialogDataEnv
QueryRowData
representing the row at the int row
indexPart
representing the row at the int row
indexPartMakeSpecialDialog
) for generating a custom special representing the row at the selected row indexPartMakeSpecialDialog
) for generating a custom special representing the row at the selected row indexQueryDialogDataEnv
cm.core.part.query.QueryDialogDataEnv
for more info.QueryDialogDataEnv
cm.core.part.query.QueryDialogDataEnv
for more info.In 16.5, the QueryDialogDataEnv
has changed it's backing data structures, replacing the str->Part parts
and int->str rowIDs
maps with a single QueryRowData[] queryRows
data sequence.
As a result, the abstract class QueryRowData
has been created to represent a generic query dialog row.
/** * QueryRowData * * This abstract class is responsible for managing * data for a row in a QueryDialog. */ public class QueryRowData : abstract { /** * ID for this row data instance. */ public str id; /** * The data object associated with this row. */ public Object data : copy=reference; /** * Constructor. * @id ID for this row * @data The data object to associate with this row */ public constructor(str id, Object data) { ... } /** * Get the special associated with this row. * Override to get specific special handling logic. * @return The PartSpecial object associated with this row */ extend public PartSpecial getSpecial() : abstract { } /** * Assign a special to this row. * Override to get specific special handling logic. * @special The PartSpecial object to associate with this row */ extend public void putSpecial(PartSpecial special) : abstract { } /** * Remove the special from this row. * Override to get specific special handling logic. */ extend public void removeSpecial() : abstract { } }
In 16.5, The QueryDialogDataEnv
has changed it's backing data structures,
replacing the str->Part parts
and int->str rowIDs
maps with a single QueryRowData[] queryRows
data sequence.
View more documentation about this change in the section for cm.core.part.query.QueryDialogDataEnv
.
The following functions in the QueryDialog
have been updated, added, or removed to reflect the new index-based data retrieval versus the old key/id based retrieval.
Old: extend public str selectedRowID() {} New: extend public int selectedRow() {} Old: extend public PartSpecial getSpecial(str id) {} New: extend public PartSpecial getSpecial(int row) {} Old: extend public void putSpecial(str id, PartSpecial special) {} New: extend public void putSpecial(int row, PartSpecial special) {} Old: extend public void removeSpecial(str id) {} New: extend public void removeSpecial(int row) {} Removed: extend public str->Part parts() {} Removed: extend public int->str rowIDs() {} Added: extend public QueryRowData selectedRowData() {}
The following functions have been added and removed from QueryDialog
in v16.5.
Added: extend public bool any() {} Added: extend public bool empty() {} Added: extend public bool contains(PropObj propObj) {} Added: public bool keyCode(Window originator, KeyCode keyCode) {} Removed: extend public bool containsSpecial() {}
QueryDialog
contains any backing dataQueryDialog
has any dataany()
on the dialogs QueryDialogDataEnv env
data
contains any QueryDataRow
s; false if notQueryDialog
contains any backing dataQueryDialog
has no dataempty()
on the dialogs QueryDialogDataEnv env
data
contains any QueryDataRow
s; false if notQueryDialog
contains the passed in propObj
in it's backing datacontains(..)
on the dialogs QueryDialogDataEnv env
cm.core.part.query.QueryDialogDataEnv
for more infoQueryDialog
to intercept Ctrl+A events originating from a QueryDialog
. CoreAppWindow
and trigger a selectAll action on snapper elements, which was not desirable.GridWindow
, it returns true immediately to prevent parent handlingGridWindow
via gridWindow().?key(CTRL_A)
super(..)
The event callback for the OK button click has been modified to utilize the new generateSpecial
method.
It now calls generateSpecial
rather than creating a special on the fly.
Old:
PartSpecial
within the event callbackPartSpecial
Old: extend public void onOKButtonClick(Object sender, Object args) { PartSpecial newSpecial(partNumTF.text, descrTF.text, priceReplaceRB.currentState > 0, amountDF.value); ... }
New:
PartSpecial
generation has been separated out into a designated function generateSpecial
PartSpecial
can be customized hereNew: extend public void onOKButtonClick(Object sender, Object args) { if (PartSpecial newSpecial = generateSpecial()) { ... } ... }
QueryGridWindow
super()
does not select this row in selectAll
isUsingMultiSelect
== true):
multiSelectedRows
multiSelectedRows
Specials created or modified in the QueryDialog
no longer replace the stored PartSpecial
value on the PartSpecialHolder
.
Instead, their values are copied over to the existing PartSpecial
instance.
Old:
PartSpecial
s created or modified in the QueryDialog
fully replaced existing PartSpecial
instancesextend public void onSpecialChanged(Object sender, Object args) { if (sender as Window) { ... if (args as QuerySpecialChangedEventArgs) { dialog.putSpecial(dialog.selectedRowID(), args.newSpecial); // directly replaces existing PartSpecial } } }
New:
PartSpecial
s created or modified in the QueryDialog
copy their values over to the existing PartSpecial
instanceextend public void onSpecialChanged(Object sender, Object args) { if (sender as Window) { ... if (args as QuerySpecialChangedEventArgs) { PartSpecial original = args.oldSpecial; original.copy(args.newSpecial); // copies new values to existing PartSpecial putSpecial(dialog, dialog.selectedRow(), original); } } }
GridCell
function clipboardValue()
has been added in EditGridCell
. It returns the cells outS()
value.