ITPub博客

首页 > 数据库 > Oracle > Jdeveloper 10g开发体验之三

Jdeveloper 10g开发体验之三

原创 Oracle 作者:yujiabian 时间:2005-07-08 14:45:25 0 删除 编辑

获取AppModual以及数据bings的方法

[@more@]

下面2个方法是用来取appModule的.
protected SdscAppModule getSdscService(DataActionContext ctx) {
return (SdscAppModule) getApplicationModule(DATACONTROLNAME, ctx);
}

protected ApplicationModule getApplicationModule(String dataControlName, DataActionContext ctx)
{
DCDataControl dc = ctx.getBindingContext().findDataControl(dataControlName);
if ((dc != null) && dc instanceof DCJboDataControl) {
return (ApplicationModule) dc.getDataProvider();
}
return null;
}


/**
* Returns true if the string is either null or empty.
*
* @param s The string to evaluate
* @return True if the string is either null or empty.
*/
protected boolean isNullOrEmpty(String s) {
return (s == null) || s.equals("");
}

// 下面3个方法是用来取和设置页面binding的属性的值.
protected Object getBindingValue(String bindingName, DataActionContext ctx) {
JUCtrlValueBinding ctrlBinding = findControlBinding(bindingName, ctx);
return (ctrlBinding != null) ? ctrlBinding.getInputValue() : null;
}

protected void setBindingValue(String bindingName, Object value,
DataActionContext ctx) {
JUCtrlValueBinding ctrlBinding = findControlBinding(bindingName, ctx);
if (ctrlBinding != null) {
ctrlBinding.setInputValue(value);
}
}

protected JUCtrlValueBinding findControlBinding(String bindingName,
DataActionContext ctx) {
if (bindingName != null) {
DCBindingContainer bc = ctx.getBindingContainer();
if (bc != null) {
DCControlBinding ctrlBinding = bc.findCtrlBinding(bindingName);
if (ctrlBinding instanceof JUCtrlValueBinding) {
return (JUCtrlValueBinding) ctrlBinding;
}
}
}
return null;
}

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/112585/viewspace-801855/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    8
  • 访问量
    25167