no message
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package Common.Database;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Database.Tables.DBTable;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.DataSet;
|
||||
@@ -84,7 +84,7 @@ public abstract class Database {
|
||||
public DBObject InsertS(DBObject object) throws Exception {
|
||||
DBTable table = tables.get(object.getClass());
|
||||
if (!(object instanceof iDBObject) && table.Data.containsKey(object.getPK()))
|
||||
throw new RepositoryRefuseException("Таблица " + CommonUtils.Brackets(table.Name) + " уже содержит объект с ключом " + CommonUtils.Brackets(object.getPK().toString()));
|
||||
throw new RepositoryRefuseException("Таблица " + Utils_.Brackets(table.Name) + " уже содержит объект с ключом " + Utils_.Brackets(object.getPK().toString()));
|
||||
insert(table, object);
|
||||
table.Data.put(object.getPK(), object);
|
||||
return object;
|
||||
@@ -111,7 +111,7 @@ public abstract class Database {
|
||||
table.Data.remove(o.getPK());
|
||||
return o;
|
||||
} else
|
||||
throw new RepositoryRefuseException("Таблица " + CommonUtils.Brackets(table.Name) + " не содержит объект с ключом " + CommonUtils.Brackets(to_delete.getPK().toString()));
|
||||
throw new RepositoryRefuseException("Таблица " + Utils_.Brackets(table.Name) + " не содержит объект с ключом " + Utils_.Brackets(to_delete.getPK().toString()));
|
||||
}
|
||||
public DBObject DeleteByPK(Class object_class, Object key) throws Exception {
|
||||
DBTable table = tables.get(object_class);
|
||||
@@ -121,7 +121,7 @@ public abstract class Database {
|
||||
table.Data.remove(key);
|
||||
return o;
|
||||
} else
|
||||
throw new RepositoryRefuseException("Таблица " + CommonUtils.Brackets(table.Name) + " не содержит объект с ключом " + CommonUtils.Brackets(key.toString()));
|
||||
throw new RepositoryRefuseException("Таблица " + Utils_.Brackets(table.Name) + " не содержит объект с ключом " + Utils_.Brackets(key.toString()));
|
||||
}
|
||||
// не работает с автоинкрементом.
|
||||
public DBObject getObjectCopyByPK(Class table_class, Object pk) throws Exception {
|
||||
@@ -178,7 +178,7 @@ public abstract class Database {
|
||||
if (fk_class.getField(owner.getFKName()).get(o).equals(owner.getPK())) res.add((DBObject) o);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -207,7 +207,7 @@ public abstract class Database {
|
||||
if (fk_class.getField(owner.getFKName()).get(f).equals(owner.getPK())) res.put((K) f.getPK(), f);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -222,7 +222,7 @@ public abstract class Database {
|
||||
if (fk_class.getField(owner.getFKName()).get(o).equals(owner.getPK())) res.add(o.toString());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@@ -243,7 +243,7 @@ public abstract class Database {
|
||||
res.put((G) (fk_class.getField(group_field).get(f)), f);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Database.Objects;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Selectable;
|
||||
import Common.Utils.Index;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
@@ -34,7 +34,7 @@ public abstract class DBObject implements Selectable, Serializable {
|
||||
}
|
||||
public abstract Object getPK();
|
||||
public String getBDialogName() {
|
||||
return CommonUtils.Brackets(getDialogName());
|
||||
return Utils_.Brackets(getDialogName());
|
||||
}
|
||||
public String getDialogName() {
|
||||
return getPK().toString();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Database.Objects;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import com.sun.org.glassfish.gmbal.Description;
|
||||
public abstract class nDBObject extends DBObject {
|
||||
@Description("PRIMARY KEY, UNIQUE")
|
||||
@@ -13,7 +13,7 @@ public abstract class nDBObject extends DBObject {
|
||||
return "";
|
||||
}
|
||||
public void genName() {
|
||||
id = CommonUtils.getDateName(getClass().getSimpleName().toLowerCase());
|
||||
id = Utils_.getDateName(getClass().getSimpleName().toLowerCase());
|
||||
}
|
||||
//-
|
||||
@Override
|
||||
|
||||
@@ -3,8 +3,8 @@ import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.DBTable;
|
||||
import Common.Database.Tables.DBTableColumn;
|
||||
import Common.Database.Database;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Passes.PassException;
|
||||
import javafx.util.Pair;
|
||||
|
||||
@@ -13,7 +13,7 @@ import java.sql.*;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Vector;
|
||||
|
||||
import static Common.Utils.CommonUtils.requireNonNullElse;
|
||||
import static Common.Utils.Utils_.requireNonNullElse;
|
||||
public abstract class SQLiteDatabase extends Database {
|
||||
protected Connection conn = null;
|
||||
protected Statement statement = null;
|
||||
@@ -36,7 +36,7 @@ public abstract class SQLiteDatabase extends Database {
|
||||
ex.printStackTrace();
|
||||
conn = null;
|
||||
System.gc();
|
||||
CommonUtils.sleep(2000);
|
||||
Utils_.sleep(2000);
|
||||
}
|
||||
}
|
||||
if (conn == null)
|
||||
@@ -116,7 +116,7 @@ public abstract class SQLiteDatabase extends Database {
|
||||
Vector<String> columns_names = new Vector<>();
|
||||
for (DBTableColumn column : table.columns.values())
|
||||
columns_names.add(column.toString());
|
||||
cmd += CommonUtils.RBrackets(String.join(",", columns_names));
|
||||
cmd += Utils_.RBrackets(String.join(",", columns_names));
|
||||
statement.execute(cmd);
|
||||
}
|
||||
}
|
||||
@@ -135,8 +135,8 @@ public abstract class SQLiteDatabase extends Database {
|
||||
}
|
||||
insertStatements.put(table.d, conn.prepareStatement(
|
||||
"INSERT OR REPLACE INTO " + table.QName() + " " +
|
||||
CommonUtils.RBrackets(String.join(",", column_names)) + " " + "VALUES " +
|
||||
CommonUtils.RBrackets(String.join(",", column_values))));
|
||||
Utils_.RBrackets(String.join(",", column_names)) + " " + "VALUES " +
|
||||
Utils_.RBrackets(String.join(",", column_values))));
|
||||
//------------------------------------------------------------------------------->>
|
||||
Vector<String> new_values = new Vector();
|
||||
for (DBTableColumn column : table.columns.values()) {
|
||||
@@ -194,7 +194,7 @@ public abstract class SQLiteDatabase extends Database {
|
||||
if (field_value != null) {
|
||||
table.d.getField(column.Name).set(o, field_value);
|
||||
} else
|
||||
throw new PassException("Ошибка при загрузке поля " + CommonUtils.Brackets(column.Name) + " класса " + CommonUtils.Brackets(table.d.getSimpleName()));
|
||||
throw new PassException("Ошибка при загрузке поля " + Utils_.Brackets(column.Name) + " класса " + Utils_.Brackets(table.d.getSimpleName()));
|
||||
}
|
||||
return new Pair<>((K) o.getPK(), o);
|
||||
}
|
||||
@@ -210,7 +210,7 @@ public abstract class SQLiteDatabase extends Database {
|
||||
protected void insert(DBTable table, DBObject o) throws Exception {
|
||||
PreparedStatement ps = insertStatements.get(table.d);
|
||||
if (ps == null)
|
||||
CommonUI.Info("INSERT NULL");
|
||||
UI_.Info("INSERT NULL");
|
||||
int i = 1;
|
||||
for (DBTableColumn column : table.columns.values()) {
|
||||
if (!column.AutoIncrement) {
|
||||
@@ -234,7 +234,7 @@ public abstract class SQLiteDatabase extends Database {
|
||||
protected void update(DBTable table, DBObject o) throws Exception {
|
||||
PreparedStatement ps = updateStatements.get(table.d);
|
||||
if (ps == null)
|
||||
CommonUI.Info("UPDATE NULL");
|
||||
UI_.Info("UPDATE NULL");
|
||||
int i = 1;
|
||||
for (DBTableColumn column : table.columns.values()) {
|
||||
if (!column.AutoIncrement) {
|
||||
|
||||
@@ -8,7 +8,7 @@ import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
import Common.Visual.Windows.Dialog.DialogFields;
|
||||
import Common.Utils.TextLog;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.FilterInterface;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -41,15 +41,15 @@ public class DataSet<K, D extends DBObject> extends DataSetAnchestor {
|
||||
Name = d.getSimpleName();
|
||||
}
|
||||
public void mountUI(JPanel content_in) {
|
||||
CommonUI.Clear(content_in);
|
||||
UI_.Clear(content_in);
|
||||
//-->
|
||||
ui_ = createUI();
|
||||
ui_.setContent(content_in);
|
||||
//-->
|
||||
if ( CommonUI.menuBars.containsKey(getClass())) {
|
||||
DataMenuBar bar = CommonUI.menuBars.get(getClass());
|
||||
if ( UI_.menuBars.containsKey(getClass())) {
|
||||
DataMenuBar bar = UI_.menuBars.get(getClass());
|
||||
content_in.add(bar, BorderLayout.NORTH);
|
||||
setFilterUI(count -> CommonUI.menuBars.get(getClass()).countLabel.setText(String.valueOf(count)));
|
||||
setFilterUI(count -> UI_.menuBars.get(getClass()).countLabel.setText(String.valueOf(count)));
|
||||
if (ui_.hasCheckBox())
|
||||
bar.createSelectionButtons(this);
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public class DataSet<K, D extends DBObject> extends DataSetAnchestor {
|
||||
//----
|
||||
createFilters();
|
||||
if (!filters.isEmpty()) {
|
||||
DataMenuBar menuBar = CommonUI.menuBars.get(getClass());
|
||||
DataMenuBar menuBar = UI_.menuBars.get(getClass());
|
||||
for (DataSetFilter<D> filter : filters)
|
||||
menuBar.addMenus(filter.menu);
|
||||
}
|
||||
@@ -133,7 +133,7 @@ public class DataSet<K, D extends DBObject> extends DataSetAnchestor {
|
||||
return false;
|
||||
}
|
||||
public boolean ShowDeleteObjectDialog(DBObject object) {
|
||||
return CommonUI.Warning(getSingleDescription() + " " + object.getBDialogName() + " будет удален(а)");
|
||||
return UI_.Warning(getSingleDescription() + " " + object.getBDialogName() + " будет удален(а)");
|
||||
}
|
||||
public String QName() {
|
||||
return "\"" + Name + "\"";
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package Common.Passes;
|
||||
import Common.Current_;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Utils.Stopwatch;
|
||||
import Common.Utils.TextLog;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Visual_DVM_2021.PassStats.PassStats;
|
||||
import Visual_DVM_2021.Passes.PassCode;
|
||||
import Visual_DVM_2021.Passes.UI.PassForm;
|
||||
@@ -53,9 +53,9 @@ public class Pass<T> {
|
||||
//важно. вызывать только если есть интерфейс. passstats делать частью общей бд.пусть будут.
|
||||
public static void CheckAllStats() throws Exception {
|
||||
for (Pass pass : FAPasses) {
|
||||
if (!((GlobalDatabase) CommonUtils.db).passStats.Data.containsKey(pass.code().toString()))
|
||||
CommonUtils.db.Insert(pass.stats = new PassStats(pass.code().toString()));
|
||||
else pass.stats = ((GlobalDatabase) CommonUtils.db).passStats.Data.get(pass.code().toString());
|
||||
if (!((GlobalDatabase) Utils_.db).passStats.Data.containsKey(pass.code().toString()))
|
||||
Utils_.db.Insert(pass.stats = new PassStats(pass.code().toString()));
|
||||
else pass.stats = ((GlobalDatabase) Utils_.db).passStats.Data.get(pass.code().toString());
|
||||
}
|
||||
FAPasses.sort(new SortPassesByStats());
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public class Pass<T> {
|
||||
if (pass.hasStats())
|
||||
FAPasses.add(pass);
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -78,7 +78,7 @@ public class Pass<T> {
|
||||
return null;
|
||||
}
|
||||
public Icon getTabIcon() {
|
||||
return CommonUtils.getTabIcon(getIconPath());
|
||||
return Utils_.getTabIcon(getIconPath());
|
||||
}
|
||||
public AbstractAction getControlAction() {
|
||||
return new AbstractAction() {
|
||||
@@ -128,12 +128,12 @@ public class Pass<T> {
|
||||
if (hasStats()) {
|
||||
stats.Inc();
|
||||
try {
|
||||
CommonUtils.db.Update(stats);
|
||||
Utils_.db.Update(stats);
|
||||
FAPasses.sort(new SortPassesByStats());
|
||||
if (Current.HasProject())
|
||||
UI.fastAccessMenuBar.Refresh();
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -190,30 +190,30 @@ public class Pass<T> {
|
||||
//-
|
||||
private void PerformCanNotStart() throws Exception {
|
||||
performCanNotStart();
|
||||
if (CommonUI.isActive())
|
||||
if (UI_.isActive())
|
||||
showCanNotStart();
|
||||
}
|
||||
protected void PerformPreparation() throws Exception {
|
||||
performPreparation();
|
||||
if (CommonUI.isActive())
|
||||
if (UI_.isActive())
|
||||
showPreparation();
|
||||
}
|
||||
private void PerformFinish() throws Exception {
|
||||
performFinish();
|
||||
//-
|
||||
if (CommonUI.isActive())
|
||||
if (UI_.isActive())
|
||||
showFinish();
|
||||
}
|
||||
private void PerformDone() throws Exception {
|
||||
performDone();
|
||||
//-
|
||||
if (CommonUI.isActive())
|
||||
if (UI_.isActive())
|
||||
showDone();
|
||||
}
|
||||
private void PerformFail() throws Exception {
|
||||
performFail();
|
||||
//-
|
||||
if (CommonUI.isActive())
|
||||
if (UI_.isActive())
|
||||
showFail();
|
||||
}
|
||||
//------
|
||||
@@ -245,7 +245,7 @@ public class Pass<T> {
|
||||
Vector<String> ToPrint = new Vector<>();
|
||||
createStack_r(ToDo, ToPrint);
|
||||
if (Global.properties.ConfirmPassesStart && !ToPrint.isEmpty() &&
|
||||
!CommonUI.Question("Выполнить проход(ы):\n" + String.join("\n", ToPrint))
|
||||
!UI_.Question("Выполнить проход(ы):\n" + String.join("\n", ToPrint))
|
||||
) return false;
|
||||
while (ToDo.size() > 1) {
|
||||
if (!ToDo.pop().start()) return false;
|
||||
@@ -256,7 +256,7 @@ public class Pass<T> {
|
||||
//-
|
||||
if (Global.properties.ShowPassesDone && !ToPrint.isEmpty()
|
||||
) {
|
||||
CommonUI.Info("Проход(ы)\n\n" + String.join("\n", ToPrint) +
|
||||
UI_.Info("Проход(ы)\n\n" + String.join("\n", ToPrint) +
|
||||
"\nуспешно выполнен(ы)!");
|
||||
}
|
||||
//-
|
||||
@@ -270,7 +270,7 @@ public class Pass<T> {
|
||||
return false;
|
||||
}
|
||||
public void Interrupt() throws Exception {
|
||||
CommonUI.Info("Проход " + CommonUtils.Brackets(getDescription()) + " не разрешено прерывать.");
|
||||
UI_.Info("Проход " + Utils_.Brackets(getDescription()) + " не разрешено прерывать.");
|
||||
}
|
||||
public boolean needsConfirmations() {
|
||||
return false;
|
||||
@@ -281,7 +281,7 @@ public class Pass<T> {
|
||||
if (ex instanceof PassException) {
|
||||
Log.Writeln_(ex.getMessage());
|
||||
} else
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
public boolean start(Object... args) {
|
||||
//------------------------------->
|
||||
@@ -293,15 +293,15 @@ public class Pass<T> {
|
||||
target = null;
|
||||
Log = new TextLog();
|
||||
if (!getDescription().isEmpty())
|
||||
CommonUtils.MainLog.Print(getDescription() + " стартует..");
|
||||
Utils_.MainLog.Print(getDescription() + " стартует..");
|
||||
timer.Start();
|
||||
//------------------------------->
|
||||
try {
|
||||
if (CommonUI.isActive()) FocusBeforeStart();
|
||||
if (UI_.isActive()) FocusBeforeStart();
|
||||
if (canStart(args)) {
|
||||
PerformPreparation();
|
||||
//todo тут должна быть вилка на анимацию?
|
||||
if (CommonUI.isActive() && needsAnimation()) {
|
||||
if (UI_.isActive() && needsAnimation()) {
|
||||
animation_sem = new Semaphore(1);
|
||||
animation_sem.acquire();
|
||||
//---
|
||||
@@ -324,7 +324,7 @@ public class Pass<T> {
|
||||
try {
|
||||
animation_sem.acquire();
|
||||
} catch (InterruptedException e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
//и уничтожаем его.
|
||||
// UI.Print(DebugPrintLevel.Passes, "Окно анимации активировано.");
|
||||
@@ -375,19 +375,19 @@ public class Pass<T> {
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
state = PassState.ExternalCrushed;
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
//------------------------------->
|
||||
timer.Stop();
|
||||
if (!getDescription().isEmpty()) {
|
||||
CommonUtils.MainLog.Print(
|
||||
Utils_.MainLog.Print(
|
||||
getDescription() +
|
||||
" окончен за " + timer.Print() +
|
||||
" состояние " + CommonUtils.Brackets(state.getDescription())
|
||||
" состояние " + Utils_.Brackets(state.getDescription())
|
||||
);
|
||||
if (!Log.isEmpty() && CommonUI.isActive())
|
||||
CommonUI.Error(
|
||||
"проход " + CommonUtils.Brackets(getDescription()) + "\n" + state.getDescription() + "\n\n" +
|
||||
if (!Log.isEmpty() && UI_.isActive())
|
||||
UI_.Error(
|
||||
"проход " + Utils_.Brackets(getDescription()) + "\n" + state.getDescription() + "\n\n" +
|
||||
Log.toString());
|
||||
}
|
||||
//------------------------------->
|
||||
@@ -395,7 +395,7 @@ public class Pass<T> {
|
||||
}
|
||||
//--
|
||||
public void ShowSapforMessage(String message) {
|
||||
if (CommonUI.isActive() && form != null) {
|
||||
if (UI_.isActive() && form != null) {
|
||||
String[] data = message.split(":");
|
||||
switch (data[0]) {
|
||||
case "message_1":
|
||||
@@ -408,17 +408,17 @@ public class Pass<T> {
|
||||
form.fields.ProgressBar.setValue((data.length > 1) ? Integer.parseInt(data[1]) : 0);
|
||||
break;
|
||||
}
|
||||
} else System.out.println(CommonUtils.Brackets(message));
|
||||
} else System.out.println(Utils_.Brackets(message));
|
||||
}
|
||||
public void ShowMessage1(String message) {
|
||||
if (form != null)
|
||||
form.fields.Label1.setText((message.length() > 1) ? message : "");
|
||||
else System.out.println(CommonUtils.Brackets(message));
|
||||
else System.out.println(Utils_.Brackets(message));
|
||||
}
|
||||
public void ShowMessage2(String message) {
|
||||
if (form != null)
|
||||
form.fields.Label2.setText((message.isEmpty() ? "" : message));
|
||||
else System.out.println(CommonUtils.Brackets(message));
|
||||
else System.out.println(Utils_.Brackets(message));
|
||||
}
|
||||
public void ShowProgress(int total, int current, boolean auto) {
|
||||
if (form != null) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Utils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Utils;
|
||||
|
||||
import java.io.File;
|
||||
@@ -23,7 +23,7 @@ public interface Loggable {
|
||||
default void Print(String message) {
|
||||
try {
|
||||
FileWriter Log = new FileWriter(getLogFile(), true);
|
||||
String datedMessage = CommonUtils.Brackets(new Date()) + " " + message;
|
||||
String datedMessage = Utils_.Brackets(new Date()) + " " + message;
|
||||
Log.write(datedMessage + "\n");
|
||||
Log.close();
|
||||
} catch (Exception ignored) {
|
||||
@@ -35,8 +35,8 @@ public interface Loggable {
|
||||
ex.printStackTrace(writer);
|
||||
writer.flush();
|
||||
Print(out.toString());
|
||||
if (CommonUI.isActive())
|
||||
CommonUI.Error("Возникло исключение. Подробности в файле журнала\n" +
|
||||
CommonUtils.Brackets(getLogFile().getAbsolutePath()));
|
||||
if (UI_.isActive())
|
||||
UI_.Error("Возникло исключение. Подробности в файле журнала\n" +
|
||||
Utils_.Brackets(getLogFile().getAbsolutePath()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,8 +11,8 @@ public class StringTemplate {
|
||||
public String pattern = "";
|
||||
//------------------------------------------------------------------
|
||||
public StringTemplate(String p, String s) {
|
||||
prefix = CommonUtils.removeRedundantSpaces(p);
|
||||
suffix = CommonUtils.removeRedundantSpaces(s);
|
||||
prefix = Utils_.removeRedundantSpaces(p);
|
||||
suffix = Utils_.removeRedundantSpaces(s);
|
||||
String[] prefix_words = prefix.split(" ");
|
||||
String[] suffix_words = suffix.split(" ");
|
||||
//настраиваем регулярное выражение----------
|
||||
|
||||
@@ -6,7 +6,7 @@ public class TextLog {
|
||||
}
|
||||
public void Writeln_(String line) {
|
||||
text += line + "\n";
|
||||
CommonUtils.MainLog.Print(line);
|
||||
Utils_.MainLog.Print(line);
|
||||
}
|
||||
public void Clear() {
|
||||
text = "";
|
||||
|
||||
@@ -21,7 +21,7 @@ import java.util.Vector;
|
||||
import java.util.concurrent.Semaphore;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.stream.Collectors;
|
||||
public class CommonUtils {
|
||||
public class Utils_ {
|
||||
static String HomePath = System.getProperty("user.dir");
|
||||
public static void setHomePath(String path_in){
|
||||
HomePath = path_in;
|
||||
@@ -401,14 +401,14 @@ public class CommonUtils {
|
||||
}
|
||||
//Иконки
|
||||
public static ImageIcon getIcon(String path) {
|
||||
URL imageUrl = CommonUtils.class.getResource(path);
|
||||
URL imageUrl = Utils_.class.getResource(path);
|
||||
if (imageUrl == null) {
|
||||
return null;
|
||||
}
|
||||
return new ImageIcon(imageUrl);
|
||||
}
|
||||
public static ImageIcon getTabIcon(String path) {
|
||||
URL imageUrl = CommonUtils.class.getResource(path);
|
||||
URL imageUrl = Utils_.class.getResource(path);
|
||||
if (imageUrl == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
@@ -34,7 +34,7 @@ public class ControlForm<C extends Component> {
|
||||
try {
|
||||
control = control_class.newInstance();
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
}
|
||||
public boolean isShown() {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
public class HyperlinksStyledList extends StyledList {
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
super.applyTheme();
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Hyperlink));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Hyperlink));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -9,7 +9,7 @@ import java.awt.*;
|
||||
public class MenuBarButton extends JButton {
|
||||
public MenuBarButton() {
|
||||
super();
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
//
|
||||
setBorderPainted(false);
|
||||
setContentAreaFilled(false);
|
||||
@@ -27,9 +27,9 @@ public class MenuBarButton extends JButton {
|
||||
super.paintComponent(g);
|
||||
}
|
||||
public void setIcon(String icon_path) {
|
||||
setIcon(CommonUtils.getIcon(icon_path));
|
||||
setIcon(Utils_.getIcon(icon_path));
|
||||
}
|
||||
public void setFont(VisualiserFonts font_in){
|
||||
setFont(CommonUI.getTheme().Fonts.get(font_in));
|
||||
setFont(UI_.getTheme().Fonts.get(font_in));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
import javax.swing.*;
|
||||
public class StyledList extends JList implements ThemeElement {
|
||||
public StyledList() {
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
applyTheme();
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackground(CommonUI.getTheme().table_background);
|
||||
setForeground(CommonUI.getTheme().foreground);
|
||||
setBackground(UI_.getTheme().table_background);
|
||||
setForeground(UI_.getTheme().foreground);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Controls;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -10,7 +10,7 @@ public class StyledProgressBar extends JProgressBar implements ThemeElement {
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackground(CommonUI.getTheme().bar_background);
|
||||
setForeground(CommonUI.getTheme().bar_foreground);
|
||||
setBackground(UI_.getTheme().bar_background);
|
||||
setForeground(UI_.getTheme().bar_foreground);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.Visual.Menus.StableMenuItem;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.DataSet;
|
||||
@@ -20,7 +20,7 @@ public abstract class DBObjectFilter<D extends DBObject> {
|
||||
return "/Common/icons/Pick.png";
|
||||
}
|
||||
void Mark() {
|
||||
menuItem.setIcon(CommonUtils.getIcon(active ? getActiveIconPath() : getNotActiveIconPath()));
|
||||
menuItem.setIcon(Utils_.getIcon(active ? getActiveIconPath() : getNotActiveIconPath()));
|
||||
}
|
||||
//-------
|
||||
public boolean Validate(D object) {
|
||||
@@ -53,7 +53,7 @@ public abstract class DBObjectFilter<D extends DBObject> {
|
||||
count = 0;
|
||||
}
|
||||
public void Refresh() {
|
||||
menuItem.setText(description + " " + CommonUtils.RBrackets(count));
|
||||
menuItem.setText(description + " " + Utils_.RBrackets(count));
|
||||
}
|
||||
public boolean isActive() {
|
||||
return active;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package Common.Visual;
|
||||
import Common.CommonConstants;
|
||||
import Common.Current_;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.DBTable;
|
||||
import Common.Database.Tables.DataSet;
|
||||
@@ -54,7 +54,7 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
@Override
|
||||
public void Clear() {
|
||||
super.Clear();
|
||||
CommonUI.Clear(dataPanel);
|
||||
UI_.Clear(dataPanel);
|
||||
}
|
||||
public DataSet getDataSource() {
|
||||
return dataSource;
|
||||
@@ -64,21 +64,21 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
return getDataSource().CurrentName();
|
||||
}
|
||||
public void SaveColumns() {
|
||||
if (CommonUtils.db != null) {
|
||||
if (Utils_.db != null) {
|
||||
try {
|
||||
if ((CurrentName() != null)) {
|
||||
String tableName= CurrentName().toString();
|
||||
Vector<String> widths = IntStream.range(0, columns.size()).mapToObj(i -> String.valueOf(control.getColumnModel().getColumn(i).getWidth())).collect(Collectors.toCollection(Vector::new));
|
||||
String packed = String.join("|", widths);
|
||||
TableVisualData tableVisualData;
|
||||
if (CommonUtils.db.tablesVisualData.containsKey(tableName)) {
|
||||
tableVisualData = CommonUtils.db.tablesVisualData.get(tableName);
|
||||
if (Utils_.db.tablesVisualData.containsKey(tableName)) {
|
||||
tableVisualData = Utils_.db.tablesVisualData.get(tableName);
|
||||
} else {
|
||||
tableVisualData = new TableVisualData(tableName);
|
||||
CommonUtils.db.Insert(tableVisualData);
|
||||
Utils_.db.Insert(tableVisualData);
|
||||
}
|
||||
tableVisualData.sizes = packed;
|
||||
CommonUtils.db.Update(tableVisualData);
|
||||
Utils_.db.Update(tableVisualData);
|
||||
}
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
@@ -149,9 +149,9 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
//-----------------------------NEW-------------------------------------
|
||||
@Override
|
||||
public void CorrectColumnsSizes() {
|
||||
if ((CommonUtils.db != null) && CurrentName() != null && CommonUtils.db.tablesVisualData.containsKey(CurrentName().toString())) {
|
||||
if ((Utils_.db != null) && CurrentName() != null && Utils_.db.tablesVisualData.containsKey(CurrentName().toString())) {
|
||||
if (!getColumnsProfile().equalsIgnoreCase(colNamesAndSizes)) {
|
||||
TableVisualData grid = CommonUtils.db.tablesVisualData.get(CurrentName().toString());
|
||||
TableVisualData grid = Utils_.db.tablesVisualData.get(CurrentName().toString());
|
||||
String[] data = grid.sizes.split("\\|");
|
||||
for (int i = 0; i < columns.size(); ++i) {
|
||||
if (i <= (data.length - 1)) {
|
||||
@@ -220,7 +220,7 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
try {
|
||||
ShowCurrentObject();
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -231,7 +231,7 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
try {
|
||||
ShowNoCurrentObject();
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -244,7 +244,7 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
try {
|
||||
MouseAction2();
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -255,7 +255,7 @@ public class DataSetControlForm extends ControlWithCurrentForm<DataTable> {
|
||||
try {
|
||||
ShowNoCurrentObject();
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
}
|
||||
//---
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.DragDrop;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
|
||||
import java.awt.datatransfer.DataFlavor;
|
||||
import java.io.*;
|
||||
@@ -314,12 +314,12 @@ public class FileDrop {
|
||||
} // end try
|
||||
catch (IOException io) {
|
||||
log(out, "FileDrop: IOException - abort:");
|
||||
CommonUtils.MainLog.PrintException(io);
|
||||
Utils_.MainLog.PrintException(io);
|
||||
evt.rejectDrop();
|
||||
} // end catch IOException
|
||||
catch (java.awt.datatransfer.UnsupportedFlavorException ufe) {
|
||||
log(out, "FileDrop: UnsupportedFlavorException - abort:");
|
||||
CommonUtils.MainLog.PrintException(ufe);
|
||||
Utils_.MainLog.PrintException(ufe);
|
||||
evt.rejectDrop();
|
||||
} // end catch: UnsupportedFlavorException
|
||||
finally {
|
||||
@@ -446,7 +446,7 @@ public class FileDrop {
|
||||
dt.addDropTargetListener(dropListener);
|
||||
} // end try
|
||||
catch (java.util.TooManyListenersException e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
Utils_.MainLog.PrintException(e);
|
||||
log(out, "FileDrop: Drop will not work due to previous error. Do you have another listener attached?");
|
||||
} // end catch
|
||||
// Listen for hierarchy changes and remove the drop target when the parent gets cleared out.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Menus;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -21,15 +21,15 @@ public class StyledPopupMenu extends JPopupMenu implements ThemeElement {
|
||||
});
|
||||
}
|
||||
private void refreshTheme_r(MenuElement element) {
|
||||
element.getComponent().setBackground(CommonUI.getTheme().background);
|
||||
element.getComponent().setForeground(CommonUI.getTheme().foreground);
|
||||
element.getComponent().setBackground(UI_.getTheme().background);
|
||||
element.getComponent().setForeground(UI_.getTheme().foreground);
|
||||
for (MenuElement se : element.getSubElements())
|
||||
refreshTheme_r(se);
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackground(CommonUI.getTheme().background);
|
||||
setForeground(CommonUI.getTheme().foreground);
|
||||
setBackground(UI_.getTheme().background);
|
||||
setForeground(UI_.getTheme().foreground);
|
||||
refreshTheme_r(this);
|
||||
}
|
||||
public void CheckElementsVisibility() {
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package Common.Visual.Menus;
|
||||
import Common.CommonConstants;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.Menus.StyledPopupMenu;
|
||||
import Common.Visual.Menus.VisualiserMenuItem;
|
||||
import Common.Utils.Utils_;
|
||||
|
||||
import javax.swing.*;
|
||||
public class TableMenu extends StyledPopupMenu {
|
||||
@@ -16,7 +14,7 @@ public class TableMenu extends StyledPopupMenu {
|
||||
owner = owner_in;
|
||||
mcopy = new VisualiserMenuItem("Копировать текст текущей ячейки", "/icons/Editor/Copy.png");
|
||||
//если удалось нажать значит все условия выполнены
|
||||
mcopy.addActionListener(e -> CommonUtils.CopyToClipboard(target.toString()));
|
||||
mcopy.addActionListener(e -> Utils_.CopyToClipboard(target.toString()));
|
||||
add(mcopy);
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
package Common.Visual.Menus;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.Menus.StyledPopupMenu;
|
||||
import Common.Visual.Menus.VisualiserMenuItem;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
@@ -20,7 +18,7 @@ public class TextComboBoxMenu extends StyledPopupMenu {
|
||||
new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
CommonUtils.CopyToClipboard(box.getSelectedItem().toString());
|
||||
Utils_.CopyToClipboard(box.getSelectedItem().toString());
|
||||
}
|
||||
});
|
||||
add(m_copy);
|
||||
@@ -29,7 +27,7 @@ public class TextComboBoxMenu extends StyledPopupMenu {
|
||||
new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
CommonUI.TrySelect(box, CommonUtils.getFromClipboard());
|
||||
UI_.TrySelect(box, Utils_.getFromClipboard());
|
||||
}
|
||||
});
|
||||
add(m_paste);
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package Common.Visual.Menus;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.Menus.StyledPopupMenu;
|
||||
import Common.Visual.Menus.VisualiserMenuItem;
|
||||
import Common.Utils.Utils_;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.text.JTextComponent;
|
||||
@@ -54,7 +52,7 @@ public class TextEditorMenu extends StyledPopupMenu {
|
||||
String[] data = selectedText.split("\n");
|
||||
Vector<String> new_data = new Vector<>();
|
||||
for (String line: data){
|
||||
new_data.add(CommonUtils.strikeThrough(line));
|
||||
new_data.add(Utils_.strikeThrough(line));
|
||||
}
|
||||
editor.replaceSelection(String.join("\n", new_data));
|
||||
}
|
||||
@@ -68,7 +66,7 @@ public class TextEditorMenu extends StyledPopupMenu {
|
||||
String[] data = selectedText.split("\n");
|
||||
Vector<String> new_data = new Vector<>();
|
||||
for (String line: data){
|
||||
new_data.add(CommonUtils.noStrikeThrough(line));
|
||||
new_data.add(Utils_.noStrikeThrough(line));
|
||||
}
|
||||
editor.replaceSelection(String.join("\n", new_data));
|
||||
}
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
package Common.Visual.Menus;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
import javax.swing.*;
|
||||
public class VisualiserMenuItem extends JMenuItem {
|
||||
public VisualiserMenuItem(String text) {
|
||||
super(text, null);
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
}
|
||||
public VisualiserMenuItem(String text, String icon_path) {
|
||||
super(text);
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
if (icon_path != null)
|
||||
setIcon(CommonUtils.getIcon(icon_path));
|
||||
setIcon(Utils_.getIcon(icon_path));
|
||||
}
|
||||
public VisualiserMenuItem(){
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
|
||||
import javax.swing.*;
|
||||
public interface Selectable {
|
||||
@@ -13,11 +13,11 @@ public interface Selectable {
|
||||
default ImageIcon GetSelectionIcon() {
|
||||
return
|
||||
isSelectionEnabled() ?
|
||||
CommonUtils.getIcon("/Common/icons/" + (isSelected() ? "Pick" : "NotPick") + ".png") :
|
||||
Utils_.getIcon("/Common/icons/" + (isSelected() ? "Pick" : "NotPick") + ".png") :
|
||||
GetDisabledIcon();
|
||||
}
|
||||
default ImageIcon GetDisabledIcon() {
|
||||
return CommonUtils.getIcon("/Common/icons/Arrays/Unknown.png");
|
||||
return Utils_.getIcon("/Common/icons/Arrays/Unknown.png");
|
||||
}
|
||||
default void SwitchSelection() {
|
||||
Select(!isSelected());
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.TextField.StyledTextField;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -47,7 +47,7 @@ public class ColumnFilter {
|
||||
//--
|
||||
dataSet.getUi().control.getColumnModel().getColumn(columnIndex).setHeaderRenderer((table, value, isSelected, hasFocus, row, column1) -> new JLabel() {
|
||||
{
|
||||
setIcon(CommonUtils.getIcon("/icons/Filter.png"));
|
||||
setIcon(Utils_.getIcon("/icons/Filter.png"));
|
||||
setForeground(dataSet.getUi().control.getTableHeader().getForeground());
|
||||
setBackground(dataSet.getUi().control.getTableHeader().getBackground());
|
||||
setFont(dataSet.getUi().control.getTableHeader().getFont());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Date;
|
||||
@@ -13,6 +13,6 @@ public class DateRenderer_ extends RendererCell<Date> {
|
||||
@Override
|
||||
public void Display() {
|
||||
if (value != null)
|
||||
setText(value.equals(zero) ? "нет" : CommonUtils.print_date(value));
|
||||
setText(value.equals(zero) ? "нет" : Utils_.print_date(value));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -12,6 +12,6 @@ public class HiddenListRenderer extends RendererCell<Vector<String>> {
|
||||
@Override
|
||||
public void Display() {
|
||||
setText(String.join(";", value));
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreePlain).deriveFont(12.0f));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain).deriveFont(12.0f));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.StatusEnum;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -12,7 +12,7 @@ public class StatusEnumRenderer extends RendererCell<StatusEnum> {
|
||||
public void Display() {
|
||||
if (value != null) {
|
||||
setText(value.getDescription());
|
||||
setFont(CommonUI.getTheme().Fonts.get(value.getFont()));
|
||||
setFont(UI_.getTheme().Fonts.get(value.getFont()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
@@ -7,7 +7,7 @@ import javax.swing.*;
|
||||
//наиболее распространенный случай. переотображение текста и/или изображения в ячейке таблицы.
|
||||
public class StyledCellLabel extends JLabel implements ThemeElement {
|
||||
public StyledCellLabel() {
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setHorizontalAlignment(SwingConstants.LEFT);
|
||||
setVerticalAlignment(SwingConstants.CENTER);
|
||||
setOpaque(true);
|
||||
@@ -15,7 +15,7 @@ public class StyledCellLabel extends JLabel implements ThemeElement {
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackground(CommonUI.getTheme().table_background);
|
||||
setForeground(CommonUI.getTheme().foreground);
|
||||
setBackground(UI_.getTheme().table_background);
|
||||
setForeground(UI_.getTheme().foreground);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Menus.TableMenu;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
@@ -16,9 +16,9 @@ public abstract class StyledTable extends JTable implements ThemeElement {
|
||||
setFillsViewportHeight(true);
|
||||
setAutoCreateRowSorter(dataModel.getRowCount() > 0);
|
||||
Init();
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
JTableHeader header = getTableHeader();
|
||||
header.setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
header.setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
|
||||
setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
//текущий объет может определяться по первому столбцу. могут быть баги если не запретить
|
||||
@@ -77,10 +77,10 @@ public abstract class StyledTable extends JTable implements ThemeElement {
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackground(CommonUI.getTheme().table_background);
|
||||
setForeground(CommonUI.getTheme().foreground);
|
||||
setSelectionBackground(CommonUI.getTheme().selection_background);
|
||||
setSelectionForeground(CommonUI.getTheme().foreground);
|
||||
setBackground(UI_.getTheme().table_background);
|
||||
setForeground(UI_.getTheme().foreground);
|
||||
setSelectionBackground(UI_.getTheme().selection_background);
|
||||
setSelectionForeground(UI_.getTheme().foreground);
|
||||
}
|
||||
public void SelectRow(int r) {
|
||||
getSelectionModel().setSelectionInterval(r, r);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -10,7 +10,7 @@ public class WrapTextRenderer extends JTextArea implements TableCellRenderer {
|
||||
setLineWrap(true);
|
||||
setWrapStyleWord(true);
|
||||
// setOpaque(false);
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Distribution).deriveFont(14.0f));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Distribution).deriveFont(14.0f));
|
||||
}
|
||||
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
|
||||
setBackground(isSelected ? table.getSelectionBackground() : table.getBackground());
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package Common.Visual.Themes;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Visual.VisualiserColor;
|
||||
import org.fife.ui.rsyntaxtextarea.Theme;
|
||||
|
||||
import java.awt.*;
|
||||
import java.awt.font.TextAttribute;
|
||||
@@ -169,7 +168,7 @@ public abstract class VisualiserTheme {
|
||||
table_background = Color.decode(getTableBackgroundHex());
|
||||
createFonts();
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Common.Visual.Trees;
|
||||
import Common.Current_;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.DataControl_OLD;
|
||||
|
||||
import javax.swing.tree.DefaultMutableTreeNode;
|
||||
@@ -25,7 +25,7 @@ public class DataTree extends StyledTree implements DataControl_OLD {
|
||||
try {
|
||||
ShowCurrentObject();
|
||||
} catch (Exception ex) {
|
||||
CommonUtils.MainLog.PrintException(ex);
|
||||
Utils_.MainLog.PrintException(ex);
|
||||
}
|
||||
}
|
||||
public void SelectNodeByCriteria(Object criteria) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Common.Visual.Trees;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import _VisualDVM.ProjectData.SapforData.FileObjectWithMessages;
|
||||
|
||||
@@ -15,11 +15,11 @@ public class GraphTreeCellRenderer extends StyledTreeCellRenderer {
|
||||
Object o = ((DefaultMutableTreeNode) value).getUserObject();
|
||||
if (o instanceof FileObjectWithMessages) {
|
||||
FileObjectWithMessages target = (FileObjectWithMessages) o;
|
||||
setIcon(CommonUtils.getIcon(target.ImageKey()));
|
||||
setFont(CommonUI.getTheme().Fonts.get(target.getFont()));
|
||||
setIcon(Utils_.getIcon(target.ImageKey()));
|
||||
setFont(UI_.getTheme().Fonts.get(target.getFont()));
|
||||
} else {
|
||||
setIcon(null);
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||
}
|
||||
setForeground(tree.getForeground());
|
||||
return this;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Trees;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Selectable;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
@@ -17,7 +17,7 @@ public class SelectionTreeCellRenderer extends StyledTreeCellRenderer {
|
||||
setText(selectable.getSelectionText());
|
||||
setIcon(selectable.GetSelectionIcon());
|
||||
} else {
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreeItalic));
|
||||
setIcon(null);
|
||||
}
|
||||
setForeground(tree.getForeground());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Trees;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import _VisualDVM.Visual.Menus.GraphMenu;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
@@ -22,7 +22,7 @@ public class StyledTree extends JTree implements ThemeElement {
|
||||
super(root_in);
|
||||
root = root_in;
|
||||
setOpaque(true);
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreePlain));
|
||||
setToggleClickCount(0); //отключение сворачивание разворачивания по двойному клику
|
||||
//--
|
||||
if (!getRenderer().equals(TreeRenderers.RendererUndefined))
|
||||
@@ -86,8 +86,8 @@ public class StyledTree extends JTree implements ThemeElement {
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackground(CommonUI.getTheme().trees_background);
|
||||
setForeground(CommonUI.getTheme().foreground);
|
||||
setBackground(UI_.getTheme().trees_background);
|
||||
setForeground(UI_.getTheme().foreground);
|
||||
menu.applyTheme();
|
||||
}
|
||||
protected GraphMenu createMenu() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Trees;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
|
||||
import javax.swing.tree.DefaultTreeCellRenderer;
|
||||
@@ -9,7 +9,7 @@ public class StyledTreeCellRenderer extends DefaultTreeCellRenderer implements T
|
||||
}
|
||||
@Override
|
||||
public void applyTheme() {
|
||||
setBackgroundNonSelectionColor(CommonUI.getTheme().trees_background);
|
||||
setBackgroundSelectionColor(CommonUI.getTheme().selection_background);
|
||||
setBackgroundNonSelectionColor(UI_.getTheme().trees_background);
|
||||
setBackgroundSelectionColor(UI_.getTheme().selection_background);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Trees;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.ControlForm;
|
||||
|
||||
import java.awt.*;
|
||||
@@ -25,6 +25,6 @@ public class TreeForm<C extends StyledTree> extends ControlForm<C> {
|
||||
@Override
|
||||
public void Clear() {
|
||||
super.Clear();
|
||||
CommonUI.Clear(content);
|
||||
UI_.Clear(content);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package Common.Visual;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Themes.DefaultTheme;
|
||||
import Common.Visual.Themes.VisualiserTheme;
|
||||
@@ -11,7 +11,7 @@ import javax.swing.text.DefaultFormatter;
|
||||
import java.awt.*;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Stack;
|
||||
public class CommonUI {
|
||||
public class UI_ {
|
||||
public static boolean active=false; //есть ли интерфейс. в консольных версиях не нужен.
|
||||
public static MenuElement[] last_menu_path; //для меню
|
||||
public static boolean isActive() {
|
||||
@@ -75,7 +75,7 @@ public class CommonUI {
|
||||
}
|
||||
//Примитивные диалоговые элементы
|
||||
public static boolean Question(Component parent, String text) {
|
||||
return !CommonUI.isActive() || (JOptionPane.showConfirmDialog(parent,
|
||||
return !UI_.isActive() || (JOptionPane.showConfirmDialog(parent,
|
||||
text + "?",
|
||||
"Подтверждение",
|
||||
JOptionPane.YES_NO_OPTION,
|
||||
@@ -85,17 +85,17 @@ public class CommonUI {
|
||||
return Question(getFrontWindow(), text);
|
||||
}
|
||||
public static void Info(String message) {
|
||||
CommonUtils.CopyToClipboard(message);
|
||||
if (CommonUI.isActive())
|
||||
Utils_.CopyToClipboard(message);
|
||||
if (UI_.isActive())
|
||||
JOptionPane.showMessageDialog(getFrontWindow(), message, "", 1);
|
||||
}
|
||||
public static void Error(String message) {
|
||||
CommonUtils.CopyToClipboard(message);
|
||||
if (CommonUI.isActive())
|
||||
Utils_.CopyToClipboard(message);
|
||||
if (UI_.isActive())
|
||||
JOptionPane.showMessageDialog(getFrontWindow(), message, "", 0);
|
||||
}
|
||||
public static boolean Warning(String text) {
|
||||
return !CommonUI.isActive() ||
|
||||
return !UI_.isActive() ||
|
||||
JOptionPane.showConfirmDialog(getFrontWindow(),
|
||||
text + "\nВы уверены?",
|
||||
"Подтверждение",
|
||||
@@ -1,6 +1,6 @@
|
||||
package Common.Visual.Windows.Dialog;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
import Common.Utils.TextLog;
|
||||
@@ -35,9 +35,9 @@ public class Dialog<T, F extends DialogFields> extends JDialog implements ThemeE
|
||||
setModal(true);
|
||||
toFront();
|
||||
getContentPane().setLayout(new BorderLayout());
|
||||
lTitle.setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
lTitle.setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
if (!getIconPath().isEmpty()) {
|
||||
setIconImage(CommonUtils.getIcon(getIconPath()).getImage());
|
||||
setIconImage(Utils_.getIcon(getIconPath()).getImage());
|
||||
}
|
||||
//делаем титульную надпись в самом окне чтобы не зависеть от языковой политики ОС
|
||||
getContentPane().add(lTitle, BorderLayout.NORTH);
|
||||
@@ -51,7 +51,7 @@ public class Dialog<T, F extends DialogFields> extends JDialog implements ThemeE
|
||||
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
|
||||
addWindowListener(new WindowAdapter() {
|
||||
public void windowClosing(WindowEvent e) {
|
||||
CommonUI.windowsStack.pop();
|
||||
UI_.windowsStack.pop();
|
||||
onCancel();
|
||||
onClose();
|
||||
}
|
||||
@@ -65,7 +65,7 @@ public class Dialog<T, F extends DialogFields> extends JDialog implements ThemeE
|
||||
content = (fields = f.newInstance()).getContent();
|
||||
//--?
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
}
|
||||
public void onClose() {
|
||||
@@ -117,7 +117,7 @@ public class Dialog<T, F extends DialogFields> extends JDialog implements ThemeE
|
||||
Init(params);
|
||||
ShowTitle();
|
||||
setAlwaysOnTop(isOnTop());
|
||||
CommonUI.windowsStack.push(this);
|
||||
UI_.windowsStack.push(this);
|
||||
setVisible(true);
|
||||
return OK;
|
||||
}
|
||||
@@ -137,7 +137,7 @@ public class Dialog<T, F extends DialogFields> extends JDialog implements ThemeE
|
||||
OK = true;
|
||||
CloseAction();
|
||||
} else
|
||||
CommonUI.Error("Валидация не пройдена:\n" + Log.toString());
|
||||
UI_.Error("Валидация не пройдена:\n" + Log.toString());
|
||||
}
|
||||
protected void onCancel() {
|
||||
CloseAction();
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package Common.Visual.Windows.Dialog;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class DialogTextComboBox extends JComboBox<String> implements DialogFields {
|
||||
public DialogTextComboBox() {
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.Menu));
|
||||
setEditable(false);
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Windows.Dialog;
|
||||
import Common.Visual.CommonUI;
|
||||
import Common.Visual.UI_;
|
||||
import Common.Visual.Fonts.VisualiserFonts;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -8,7 +8,7 @@ public class DialogWrapText extends JTextPane implements DialogFields {
|
||||
public DialogWrapText(){
|
||||
setOpaque(true);
|
||||
setBackground(Color.WHITE);
|
||||
setFont(CommonUI.getTheme().Fonts.get(VisualiserFonts.TreeBold));
|
||||
setFont(UI_.getTheme().Fonts.get(VisualiserFonts.TreeBold));
|
||||
setEditable(false);
|
||||
}
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Windows.Dialog;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.filechooser.FileFilter;
|
||||
@@ -9,7 +9,7 @@ public class VDirectoryChooser extends VFileChooser_ {
|
||||
super(title, new FileFilter() {
|
||||
@Override
|
||||
public boolean accept(File f) {
|
||||
return !CommonUtils.ContainsCyrillic(f.getAbsolutePath());
|
||||
return !Utils_.ContainsCyrillic(f.getAbsolutePath());
|
||||
}
|
||||
@Override
|
||||
public String getDescription() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Windows.Dialog;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.filechooser.FileFilter;
|
||||
@@ -20,7 +20,7 @@ public class VFileChooser extends VFileChooser_ {
|
||||
fileChooser.setFileFilter(new FileFilter() {
|
||||
@Override
|
||||
public boolean accept(File f) {
|
||||
return !CommonUtils.ContainsCyrillic(f.getName())
|
||||
return !Utils_.ContainsCyrillic(f.getName())
|
||||
&& (f.isDirectory() || acceptExtensions(f));
|
||||
}
|
||||
@Override
|
||||
@@ -36,7 +36,7 @@ public class VFileChooser extends VFileChooser_ {
|
||||
}
|
||||
public boolean acceptExtensions(File file) {
|
||||
if (Extensions.isEmpty()) return true;
|
||||
String file_ext = CommonUtils.getExtension(file);
|
||||
String file_ext = Utils_.getExtension(file);
|
||||
for (String ext : Extensions)
|
||||
if (ext.equalsIgnoreCase(file_ext)) return true;
|
||||
return false;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package Common.Visual.Windows;
|
||||
import Common.Utils.CommonUtils;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.Themes.ThemeElement;
|
||||
import Common.Database.Objects.DBForm.DBForm;
|
||||
|
||||
@@ -10,9 +10,9 @@ import java.awt.event.WindowEvent;
|
||||
public abstract class Form extends JFrame implements ThemeElement {
|
||||
private DBForm dbInfo = null;
|
||||
public Form() {
|
||||
if (getIconPath()!=null) setIconImage(CommonUtils.getIcon(getIconPath()).getImage());
|
||||
if (getIconPath()!=null) setIconImage(Utils_.getIcon(getIconPath()).getImage());
|
||||
SetListener();
|
||||
this.setTitle(CommonUtils.isWindows() ? getWTitleText() : getUTitleText());
|
||||
this.setTitle(Utils_.isWindows() ? getWTitleText() : getUTitleText());
|
||||
pack();
|
||||
setMinimumSize(new Dimension(getDefaultWidth(), getDefaultHeight()));
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public abstract class Form extends JFrame implements ThemeElement {
|
||||
try {
|
||||
LoadWindowParameters();
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
setContentPane(getMainPanel());
|
||||
setVisible(true);
|
||||
@@ -63,7 +63,7 @@ public abstract class Form extends JFrame implements ThemeElement {
|
||||
try {
|
||||
SaveWindowParameters();
|
||||
} catch (Exception e) {
|
||||
CommonUtils.MainLog.PrintException(e);
|
||||
Utils_.MainLog.PrintException(e);
|
||||
}
|
||||
setVisible(false);
|
||||
dispose();
|
||||
@@ -73,8 +73,8 @@ public abstract class Form extends JFrame implements ThemeElement {
|
||||
}
|
||||
public void LoadWindowParameters() throws Exception {
|
||||
if (getFormKey()!=null)
|
||||
if (CommonUtils.db.forms.Data.containsKey(getFormKey())) {
|
||||
dbInfo = CommonUtils.db.forms.Data.get(getFormKey());
|
||||
if (Utils_.db.forms.Data.containsKey(getFormKey())) {
|
||||
dbInfo = Utils_.db.forms.Data.get(getFormKey());
|
||||
dbInfo.Apply(this);
|
||||
return;
|
||||
}
|
||||
@@ -85,9 +85,9 @@ public abstract class Form extends JFrame implements ThemeElement {
|
||||
if (getFormKey()!=null) {
|
||||
if (dbInfo != null) {
|
||||
dbInfo.Init(this);
|
||||
CommonUtils.db.Update(dbInfo);
|
||||
Utils_.db.Update(dbInfo);
|
||||
} else
|
||||
CommonUtils.db.Insert(new DBForm(getFormKey(), this));
|
||||
Utils_.db.Insert(new DBForm(getFormKey(), this));
|
||||
}
|
||||
}
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user