@Override public ITableRow getSelectedRow() { return CollectionUtility.firstElement(m_selectedRows); }
@Override public Resource<RI> getSelectedResource() { return CollectionUtility.firstElement(m_selectedResources); }
public ITreeNode getNode() { return CollectionUtility.firstElement(m_nodes); }
public IColumn getFirstColumn() { return CollectionUtility.firstElement(m_columns); }
/** * Convenience to add row by data only */ @Override public ITableRow addRowByArray(Object dataArray) { if (dataArray == null) { return null; } List<ITableRow> result = addRowsByMatrix(new Object[]{dataArray}); return CollectionUtility.firstElement(result); }
@Override public List<BookmarkChangedClientNotification> coalesce(List<BookmarkChangedClientNotification> notifications) { // reduce to one return CollectionUtility.arrayList(CollectionUtility.firstElement(notifications)); }
@Override public KEY getSingleValue() { return CollectionUtility.firstElement(super.getValue()); }
@Override public <F extends IForm, H extends IFormHandler> F findOpenView(Class<? extends F> formClass, Class<? extends H> handlerClass, Object exclusiveKey) { return CollectionUtility.firstElement(findAllOpenViews(formClass, handlerClass, exclusiveKey)); }
@Override public T getSingleValue() { return CollectionUtility.firstElement(super.getValue()); }
public <T extends IAction> T findAction(List<? extends IAction> actionTree, Class<T> searchType) { List<T> filteredActions = findActions(actionTree, searchType, true, true); return CollectionUtility.firstElement(filteredActions); }
@Override public ITreeNode findNode(Object primaryKey) { Collection<ITreeNode> a = findNodes(CollectionUtility.hashSet(primaryKey)); if (a != null && !a.isEmpty()) { return CollectionUtility.firstElement(a); } else { return null; } }
@Override public ITableRow addRow(ITableRow newRow, boolean markAsInserted) { List<ITableRow> addedRows = addRows(CollectionUtility.arrayList(newRow), markAsInserted); return CollectionUtility.firstElement(addedRows); }
protected IFormField getTreeBoxFilterBoxModel() { List<IFormField> childFields = getModel().getFields(); if (CollectionUtility.hasElements(childFields)) { return CollectionUtility.firstElement(childFields); } return null; } }
@Override public void consumeBinaryResource(List<BinaryResource> binaryResources, Map<String, String> uploadProperties) { if (!CollectionUtility.isEmpty(binaryResources)) { getModel().setValue(CollectionUtility.firstElement(binaryResources)); } }
@SuppressWarnings("unchecked") protected T createAccordion() { List<IAccordion> contributedFields = m_contributionHolder.getContributionsByClass(IAccordion.class); IAccordion result = CollectionUtility.firstElement(contributedFields); if (result != null) { return (T) result; } Class<? extends IAccordion> configuredAccordion = getConfiguredAccordion(); if (configuredAccordion != null) { return (T) ConfigurationUtility.newInnerInstance(this, configuredAccordion); } return null; }
protected IWidget createBody() { List<IWidget> contributedFields = m_contributionHolder.getContributionsByClass(IWidget.class); IWidget result = CollectionUtility.firstElement(contributedFields); if (result != null) { return result; } Class<? extends IWidget> configuredBody = getConfiguredBody(); if (configuredBody != null) { return ConfigurationUtility.newInnerInstance(this, configuredBody); } return null; }
@SuppressWarnings("unchecked") protected T createTileGrid() { List<ITileGrid> contributedFields = m_contributionHolder.getContributionsByClass(ITileGrid.class); ITileGrid result = CollectionUtility.firstElement(contributedFields); if (result != null) { return (T) result; } Class<? extends ITileGrid> configuredTileGrid = getConfiguredTileGrid(); if (configuredTileGrid != null) { return (T) ConfigurationUtility.newInnerInstance(this, configuredTileGrid); } return null; }
@SuppressWarnings("unchecked") protected T createTable() { List<ITable> contributedFields = m_contributionHolder.getContributionsByClass(ITable.class); ITable result = CollectionUtility.firstElement(contributedFields); if (result != null) { return (T) result; } Class<? extends ITable> configuredTable = getConfiguredTable(); if (configuredTable != null) { return (T) ConfigurationUtility.newInnerInstance(this, configuredTable); } return null; }
@Override public void consumeBinaryResource(List<BinaryResource> binaryResources, Map<String, String> uploadProperties) { if (!CollectionUtility.isEmpty(binaryResources)) { getModel().setValue(CollectionUtility.firstElement(binaryResources)); } }
protected void handleModelRequestFocusInCell(TableEvent event) { final ITableRow row = CollectionUtility.firstElement(event.getRows()); if (row == null || !isRowAccepted(row)) { return; } JSONObject jsonEvent = new JSONObject(); putProperty(jsonEvent, PROP_ROW_ID, getOrCreateRowId(row)); putProperty(jsonEvent, PROP_COLUMN_ID, getColumnId(CollectionUtility.firstElement(event.getColumns()))); addActionEvent(EVENT_REQUEST_FOCUS_IN_CELL, jsonEvent).protect(); }