2024-10-20 17:27:58 +03:00
|
|
|
package _VisualDVM.GlobalData.Machine.UI;
|
|
|
|
|
import Common.Database.Tables.DataSet;
|
|
|
|
|
import Common.Visual.Controls.MenuBarButton;
|
|
|
|
|
import Common.Visual.DataSetControlForm;
|
|
|
|
|
import Common.Visual.Menus.DataMenuBar;
|
2024-10-26 14:34:55 +03:00
|
|
|
import Common.Visual.Tables.ColumnInfo;
|
2024-10-22 16:44:13 +03:00
|
|
|
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
|
|
|
|
import Common.Visual.Windows.Dialog.DialogFields;
|
2024-10-20 17:27:58 +03:00
|
|
|
import _VisualDVM.Global;
|
|
|
|
|
import _VisualDVM.GlobalData.Machine.Machine;
|
|
|
|
|
import _VisualDVM.Passes.PassCode;
|
|
|
|
|
|
|
|
|
|
import javax.swing.*;
|
|
|
|
|
import java.awt.event.ActionEvent;
|
|
|
|
|
import java.awt.event.ActionListener;
|
|
|
|
|
public class MachinesForm extends DataSetControlForm<Machine> {
|
|
|
|
|
public MachinesForm(DataSet<?, Machine> dataSource_in, JPanel mountPanel_in) {
|
|
|
|
|
super(dataSource_in, mountPanel_in);
|
2024-10-26 15:14:23 +03:00
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
protected void createColumns() {
|
2024-10-26 14:34:55 +03:00
|
|
|
AddColumns(
|
|
|
|
|
new ColumnInfo<Machine>("URL") {
|
|
|
|
|
@Override
|
|
|
|
|
public Object getFieldAt(Machine object) {
|
|
|
|
|
return object.getURL();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
);
|
2024-10-22 16:44:13 +03:00
|
|
|
}
|
|
|
|
|
@Override
|
2024-10-22 17:27:41 +03:00
|
|
|
protected void ShowCurrentObject() throws Exception {
|
2024-10-20 17:27:58 +03:00
|
|
|
super.ShowCurrentObject();
|
|
|
|
|
Global.mainModule.getUI().getMainWindow().getTestingWindow().ShowCurrentCompiler();
|
|
|
|
|
Global.mainModule.getUI().getCredentialsMenuBar().ShowMachine();
|
|
|
|
|
}
|
|
|
|
|
@Override
|
2024-10-22 17:27:41 +03:00
|
|
|
protected void ShowNoCurrentObject() throws Exception {
|
2024-10-20 17:27:58 +03:00
|
|
|
super.ShowNoCurrentObject();
|
|
|
|
|
Global.mainModule.getUI().getMainWindow().getTestingWindow().ShowCurrentCompiler();
|
|
|
|
|
Global.mainModule.getUI().getCredentialsMenuBar().ShowNoMachine();
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public DataMenuBar createMenuBar() {
|
2024-10-22 19:17:01 +03:00
|
|
|
return new DataMenuBar(dataSource.getPluralDescription(),
|
2024-10-20 17:27:58 +03:00
|
|
|
PassCode.AddMachine,
|
|
|
|
|
PassCode.EditMachine,
|
|
|
|
|
PassCode.DeleteMachine) {
|
|
|
|
|
{
|
|
|
|
|
add(new MenuBarButton() {
|
|
|
|
|
{
|
|
|
|
|
setIcon("/Common/icons/SilverArrowUp.png");
|
|
|
|
|
setToolTipText("Свернуть");
|
|
|
|
|
addActionListener(new ActionListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void actionPerformed(ActionEvent e) {
|
|
|
|
|
Global.mainModule.getPass(PassCode.UpdateProperty).Do("collapseCredentials", true);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, 0);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
}
|
2024-10-20 21:59:39 +03:00
|
|
|
@Override
|
2024-10-22 17:27:41 +03:00
|
|
|
protected DBObjectDialog<Machine, ? extends DialogFields> getDialog() {
|
2024-10-22 16:44:13 +03:00
|
|
|
return new MachineDialog();
|
2024-10-20 21:59:39 +03:00
|
|
|
}
|
2024-10-20 17:27:58 +03:00
|
|
|
}
|