no message
This commit is contained in:
8
src/_VisualDVM/GlobalData/DVMParameter/DVMParameter.java
Normal file
8
src/_VisualDVM/GlobalData/DVMParameter/DVMParameter.java
Normal file
@@ -0,0 +1,8 @@
|
||||
package _VisualDVM.GlobalData.DVMParameter;
|
||||
import _VisualDVM.GlobalData.EnvironmentValue.EnvironmentValue;
|
||||
public class DVMParameter extends EnvironmentValue {
|
||||
@Override
|
||||
public String toString() {
|
||||
return name + "=" + value + ";";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package _VisualDVM.GlobalData.DVMParameter;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import _VisualDVM.Current;
|
||||
import Common.Database.Tables.iDBTable;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import _VisualDVM.Utils;
|
||||
import _VisualDVM.GlobalData.DVMParameter.UI.DVMParameterFields;
|
||||
import _VisualDVM.GlobalData.GlobalDatabase;
|
||||
public class DVMParameterDBTable extends iDBTable<DVMParameter> {
|
||||
public DVMParameterDBTable() {
|
||||
super(DVMParameter.class);
|
||||
}
|
||||
@Override
|
||||
public String getSingleDescription() {
|
||||
return "параметр DVM системы";
|
||||
}
|
||||
@Override
|
||||
public String getPluralDescription() {
|
||||
return "параметры DVM";
|
||||
}
|
||||
@Override
|
||||
public String[] getUIColumnNames() {
|
||||
return new String[]{"имя", "значение"};
|
||||
}
|
||||
@Override
|
||||
public Object getFieldAt(DVMParameter object, int columnIndex) {
|
||||
switch (columnIndex) {
|
||||
case 1:
|
||||
return object.name;
|
||||
case 2:
|
||||
return object.value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@Override
|
||||
public Current CurrentName() {
|
||||
return Current.DVMParameterValue;
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI() {
|
||||
return new DataSetControlForm(this){
|
||||
@Override
|
||||
protected void AdditionalInitColumns() {
|
||||
columns.get(0).setVisible(false);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
@Override
|
||||
public DBObjectDialog<DVMParameter, DVMParameterFields> getDialog() {
|
||||
return new DBObjectDialog<DVMParameter, DVMParameterFields>(DVMParameterFields.class) {
|
||||
@Override
|
||||
public void fillFields() {
|
||||
CommonUI.TrySelect(fields.cbName, Result.name);
|
||||
fields.tfValue.setText(Result.value);
|
||||
}
|
||||
//https://javarush.ru/groups/posts/regulyarnye-vyrazheniya-v-java
|
||||
@Override
|
||||
public void validateFields() {
|
||||
String name = (String) fields.cbName.getSelectedItem();
|
||||
String value = fields.tfValue.getText();
|
||||
if (name.isEmpty())
|
||||
Log.Writeln("Имя параметра DVM системы не может быть пустым.");
|
||||
/*
|
||||
if (!name.matches("\\w*")) {
|
||||
Log.Writeln("Имя переменной окружения может содержать только латинские буквы, цифры и подчёркивания");
|
||||
}
|
||||
*/
|
||||
if (Utils.isLinuxSystemCommand(name))
|
||||
Log.Writeln(CommonUtils.DQuotes(name) + " является системной командой Linux,\nи не может быть задано в качестве имени переменной окружения.");
|
||||
|
||||
/*
|
||||
if (value.contains("\"")) {
|
||||
Log.Writeln("Значение переменной окружения не может содержать двойные кавычки");
|
||||
}
|
||||
*/
|
||||
for (DVMParameter par : ((GlobalDatabase)CommonUtils.db).dvmParameters.Data.values()) {
|
||||
if (par.isVisible() && (Result.id != par.id) && (par.name.equals(name))) {
|
||||
Log.Writeln("В конфигурации запуска уже задан параметр DVM системы с именем " + CommonUtils.Brackets(name));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void ProcessResult() {
|
||||
Result.machine_id = Current.getMachine().id;
|
||||
Result.run_configuration_id = Current.getRunConfiguration().id;
|
||||
Result.name = (String) fields.cbName.getSelectedItem();
|
||||
Result.value = fields.tfValue.getText();
|
||||
}
|
||||
@Override
|
||||
public int getDefaultHeight() {
|
||||
return 200;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package _VisualDVM.GlobalData.DVMParameter;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
public class DVMParametersMenuBar extends DataMenuBar {
|
||||
public DVMParametersMenuBar() {
|
||||
super("параметры",
|
||||
PassCode_2021.AddDVMParameter,
|
||||
PassCode_2021.EditDVMParameter,
|
||||
PassCode_2021.DeleteDVMParameter);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.GlobalData.DVMParameter.UI.DVMParameterFields">
|
||||
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="3" 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="79882" 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="db063">
|
||||
<constraints>
|
||||
<grid row="2" 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="6dffc" class="javax.swing.JLabel">
|
||||
<constraints>
|
||||
<grid row="1" 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>
|
||||
<component id="5996e" class="javax.swing.JTextField" binding="tfValue" custom-create="true">
|
||||
<constraints>
|
||||
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
|
||||
<preferred-size width="150" height="-1"/>
|
||||
</grid>
|
||||
</constraints>
|
||||
<properties/>
|
||||
</component>
|
||||
<component id="9fa4" class="javax.swing.JComboBox" binding="cbName" 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>
|
||||
<editable value="true"/>
|
||||
<font name="Times New Roman" size="16" style="0"/>
|
||||
<model>
|
||||
<item value="Is_DVM_STAT"/>
|
||||
<item value="StatBufLength"/>
|
||||
</model>
|
||||
<toolTipText value="Выберите из списка дополнительную команду компиляции ( актуально для DVM компиляторов)"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
@@ -0,0 +1,21 @@
|
||||
package _VisualDVM.GlobalData.DVMParameter.UI;
|
||||
import Common.Visual.Controls.StyledTextComboBox;
|
||||
import Common.Visual.TextField.StyledTextField;
|
||||
import Common.Visual.Windows.Dialog.DialogFields;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class DVMParameterFields implements DialogFields {
|
||||
public JTextField tfValue;
|
||||
public JComboBox<String> cbName;
|
||||
private JPanel content;
|
||||
@Override
|
||||
public Component getContent() {
|
||||
return content;
|
||||
}
|
||||
private void createUIComponents() {
|
||||
// TODO: place custom component creation code here
|
||||
cbName = new StyledTextComboBox();
|
||||
tfValue = new StyledTextField();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user