New QD files that don't do anything yet.
This commit is contained in:
parent
26993a5093
commit
86c2374706
2 changed files with 109 additions and 0 deletions
33
source/org/thdl/quilldriver/TranscriptMediator.java
Normal file
33
source/org/thdl/quilldriver/TranscriptMediator.java
Normal file
|
@ -0,0 +1,33 @@
|
|||
package org.thdl.quilldriver;
|
||||
|
||||
import org.jdom.Document;
|
||||
import org.thdl.tib.input.DuffPane;
|
||||
|
||||
public class TranscriptMediator {
|
||||
private Document xml;
|
||||
private DuffPane pane;
|
||||
Properties nodeAbbreviations;
|
||||
Properties globalProperties;
|
||||
|
||||
public TranscriptMediator(Document xmlDoc, DuffPane duffPane) {
|
||||
xml = xmlDoc;
|
||||
pane = duffPane;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
public DuffPane getPane() {
|
||||
return pane;
|
||||
}
|
||||
|
||||
public Document getXML() {
|
||||
return xml;
|
||||
}
|
||||
|
||||
public Object getNodeAtPosition(int position) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
76
source/org/thdl/quilldriver/TranscriptNavigator.java
Normal file
76
source/org/thdl/quilldriver/TranscriptNavigator.java
Normal file
|
@ -0,0 +1,76 @@
|
|||
package org.thdl.quilldriver;
|
||||
|
||||
import org.jaxen.jdom.JDOMXPath;
|
||||
import org.jaxen.XPath;
|
||||
|
||||
public class TranscriptNavigator {
|
||||
private boolean autoInsertFlag = false;
|
||||
private TranscriptMediator mediator;
|
||||
|
||||
TranscriptNavigator(TranscriptMediator mediator) {
|
||||
this.mediator = mediator;
|
||||
}
|
||||
|
||||
/*
|
||||
Next = ancestor-or-self::S/following-sibling::
|
||||
*/
|
||||
|
||||
public boolean edit(String xpathExpression) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean editNextText(String elementName) {
|
||||
int pos = mediator.getPane().getCaretPosition();
|
||||
|
||||
Object next = next(pos, elementName);
|
||||
if (next == null) {
|
||||
if (autoInsertFlag) {
|
||||
//insert after
|
||||
return false;
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean editPrevText(String elementName) {
|
||||
pos = mediator.getPane().getCaretPosition();
|
||||
|
||||
Object prev = prev(pos, elementName);
|
||||
if (prev == null) {
|
||||
if (autoInsertFlag) {
|
||||
//insert after
|
||||
return false;
|
||||
} else
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean highlightNext(String elementName) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean highlightPrev(String elementName) {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Object next(int pos, String elementName) {
|
||||
Object jdomNode = mediator.getNodeAtPos(int position);
|
||||
if (jdomNode == null)
|
||||
return null;
|
||||
XPath path = new JDOMXPath("a/b/c");
|
||||
List results = path.selectNodes(jdomNode);
|
||||
return null;
|
||||
}
|
||||
|
||||
public Object prev(int pos, String elementName) {
|
||||
Object jdomNode = mediator.getNodeAtPos(int position);
|
||||
if (jdomNode == null)
|
||||
return null;
|
||||
XPath path = new JDOMXPath("a/b/c");
|
||||
List results = path.selectNodes(jdomNode);
|
||||
return null;
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue