no message

This commit is contained in:
2023-11-17 00:04:21 +03:00
parent 1ff88fc5fb
commit beb1359544
132 changed files with 617 additions and 591 deletions

View File

@@ -0,0 +1,13 @@
package TestingSystem.SAPFOR.SapforConfigurationCommand;
import Common.Database.rDBObject;
import Visual_DVM_2021.Passes.PassCode_2021;
import com.sun.org.glassfish.gmbal.Description;
public class SapforConfigurationCommand extends rDBObject {
@Description("DEFAULT ''")
public String sapforconfiguration_id = "";
public PassCode_2021 passCode = PassCode_2021.SPF_RemoveDvmDirectives;
@Override
public boolean isVisible() {
return SapforConfigurationCommandInterface.isVisible(this);
}
}

View File

@@ -0,0 +1,7 @@
package TestingSystem.SAPFOR.SapforConfigurationCommand;
import Common.Current;
public class SapforConfigurationCommandInterface {
public static boolean isVisible(SapforConfigurationCommand object) {
return Current.HasSapforConfiguration() && (Current.getSapforConfiguration().id.equals(object.sapforconfiguration_id));
}
}

View File

@@ -0,0 +1,76 @@
package TestingSystem.SAPFOR.SapforConfigurationCommand;
import Common.Current;
import Common.Database.DBTable;
import Common.UI.DataSetControlForm;
import Common.UI.UI;
import Common.UI.Windows.Dialog.DBObjectDialog;
import TestingSystem.SAPFOR.SapforConfigurationCommand.UI.SapforConfigurationCommandFields;
import Visual_DVM_2021.Passes.PassCode_2021;
public class SapforConfigurationCommandsDBTable extends DBTable<String, SapforConfigurationCommand> {
public SapforConfigurationCommandsDBTable() {
super(String.class, SapforConfigurationCommand.class);
}
@Override
public String getSingleDescription() {
return "команда";
}
@Override
public String getPluralDescription() {
return "команды";
}
@Override
protected DataSetControlForm createUI() {
return new DataSetControlForm(this){
@Override
protected void AdditionalInitColumns() {
columns.get(0).setVisible(false);
}
};
}
@Override
public String[] getUIColumnNames() {
return new String[]{
"Проход"
};
}
@Override
public Object getFieldAt(SapforConfigurationCommand object, int columnIndex) {
switch (columnIndex) {
case 1:
return object.passCode.getDescription();
default:
return null;
}
}
@Override
public Current CurrentName() {
return Current.SapforConfigurationCommand;
}
@Override
public DBObjectDialog<SapforConfigurationCommand, SapforConfigurationCommandFields> getDialog() {
return new DBObjectDialog<SapforConfigurationCommand, SapforConfigurationCommandFields>(SapforConfigurationCommandFields.class) {
@Override
public int getDefaultHeight() {
return 250;
}
@Override
public void fillFields() {
UI.TrySelect(fields.cbPassCode, Result.passCode);
}
@Override
public void ProcessResult() {
Result.passCode = (PassCode_2021) fields.cbPassCode.getSelectedItem();
Result.sapforconfiguration_id = Current.getSapforConfiguration().id;
}
@Override
public void validateFields() {
/*
Vector<ScenarioCommand> commands = new Vector<>(Current.getSapforConfiguration().getCommands().values());
if (!commands.isEmpty()&&commands.get(commands.size()-1).passCode.equals(PassCode_2021.CreateParallelVariantsCoverageForScenario)){
Log.Writeln_("После построения покрытия вариантов запрещено добавлять другие команды в сценарий.");
}
*/
}
};
}
}

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="TestingSystem.SAPFOR.SapforConfigurationCommand.UI.SapforConfigurationCommandFields">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="97a3c" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="проход"/>
</properties>
</component>
<vspacer id="7e4ea">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="e95d0" class="javax.swing.JComboBox" binding="cbPassCode" custom-create="true">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<toolTipText value="выберите проход"/>
</properties>
</component>
</children>
</grid>
</form>

View File

@@ -0,0 +1,32 @@
package TestingSystem.SAPFOR.SapforConfigurationCommand.UI;
import Common.Current;
import Common.UI.Tables.StyledCellLabel;
import Common.UI.Windows.Dialog.DialogFields;
import Repository.Component.Sapfor.Sapfor;
import Visual_DVM_2021.Passes.PassCode_2021;
import javax.swing.*;
import java.awt.*;
public class SapforConfigurationCommandFields implements DialogFields {
private JPanel content;
public JComboBox<PassCode_2021> cbPassCode;
@Override
public Component getContent() {
return content;
}
private void createUIComponents() {
// TODO: place custom component creation code here
cbPassCode = new JComboBox<>();
cbPassCode.setRenderer((list, value, index, isSelected, cellHasFocus) -> {
JLabel res = new StyledCellLabel();
res.setText(value.getDescription());
res.setBackground(isSelected ?
Current.getTheme().selection_background : Current.getTheme().background
);
return res;
});
//-
for (PassCode_2021 code : Sapfor.getScenariosCodes())
cbPassCode.addItem(code);
}
}