**
8、左侧查询框默认显示(代码类)
**
//黑色字体为我们修改代码
/* / package nc.ui.uif2.actions;
/ /
/ / import java.awt.BorderLayout;
/ */ import java.util.List;
/* */ import javax.swing.SwingWorker;
/* / import nc.bs.logging.Logger;
/ / import nc.bs.ml.NCLangResOnserver;
import nc.ui.hffin.hffin_bankcreditchange.ace.action.HFQueryAction;
import nc.ui.hffin.hffin_bankwatereseipt.ace.action.HFAddQueryAction;
/ / import nc.ui.pub.beans.UIPanel;
import nc.ui.pubapp.uif2app.query2.action.DefaultQueryAction;
/ / import nc.ui.queryarea.QueryArea;
/ / import nc.ui.queryarea.QueryAreaPreferences;
/ / import nc.ui.uif2.LoadingPanel;
/ / import nc.ui.uif2.ShowStatusBarMsgUtil;
/ / import nc.ui.uif2.components.IMiniminizedEventListener;
/ / import nc.ui.uif2.components.IMinimizableComponent;
/ / import nc.ui.uif2.components.MiniminizedEventSource;
/ / import nc.ui.uif2.components.miniext.IMinimizableComponentExt2;
/ / import nc.ui.uif2.components.miniext.MiniIconAction;
/ / import nc.ui.uif2.tangramlayout.model.SplitMiniOrientationEnum;
import nc.vo.pubapp.AppContext;
/ / import nc.vo.uif2.AppStatusRegistery;
/ / import nc.vo.uif2.AppStatusRegisteryCallback;
/ / import nc.vo.uif2.LoginContext;
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ / public class QueryAreaShell
/ / extends UIPanel
/ / implements IMinimizableComponentExt2, ILazyLoadUIComponent
/ / {
/ 33 / private QueryArea queryArea = null;
/ /
/ / private IQueryAreaCreator queryAreaCreator;
/ /
/ 37 / private IMinimizableComponent miniDelegator = null;
/ /
/ /
/ /
/ /
/ 42 / private LoginContext context = null;
/ /
/ / private static final String QUERYAREA_ID = “#QUERYAREA_ID_SHELL#”;
/ /
/ 46 / private List miniIconActions = null;
/ /
/ 48 / private boolean hasCreate = false;
/ /
/ / public QueryAreaShell()
/ / {
/ 52 / this.miniDelegator = new MiniminizedEventSource(this);
/ / }
/ /
/ /
/ /
/ / public void initUI()
/ / {
/ 59 / if ((getQueryArea() == null) && (getQueryAreaCreator() == null))
/ 60 / throw new IllegalStateException(“queryArea属性和queryAreaCreator属性必须设置一个!”);
/ 61 / setLayout(new BorderLayout());
/ 62 / if (!isMinimizInit()) {
/ 63 / innerInitUI();
/ / }
/ / }
/ /
/ / private void innerInitUI()
/ / {
/ 69 / if (getQueryArea() == null)
/ / {
/ 71 / add(new LoadingPanel());
/ 72 / getQueryAreaCreator().preFetchQueryTemplateData();
/ 73 / SwingWorker<QueryArea, Object> sw = new SwingWorker()
/ / {
/ / protected QueryArea doInBackground()
/ / throws Exception
/ / {
/ 78 / QueryArea qa = QueryAreaShell.this.getQueryAreaCreator().createQueryArea();
/ 79 / if (!qa.isInit())
/ 80 / qa.initQueryArea();
/ 81 / return qa;
/ / }
/ /
/ / protected void done() {
/ / try {
/ 86 / QueryArea qa = (QueryArea)get();
/ 87 / QueryAreaShell.this.removeAll();
/ 88 / QueryAreaShell.this.setQueryArea(qa);
/ 89 / QueryAreaShell.this.installQueryArea();
/ 90 / QueryAreaShell.this.validate();
/ 91 / QueryAreaShell.this.repaint();
/ 92 / QueryAreaShell.this.hasCreate = true;
/ / }
/ / catch (Exception e) {
/ 95 / Logger.error(NCLangResOnserver.getInstance().getStrByID(“uif2”, “QueryAreaShell-000001”), e);
/ /
/ 97 / if (QueryAreaShell.this.getContext() != null) {
/ 98 / ShowStatusBarMsgUtil.showStatusBarMsg(NCLangResOnserver.getInstance().getStrByID(“uif2”, “QueryAreaShell-000001”), QueryAreaShell.this.getContext());
/ / }
/ /
/ / }
/ /
/ / }
/ /
/ 105 / };
/ 106 / sw.execute();
/ / }
/ 108 / else if (!getQueryArea().isInit())
/ / {
/ 110 / add(new LoadingPanel());
/ 111 / SwingWorker<QueryArea, Object> sw = new SwingWorker()
/ / {
/ / protected QueryArea doInBackground()
/ / throws Exception
/ / {
/ 116 / QueryAreaShell.this.getQueryArea().initQueryArea();
/ 117 / return QueryAreaShell.this.getQueryArea();
/ / }
/ /
/ / protected void done() {
/ / try {
/ 122 / QueryAreaShell.this.removeAll();
/ 123 / QueryAreaShell.this.installQueryArea();
/ 124 / QueryAreaShell.this.validate();
/ 125 / QueryAreaShell.this.repaint();
/ 126 / QueryAreaShell.this.hasCreate = true;
/ / }
/ / catch (Exception e) {
/ 129 / Logger.error(NCLangResOnserver.getInstance().getStrByID(“uif2”, “QueryAreaShell-000001”), e);
/ /
/ 131 / if (QueryAreaShell.this.getContext() != null) {
/ 132 / ShowStatusBarMsgUtil.showStatusBarMsg(NCLangResOnserver.getInstance().getStrByID(“uif2”, “QueryAreaShell-000001”), QueryAreaShell.this.getContext());
/ / }
/ /
/ / }
/ /
/ / }
/ /
/ 139 / };
/ 140 / sw.execute();
/ / } else {
/ 142 / installQueryArea();
/ / }
/ / }
/ /
/ /
/ /
/ / private void installQueryArea()
/ / {
/ 150 / if (!getQueryArea().isInit()) {
/ 151 / getQueryArea().initQueryArea();
/ / }
/ 153 / add(getQueryArea(), “Center”);
/ 154 / resetByRegisteInfo();
/ 155 / setMiniAction4QueryArea();
/ 156 / registeCallback();
/ / }
/ /
/ /
/ / private void registeCallback()
/ / {
/ 162 / if (getContext() == null) {
/ 163 / return;
/ / }
/ 165 / getContext().getStatusRegistery().addCallback(new AppStatusRegisteryCallback()
/ / {
/ / public Object getID() {
/ 168 / return “#QUERYAREA_ID_SHELL#”;
/ / }
/ /
/ / public Object getStatusObject() {
/ 172 / return QueryAreaShell.this.getQueryArea().getPreferences();
/ / }
/ / });
/ / }
/ /
/ / private void resetByRegisteInfo()
/ / {
/ 179 / if ((getContext() == null) || (getContext().getStatusRegistery() == null))
/ 180 / return;
/ 181 / Object obj = getContext().getStatusRegistery().getAppStatusObject("#QUERYAREA_ID_SHELL#");
/ 182 / if ((obj != null) && ((obj instanceof QueryAreaPreferences))) {
/ 183 / getQueryArea().setPreferences((QueryAreaPreferences)obj);
/ / }
/ / }
/ /
/ / public QueryArea getQueryArea() {
/ 188 / return this.queryArea;
/ / }
/ /
/ / public void setQueryArea(QueryArea queryArea)
/ / {
/ 193 / this.queryArea = queryArea;
/ / }
/ /
/ / private void setMiniAction4QueryArea()
/ / {
/ 198 / ComponentMiniAction miniAction = new ComponentMiniAction();
/ 199 / miniAction.setComponent(this);
/ 200 / getQueryArea().setMiniAction(miniAction);
/ / }
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ /
/ / public boolean isMiniminized()
/ / {
/ 225 / return this.miniDelegator.isMiniminized();
/ / }
/ /
/ / public void miniminized()
/ / {
/ 230 / this.miniDelegator.miniminized();
/ / }
/ /
/ / public void setMiniminized(boolean isMini)
/ / {
/ 235 / this.miniDelegator.setMiniminized(isMini);
/ /
/ 237 / if ((!isMini) && (!this.hasCreate))
/ / {
/ 239 / lazyLoadUI();
/ / }
/ / }
/ /
/ / public void setMiniminizedEventListener(IMiniminizedEventListener listener)
/ / {
/ 245 / this.miniDelegator.setMiniminizedEventListener(listener);
/ / }
/ /
/ / public LoginContext getContext()
/ / {
/ 250 / return this.context;
/ / }
/ /
/ / public void setContext(LoginContext context)
/ / {
/ 255 / this.context = context;
/ / }
/ /
/ /
/ / public List getMiniIconActions()
/ / {
/ 261 / return this.miniIconActions;
/ / }
/ /
/ / public void setMiniIconActions(List actions)
/ / {
/ 266 / this.miniIconActions = actions;
/ / }
/ /
/ / public void setQueryAreaCreator(IQueryAreaCreator queryAreaCreator)
/ / {
/ 271 / this.queryAreaCreator = queryAreaCreator;
/ / }
/ /
/ / public IQueryAreaCreator getQueryAreaCreator()
/ / {
/ 276 / return this.queryAreaCreator;
/ / }
/ /
/ /
/ /
/ / public SplitMiniOrientationEnum getMiniOrientation()
/ / {
/ 283 / return SplitMiniOrientationEnum.MINI_LEFT;
/ / }
/ /
/ /
/ /
/ / public void lazyLoadUI()
/ / {
/ 290 / if (!this.hasCreate) {
/ 291 / innerInitUI();
/ / }
/ / }
/ /
/ / public boolean isMinimizInit()
/ */ {//update by cxx 20170615 银行水单签收默认显示快速查询区域
if(getQueryAreaCreator() instanceof HFAddQueryAction){
if(“20H530”.equals(((HFAddQueryAction)getQueryAreaCreator()).getFunNode()) || “20H535”.equals(((HFAddQueryAction)getQueryAreaCreator()).getFunNode())){
return false;
}else{
return true;
}
}else if(getQueryAreaCreator() instanceof HFQueryAction){
if(“20H540”.equals(((HFQueryAction)getQueryAreaCreator()).getFunNode())){
return false;
}else{
return true;
}
}else if(getQueryAreaCreator() instanceof DefaultQueryAction){
if(“61H560”.equals(((DefaultQueryAction)getQueryAreaCreator()).getFunNode()) ||“61H125”.equals(((DefaultQueryAction)getQueryAreaCreator()).getFunNode()) ||“61H550”.equals(((DefaultQueryAction)getQueryAreaCreator()).getFunNode()) ||“61H513”.equals(((DefaultQueryAction)getQueryAreaCreator()).getFunNode()) ||“61H540”.equals(((DefaultQueryAction)getQueryAreaCreator()).getFunNode()) ||“61H535”.equals(((DefaultQueryAction)getQueryAreaCreator()).getFunNode()) ||“61H530”.equals(((DefaultQueryAction)getQueryAreaCreator()).getFunNode()) || “61H525”.equals(((DefaultQueryAction)getQueryAreaCreator()).getFunNode()) || “61H515”.equals(((DefaultQueryAction)getQueryAreaCreator()).getFunNode()) || “20H535”.equals(((DefaultQueryAction)getQueryAreaCreator()).getFunNode()) || “40H525”.equals(((DefaultQueryAction)getQueryAreaCreator()).getFunNode()) || “20H560”.equals(((DefaultQueryAction)getQueryAreaCreator()).getFunNode()) || “51H507”.equals(((DefaultQueryAction)getQueryAreaCreator()).getFunNode()) || “51H510”.equals(((DefaultQueryAction)getQueryAreaCreator()).getFunNode()) || “51H518”.equals(((DefaultQueryAction)getQueryAreaCreator()).getFunNode()) ){
return false;
}else{
return true;
}
}else{
return true;
}
/* 297 /
/ / }
/ /
/ / protected void refreshUI() {
/ 301 / innerInitUI();
/ / }
/ */ }