PageRenderTime 25ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/bundles/plugins-trunk/Console/console/bsh/changeToPvRoot.bsh

#
Unknown | 28 lines | 24 code | 4 blank | 0 comment | 0 complexity | 047d702448aa05bb08f04b3fcaca49dd MD5 | raw file
Possible License(s): BSD-3-Clause, AGPL-1.0, Apache-2.0, LGPL-2.0, LGPL-3.0, GPL-2.0, CC-BY-SA-3.0, LGPL-2.1, GPL-3.0, MPL-2.0-no-copyleft-exception, IPL-1.0
  1. /**
  2. Beanshell Script to change the current console's directory
  3. to the root of the current ProjectViewer's project.
  4. by ezust
  5. */
  6. changeToPvRoot(view) {
  7. pv = view.getDockableWindowManager().getDockable("projectviewer");
  8. if (pv == null) return;
  9. con = view.getDockableWindowManager().getDockable("console");
  10. if (con == null) return;
  11. view.getDockableWindowManager().showDockableWindow("projectviewer");
  12. view.getDockableWindowManager().showDockableWindow("console");
  13. sysShell = console.Shell.getShell("System");
  14. sstate = con.getShellState(sysShell);
  15. project = pv.getActiveProject(view);
  16. if (project != null) {
  17. path = project.getRootPath();
  18. cmd = "cd \"" + path + "\"";
  19. sysShell.execute(con, null, sstate, null, cmd);
  20. sstate.print(con.getPlainColor(), "\n");
  21. sysShell.printPrompt(con, sstate);
  22. }
  23. }
  24. // changeToPvRoot(view);