起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1635|回复: 3

[结贴] toolbar的“选择操作”是如何实现的.

[复制链接]

80

主题

245

帖子

586

积分

高级会员

Rank: 4

积分
586
QQ
发表于 2016-8-10 15:46:26 | 显示全部楼层 |阅读模式
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <elements>
  3.         <element name="$UI/system/components/justep/toolBar/toolBar" tag-type="rich" tag-name="div" icon="toolBar.png" text="工具条"  
  4.             binding-component="$UI/system/components/justep/toolBar/toolBar" display-property="xid"
  5.                 component-type="layout-container" validator="ViewValidator" design-view="web-designer" >
  6.                 <properties>
  7.                         <property name="xid" text="编号" required="false" editor-discriptor-ref=""/>  
  8.                         <property name="class"  text="class" editor-ref="classSelector">
  9.                                 <editor-parameter><![CDATA[
  10.                                 {
  11.                                         "0base": {
  12.                                                 label: "基础样式",
  13.                                                 value: "x-toolbar"
  14.                                         },
  15.                                         "2spliter": {
  16.                                                 label: "分割线",
  17.                                                 value: "x-toolbar-spliter",
  18.                                                 require: false
  19.                                         }
  20.                                 }
  21.                                 ]]></editor-parameter>
  22.                         </property>
  23.                         <property name="style" text="样式" editor-ref="styleDialog" />
  24.                         <include path="$UI/system/components/designerCommon/commonConfig.xml#//common-properties/group[@name='bind']"/>
  25.                 </properties>
  26.                 <events>
  27.                     <include path="$UI/system/components/designerCommon/commonConfig.xml#/ml-evens/*"/>
  28.                 </events>
  29.                  <toolbar>               
  30.                         <item text="添加操作" class="com.justep.designer.components.Commands" method="selectOperation"></item>                                               
  31.                 </toolbar>
  32.                 <templates>
  33.                    <template name="default"><![CDATA[
  34.                     <div component="$UI/system/components/justep/toolBar/toolBar" class="x-toolbar form-inline x-toolbar-spliter">
  35.                     </div>         
  36.                    ]]></template>
  37.                 </templates>

  38.         </element>
  39.        
  40. </elements>
复制代码
其中这一句<item text="添加操作" class="com.justep.designer.components.Commands" method="selectOperation"></item> 这个类在哪?


发表于 2016-8-10 17:23:11 | 显示全部楼层
源码在这里:/UI2/system/components/justep/toolBar/designer/toolBar.js
qq:1912779713
WeX5教程--WeX5下载
回复 支持 反对

使用道具 举报

80

主题

245

帖子

586

积分

高级会员

Rank: 4

积分
586
QQ
 楼主| 发表于 2016-11-14 09:13:11 | 显示全部楼层
找到了。
eclipse中搜索"selectOperation"文件内容,找到/UI2/system/components/designerCommon/src/com/justep/designer/components/Commands.java
的selectOperation方法,第二行$UI/system/components/designerCommon/propEdtorPages/operationSelector/operationSelector.w,找这个.w,
代码var xuiDoc = xuiService.getXuiDoc();原来是根据.xdoc生成的。看了一下windowreceiver的xdoc,最下面果然有
/**
@name $UI/system/components/justep/windowReceiver/windowReceiver#windowCancel
@operation
@see $UI/system/components/justep/windowReceiver/windowReceiver#windowCancel
@description 取消关闭
@returns {void}
*/

在xdoc中添加@operation属性即可让toolbar中有操作选项
回复 支持 反对

使用道具 举报

80

主题

245

帖子

586

积分

高级会员

Rank: 4

积分
586
QQ
 楼主| 发表于 2016-11-14 09:13:27 | 显示全部楼层
liangyongfei 发表于 2016-8-10 17:23
源码在这里:/UI2/system/components/justep/toolBar/designer/toolBar.js

请结贴。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-5-2 16:12 , Processed in 0.059221 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表