📄 applauncher.xml
字号:
<Application defaultPackages="Core, Gui"> <Window caption="App Launcher"> <SplitPane id="split-pane" dividerLocation="200" left="7" top="7" right="7" bottom="38"> <List id="app-list" multipleSelection="false"/> <Iframe id="iframe"/> </SplitPane> <Button id="open-button" text="Open" enabled="false" width="75" right="7" bottom="7"/> </Window> <Resources> <XmlLoader id="applist-xml" uri="applist.xml"/> <Image uri="file.png"/> <Script><![CDATA[/* * This is a sample application for launching test applications. The application * loads an xml file and populates a list from that xml. Each item represents a * test application in the test directory */function AppLauncher() { var win = application.getWindow(); this.iframe = application.getComponentById("iframe"); this.appList = application.getComponentById("app-list"); this.openButton = application.getComponentById("open-button"); this.timer = new BiTimer(100); // the default border in Mozilla is just plain ugly if ( BiBrowserCheck.moz ) this.iframe.setBorder( new BiBorder(2, "inset") ); this.populateList(); this.openButton.addEventListener("action", this.onOpenButtonAction, this); this.appList.addEventListener("change", this.onAppListChange, this); this.timer.addEventListener("tick", this.onTick, this);}AppLauncher.APP_BASE = "../../test/";AppLauncher.prototype.populateList = function () { var doc = application.getResourceById("applist-xml").getDocument(); var listItems = doc.getElementsByTagName("Application"); var l = listItems.length; var listItem; var image = new BiImage( "file.png", 16, 16 ); for (var i = 0; i < l; i++) { listItem = new BiListItem( listItems[i].getAttribute("src") ); listItem.setIcon( image ); this.appList.add(listItem); listItem.addEventListener("action", this.onItemAction, this); }};AppLauncher.prototype.onItemAction = function (e) { this.runItem(e.getTarget());};AppLauncher.prototype.onOpenButtonAction = function (e) { var item = this.appList.getSelectedItems(); if (item.length == 1) this.runItem(item[0]);};AppLauncher.prototype.onAppListChange = function (e) { var oItem = this.appList.getSelectedItem(); this.openButton.setEnabled( oItem != null ); this.timer.start();};AppLauncher.prototype.onTick = function (e) { this.timer.stop(); var oItem = this.appList.getSelectedItem(); this.iframe.getContentDocument().location.replace( AppLauncher.APP_BASE + oItem.getText() );};AppLauncher.prototype.runItem = function (oItem) { biExec( application.getPath(), AppLauncher.APP_BASE + oItem.getText() );};AppLauncher.main = function () { new AppLauncher; }; ]]></Script> </Resources></Application>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -