no message
This commit is contained in:
@@ -70,13 +70,14 @@ public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTabl
|
||||
public ColumnInfo getColumnInfo(int i) {
|
||||
return columns.get(i);
|
||||
}
|
||||
//--
|
||||
protected String[] getUIColumnNames() {
|
||||
return new String[]{};
|
||||
}
|
||||
//---------для отображения.
|
||||
protected Object getFieldAt(D object, int coulmnIndex) {
|
||||
public Object getFieldAt(D object, int coulmnIndex) {
|
||||
return null;
|
||||
}
|
||||
//-
|
||||
public void SaveColumns() {
|
||||
if (MainModule_.instance.getDb() != null) {
|
||||
try {
|
||||
@@ -326,16 +327,23 @@ public class DataSetControlForm<D extends DBObject> extends ControlForm<DataTabl
|
||||
}
|
||||
protected void createFilters() {
|
||||
}
|
||||
protected boolean applyFiltersMenus(DBObject object) {
|
||||
protected boolean applyFiltersMenus(D object) {
|
||||
for (DataSetFiltersMenu filterMenu : filtersMenus) {
|
||||
if (!filterMenu.Validate(object))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public boolean ApplyFilters(DBObject object) {
|
||||
protected boolean applyHeadersFilters(D object){
|
||||
for (HeaderTextFilter headerTextFilter: headersTextFilters.values()){
|
||||
if (!headerTextFilter.Validate(object))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
public boolean ApplyFilters(D object) {
|
||||
//могут быть и другие фильтры ( например свои/активные). перенести их сюда и обобщить
|
||||
return applyFiltersMenus(object);
|
||||
return applyFiltersMenus(object)&&applyHeadersFilters(object);
|
||||
}
|
||||
@Override
|
||||
protected void redrawControl() {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package Common.Visual.Tables;
|
||||
import Common.CommonConstants;
|
||||
import Common.Database.Objects.DBObject;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Utils.Utils_;
|
||||
import Common.Visual.TextField.StyledTextField;
|
||||
@@ -98,11 +99,13 @@ public class HeaderTextFilter {
|
||||
});
|
||||
}
|
||||
public String getFilterValue() {
|
||||
// System.out.println("get filter value ="+Utils_.Brackets(filterValue));
|
||||
return filterValue;
|
||||
}
|
||||
public void setFilterValue(String filterValue_in) {
|
||||
this.filterValue = filterValue_in;
|
||||
System.out.println("set filter value =" + Utils_.Brackets(filterValue));
|
||||
}
|
||||
public boolean Validate(DBObject object){
|
||||
Object field = dataSet.getUI().getFieldAt(object, columnIndex);
|
||||
return (field instanceof String)&& field.toString().contains(filterValue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
package _VisualDVM.ProjectData.Messages;
|
||||
import Common.Database.Tables.DataSet;
|
||||
import Common.Visual.DataSetControlForm;
|
||||
import Common.Visual.Tables.HeaderTextFilter;
|
||||
import Common.Visual.Tables.RendererWrapText;
|
||||
import _VisualDVM.Current;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.ProjectData.SapforData.FileObjectWithMessages;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.util.Comparator;
|
||||
@@ -45,13 +48,10 @@ public class MessagesControlForm extends DataSetControlForm<Message> {
|
||||
public void MouseAction2() throws Exception {
|
||||
ShowCurrentObject();
|
||||
}
|
||||
/*
|
||||
@Override
|
||||
protected void createFilters() {
|
||||
super.createFilters();
|
||||
headersTextFilters.put(3, new HeaderTextFilter(dataSource, 3));
|
||||
}
|
||||
*/
|
||||
@Override
|
||||
protected void createFilters() {
|
||||
headersTextFilters.put(3, new HeaderTextFilter(dataSource, 3));
|
||||
}
|
||||
@Override
|
||||
protected Comparator<Message> getDefaultComparator() {
|
||||
return Comparator.comparingInt(o -> o.line);
|
||||
@@ -62,13 +62,12 @@ public class MessagesControlForm extends DataSetControlForm<Message> {
|
||||
}
|
||||
@Override
|
||||
public boolean isObjectVisible(Message object) {
|
||||
return super.isObjectVisible(object);
|
||||
if (super.isObjectVisible(object)){
|
||||
if (Global.mainModule.HasFile() && Global.mainModule.getFile().name.equals(object.file)) {
|
||||
Object o = Global.mainModule.get(Current.FileGraphElement);
|
||||
return !(o instanceof FileObjectWithMessages) || ((FileObjectWithMessages) o).HasMessage(object);
|
||||
} else return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/*
|
||||
if (Global.mainModule.HasFile() && Global.mainModule.getFile().name.equals(file)) {
|
||||
Object o = Global.mainModule.get(Current.FileGraphElement);
|
||||
return !(o instanceof FileObjectWithMessages) || ((FileObjectWithMessages) o).HasMessage(this);
|
||||
} else return false;
|
||||
*/
|
||||
}
|
||||
|
||||
@@ -21,24 +21,4 @@ public class WarningsDBTable extends MessagesDBTable<MessageWarning> {
|
||||
public Current CurrentName() {
|
||||
return Current.Warnings;
|
||||
}
|
||||
@Override
|
||||
protected DataSetControlForm createUI(JPanel mountPanel) {
|
||||
return new MessagesControlForm(this, mountPanel) {
|
||||
@Override
|
||||
protected void createFilters() {
|
||||
super.createFilters();
|
||||
headersTextFilters.put(3, new HeaderTextFilter(dataSource, 3));
|
||||
}
|
||||
@Override
|
||||
public boolean ApplyFilters(DBObject object) {
|
||||
if (super.ApplyFilters(object)) {
|
||||
System.out.println("apply warnings tet filter for message " + object.getPK());
|
||||
Message message = (MessageWarning) object;
|
||||
return message.value.contains(headersTextFilters.get(3).getFilterValue());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
;
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user