将AuthorDocumentFragment(氧气)粘贴到TextArea(Java swing)中
我想将AuthorDocumentFragment(Oxygen)粘贴到模态对话框的TextArea(javaswing)中。但是textarea不支持元素AuthorDocumentFragment。我该怎么处理这个 我的代码:将AuthorDocumentFragment(氧气)粘贴到TextArea(Java swing)中,java,swing,jtextarea,oxygenxml,Java,Swing,Jtextarea,Oxygenxml,我想将AuthorDocumentFragment(Oxygen)粘贴到模态对话框的TextArea(javaswing)中。但是textarea不支持元素AuthorDocumentFragment。我该怎么处理这个 我的代码: public void doOperation(final AuthorAccess authorAccess, final ArgumentsMap args) throws IllegalArgumentException, AuthorOpera
public void doOperation(final AuthorAccess authorAccess, final ArgumentsMap args)
throws IllegalArgumentException, AuthorOperationException {
AuthorNode[] nodeList2 = authorAccess.getDocumentController().findNodesByXPath("//*[@id]/child::node()", true, true, true);
ArrayList<AuthorDocumentFragment> arrayList = new ArrayList<AuthorDocumentFragment>();
for (AuthorNode i : nodeList2) {
AuthorDocumentFragment newFragText = null;
try {
newFragText = authorAccess.getDocumentController().createDocumentFragment(i, true);
} catch (BadLocationException e) {
e.printStackTrace();
}
arrayList.add(newFragText);
}
}
void jList1MouseClicked(java.awt.event.MouseEvent evt) {
textAreaRefs.setText(???);
}
public void doOperation(最终AuthorAccess AuthorAccess,最终参数map args)
引发IllegalArgumentException、AuthorOperationException{
AuthorNode[]nodeList2=authorAccess.getDocumentController().findNodesByXPath(“/*[@id]/child::node()”,true,true);
ArrayList ArrayList=新的ArrayList();
for(作者代码i:nodeList2){
AuthorDocumentFragment newFragText=null;
试一试{
newFragText=authorAccess.getDocumentController().createDocumentFragment(i,true);
}捕获(错误位置异常e){
e、 printStackTrace();
}
arrayList.add(newFragText);
}
}
void jList1MouseClicked(java.awt.event.MouseEvent evt){
textAreaRefs.setText(???);
}
AuthorDocumentController API具有将AuthorDocumentFragment序列化为XML的方法:
AuthorDocumentController API具有将AuthorDocumentFragment序列化为XML的方法:
嗯?我想保存我的格式。toString()将更改我的格式,我的片段也将是stringWell
String
是JTextArea
设计用来处理的唯一东西。因此,也许可以将组件更改为能够充分表示XML格式数据的组件(例如,作为解决方案的一部分,aJTree
)。我想在预演中这样做,嗯?我想保存我的格式。toString()将更改我的格式,我的片段也将是stringWellString
是JTextArea
设计用来处理的唯一东西。因此,也许可以将组件更改为能够充分表示XML格式数据的组件(例如,作为解决方案的一部分,aJTree
)。我想在预览中执行此操作,我将尝试使用此方法。谢谢我将尝试使用这种方法。谢谢