вывод диалоговых форм для объектов в отдельный класс
This commit is contained in:
@@ -13,6 +13,7 @@ import Common.Visual.Menus.DataMenuBar;
|
||||
import Common.Visual.Menus.TableMenu;
|
||||
import Common.Visual.Tables.*;
|
||||
import Common.Visual.Tables.Grid.GridAnchestor;
|
||||
import Common.Visual.Windows.Dialog.DBObjectDialog;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.table.TableColumn;
|
||||
@@ -33,10 +34,7 @@ public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTabl
|
||||
protected boolean events_on = true;
|
||||
protected String colNamesAndSizes = "";
|
||||
protected Vector<ColumnInfo> columns = new Vector<>(); //информация о столбцах и их оформлении
|
||||
//-
|
||||
protected Vector<DBObjectFilter_<D>> allFilters = new Vector<>();
|
||||
//---
|
||||
//фильтры и подсчеты. todo слить с баром (?)
|
||||
MatchesCounter counter_ui = null;
|
||||
//--
|
||||
Object savedCurrentKey = null;
|
||||
@@ -505,4 +503,30 @@ public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTabl
|
||||
}
|
||||
return res;
|
||||
}
|
||||
@SuppressWarnings("unchecked")
|
||||
public DBObjectDialog getDialog() {
|
||||
return null;
|
||||
}
|
||||
public boolean ShowAddObjectDialog(D object) {
|
||||
return getDialog().ShowDialog(getSingleDescription() + ": добавление", object);
|
||||
}
|
||||
//todo встроить развилку на возможность редактирования объекты boolean isObjectEditable(D object){return true;}
|
||||
public boolean ShowEditObjectDialog(D object) {
|
||||
DBObjectDialog dialog = getDialog();
|
||||
dialog.edit = true;
|
||||
dialog.SetEditLimits();
|
||||
return dialog.ShowDialog(getSingleDescription() + ": редактирование", object);
|
||||
}
|
||||
public boolean ViewObject(D object) {
|
||||
DBObjectDialog dialog = getDialog();
|
||||
dialog.SetReadonly();
|
||||
dialog.ShowDialog(getSingleDescription() + ": просмотр", object);
|
||||
return false;
|
||||
}
|
||||
public boolean ShowDeleteObjectDialog(D object) {
|
||||
return UI.Warning(getSingleDescription() + " " + object.getBDialogName() + " будет удален(а)");
|
||||
}
|
||||
public boolean ShowDeleteObjectsDialog(int toDeleteCount) {
|
||||
return UI.Warning(getPluralDescription() + " в количестве " + toDeleteCount + " будут удалены)");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user