程序员的基本素质:逻辑思维、细心、能坐得住、算法。如果你不具备这些素质,就不要做程序开发了
/**
* 获得城市下拉框
* @return
*/
private JComboBox getCity(){
cityCB = new JComboBox();
cityCB.setPreferredSize(new Dimension(115, 25));
cityCB.setBackground(Color.WHITE);
cityCB.addItem(" ");
String[] citys = client.getConfigOperatorServer().getCitys();
for(int i=0; i<citys.length; i++){
cityCB.addItem(citys[i]);
}
if(null != city){
//设置默认选项
cityCB.setSelectedItem(city);
}
cityCB.addItemListener(this);
return cityCB;
}
/**
* 应用组下拉框
*
* @return
*/
private JComboBox getAppGrpNameCB() {
JComboBox appGrpNameCB = new JComboBox();
appGrpNameCB.setPreferredSize(JComboBox_size);
List<ApplicationGrp> rootAppGrpList = client.getConfigOperatorServer().getAllRootAppGrp();
appGrpList = new ArrayList<ApplicationGrp>();
if(rootAppGrpList != null && rootAppGrpList.size()>0) {
for(ApplicationGrp rootAppGrp:rootAppGrpList) {
appGrpList.add(rootAppGrp);
appGrpList.addAll(getSubAppGroupList(rootAppGrp));
}
}
for (ApplicationGrp itAppGrp: appGrpList) {
appGrpNameCB.addItem(itAppGrp.name);
}
if(appGrp != null) {
appGrpNameCB.setSelectedItem(appGrp.name);
}
appGrpNameCB.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
String s = (String)e.getItem();
if(!s.equals(" ")){
appGrpName = s;
/**
* 下面这段代码实现应用组和应用的级联
*/
appList = client.getConfigOperatorServer().getAppInfoByAppGrp(appGrpName);
appNameCB.removeAllItems();
appNameCB.addItem(" ");
for (AppInfo itApp: appList) {
appNameCB.addItem(itApp.name);
}
if(app != null) {
appNameCB.setSelectedItem(app.name);
}
}else{
appGrpName = null;
}
}
});
return appGrpNameCB;
}
/**
* 应用下拉框
*
* @return
*/
private JComboBox getAppNameCB() {
appNameCB = new JComboBox();
appNameCB.setPreferredSize(JComboBox_size);
appNameCB.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
String s = (String)e.getItem();
if(!s.equals(" ")){
appName = s;
}else{
appName = null;
}
}
});
return appNameCB;
}
上面两个方法合起来能实现应用组和应用的级联
注意appNameCB必须设成全局变量
1.
ArgTemplItem.java对应参数项设置
RespRaw.java对应采集项设置
OrgRawRule.java对应断言项设置
2.
ICEUtil iceUtil = new ICEUtil();
ScheduleOperatorPrx operatorPrx = iceUtil.getScheduleOperatorPrx();
List<ArgTempl> list = operatorPrx.getArgTemplsByType(protocolType);
3.
架构 != 设计模式
算法 >= 数据结构
数据结构 != 数学
数学 >= 算法
语言 won't work without algorithm & data structure.
程序=数据结构+算法
>>1.type="submit" 这时候点查询按钮就会重新打开一个页面
由此可以推出按回车的时候就相当于按了submit按钮
>>2.需要逐步掌握独当一面的能力,在某个领域能够设计框架并正确引导产品开发最终交付。你需要多学习一些开源框架,掌握并能活学活用,最终积累出自己的解决方案。
>>3.follow your heart, do what you want
follow your heart and do what you really want to do!
>>4.断言注意事项:
断言索引和表达式索引名字格式是固定的:Assert_1 Expression_1
断言设置和表达式设置必须同时存在
>>5.
try {
action = client.getScheduleOperator().getActionbyName(actionNameTemp);
if(action != null) {
JOptionPane.showMessageDialog(null, "当前Action已经存在,可直接添加步骤! ");
} else {
action = new Action();
action.actionName = actionNameTemp;
action.collectTypeInfo = collectTypeTemp;
//保存Action操作
try {
client.getScheduleOperator().addAction(action);
JOptionPane.showMessageDialog(null, "添加Action成功! ");
} catch (ExistAction e1) {
JOptionPane.showMessageDialog(null, "添加Action步骤错误! "+e1, "错误", JOptionPane.ERROR_MESSAGE);
log.error("MonitorScheduleDatailsPane add Action err. "+e1);
}
}
} catch (NoExistAction e2) {
log.error("MonitorScheduleDatailsPane getActionbyName err. "+e2);
}
>>6.
else if(e.getSource() == addActionButton){//添加Action按钮
String actionNameTemp = actionNameField.getText();
CollectType collectTypeTemp = collectType;
if(actionNameTemp == null || "".equals(actionNameTemp)){
JOptionPane.showMessageDialog(null, "请填写ActionName!", "警告", JOptionPane.WARNING_MESSAGE);
} else if(collectTypeTemp == null || "".equals(collectTypeTemp)){
JOptionPane.showMessageDialog(null, "请选择采集类型!", "警告", JOptionPane.WARNING_MESSAGE);
} else {
try {
action = client.getScheduleOperator().getActionbyName(actionNameTemp);
if(action != null) {
JOptionPane.showMessageDialog(null, "当前Action已经存在,可直接添加步骤! ");
}
} catch (NoExistAction e2) {
action = new Action();
action.actionName = actionNameTemp;
action.collectTypeInfo = collectTypeTemp;
//保存Action操作
try {
client.getScheduleOperator().addAction(action);
JOptionPane.showMessageDialog(null, "添加Action成功! ");
} catch (ExistAction e1) {
JOptionPane.showMessageDialog(null, "添加Action步骤错误! "+e1, "错误", JOptionPane.ERROR_MESSAGE);
log.error("MonitorScheduleDatailsPane add Action err. "+e1);
}
log.error("MonitorScheduleDatailsPane getActionbyName err. "+e2);
}
}
}