Repair Table ColumnCollapseListener #PL-5097

This commit is contained in:
Gleb Gorelov 2015-04-10 13:24:20 +00:00
parent b76654dc77
commit da4d461bd9
4 changed files with 12 additions and 12 deletions

View File

@ -517,7 +517,7 @@ public abstract class WebAbstractTable<T extends com.vaadin.ui.Table & CubaEnhan
}); });
// vaadin7 // vaadin7
component.addColumnCollapseListener(new CubaEnhancedTable.CollapseListener() { component.addColumnCollapseListener(new CubaEnhancedTable.ColumnCollapseListener() {
@Override @Override
public void columnCollapsed(Object columnId, boolean collapsed) { public void columnCollapsed(Object columnId, boolean collapsed) {
final Column collapsedColumn = getColumn(columnId.toString()); final Column collapsedColumn = getColumn(columnId.toString());

View File

@ -52,11 +52,11 @@ public interface CubaEnhancedTable extends AggregationContainer {
boolean isShowTotalAggregation(); boolean isShowTotalAggregation();
void setShowTotalAggregation(boolean showTotalAggregation); void setShowTotalAggregation(boolean showTotalAggregation);
void addColumnCollapseListener(CollapseListener listener); void addColumnCollapseListener(ColumnCollapseListener listener);
void removeColumnCollapseListener(CollapseListener listener); void removeColumnCollapseListener(ColumnCollapseListener listener);
interface CollapseListener { interface ColumnCollapseListener {
void columnCollapsed(Object columnId, boolean collapsed); void columnCollapsed(Object columnId, boolean collapsed);
} }
} }

View File

@ -46,7 +46,7 @@ public class CubaTable extends com.vaadin.ui.Table implements TableContainer, Cu
protected boolean aggregatable = false; protected boolean aggregatable = false;
protected List<CollapseListener> columnCollapseListeners = new ArrayList<>(); protected List<ColumnCollapseListener> columnCollapseListeners = new ArrayList<>();
@Override @Override
protected CubaTableState getState() { protected CubaTableState getState() {
@ -265,18 +265,18 @@ public class CubaTable extends com.vaadin.ui.Table implements TableContainer, Cu
} }
} }
public void addColumnCollapseListener(CollapseListener listener) { public void addColumnCollapseListener(ColumnCollapseListener listener) {
columnCollapseListeners.add(listener); columnCollapseListeners.add(listener);
} }
public void removeColumnCollapseListener(CollapseListener listener) { public void removeColumnCollapseListener(ColumnCollapseListener listener) {
columnCollapseListeners.remove(listener); columnCollapseListeners.remove(listener);
} }
@Override @Override
public void setColumnCollapsed(Object propertyId, boolean collapsed) throws IllegalStateException { public void setColumnCollapsed(Object propertyId, boolean collapsed) throws IllegalStateException {
if (isColumnCollapsed(propertyId) != collapsed) { if (isColumnCollapsed(propertyId) != collapsed) {
for (CollapseListener listener : columnCollapseListeners) { for (ColumnCollapseListener listener : columnCollapseListeners) {
listener.columnCollapsed(propertyId, collapsed); listener.columnCollapsed(propertyId, collapsed);
} }
} }

View File

@ -50,7 +50,7 @@ public class CubaTreeTable extends com.vaadin.ui.TreeTable implements TreeTableC
protected boolean aggregatable = false; protected boolean aggregatable = false;
protected List<CollapseListener> columnCollapseListeners = new ArrayList<>(); protected List<ColumnCollapseListener> columnCollapseListeners = new ArrayList<>();
@Override @Override
protected CubaTreeTableState getState() { protected CubaTreeTableState getState() {
@ -209,18 +209,18 @@ public class CubaTreeTable extends com.vaadin.ui.TreeTable implements TreeTableC
} }
} }
public void addColumnCollapseListener(CollapseListener listener) { public void addColumnCollapseListener(ColumnCollapseListener listener) {
columnCollapseListeners.add(listener); columnCollapseListeners.add(listener);
} }
public void removeColumnCollapseListener(CollapseListener listener) { public void removeColumnCollapseListener(ColumnCollapseListener listener) {
columnCollapseListeners.remove(listener); columnCollapseListeners.remove(listener);
} }
@Override @Override
public void setColumnCollapsed(Object propertyId, boolean collapsed) throws IllegalStateException { public void setColumnCollapsed(Object propertyId, boolean collapsed) throws IllegalStateException {
if (isColumnCollapsed(propertyId) != collapsed) { if (isColumnCollapsed(propertyId) != collapsed) {
for (CollapseListener listener : columnCollapseListeners) { for (ColumnCollapseListener listener : columnCollapseListeners) {
listener.columnCollapsed(propertyId, collapsed); listener.columnCollapsed(propertyId, collapsed);
} }
} }