📄 partchangemanager.java
字号:
/********************************************************************
* 项目名称 :<b>j2me学习 J2me Wap Explorer</b> <br/>
*
* Copyright 2005-2006 Wuhua. All rights reserved </br>
*
* 本程序只用于学习目的,不能用于商业目的。如有需要请联系作者
********************************************************************/
package org.wuhua.wap.main.service;
import java.io.IOException;
import org.wuhua.wap.WapExplorer;
import org.wuhua.wap.main.MainForm;
import org.wuhua.wap.net.Url;
import org.wuhua.wap.net.WapDownload;
import org.wuhua.wap.ui.Part;
import org.wuhua.wap.ui.event.PartChangeListener;
import org.xmlpull.v1.XmlPullParserException;
/**
* <b>类名:PartChangeManage.java</b> </br>
* 编写日期: 2007-1-5 <br/>
* 程序功能描述:Part对象改变时候产生的动作 <br/>
* Demo: <br/>
* Bug: <br/>
*
* 程序变更日期 :<br/>
* 变更作者 :<br/>
* 变更说明 :<br/>
*
* @author wuhua </br> <a href="mailto:rrq12345@163.com">rrq12345@163.com</a>
*/
public class PartChangeManager implements PartChangeListener {
MainForm mf;
WapDownload wd;
private String url;
private String current;
public PartChangeManager(MainForm mf){
this.mf = mf;
mf.setPartChangeListener(this);
}
public void partChangeAction(Part part) {
opeWeb(part);
}
private void opeWeb(Part part) {
WapExplorer.activeSchedule();
try {
current = part.getUrl();
if(Url.isUrl(current)){
url = current;
}else{
current = url + current;
}
mf.crateCurrentPage(this);
wd = WapDownload.openWapDownload(current, mf);
// System.out.println("dsfsdfdsf");
// mf.addItems(wd.getResult());
} catch (XmlPullParserException e) {
WapExplorer.openErrorDialog(e.getMessage());
e.printStackTrace();
} catch (IOException e) {
WapExplorer.openErrorDialog(e.getMessage());
e.printStackTrace();
}
WapExplorer.cacelSchedule();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -