@Listen("onAfterSheetOrderChange = #ss") public void onSheetOrderChange(SheetEvent event) { StringBuilder info = new StringBuilder(); Sheet sheet = event.getSheet(); info.append("Reorder sheet : ") .append(event.getSheetName()) .append(" to ") .append(sheet.getBook().getSheetIndex(sheet)); if (isShowEventInfo(event.getName())) { addInfo(info.toString()); } }
@Override protected boolean isSheetProtected() { try { return _destSheet.isProtected(); } catch (Exception x) { } return true; }
@Override public void doAction() { if (isSheetProtected()) return; // keep old style/data of src and dest int srcRow = getReservedSrcRow(); int srcColumn = getReservedSrcColumn(); int srcLastRow = getReservedSrcLastRow(); int srcLastColumn = getReservedSrcLastColumn(); Sheet srcSheet = getReservedSrcSheet(); int destRow = getReservedDestRow(); int destColumn = getReservedDestColumn(); int destLastRow = getReservedDestLastRow(); int destLastColumn = getReservedDestLastColumn(); Sheet destSheet = getReservedDestSheet(); _srcOldReserve = ReserveUtil.reserve( srcSheet.getInternalSheet(), srcRow, srcColumn, srcLastRow, srcLastColumn, _reserveType); _destOldReserve = ReserveUtil.reserve( destSheet.getInternalSheet(), destRow, destColumn, destLastRow, destLastColumn, _reserveType); applyAction(); }