MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / copyTable

Method copyTable

src/org/opensourcephysics/display/DataTable.java:2718–2728  ·  view source on GitHub ↗

Copies data from this table to the system clipboard. @param asFormatted true to retain table formatting @param header the table header

(boolean asFormatted, String header)

Source from the content-addressed store, hash-verified

2716 * @param header the table header
2717 */
2718 public void copyTable(boolean asFormatted, String header) {
2719 StringBuffer buf = getData(asFormatted);
2720 // replace spaces with underscores in header (must be single string)
2721 header = header.replace(' ', '_');
2722 if (!header.endsWith(XML.NEW_LINE))
2723 header += XML.NEW_LINE;
2724 if (includeHeadersInCopiedData)
2725 OSPRuntime.copy(header + buf, null);
2726 else
2727 OSPRuntime.copy(buf.toString(), null);
2728 }
2729
2730 /**
2731 * subclass should return the modelIndex of the first column name (comma-quoted

Callers

nothing calls this directly

Calls 3

getDataMethod · 0.95
copyMethod · 0.95
toStringMethod · 0.45

Tested by

no test coverage detected