@Override public void transferWidget(DashboardColumn fromColumn, DashboardColumn toColumn, String widgetId, int index) { fromColumn.removeWidget(widgetId); toColumn.addWidget(index, widgetId); } }
if (model != null) { for (DashboardColumn column : model.getColumns()) { String columnStyle = column.getStyle(); String columnStyleClass = column.getStyleClass(); columnStyleClass = (columnStyleClass == null) ? Dashboard.COLUMN_CLASS : Dashboard.COLUMN_CLASS + " " + columnStyleClass; for (String widgetId : column.getWidgets()) { Panel widget = findWidget(widgetId, dashboard);
protected void updateDashboardModel(DashboardModel model, String widgetId, Integer itemIndex, Integer receiverColumnIndex, Integer senderColumnIndex) { if (senderColumnIndex == null) { //Reorder widget in same column DashboardColumn column = model.getColumn(receiverColumnIndex); column.reorderWidget(itemIndex, widgetId); } else { //Transfer widget DashboardColumn oldColumn = model.getColumn(senderColumnIndex); DashboardColumn newColumn = model.getColumn(receiverColumnIndex); model.transferWidget(oldColumn, newColumn, widgetId, itemIndex); } }
if (model != null) { for (DashboardColumn column : model.getColumns()) { String columnStyle = column.getStyle(); String columnStyleClass = column.getStyleClass(); columnStyleClass = (columnStyleClass == null) ? Dashboard.COLUMN_CLASS : Dashboard.COLUMN_CLASS + " " + columnStyleClass; for (String widgetId : column.getWidgets()) { Panel widget = findWidget(widgetId, dashboard);
protected void updateDashboardModel(DashboardModel model, String widgetId, Integer itemIndex, Integer receiverColumnIndex, Integer senderColumnIndex) { if(senderColumnIndex == null) { //Reorder widget in same column DashboardColumn column = model.getColumn(receiverColumnIndex); column.reorderWidget(itemIndex, widgetId); } else { //Transfer widget DashboardColumn oldColumn = model.getColumn(senderColumnIndex); DashboardColumn newColumn = model.getColumn(receiverColumnIndex); model.transferWidget(oldColumn, newColumn, widgetId, itemIndex); } }
public void transferWidget(DashboardColumn fromColumn, DashboardColumn toColumn, String widgetId, int index) { fromColumn.removeWidget(widgetId); toColumn.addWidget(index, widgetId); } }