表格图示

表格的测试类

 package com.xiaostudy;

 import javax.servlet.http.HttpServletRequest;

 import org.apache.log4j.Logger;

 import wt.fc.QueryResult;
import wt.log4j.LogR;
import wt.util.WTException; import com.ptc.core.components.descriptor.DescriptorConstants.ColumnIdentifiers;
import com.ptc.jca.mvc.components.JcaComponentParams;
import com.ptc.mvc.components.AbstractComponentBuilder;
import com.ptc.mvc.components.ColumnConfig;
import com.ptc.mvc.components.ComponentBuilder;
import com.ptc.mvc.components.ComponentConfig;
import com.ptc.mvc.components.ComponentConfigFactory;
import com.ptc.mvc.components.ComponentParams;
import com.ptc.mvc.components.TableConfig;
import com.ptc.netmarkets.util.beans.NmCommandBean;
import com.ptc.netmarkets.util.beans.NmHelperBean; @ComponentBuilder("com.xiaostudy.Test_table")
public class Test_table extends AbstractComponentBuilder { private static final String CLASSNAME = Test_table.class.getName(); private static final Logger logger = LogR.getLogger(CLASSNAME); @Override
public ComponentConfig buildComponentConfig(ComponentParams params) throws WTException {
logger.debug(">>>>>>" + CLASSNAME + ".buildComponentConfig()...");
ComponentConfigFactory factory = getComponentConfigFactory();//得到一个组件配置工厂
TableConfig table = factory.newTableConfig();//设置为表格,除了表格还有tree
table.setType(Object.class.getName());//设置表格行对象类型,行对象的类名.class.getName()
table.setLabel("测试列表");//表格名称 table.setActionModel("test_list_toolbar_actions");//设置模型 table.setSelectable(true);//显示表格前面的选择框
table.setShowCount(true);//显示对象数量,不过windchill自动显示,这里不设置也一样显示
table.setShowCustomViewLink(true);//设置下拉框的链接
table.setConfigurable(true);//设置此表支持可配置视图【视图:下拉列表】
table.setSingleSelect(true);//设置为单选框 ColumnConfig col = factory.newColumnConfig("常量1", true);//常量为行对象的属性,因为行对象没有这个属性的话怎么显示?
col.setSortable(true);
col.setLabel("列名1");
table.addComponent(col); table.setStrikeThroughColumn(col);//设置将用于行删除操作的列 col = factory.newColumnConfig("常量2", true);//行对象没有的属性,可以通过datautility类显示,datautility要注册,数据到底还是要跟行对象有关联,不然显示什么数据?
col.setSortable(true);//可排列的
col.setLabel("列名2");//列名
col.setDataUtilityId("datautility类名");//声明列是通过datautility来处理数据,直接就是datautility的类名
table.addComponent(col);//把列添加到表格里 col = factory.newColumnConfig(ColumnIdentifiers.MODIFIED_BY, true);//修改者
col.setSortable(true);
table.addComponent(col); col = factory.newColumnConfig(ColumnIdentifiers.CREATED, true);//创建时间,windchill自带,是零部件的类型,所以行对象得是零部件的子类才能用,不然只能通过datautility来显示,但是要查看是否注册了
col.setSortable(true);
table.addComponent(col); col = factory.newColumnConfig(ColumnIdentifiers.LAST_MODIFIED, true);//最后修改时间
col.setSortable(true);
table.addComponent(col); logger.debug("<<<<<<" + CLASSNAME + ".buildComponentConfig().");
return table;
} @Override
public Object buildComponentData(ComponentConfig config, ComponentParams params) throws Exception {
logger.debug(">>>>>>" + CLASSNAME + ".buildComponentData()...");
QueryResult qr = new QueryResult();
if (params instanceof JcaComponentParams) {
JcaComponentParams jcaCompParams = (JcaComponentParams) params;
NmHelperBean helper = jcaCompParams.getHelperBean(); NmCommandBean commandBean = helper.getNmCommandBean(); HttpServletRequest request = commandBean.getRequest(); String strForm= (String) params.getParameter("jsp中的表单数据名");
if(strForm == null) {
strForm = "";
}
//qr这里查询数据
}
logger.debug("<<<<<<" + CLASSNAME + ".buildComponentData().");
return qr;
} }

表格的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

