2023-09-17 22:13:42 +03:00
|
|
|
package GlobalData.CompilerEnvironment.UI;
|
2024-10-07 17:46:38 +03:00
|
|
|
import Common.Visual.CommonUI;
|
2024-10-07 00:58:29 +03:00
|
|
|
import Common_old.Current;
|
|
|
|
|
import Common_old.UI.Tables.DBObjectEditor;
|
2024-10-07 14:44:24 +03:00
|
|
|
import _VisualDVM.Syntax.VisualiserFonts;
|
2024-10-07 00:58:29 +03:00
|
|
|
import Common_old.UI.Windows.Dialog.Text.ComboTextDialog;
|
2023-09-17 22:13:42 +03:00
|
|
|
import GlobalData.CompilerEnvironment.CompilerEnvironment;
|
|
|
|
|
public class CompilerEnvironmentValueEditor extends DBObjectEditor<CompilerEnvironment> {
|
|
|
|
|
@Override
|
|
|
|
|
public void Action() {
|
|
|
|
|
setFont(Current.getTheme().Fonts.get(VisualiserFonts.Hyperlink));
|
|
|
|
|
setText(value.value.isEmpty() ? "не задано" : value.value);
|
|
|
|
|
//-
|
|
|
|
|
ComboTextDialog dialog = new ComboTextDialog() {
|
|
|
|
|
@Override
|
|
|
|
|
public void validateFields() {
|
|
|
|
|
super.validateFields();
|
|
|
|
|
if (fields.getSelectedItem() != null)
|
|
|
|
|
value.validate(Log, fields.getSelectedItem().toString());
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
dialog.fields.setEditable(value.valueVariants.isEmpty());
|
|
|
|
|
if (!value.value.isEmpty())
|
2024-10-07 17:46:38 +03:00
|
|
|
CommonUI.TrySelect(dialog.fields, value.value);
|
2023-09-17 22:13:42 +03:00
|
|
|
if (dialog.ShowDialog("Изменить значение опции " + value.name,
|
|
|
|
|
value.valueVariants
|
|
|
|
|
)) {
|
|
|
|
|
value.value = dialog.Result;
|
|
|
|
|
setText(value.value.isEmpty() ? "не задано" : value.value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public Object getCellEditorValue() {
|
|
|
|
|
return value.value;
|
|
|
|
|
}
|
|
|
|
|
}
|