Search in sources :

Example 1 with LightScrollPaneShell

use of com.jsql.view.swing.scrollpane.LightScrollPaneShell in project jsql-injection by ron190.

the class CreateSQLShellTab method execute.

@Override
public void execute() {
    if (MediatorGui.frame() == null) {
        LOGGER.error("Unexpected unregistered MediatorGui.frame() in " + this.getClass());
    }
    try {
        UUID terminalID = UUID.randomUUID();
        ShellSql terminal = new ShellSql(terminalID, this.url, this.user, this.pass);
        MediatorGui.frame().getConsoles().put(terminalID, terminal);
        LightScrollPane scroller = new LightScrollPaneShell(terminal);
        MediatorGui.tabResults().addTab("SQL shell ", scroller);
        // Focus on the new tab
        MediatorGui.tabResults().setSelectedComponent(scroller);
        // Create a custom tab header with close button
        TabHeader header = new TabHeader("SQL shell", HelperUi.ICON_SHELL_SERVER);
        MediatorGui.tabResults().setToolTipTextAt(MediatorGui.tabResults().indexOfComponent(scroller), "<html><b>URL</b><br>" + this.url + RessourceAccess.FILENAME_SQLSHELL + "<br><b>Path</b><br>" + this.path + RessourceAccess.FILENAME_SQLSHELL + "</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) ShellSql(com.jsql.view.swing.shell.ShellSql) LightScrollPane(com.jsql.view.swing.scrollpane.LightScrollPane) UUID(java.util.UUID)

Example 2 with LightScrollPaneShell

use of com.jsql.view.swing.scrollpane.LightScrollPaneShell 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)2 LightScrollPaneShell (com.jsql.view.swing.scrollpane.LightScrollPaneShell)2 TabHeader (com.jsql.view.swing.tab.TabHeader)2 MalformedURLException (java.net.MalformedURLException)2 UUID (java.util.UUID)2 ShellSql (com.jsql.view.swing.shell.ShellSql)1 ShellWeb (com.jsql.view.swing.shell.ShellWeb)1