windchill中表格API的更多相关文章

  1. [Python][flask][flask-login]关于flask-login中各种API使用实例

    本篇博文跟上一篇[Python][flask][flask-wtf]关于flask-wtf中API使用实例教程有莫大的关系. 简介:Flask-Login 为 Flask 提供了用户会话管理.它处理了 ...

  2. HDFS中JAVA API的使用

    HDFS中JAVA API的使用   HDFS是一个分布式文件系统,既然是文件系统,就可以对其文件进行操作,比如说新建文件.删除文件.读取文件内容等操作.下面记录一下使用JAVA API对HDFS中的 ...

  3. Appium中部分api的使用方法

    使用的语言是java,appium的版本是1.3.4,java-client的版本是java-client-2.1.0,建议多参考java-client-2.1.0-javadoc. 1.使用Andr ...

  4. VB中的API详解

    一.API是什么? 这个我本来不想说的,不过也许你知道其它人不知道,这里为了照顾一下新手,不得不说些废话,请大家谅解. Win32 API即为Microsoft 32位平台的应用程序编程接口(Appl ...

  5. elasticsearch中的API

    elasticsearch中的API es中的API按照大类分为下面几种: 文档API: 提供对文档的增删改查操作 搜索API: 提供对文档进行某个字段的查询 索引API: 提供对索引进行操作 查看A ...

  6. Linux 编程中的API函数和系统调用的关系【转】

    转自:http://blog.chinaunix.net/uid-25968088-id-3426027.html 原文地址:Linux 编程中的API函数和系统调用的关系 作者:up哥小号 API: ...

  7. C#中调用API

    介绍 API( Application Programming Interface ),我想大家不会陌生,它是我们Windows编程的常客,虽然基于.Net平台的C#有了强大的类库,但是,我们还是不能 ...

  8. 在C#中调用API获取网络信息和流量

    原文 在C#中调用API获取网络信息和流量 最近一项目中要求显示网络流量,而且必须使用C#. 事实上,调用 IpHlpApi.dll 的 GetIfTable API 可以轻易获得网络信息和网络流量. ...

  9. FineUIMvc随笔(6)对比WebForms和MVC中表格的数据库分页

    声明:FineUIMvc(基础版)是免费软件,本系列文章适用于基础版. 通过对比WebForms和MVC中表格数据库分页代码的不同,可以对 MVC 中的数据流转有更加深入的了解. WebForms 中 ...

随机推荐

  1. jmeter常见参数 vars、prev、ctx 、props 类的api

    ctx - ( JMeterContext) - gives access to the context vars - ( JMeterVariables) - gives read/write ac ...

  2. python基础-第六篇-6.2模块

    python之强大,就是因为它其提供的模块全面,模块的知识点不仅多,而且零散---一个字!错综复杂 没办法,二八原则抓重点咯!只要抓住那些以后常用开发的方法就可以了,哪些是常用的?往下看--找答案~ ...

  3. django将数据库中数据直接传到html

    1.当然,前提是建立和配置好django数据库啦~ 2.在python后台函数中引入需要的表 #要读取home这个APP下的models.py文件,引入其中的Student_message_unedi ...

  4. 兼容ie的半透明背景颜色过滤器,会影响事件的触发.

    兼容ie的半透明背景颜色过滤器,会影响事件的触发.

  5. python序列化和json

    python 的序列化和反序列化用于内存之间的共享,包括服务器和客户端的共享,两个Python程序之间的共享,以及以字符串的形式存储到硬盘中. pyhton 的pickle 可以对Python的各种数 ...

  6. JSON 序列化与反序列化(二)使用TypeReference 构建类型安全的异构容器

    1. 泛型通常用于集合,如Set和Map等.这样的用法也就限制了每个容器只能有固定数目的类型参数,一般来说,这也确实是我们想要的. 然而有的时候我们需要更多的灵活性,如数据库可以用任意多的Column ...

  7. windows server 2008 r2 IIS 6 元数据库与IIS 6 配置的兼容性 解决方案

    1 菜单-管理工具-服务器管理 2 添加角色服务 3 选中 IIS6 管理兼容性 4 安装完成 5 在IIS上新建一个相应端口的网站 6重新加载项目,OK

  8. js-jquery-003-条形码-二维码【QR码】

    一.基本使用 插件地址:https://github.com/jeromeetienne/jquery-qrcode 1.首先在页面中加入jquery库文件和qrcode插件. <script ...

  9. 19.如何在vue里面调用其他js

    可以通过把js放到服务器,然后再html文件中通过链接的形式引入,这是目前我试过成功的唯一方法

  10. Spark2.0机器学习系列之3:决策树

    概述 分类决策树模型是一种描述对实例进行分类的树形结构. 决策树可以看为一个if-then规则集合,具有“互斥完备”性质 .决策树基本上都是 采用的是贪心(即非回溯)的算法,自顶向下递归分治构造. 生 ...