use of com.jsql.view.swing.ui.FlatButtonMouseAdapter in project jsql-injection by ron190.
the class DialogAbout method initializeButtonWebpage.
private JButton initializeButtonWebpage() {
final var buttonWebpage = new JButton("Webpage");
buttonWebpage.setBorder(BorderFactory.createCompoundBorder(UiUtil.BORDER_FOCUS_GAINED, BorderFactory.createEmptyBorder(2, 20, 2, 20)));
buttonWebpage.addActionListener(ev -> {
try {
Desktop.getDesktop().browse(new URI((String) MediatorHelper.model().getMediatorUtils().getPropertiesUtil().getProperties().get("github.url")));
} catch (IOException | URISyntaxException | UnsupportedOperationException e) {
LOGGER.log(LogLevel.CONSOLE_ERROR, "Browsing to Url failed", e);
}
});
buttonWebpage.setContentAreaFilled(false);
buttonWebpage.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8));
buttonWebpage.setBackground(new Color(200, 221, 242));
buttonWebpage.addMouseListener(new FlatButtonMouseAdapter(buttonWebpage));
return buttonWebpage;
}
use of com.jsql.view.swing.ui.FlatButtonMouseAdapter in project jsql-injection by ron190.
the class DialogAbout method initializeButtonClose.
private void initializeButtonClose(ActionListener escapeListener) {
this.buttonClose = new JButton("Close");
this.buttonClose.setBorder(BorderFactory.createCompoundBorder(UiUtil.BORDER_FOCUS_GAINED, BorderFactory.createEmptyBorder(2, 20, 2, 20)));
this.buttonClose.addActionListener(escapeListener);
this.buttonClose.setContentAreaFilled(false);
this.buttonClose.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8));
this.buttonClose.setBackground(new Color(200, 221, 242));
this.buttonClose.addMouseListener(new FlatButtonMouseAdapter(this.buttonClose));
}
use of com.jsql.view.swing.ui.FlatButtonMouseAdapter in project jsql-injection by ron190.
the class AbstractManagerShell method initializeRunButtonPanel.
private JPanel initializeRunButtonPanel() {
this.defaultText = "SHELL_RUN_BUTTON_LABEL";
var lastLine = new JPanel();
lastLine.setLayout(new BoxLayout(lastLine, BoxLayout.X_AXIS));
lastLine.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createMatteBorder(0, 0, 0, 0, UiUtil.COLOR_COMPONENT_BORDER), BorderFactory.createEmptyBorder(1, 0, 1, 1)));
this.run = new JButtonStateful(this.defaultText);
I18nViewUtil.addComponentForKey(this.defaultText, this.run);
this.run.setToolTipText(I18nUtil.valueByKey("SHELL_RUN_BUTTON_TOOLTIP"));
this.run.setEnabled(false);
this.run.setContentAreaFilled(false);
this.run.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8));
this.run.setBackground(new Color(200, 221, 242));
this.run.addMouseListener(new FlatButtonMouseAdapter(this.run));
this.run.addActionListener(new ActionCreationShell());
this.privilege = new JLabel(I18nUtil.valueByKey("PRIVILEGE_LABEL"), UiUtil.ICON_SQUARE_GREY, SwingConstants.LEFT);
I18nViewUtil.addComponentForKey("PRIVILEGE_LABEL", this.privilege);
this.privilege.setBorder(BorderFactory.createMatteBorder(2, 0, 0, 0, UiUtil.COLOR_DEFAULT_BACKGROUND));
this.privilege.setToolTipText(I18nUtil.valueByKey("PRIVILEGE_TOOLTIP"));
lastLine.add(this.privilege);
lastLine.add(Box.createHorizontalStrut(5));
lastLine.add(Box.createHorizontalGlue());
lastLine.add(this.run);
return lastLine;
}
use of com.jsql.view.swing.ui.FlatButtonMouseAdapter in project jsql-injection by ron190.
the class ManagerFile method initializeRunButton.
private void initializeRunButton() {
this.defaultText = "FILE_RUN_BUTTON_LABEL";
this.run = new JButtonStateful(this.defaultText);
I18nViewUtil.addComponentForKey("FILE_RUN_BUTTON_LABEL", this.run);
this.run.setToolTipText(I18nUtil.valueByKey("FILE_RUN_BUTTON_TOOLTIP"));
this.run.setEnabled(false);
this.run.setContentAreaFilled(false);
this.run.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8));
this.run.setBackground(new Color(200, 221, 242));
this.run.addMouseListener(new FlatButtonMouseAdapter(this.run));
this.run.addActionListener(actionEvent -> {
if (this.listFile.getSelectedValuesList().isEmpty()) {
LOGGER.log(LogLevel.CONSOLE_ERROR, "Select at least one file to read in the list");
return;
}
new Thread(() -> {
if (ManagerFile.this.run.getState() == StateButton.STARTABLE) {
ManagerFile.this.run.setText(I18nViewUtil.valueByKey("FILE_RUN_BUTTON_STOP"));
ManagerFile.this.run.setState(StateButton.STOPPABLE);
ManagerFile.this.loader.setVisible(true);
MediatorHelper.managerWebshell().clearSelection();
MediatorHelper.managerSqlshell().clearSelection();
try {
this.readFile(this.listFile.getSelectedValuesList());
} catch (InterruptedException e) {
LOGGER.log(LogLevel.CONSOLE_JAVA, e, e);
Thread.currentThread().interrupt();
} catch (Exception e) {
LOGGER.log(LogLevel.CONSOLE_ERROR, e, e);
}
} else {
MediatorHelper.model().getResourceAccess().stopSearchingFile();
ManagerFile.this.run.setEnabled(false);
ManagerFile.this.run.setState(StateButton.STOPPING);
}
}, "ThreadReadFile").start();
});
}
use of com.jsql.view.swing.ui.FlatButtonMouseAdapter in project jsql-injection by ron190.
the class ManagerScan method initializeRunButton.
private void initializeRunButton(final DnDList dndListScan) {
this.defaultText = "SCAN_RUN_BUTTON_LABEL";
this.run = new JButtonStateful(this.defaultText);
I18nViewUtil.addComponentForKey("SCAN_RUN_BUTTON_LABEL", this.run);
this.run.setToolTipText(I18nUtil.valueByKey("SCAN_RUN_BUTTON_TOOLTIP"));
this.run.setContentAreaFilled(false);
this.run.setBorder(BorderFactory.createEmptyBorder(4, 8, 4, 8));
this.run.setBackground(new Color(200, 221, 242));
this.run.addMouseListener(new FlatButtonMouseAdapter(this.run));
this.run.addActionListener(actionEvent -> {
if (dndListScan.getSelectedValuesList().isEmpty()) {
LOGGER.log(LogLevel.CONSOLE_ERROR, "Select URL(s) to scan");
return;
}
new Thread(() -> {
if (ManagerScan.this.run.getState() == StateButton.STARTABLE) {
ManagerScan.this.run.setText(I18nViewUtil.valueByKey("SCAN_RUN_BUTTON_STOP"));
ManagerScan.this.run.setState(StateButton.STOPPABLE);
ManagerScan.this.loader.setVisible(true);
DefaultListModel<ItemList> listModel = (DefaultListModel<ItemList>) dndListScan.getModel();
for (var i = 0; i < listModel.getSize(); i++) {
listModel.get(i).reset();
}
this.scan(dndListScan.getSelectedValuesList());
} else {
MediatorHelper.model().getResourceAccess().setScanStopped(true);
MediatorHelper.model().setIsStoppedByUser(true);
ManagerScan.this.run.setEnabled(false);
ManagerScan.this.run.setState(StateButton.STOPPING);
}
}, "ThreadScan").start();
});
}
Aggregations