xmlresourceparsertest3.class.js

来自「在流览器上仿CS界面的JAVASCRIPT脚本」· JavaScript 代码 · 共 51 行

JS
51
字号
/*This is the JS code that goes together with the markup found inXmlResourceParserTest.class.xml*/// create the constructor for the prototype (super class)var _MyListPanel = BiXmlResourceParser.getClassFromDocument(				application.getResourceById("test-class-xml").getDocument() );function MyListPanel( s ){	_MyListPanel.call( this );}_p = MyListPanel.prototype = new _MyListPanel;_p._className = "MyListPanel";// override addXmlNode to add list items into the list_p.addXmlNode = function ( oNode, oXmlResourceParser ){	if ( oNode.nodeType == 1 )	// ELEMENT	{		var list = this.getComponentById( "list" );		var c = oXmlResourceParser.fromNode( oNode );		if ( c instanceof BiListItem )			list.add( c );		else			_MyListPanel.prototype.addXmlNode.apply( this, arguments );	}};// create getter and setter for caption so we can set the caption_p.setCaption = function ( s ){	var label = this.getComponentById( "label" );	label.setText( s );};_p.getCaption = function (){	var label = this.getComponentById( "label" );	return label.getText();};_p.close = function (){	alert( "Close " + this.getCaption() );};

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?