@Override public void closeTab(String key) { final Component tab = keyMapper.get(key); if (tab != null) { closeHandler.onTabClose(TabSheet.this, tab); } } }
public void handleActions(Map<String, Object> variables, Container sender) { if (variables.containsKey("action") && actionMapper != null) { final String key = (String) variables.get("action"); final Action action = actionMapper.get(key); final Object target = variables.get("actiontarget"); if (action != null) { handleAction(action, sender, target); } } }
@Override public void setSelected(String key) { setSelectedTab(keyMapper.get(key), true); }
@Override public Object getItemByRowKey(String rowKey) { return itemIdMapper.get(rowKey); }
/** * Used internally by the {@link Grid} to get a property id by referencing * the columns generated state id. * * @param columnId * The state id of the column * @return The column instance or null if not found */ Object getPropertyIdByColumnId(String columnId) { return columnKeys.get(columnId); }
@Override public void onClick(String columnKey, String rowKey) { Object columnId = _columnIdMap().get(columnKey); Object itemId = itemIdMapper.get(rowKey); if (cellClickListeners != null) { CellClickListener cellClickListener = cellClickListeners.get(columnId); if (cellClickListener != null) { cellClickListener.onClick(itemId, columnId); } } }
@Override public void contextClick(String rowKey, MouseEventDetails details) { fireEvent(new TreeContextClickEvent(Tree.this, itemIdMapper.get(rowKey), details)); } });
@Override public View getSubAppViewContainer(final String instanceId) { return new ViewAdapter(mapper.get(instanceId)); }
@Override public void performContextMenuAction(String actionKey) { if (contextActionMapper != null) { Action action = contextActionMapper.get(actionKey); Action.Handler[] handlers = contextActionHandlers.toArray(new Action.Handler[0]); for (Action.Handler handler : handlers) { handler.handleAction(action, this, CubaWindow.this); } // forget all painted actions after perform one contextActionMapper = null; } }
protected TableTransferable(Map<String, Object> rawVariables) { super(Table.this, rawVariables); Object object = rawVariables.get("itemId"); if (object != null) { setData("itemId", itemIdMapper.get((String) object)); } object = rawVariables.get("propertyId"); if (object != null) { setData("propertyId", columnIdMap.get((String) object)); } }
@Override public void actionOnEvent(String actionKey, String startDate, String endDate, int eventIndex) { Action action = actionMapper.get(actionKey); SimpleDateFormat formatter = new SimpleDateFormat( DateConstants.ACTION_DATE_FORMAT_PATTERN); formatter.setTimeZone(getTimeZone()); for (Action.Handler ah : actionHandlers) { ah.handleAction(action, Calendar.this, events.get(eventIndex)); } } }
@Override public void onAggregationTotalInputChange(String columnKey, String value, boolean isFocused) { if (aggregationDistributionProvider != null) { Object columnId = _columnIdMap().get(columnKey); focusTotalAggregationInputColumnKey = isFocused ? columnKey : null; AggregationInputValueChangeContext event = new AggregationInputValueChangeContext(columnId, value, true); if (!aggregationDistributionProvider.apply(event)) { markAsDirty(); } } }
@Override public void onAggregationTotalInputChange(String columnKey, String value, boolean isFocused) { if (aggregationDistributionProvider != null) { Object columnId = _columnIdMap().get(columnKey); focusTotalAggregationInputColumnKey = isFocused ? columnKey : null; AggregationInputValueChangeContext event = new AggregationInputValueChangeContext(columnId, value, true); if (!aggregationDistributionProvider.apply(event)) { markAsDirty(); } } }
@Override public Transferable getTransferable(Map<String, Object> payload) { TreeTransferable transferable = new TreeTransferable(this, payload); // updating drag source variables Object object = payload.get("itemId"); if (object != null) { transferable.setData("itemId", itemIdMapper.get((String) object)); } return transferable; }
@Override public void selectSuggestion(String suggestionId) { T suggestion = keyMapper.get(suggestionId); setValue(suggestion); updateTextPresentation(getValue()); }
@Override public void contextClick(int rowIndex, String rowKey, String columnId, Section section, MouseEventDetails details) { Object itemId = null; if (rowKey != null) { itemId = getKeyMapper().get(rowKey); } fireEvent(new GridContextClickEvent(Grid.this, details, section, rowIndex, itemId, getPropertyIdByColumnId(columnId))); }
@Override public void itemClick(String rowKey, String columnId, MouseEventDetails details) { Object itemId = getKeyMapper().get(rowKey); Item item = datasource.getItem(itemId); Object propertyId = getPropertyIdByColumnId(columnId); fireEvent(new ItemClickEvent(Grid.this, item, itemId, propertyId, details)); }
@Override public void dropRows(JsonArray rowKeys) { for (int i = 0; i < rowKeys.length(); ++i) { activeItemHandler.dropActiveItem( getKeyMapper().get(rowKeys.getString(i))); } } });
void handleAction(String action) { handleAction(getMapper().get(nameToKey.get(action)), null, null); }