PageRenderTime 52ms CodeModel.GetById 49ms app.highlight 1ms RepoModel.GetById 1ms 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
 1/**
 2   Beanshell Script to change the current console's directory
 3   to the root of the current ProjectViewer's project.
 4   
 5   by ezust
 6   
 7*/
 8changeToPvRoot(view) { 
 9    pv = view.getDockableWindowManager().getDockable("projectviewer");
10    if (pv == null) return;
11    con = view.getDockableWindowManager().getDockable("console");
12    if (con == null) return;
13    view.getDockableWindowManager().showDockableWindow("projectviewer");
14    view.getDockableWindowManager().showDockableWindow("console");
15    sysShell = console.Shell.getShell("System");
16    sstate = con.getShellState(sysShell);
17    project = pv.getActiveProject(view);
18    if (project != null) {
19        path = project.getRootPath();
20		cmd = "cd \"" + path + "\"";
21		sysShell.execute(con, null, sstate, null, cmd);
22		sstate.print(con.getPlainColor(), "\n");
23		sysShell.printPrompt(con, sstate);
24    }
25}
26
27// changeToPvRoot(view);
28