Dispatch.call(this.doc, "Save");
System.out.println("保存完成");
return true;
}
}
public boolean moveRight(int steps) throws Exception
{
//int start = Dispatch.get(this.cursor, "Start").getInt();
//Dispatch.put(this.cursor, "Start", start + steps);
for (int i=0; i<steps; i++)
{
Dispatch.call(cursor, "MoveRight");
}
return true;
}
public boolean moveLeft(int steps) throws Exception
{
for (int i=0; i<steps; i++)
{
Dispatch.call(cursor, "MoveLeft");
}
return true;
}
public int search(String str) throws Exception
{
// 从cursor所在位置开始查询
Dispatch find = Dispatch.call(this.cursor, "Find").toDispatch();
// 设置要查找的内容
Dispatch.put(find, "Text", str);
// 向前查找
Dispatch.put(find, "Forward", "True");
// 设置格式
Dispatch.put(find, "Format", "True");
// 大小写匹配
Dispatch.put(find, "MatchCase", "True");
// 全字匹配
Dispatch.put(find, "MatchWholeWord", "True");
// 查找
if (!Dispatch.call(find,"Execute").getBoolean())
return 0;
else
{
return Dispatch.get(this.cursor, "Start").getInt();
}
}
public int searchOnly(String str) throws Exception
{
// 从cursor所在位置开始查询
Dispatch find = Dispatch.call(this.cursor, "Find").toDispatch();
// 设置要查找的内容
Dispatch.put(find, "Text", str);
// 向前查找
Dispatch.put(find, "Forward", "True");
// 大小写匹配
Dispatch.put(find, "MatchCase", "True");