2024-10-09 22:21:57 +03:00
|
|
|
package _VisualDVM.ProjectData.Messages.Recommendations;
|
2024-10-07 00:58:29 +03:00
|
|
|
import Common.Database.Objects.iDBObject;
|
2024-10-11 00:00:30 +03:00
|
|
|
import Common.Utils.Utils_;
|
2024-10-09 22:21:57 +03:00
|
|
|
import _VisualDVM.GlobalData.Settings.SettingName;
|
2024-10-09 23:37:58 +03:00
|
|
|
import Visual_DVM_2021.Passes.PassCode;
|
2023-09-17 22:13:42 +03:00
|
|
|
import com.sun.org.glassfish.gmbal.Description;
|
|
|
|
|
public class MessageRecommendation extends iDBObject {
|
|
|
|
|
//рекомендация может касаться, либо настройки либо прохода. так же может быть просто текстовой.
|
|
|
|
|
@Description("DEFAULT 'Text'")
|
|
|
|
|
public RecommendationType type = RecommendationType.Text;
|
|
|
|
|
@Description("DEFAULT 'Undefined'")
|
|
|
|
|
public String argName = "Undefined";//либо имя настройки либо имя прохода
|
|
|
|
|
@Description("DEFAULT ''")
|
|
|
|
|
public String argValue = ""; //Либо значение настройки либо аргумент для прохода
|
|
|
|
|
@Description("DEFAULT ''")
|
|
|
|
|
public String text = ""; //текст
|
|
|
|
|
public MessageRecommendation() {
|
|
|
|
|
}
|
2024-10-09 23:37:58 +03:00
|
|
|
public MessageRecommendation(PassCode passCode_in) {
|
2023-09-17 22:13:42 +03:00
|
|
|
type = RecommendationType.Transformation;
|
|
|
|
|
argName = passCode_in.toString();
|
2024-10-11 00:00:30 +03:00
|
|
|
text = "Выполните преобразование " + Utils_.Quotes(passCode_in.getDescription());
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
public MessageRecommendation(SettingName settingName_in, String settingValue_in) {
|
|
|
|
|
type = RecommendationType.Setting;
|
|
|
|
|
argName = settingName_in.toString();
|
|
|
|
|
argValue = settingValue_in;
|
|
|
|
|
if (argValue.equals("1"))
|
2024-10-11 00:00:30 +03:00
|
|
|
text = "Включите настройку SAPFOR " + Utils_.Quotes(settingName_in.getDescription());
|
2023-09-17 22:13:42 +03:00
|
|
|
else if (argValue.equals("0"))
|
2024-10-11 00:00:30 +03:00
|
|
|
text = "Отключите настройку SAPFOR " + Utils_.Quotes(settingName_in.getDescription());
|
2023-09-17 22:13:42 +03:00
|
|
|
else
|
2024-10-11 00:00:30 +03:00
|
|
|
text = "Задайте значение " + Utils_.DQuotes(argValue) + " для настройки SAPFOR " + Utils_.Quotes(settingName_in.getDescription());
|
2023-09-17 22:13:42 +03:00
|
|
|
}
|
|
|
|
|
public MessageRecommendation(String text_in) {
|
|
|
|
|
type = RecommendationType.Text;
|
|
|
|
|
text = text_in;
|
|
|
|
|
}
|
|
|
|
|
public boolean isMatch(MessageRecommendation recommendation_in) {
|
|
|
|
|
return type.equals(recommendation_in.type) &&
|
|
|
|
|
argName.equals(recommendation_in.argName) &&
|
|
|
|
|
argValue.equals(recommendation_in.argValue);
|
|
|
|
|
}
|
|
|
|
|
@Override
|
|
|
|
|
public boolean isVisible() {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|