public static Console openConsole(final Component parent, final ClientModel model, final String file) {
try {
parent.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
Console console = new Console(parent.getClass().getClassLoader());
console.setVariable("session", model.getClientSession().getSession());
console.setVariable("binding", model.getClientSession().getSession().getBinding());
console.run();
JMenu cmisMenu = new JMenu("CMIS");
console.getFrame().getRootPane().getJMenuBar().add(cmisMenu);
addConsoleMenu(cmisMenu, "CMIS 1.0 Specification", new URI(
"http://docs.oasis-open.org/cmis/CMIS/v1.0/os/cmis-spec-v1.0.html"));
addConsoleMenu(cmisMenu, "OpenCMIS Documentation",
new URI("http://chemistry.apache.org/java/opencmis.html"));
addConsoleMenu(cmisMenu, "OpenCMIS Client API JavaDoc", new URI(
"http://chemistry.apache.org/java/0.4.0/maven/apidocs/"));
console.getInputArea().setText(ClientHelper.readFileAndRemoveHeader(file));
return console;
} catch (Exception ex) {
ClientHelper.showError(null, ex);
return null;