use of com.jsql.view.swing.scrollpane.LightScrollPane in project jsql-injection by ron190.
the class ManagerCoder method initializeTopPanel.
private JPanel initializeTopPanel() {
var topMixed = new JPanel(new BorderLayout());
final var middleLine = new JPanel();
middleLine.setLayout(new BorderLayout());
middleLine.setBorder(BorderFactory.createEmptyBorder(1, 0, 1, 1));
var comboMenubar = this.initializeMenuBarCoder();
this.menuMethod.setText("Encode to Base64");
middleLine.add(comboMenubar);
topMixed.add(new LightScrollPane(0, 0, 1, 0, this.textInput), BorderLayout.CENTER);
topMixed.add(middleLine, BorderLayout.SOUTH);
return topMixed;
}
use of com.jsql.view.swing.scrollpane.LightScrollPane in project jsql-injection by ron190.
the class SqlEngine method populateTabError.
/**
* Dynamically add textPanes to Error tab for current vendor.
*/
private static void populateTabError() {
SqlEngine.tabbedPaneError.removeAll();
if (SqlEngine.modelYaml.getStrategy().getError() == null) {
return;
}
for (Method methodError : SqlEngine.modelYaml.getStrategy().getError().getMethod()) {
var panelError = new JPanel(new BorderLayout());
final var refMethodError = new Method[] { methodError };
var textPaneError = new JTextPaneLexer(refMethodError[0]::setQuery, refMethodError[0]::getQuery);
SqlEngine.resetLexer(textPaneError);
textPaneError.switchSetterToVendor();
textPaneError.setText(methodError.getQuery().trim());
textPaneError.setBorder(SqlEngine.borderRight);
panelError.add(new LightScrollPane(1, 0, 1, 0, textPaneError), BorderLayout.CENTER);
var panelLimit = new JPanel();
panelLimit.setLayout(new BoxLayout(panelLimit, BoxLayout.LINE_AXIS));
panelLimit.add(new JLabel(" Overflow limit: "));
panelLimit.add(new JTextField(Integer.toString(methodError.getCapacity())));
// TODO Integrate Error limit
panelError.add(panelLimit, BorderLayout.SOUTH);
SqlEngine.tabbedPaneError.addTab(methodError.getName(), panelError);
SqlEngine.tabbedPaneError.setTitleAt(SqlEngine.tabbedPaneError.getTabCount() - 1, String.format("<html><div style=\"text-align:left;width:100px;\">%s</div></html>", methodError.getName()));
SqlEngine.textPanesError.add(textPaneError);
}
}
use of com.jsql.view.swing.scrollpane.LightScrollPane in project jsql-injection by ron190.
the class SqlEngine method getPanelFingerprinting.
private JPanel getPanelFingerprinting() {
JTabbedPane tabs = new TabbedPaneWheeled(SwingConstants.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
tabs.addTab(I18nUtil.valueByKey("SQLENGINE_ORDER_BY"), new LightScrollPane(1, 0, 1, 0, TextareaWithColor.ORDER_BY.getText()));
tabs.addTab("Order by error", new LightScrollPane(1, 0, 1, 0, TextareaWithColor.ORDER_BY_ERROR_MESSAGE.getText()));
tabs.addTab("String error", new LightScrollPane(1, 0, 1, 0, TextareaWithColor.INCORRECT_STRING_ERROR_MESSAGE.getText()));
tabs.addTab("Truthy", new LightScrollPane(1, 0, 1, 0, TextareaWithColor.TRUTHY.getText()));
tabs.addTab("Falsy", new LightScrollPane(1, 0, 1, 0, TextareaWithColor.FALSY.getText()));
Stream.of("SQLENGINE_ORDER_BY").forEach(keyI18n -> {
var label = new JLabel(I18nUtil.valueByKey(keyI18n));
tabs.setTabComponentAt(tabs.indexOfTab(I18nUtil.valueByKey(keyI18n)), label);
I18nViewUtil.addComponentForKey(keyI18n, label);
});
var panel = new JPanel(new BorderLayout());
panel.add(tabs, BorderLayout.CENTER);
panel.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, UiUtil.COLOR_COMPONENT_BORDER));
return panel;
}
use of com.jsql.view.swing.scrollpane.LightScrollPane in project jsql-injection by ron190.
the class ActionSaveTab method actionPerformed.
@Override
public void actionPerformed(ActionEvent e) {
this.filechooser.setDialogTitle("Save Tab As");
var componentResult = MediatorHelper.tabResults().getSelectedComponent();
if (componentResult instanceof PanelTable) {
JTable table = ((PanelTable) componentResult).getTableValues();
this.saveToFile(table);
} else if (componentResult instanceof LightScrollPane && ((LightScrollPane) componentResult).scrollPane.getViewport().getView() instanceof JTextComponent) {
JTextComponent textarea = (JTextComponent) ((LightScrollPane) componentResult).scrollPane.getViewport().getView();
this.saveToFile(textarea);
}
}
Aggregations