网站推荐、资源下载等 | 个人网站

windchill中表格API

表格图示

表格的测试类

 1 package com.xiaostudy;
 2 
 3 import javax.servlet.http.HttpServletRequest;
 4 
 5 import org.apache.log4j.Logger;
 6 
 7 import wt.fc.QueryResult;
 8 import wt.log4j.LogR;
 9 import wt.util.WTException;
10 
11 import com.ptc.core.components.descriptor.DescriptorConstants.ColumnIdentifiers;
12 import com.ptc.jca.mvc.components.JcaComponentParams;
13 import com.ptc.mvc.components.AbstractComponentBuilder;
14 import com.ptc.mvc.components.ColumnConfig;
15 import com.ptc.mvc.components.ComponentBuilder;
16 import com.ptc.mvc.components.ComponentConfig;
17 import com.ptc.mvc.components.ComponentConfigFactory;
18 import com.ptc.mvc.components.ComponentParams;
19 import com.ptc.mvc.components.TableConfig;
20 import com.ptc.netmarkets.util.beans.NmCommandBean;
21 import com.ptc.netmarkets.util.beans.NmHelperBean;
22 
23 @ComponentBuilder("com.xiaostudy.Test_table")
24 public class Test_table extends AbstractComponentBuilder {
25 
26     private static final String CLASSNAME = Test_table.class.getName();
27 
28     private static final Logger logger = LogR.getLogger(CLASSNAME);
29 
30     @Override
31     public ComponentConfig buildComponentConfig(ComponentParams params) throws WTException {
32         logger.debug(">>>>>>" + CLASSNAME + ".buildComponentConfig()...");
33         ComponentConfigFactory factory = getComponentConfigFactory();//得到一个组件配置工厂
34         TableConfig table = factory.newTableConfig();//设置为表格,除了表格还有tree
35         table.setType(Object.class.getName());//设置表格行对象类型,行对象的类名.class.getName()
36         table.setLabel("测试列表");//表格名称
37         
38         table.setActionModel("test_list_toolbar_actions");//设置模型
39 
40         table.setSelectable(true);//显示表格前面的选择框
41         table.setShowCount(true);//显示对象数量,不过windchill自动显示,这里不设置也一样显示
42         table.setShowCustomViewLink(true);//设置下拉框的链接
43         table.setConfigurable(true);//设置此表支持可配置视图【视图:下拉列表】
44         table.setSingleSelect(true);//设置为单选框
45 
46         ColumnConfig col = factory.newColumnConfig("常量1", true);//常量为行对象的属性,因为行对象没有这个属性的话怎么显示?
47         col.setSortable(true);
48         col.setLabel("列名1");
49         table.addComponent(col);
50         
51         table.setStrikeThroughColumn(col);//设置将用于行删除操作的列
52 
53         col = factory.newColumnConfig("常量2", true);//行对象没有的属性,可以通过datautility类显示,datautility要注册,数据到底还是要跟行对象有关联,不然显示什么数据?
54         col.setSortable(true);//可排列的
55         col.setLabel("列名2");//列名
56         col.setDataUtilityId("datautility类名");//声明列是通过datautility来处理数据,直接就是datautility的类名
57         table.addComponent(col);//把列添加到表格里
58         
59         col = factory.newColumnConfig(ColumnIdentifiers.MODIFIED_BY, true);//修改者
60         col.setSortable(true);
61         table.addComponent(col);
62         
63         col = factory.newColumnConfig(ColumnIdentifiers.CREATED, true);//创建时间,windchill自带,是零部件的类型,所以行对象得是零部件的子类才能用,不然只能通过datautility来显示,但是要查看是否注册了
64         col.setSortable(true);
65         table.addComponent(col);
66         
67         col = factory.newColumnConfig(ColumnIdentifiers.LAST_MODIFIED, true);//最后修改时间
68         col.setSortable(true);
69         table.addComponent(col);
70 
71         logger.debug("<<<<<<" + CLASSNAME + ".buildComponentConfig().");
72         return table;
73     }
74 
75     @Override
76     public Object buildComponentData(ComponentConfig config, ComponentParams params) throws Exception {
77         logger.debug(">>>>>>" + CLASSNAME + ".buildComponentData()...");
78         QueryResult qr = new QueryResult();
79         if (params instanceof JcaComponentParams) {
80             JcaComponentParams jcaCompParams = (JcaComponentParams) params;
81             NmHelperBean helper = jcaCompParams.getHelperBean();
82 
83             NmCommandBean commandBean = helper.getNmCommandBean();
84 
85             HttpServletRequest request = commandBean.getRequest();
86 
87             String strForm= (String) params.getParameter("jsp中的表单数据名");
88             if(strForm == null) {
89                 strForm = "";
90             }
91             //qr这里查询数据
92         }
93         logger.debug("<<<<<<" + CLASSNAME + ".buildComponentData().");
94         return qr;
95     }
96 
97 }

