use of com.jsql.model.injection.vendor.model.Model.Strategy.Error.Method in project jsql-injection by ron190.
the class ManagerDatabase method initErrorMethods.
public void initErrorMethods(Vendor vendor) {
this.itemRadioStrategyError[0].removeAll();
Integer[] i = { 0 };
if (vendor != Vendor.AUTO && vendor.instance().getXmlModel().getStrategy().getError() != null) {
for (Method methodError : vendor.instance().getXmlModel().getStrategy().getError().getMethod()) {
JMenuItem itemRadioVendor = new JRadioButtonMenuItem(methodError.getName());
itemRadioVendor.setEnabled(false);
this.itemRadioStrategyError[0].add(itemRadioVendor);
this.groupStrategy.add(itemRadioVendor);
final int indexError = i[0];
itemRadioVendor.addActionListener(actionEvent -> {
ManagerDatabase.this.menuStrategy.setText(methodError.getName());
MediatorModel.model().setStrategy(StrategyInjection.ERROR);
((StrategyInjectionError) StrategyInjection.ERROR.instance()).setIndexMethod(indexError);
});
i[0]++;
}
}
}
use of com.jsql.model.injection.vendor.model.Model.Strategy.Error.Method in project jsql-injection by ron190.
the class SqlEngine method initErrorTabs.
private void initErrorTabs() {
SqlEngine.TAB_ERROR.removeAll();
if (xmlModel.getStrategy().getError() != null) {
for (Method methodError : xmlModel.getStrategy().getError().getMethod()) {
JPanel panelError = new JPanel(new BorderLayout());
final Method[] m = new Method[] { methodError };
JTextPaneLexer textPane = new JTextPaneLexer(false) {
@Override
public void switchSetterToVendor() {
this.attributeSetter = new AttributeSetterForVendor(m[0], "setQuery");
}
};
SqlEngine.resetLexer(textPane);
textPane.switchSetterToVendor();
textPane.setText(methodError.getQuery().trim());
textPane.setBorder(SqlEngine.BORDER_RIGHT);
panelError.add(new LightScrollPane(1, 0, 1, 0, textPane), BorderLayout.CENTER);
JPanel 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())));
panelError.add(panelLimit, BorderLayout.SOUTH);
SqlEngine.TAB_ERROR.addTab(methodError.getName(), panelError);
SqlEngine.TAB_ERROR.setTitleAt(SqlEngine.TAB_ERROR.getTabCount() - 1, "<html><div style=\"text-align:left;width:150px;\">" + methodError.getName() + "</div></html>");
}
}
}
Aggregations