private String printSourceQuery(OBDASQLQuery query) { String sourceString = SourceQueryRenderer.encode(query); String toReturn = convertTabToSpaces(sourceString); return toReturn.replaceAll("\n", "\n\t\t\t"); } private String convertTabToSpaces(String input) {
/*** * Sets the current mapping to the input. Note, if the current mapping is * set, this means that this dialog is "updating" a mapping, and not * creating a new one. */ public void setMapping(SQLPPTriplesMap mapping) { this.mapping = mapping; cmdInsertMapping.setText("Update"); txtMappingID.setText(mapping.getId()); OBDASQLQuery sourceQuery = mapping.getSourceQuery(); String srcQuery = SourceQueryRenderer.encode(sourceQuery); txtSourceQuery.setText(srcQuery); ImmutableList<TargetAtom> targetQuery = mapping.getTargetAtoms(); String trgQuery = TargetQueryRenderer.encode(targetQuery, prefixManager); txtTargetQuery.setText(trgQuery); } }
String srcQuery = SourceQueryRenderer.encode(sourceQuery); srcQueryTextPane.setText(srcQuery);