Search in sources :

Example 1 with ShellWeb

use of com.jsql.view.swing.shell.ShellWeb in project jsql-injection by ron190.

the class CreateShellTab method execute.

@Override
public void execute() {
    if (MediatorGui.frame() == null) {
        LOGGER.error("Unexpected unregistered MediatorGui.frame() in " + this.getClass());
    }
    try {
        UUID terminalID = UUID.randomUUID();
        ShellWeb terminal = new ShellWeb(terminalID, this.url);
        MediatorGui.frame().getConsoles().put(terminalID, terminal);
        LightScrollPane scroller = new LightScrollPaneShell(terminal);
        MediatorGui.tabResults().addTab("Web shell ", scroller);
        // Focus on the new tab
        MediatorGui.tabResults().setSelectedComponent(scroller);
        // Create a custom tab header with close button
        TabHeader header = new TabHeader("Web shell", HelperUi.ICON_SHELL_SERVER);
        MediatorGui.tabResults().setToolTipTextAt(MediatorGui.tabResults().indexOfComponent(scroller), "<html><b>URL</b><br>" + this.url + RessourceAccess.FILENAME_WEBSHELL + "<br><b>Path</b><br>" + this.path + RessourceAccess.FILENAME_WEBSHELL + "</html>");
        // Apply the custom header to the tab
        MediatorGui.tabResults().setTabComponentAt(MediatorGui.tabResults().indexOfComponent(scroller), header);
        terminal.requestFocusInWindow();
    } catch (MalformedURLException e) {
        LOGGER.warn("Incorrect shell Url", e);
    }
}
Also used : TabHeader(com.jsql.view.swing.tab.TabHeader) LightScrollPaneShell(com.jsql.view.swing.scrollpane.LightScrollPaneShell) MalformedURLException(java.net.MalformedURLException) ShellWeb(com.jsql.view.swing.shell.ShellWeb) LightScrollPane(com.jsql.view.swing.scrollpane.LightScrollPane) UUID(java.util.UUID)

Aggregations

LightScrollPane (com.jsql.view.swing.scrollpane.LightScrollPane)1 LightScrollPaneShell (com.jsql.view.swing.scrollpane.LightScrollPaneShell)1 ShellWeb (com.jsql.view.swing.shell.ShellWeb)1 TabHeader (com.jsql.view.swing.tab.TabHeader)1 MalformedURLException (java.net.MalformedURLException)1 UUID (java.util.UUID)1