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-22 16:44:13 +03:00
|
|
|
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
|
|
|
|
import Common.Visual.Windows.Dialog.DialogFields;
|
2024-10-22 15:25:06 +03:00
|
|
|
import _VisualDVM.Current;
|
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);
|
|
|
|
|
}
|
|
|
|
|
@Override
|
2024-10-22 17:27:41 +03:00
|
|
|
protected Current CurrentName() {
|
2024-10-22 15:25:06 +03:00
|
|
|
return Current.Machine;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
2024-10-22 17:27:41 +03:00
|
|
|
protected String getSingleDescription() {
|
2024-10-22 15:25:06 +03:00
|
|
|
return "машина";
|
|
|
|
|
}
|
|
|
|
|
@Override
|
2024-10-22 17:27:41 +03:00
|
|
|
protected String getPluralDescription() {
|
2024-10-22 15:25:06 +03:00
|
|
|
return "машины";
|
|
|
|
|
}
|
|
|
|
|
@Override
|
2024-10-22 17:27:41 +03:00
|
|
|
protected boolean hasCheckBox() {
|
2024-10-20 17:27:58 +03:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public String[] getUIColumnNames() {
|
|
|
|
|
return new String[]{"URL"};
|
|
|
|
|
}
|
|
|
|
|
@Override
|
2024-10-22 16:44:13 +03:00
|
|
|
public Object getFieldAt(Machine object, int columnIndex) {
|
|
|
|
|
switch (columnIndex) {
|
|
|
|
|
case 2:
|
|
|
|
|
return object.getURL();
|
|
|
|
|
default:
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@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
|
|
|
|
|
protected void AdditionalInitColumns() {
|
|
|
|
|
columns.get(0).setVisible(false);
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public DataMenuBar createMenuBar() {
|
2024-10-22 15:25:06 +03:00
|
|
|
return new DataMenuBar(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
|
|
|
}
|