2024-10-20 17:27:58 +03:00
|
|
|
package _VisualDVM.GlobalData.EnvironmentValue.UI;
|
|
|
|
|
import Common.Database.Tables.DataSet;
|
2024-10-20 20:51:23 +03:00
|
|
|
import Common.MainModule_;
|
2024-10-20 17:27:58 +03:00
|
|
|
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-20 20:51:23 +03:00
|
|
|
import _VisualDVM.Current;
|
2024-10-20 17:27:58 +03:00
|
|
|
import _VisualDVM.GlobalData.EnvironmentValue.EnvironmentValue;
|
|
|
|
|
import _VisualDVM.Passes.PassCode;
|
|
|
|
|
|
|
|
|
|
import javax.swing.*;
|
|
|
|
|
public class EnvironmentsValuesForm extends DataSetControlForm<EnvironmentValue> {
|
|
|
|
|
public EnvironmentsValuesForm(DataSet<?, EnvironmentValue> 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.EnvironmentValue;
|
|
|
|
|
}
|
|
|
|
|
@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-20 17:27:58 +03:00
|
|
|
public String[] getUIColumnNames() {
|
|
|
|
|
return new String[]{
|
|
|
|
|
"имя",
|
|
|
|
|
"значение"};
|
|
|
|
|
}
|
|
|
|
|
@Override
|
2024-10-20 21:59:39 +03:00
|
|
|
public Object getFieldAt(EnvironmentValue object, int columnIndex) {
|
|
|
|
|
switch (columnIndex) {
|
|
|
|
|
case 1:
|
|
|
|
|
return object.name;
|
|
|
|
|
case 2:
|
|
|
|
|
return object.value;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
@Override
|
2024-10-20 17:27:58 +03:00
|
|
|
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.AddEnvironmentValue,
|
|
|
|
|
PassCode.EditEnvironmentValue,
|
|
|
|
|
PassCode.DeleteEnvironmentValue,
|
|
|
|
|
PassCode.PickCompilerEnvironments);
|
|
|
|
|
}
|
2024-10-20 20:51:23 +03:00
|
|
|
@Override
|
|
|
|
|
public boolean isObjectVisible(EnvironmentValue object) {
|
2024-10-20 21:59:39 +03:00
|
|
|
return super.isObjectVisible(object) && MainModule_.instance.matchCurrentID(Current.RunConfiguration, object.run_configuration_id);
|
2024-10-20 20:51:23 +03:00
|
|
|
}
|
2024-10-22 16:44:13 +03:00
|
|
|
@Override
|
2024-10-22 17:27:41 +03:00
|
|
|
protected DBObjectDialog<EnvironmentValue, ? extends DialogFields> getDialog() {
|
2024-10-22 16:44:13 +03:00
|
|
|
return new EnvironmentValueDialog();
|
|
|
|
|
}
|
2024-10-20 17:27:58 +03:00
|
|
|
}
|