表格的API

setConfigurable(boolean configurable) 
Set whether this table supports configurable views.(设置此表是否支持可配置视图【视图:下拉列表】。)
setDisableAction(String disableAction) Set the disableAction
for this component (设置此组件的禁用操作【禁用的action】)
setFreezable(
boolean freezable) Set the component to be considered for column freezing.(设置要考虑用于列冻结的组件)
setGroupBy(String groupByColumn) Set the groupBy attribute of a TableConfig.(通过表配置的属性设置组)
setMenubarName(String menubarName) Set the name of the action model used
for menubar actions (设置用于menubar操作的操作模型的名称)
setRowBasedObjectHandle(
boolean rowBasedObjectHandle) Set whether objectHandles are needed for each row.(设置每一行是否需要对象)
setSelectable(
boolean selectable) Set whether the table is selectable.(设置表是否可选择)
setShowCustomViewLink(
boolean showCustomViewLink) Set to show The customize view link in the view drop down.(设置为在视图下拉列表中显示定制视图链接)
setSingleSelect(
boolean singleSelect) Set whether in Single Select mode.(设置是否在单一选择模式)
setSingleViewOnly(
boolean singleViewOnly) Set whether component is singleViewOnly.(设置组件是否为单视图【视图:下拉列表】)
setStrikeThroughColumn(ColumnConfig column) Set the column which will get used
for row strike-through.(设置将用于行删除操作的列)

//set方法返回的类型都是void
String getDisableAction() Get the disableAction
for this component (获取此组件的禁用操作) Supported API: true
String getGroupBy() Returns the groupBy attribute of a TableConfig. (通过表配置的属性返回组)
String getMenubarName() Get the name of the action model used
for menubar actions (获取用于menubar操作的操作模型的名称) Supported API: true
ColumnConfig getStrikeThroughColumn() Returns the column which will get used
for row strike-through. (返回将用于行删除操作的列)
boolean isConfigurable() Whether the component supports configurable views. (组件是否支持可配置视图)
boolean isFreezable() Whether the component is marked for column freeze. (组件是否标记为列冻结)
boolean isRowBasedObjectHandle() Whether objectHandles are needed for each row (每一行是否需要对象) Supported API: true
boolean isSelectable() Whether the table is selectable. (这个表格是否可选)
boolean isShowCustomViewLink() Whether to show The customize view link in the view drop down. (是否在“视图”下拉列表中显示“定制视图”链接)
boolean isSingleSelect() Whether in Single Select mode. (是否在单一选择模式)
boolean isSingleViewOnly() Whether the component is of singleView only. (组件是否只有一个视图)

列API


 void setAscending(boolean ascending)

 Set the column sort ascending or not (设置列是否升序排序)

 Supported API: true


void
setAutoSize(boolean autoSize) Default value is false. (是否自动调节宽度,默认是为false)
void setCompareJsFunction(String compareJsFunction) Sets the custom compare javascript function to be used during client side sort. (设置客户端排序期间使用的自定义比较javascript函数)
void setDataStoreOnly(boolean forDataStoreOnly) Mark the column to be included in the backing datastore, but not be displayed to the user at all. (标记要包含在备份数据存储中的列,但完全不显示给用户)
void setDataType(String dataType) Default value is null. (设置数据类型,默认值为null)
void setDefaultFreeze(boolean defaultFreeze) Mark the column for default freeze, defaults to true. (将列标记为default freeze,默认为true。)
void setDefaultSecondarySort(boolean secondarySort) Mark this column for secondary sort. (为二级排序标记此列)
void setDefaultSort(boolean defaultSort) Mark this column for default sort. (将此列标记为默认排序)
void setExactWidth(boolean useExact) Default value is false. (设置准确的宽度,默认值为false)
void setSortable(boolean sortable) Mark the column to be rendered sortable, defaults to true. (标记要呈现可排序的列,默认为true)
void setVariableHeight(boolean variableHeight) Mark the column to have variable height to show its content properly (将列标记为具有可变高度以正确显示其内容) Supported API: true
void setWidth(int columnWidth) Sets the width, in pixels, for a column in a table. (设置表中列的宽度(以像素px为单位))
String getCompareJsFunction() Get the custom compare javascript function to be used during client side sort (获取客户端排序期间使用的自定义比较javascript函数) Supported API:
true

