Mon 21 Jul 22:43:21 CEST 2025
This commit is contained in:
parent
182bbee21d
commit
e38c23b629
54
js/ui/mxgraph/src/js/io/mxDefaultPopupMenuCodec.js
Normal file
54
js/ui/mxgraph/src/js/io/mxDefaultPopupMenuCodec.js
Normal file
|
@ -0,0 +1,54 @@
|
|||
/**
|
||||
* Copyright (c) 2006-2015, JGraph Ltd
|
||||
* Copyright (c) 2006-2015, Gaudenz Alder
|
||||
*/
|
||||
mxCodecRegistry.register(function()
|
||||
{
|
||||
/**
|
||||
* Class: mxDefaultPopupMenuCodec
|
||||
*
|
||||
* Custom codec for configuring <mxDefaultPopupMenu>s. This class is created
|
||||
* and registered dynamically at load time and used implicitely via
|
||||
* <mxCodec> and the <mxCodecRegistry>. This codec only reads configuration
|
||||
* data for existing popup menus, it does not encode or create menus. Note
|
||||
* that this codec only passes the configuration node to the popup menu,
|
||||
* which uses the config to dynamically create menus. See
|
||||
* <mxDefaultPopupMenu.createMenu>.
|
||||
*/
|
||||
var codec = new mxObjectCodec(new mxDefaultPopupMenu());
|
||||
|
||||
/**
|
||||
* Function: encode
|
||||
*
|
||||
* Returns null.
|
||||
*/
|
||||
codec.encode = function(enc, obj)
|
||||
{
|
||||
return null;
|
||||
};
|
||||
|
||||
/**
|
||||
* Function: decode
|
||||
*
|
||||
* Uses the given node as the config for <mxDefaultPopupMenu>.
|
||||
*/
|
||||
codec.decode = function(dec, node, into)
|
||||
{
|
||||
var inc = node.getElementsByTagName('include')[0];
|
||||
|
||||
if (inc != null)
|
||||
{
|
||||
this.processInclude(dec, inc, into);
|
||||
}
|
||||
else if (into != null)
|
||||
{
|
||||
into.config = node;
|
||||
}
|
||||
|
||||
return into;
|
||||
};
|
||||
|
||||
// Returns the codec into the registry
|
||||
return codec;
|
||||
|
||||
}());
|
Loading…
Reference in New Issue
Block a user