protected void showPivotTable(ShowPivotMode mode) { ParamsMap paramsMap = ParamsMap.of(); if (mode == ALL_ROWS) { paramsMap.pair("dataItems", convertEntitiesToDataItems(target.getDatasource().getItems())); } else { paramsMap.pair("dataItems", convertEntitiesToDataItems(target.getSelected())); } paramsMap.pair("properties", getPropertiesWithLocale()); paramsMap.pair("nativeJson", nativeJson); WindowManager wm = target.getFrame().getWindowManager(); WindowConfig windowConfig = AppBeans.get(WindowConfig.NAME); wm.openWindow(windowConfig.getWindowInfo(SCREEN_ID), WindowManager.OpenType.NEW_TAB, paramsMap.create()); }
@Override public void actionPerform(Component component) { if (beforeActionPerformedHandler != null) { if (!beforeActionPerformedHandler.beforeActionPerformed()) return; } Messages messages = AppBeans.get(Messages.NAME); if (target.getSelected().isEmpty() || target.getDatasource().size() <= 1) { showPivotTable(ALL_ROWS); } else { Action[] actions = new Action[]{ new BaseAction("actions.showPivotAction.SELECTED_ROWS") .withCaption(messages.getMainMessage("actions.showPivotAction.SELECTED_ROWS")) .withHandler(event -> showPivotTable(SELECTED_ROWS)), new BaseAction("actions.showPivotAction.ALL_ROWS") .withCaption(messages.getMainMessage("actions.showPivotAction.ALL_ROWS")) .withHandler(event -> showPivotTable(ALL_ROWS)), new DialogAction(DialogAction.Type.CANCEL) }; WindowManager wm = target.getFrame().getWindowManager(); wm.showOptionDialog( messages.getMainMessage("actions.showPivotAction.dialogTitle"), messages.getMainMessage("actions.showPivotAction.dialogMessage"), Frame.MessageType.CONFIRMATION, actions); } }
UserSessionSource userSessionSource = getBeanLocator().get(UserSessionSource.NAME); getFrame().getWindowManager().showNotification( messages.getMainMessage("entityLocked.msg"), String.format(messages.getMainMessage("entityLocked.desc"),