String getDataType() Default value is null. (获取数据类型,默认值为null)
int getWidth() Gets the width, in pixels, for a column in a table. (获取表中列的宽度(以像素px为单位))
boolean isAscending() Whether to sort the columns ascending (是否对列进行升序排序,默认值为true) Supported API: true
boolean isDataStoreOnly() Return whether the column is to be included in the backing datastore, but not be displayed to the user at all. (返回列是否包括在备份数据存储中,但根本不显示给用户)
boolean isDefaultFreeze() Whether the column is marked for default freeze (列是否被标记为默认冻结,默认值为true) Supported API: true
boolean isDefaultSecondarySort() Is the column marked for secondary sort (列是否标记为二级排序,默认值为true) Supported API: true
boolean isDefaultSort() Is the column marked for default sort. (列是否为默认排序标记的列)
boolean isSortable() Whether the column should be rendered sortable. (该列是否应呈现可排序)
boolean isVariableHeight() Whether the column is marked to have variable height (列是否标为可变高度,默认值为true) Supported API: true

 

posted @ 2018-09-04 17:39  xiaostudy  阅读(2912)  评论(0编辑  收藏  举报
网站推荐
[理工最爱]小时百科 |  GitHub |  Gitee |  开源中国社区 |  牛客网 |  不学网论坛 |  r2coding |  冷熊简历 |  爱盘 |  零散坑 |  bootstrap中文网 |  vue.js官网教程 |  源码分享站 |  maven仓库 |  楼教主网站 |  廖雪峰网站 |  w3cschool |  在线API |  代码在线运行 |  [不学网]代码在线运行 |  JS在线运行 |  PHP中文网 |  深度开源eclipse插件 |  文字在线加密解密 |  菜鸟教程 |  慕课网 |  千图网 |  手册网 |  素材兔 |  盘多多 |  悦书PDF |  sumatra PDF |  calibre PDF |  Snipaste截图 |  shareX截图 |  vlc-media-player播放器 |  MCMusic player |  IDM下载器 |  格式工厂 |  插件网 |  谷歌浏览器插件 |  Crx搜搜 |  懒人在线计算器 |  leetcode算法题库 |  layer官网 |  layui官网 |  formSelects官网 |  Fly社区 |  程序员客栈 |  融云 |  华为云 |  阿里云 |  ztree官网API |  teamviewer官网 |  sonarlint官网 |  editormd |  pcmark10官网 |  crx4chrome官网 |  apipost官网 |  花生壳官网 |  serv-u官网 |  杀毒eset官网 |  分流抢票bypass官网 |  懒猴子CG代码生成器官网 |  IT猿网 |  natapp[内网穿透] |  ngrok[内网穿透] |  深蓝穿透[内网穿透] |  WakeMeOnLan[查看ip] |  iis7 |  [漏洞扫描]Dependency_Check官网 |  [图标UI]fontawesome官网 |  idea插件官网 |  路过图床官网 |  sha256在线解密 |  在线正则表达式测试 |  在线文件扫毒 |  KuangStudy | 
资源下载
电脑相关: Windows原装下载msdn我告诉你 |  U盘制作微PE工具官网下载 |  Linux_CentOS官网下载 |  Linux_Ubuntu官网下载 |  Linux_OpenSUSE官网下载 |  IE浏览器官网下载 |  firefox浏览器官网下载 |  百分浏览器官网下载 |  谷歌google浏览器历史版本下载 |  深度deepin系统官网下载 |  中兴新支点操作系统官网下载 |  文件对比工具Beyond Compare官网下载 |  开机启动程序startup-delayer官网下载 |  openoffice官网下载 |  utorrent官网下载 |  qbittorrent官网下载 |  cpu-z官网下载 |  蜘蛛校色仪displaycal官网下载 |  单文件制作greenone下载 |  win清理工具Advanced SystemCare官网下载 |  解压bandizip官网下载 |  内存检测工具memtest官网下载 |  磁盘坏道检测与修复DiskGenius官网下载 |  磁盘占用可视化SpaceSniffer官网下载 |  [磁盘可视化]WizTree官网下载 |  win快速定位文件Everything官网下载 |  文件定位listary官网下载 |  动图gifcam官网下载 |  7-Zip官网下载 |  磁盘分区工具diskgenius官网下载 |  CEB文件查看工具Apabi Reader官网下载 |  罗技鼠标options官网下载 |  [去除重复文件]doublekiller官网下载 | 
编程相关: ApacheServer官网下载 |  Apache官网下载 |  Git官网下载 |  Git高速下载 |  Jboss官网下载 |  Mysql官网下载 |  Mysql官网历史版本下载 |  NetBeans IDE官网下载 |  Spring官网下载 |  Nginx官网下载 |  Resin官网下载 |  Tomcat官网下载 |  jQuery历史版本下载 |  nosql官网下载 |  mongodb官网下载 |  mongodb_linux历史版本下载 |  mongodb客户端下载 |  VScode官网下载 |  cxf官网下载 |  maven官网下载 |  QT官网下载 |  SVN官网下载 |  SVN历史版本下载 |  nodeJS官网下载 |  oracle官网下载 |  jdk官网下载 |  STS官网下载 |  STS历史版本官网下载 |  vue官网下载 |  virtualbox官网下载 |  docker desktop官网下载 |  github desktop官网下载 |  EditPlus官网下载 |  zTree下载 |  layui官网下载 |  jqgrid官网下载 |  jqueryui官网下载 |  solr历史版本下载 |  solr分词器ik-analyzer-solr历史版本下载 |  zookeeper历史版本官网下载 |  nssm官网下载 |  elasticsearch官网下载 |  elasticsearch历史版本官网下载 |  redis官网下载 |  redis历史版本官网下载 |  redis的win版本下载 |  putty官网下载 |  查看svn密码TSvnPD官网下载 |  MongoDB连接工具Robo官网下载 |  dll查看exescope官网下载 |  dll2c官网下载 |  接口测试apipost官网下载 |  接口测试postman官网下载 |  原型设计工具AxureRP官网下载 |  canal官网下载 |  idea主题样式下载 |  vue的GitHub下载 |  finalShell官网下载 |  ETL工具kafka官网下载 |  cavaj[java反编译]官网下载 |  jd-gui[java反编译]官网下载 |  radmin[远程连接]官网下载 |  tcping[win ping端口]下载 |  jQueryUploadFile官网下载 |  RedisPlus下载 |  aiXcoder智能编程助手官网下载 |  [表单效验]validform官网下载 |  idea官网下载 |  RedisStudio下载 |  MD转word含公式pandoc官网下载 |  logviewer官网下载 |  Kafka官网下载 |  hbase高速下载 |  hadoop官网下载 |  hadooponwindows的GitHub下载 |  hive官网下载 |  soapui官网下载 |  flink官网下载 |  kafkatool官网下载 |  MinIO官网下载 |  MinIO中国镜像下载 | 
办公相关工具
免费在线拆分PDF【不超过30M】 |  免费在线PDF转Word【不超过10M】 |  在线文字识别转换【不超过1M】 |  PDF转换成Word【不超过50M】 |  在线OCR识别 |  Smallpdf |  文件转换器Convertio |  迅捷PDF转换器 |  字母大小写转换工具 |  档铺 |  快传airportal[可文字] |  快传-文叔叔 |  P2P-小鹿快传 |  [图床]ImgURL | 
网站入口
腾讯文档 |  有道云笔记网页版 |  为知笔记网页版 |  印象笔记网页版 |  蓝奏云 |  QQ邮箱 |  MindMaster在线思维导图 |  bilibili |  PDM文件在线打开 |  MPP文件在线打开 |  在线PS软件 |  在线WPS |  阿里云企业邮箱登陆入口 | 
其他
PDF转换 |  悦书PDF转换 |  手机号注册查询 |  Reg007 |  akmsg |  ip8_ip查询 |  ipip_ip查询 |  天体运行testtubegames |  测试帧率 |  在线网速测试 |