@Override protected List<ILookupRow<Integer>> execCreateLookupRows() { if (m_lookupRows != null) { return m_lookupRows; } else { return CollectionUtility.emptyArrayList(); } }
@Override public List<? extends IWidget> getChildren() { return CollectionUtility.emptyArrayList(); // by default a widget has no children }
@Override public List<Object> getParentRowKeys(ITableRow row) { if (row != null) { return row.getParentKeyValues(); } return CollectionUtility.emptyArrayList(); }
public List<IColumn<?>> resolveColumns(Collection<? extends IColumn> columns) { if (columns != null) { List<IColumn<?>> result = new ArrayList<>(columns.size()); for (IColumn col : columns) { IColumn resolvedCol = resolveColumn(col); if (resolvedCol != null) { result.add(resolvedCol); } } return result; } return CollectionUtility.emptyArrayList(); }
@Override public List<ITableRow> getRows(int[] rowIndexes) { if (rowIndexes == null) { return CollectionUtility.emptyArrayList(); } List<ITableRow> result = new ArrayList<>(rowIndexes.length); for (int rowIndex : rowIndexes) { ITableRow row = getRow(rowIndex); if (row != null) { result.add(row); } } return result; }
@Override public List<Object> getRowKeys(ITableRow row) { if (row != null) { return row.getKeyValues(); } return CollectionUtility.emptyArrayList(); }
public void setAttribute(IDataModelAttribute attribute) { if (m_attribute != attribute) { m_attribute = attribute; try { updateLookupRows(); } catch (Exception t) { // NOSONAR LOG.error("Failed updating aggregation lookup rows for attribute {}", attribute); m_lookupRows = CollectionUtility.emptyArrayList(); } } }
@Override public List<IRadioButton<T>> getButtons() { if (m_radioButtons == null) { return CollectionUtility.emptyArrayList(); } return CollectionUtility.arrayList(m_radioButtons); }
@Override public List<ITableRow> resolveRows(Collection<? extends ITableRow> rows) { if (rows == null) { rows = CollectionUtility.emptyArrayList(); } List<ITableRow> resolvedRows = new ArrayList<>(rows.size()); for (ITableRow row : rows) { if (resolveRow(row) == row) { resolvedRows.add(row); } else { LOG.warn("could not resolve row {}", row); } } return resolvedRows; }
public static <T extends IAction> List<T> getActions(List<T> actions, final Predicate<IAction> filter) { if (actions != null) { List<T> result = new ArrayList<>(actions.size()); for (T a : actions) { if (a.isSeparator()) { result.add(a); } else if (filter.test(a)) { result.add(a); } } return result; } return CollectionUtility.emptyArrayList(); }
@Override public <FORM extends IForm> List<FORM> findForms(final Class<FORM> formType) { if (formType == null) { return CollectionUtility.emptyArrayList(); } final List<FORM> forms = new ArrayList<>(); for (final IForm candidate : m_formStore.values()) { if (formType.isAssignableFrom(candidate.getClass())) { @SuppressWarnings("unchecked") FORM form = (FORM) candidate; forms.add(form); } } return forms; }
public List<IWizardStep<? extends IForm>> getExpectedFuture() { int index = getStepIndex(getActiveStep()); if (!m_stepList.isEmpty() && index < m_stepList.size()) { return CollectionUtility.arrayList(m_stepList.subList(Math.max(index + 1, 0), m_stepList.size())); } else { return CollectionUtility.emptyArrayList(); } }
public List<IWizardStep<? extends IForm>> getHistory() { int index = getStepIndex(getActiveStep()); if (!m_stepList.isEmpty() && index >= 0) { return CollectionUtility.arrayList(m_stepList.subList(0, Math.min(index, m_stepList.size()))); } else { return CollectionUtility.emptyArrayList(); } }
/** * keeps order of input * * @param nodes * @return */ private List<ITreeNode> resolveNodes(Collection<? extends ITreeNode> nodes) { if (!CollectionUtility.hasElements(nodes)) { return CollectionUtility.emptyArrayList(); } List<ITreeNode> resolvedNodes = new ArrayList<>(nodes.size()); for (ITreeNode node : nodes) { if (resolveNode(node) != null) { resolvedNodes.add(node); } } return resolvedNodes; }
public static <T extends IAction> List<T> normalizedActions(List<T> actionNodes, Predicate<IAction> filter) { if (actionNodes == null) { return CollectionUtility.emptyArrayList(); } // only visible List<T> cleanedActions = getActions(actionNodes, filter); normalizeSeparators(cleanedActions); return cleanedActions; }
@Override public List<ITableRow> findRows(Collection<? extends VALUE> values) { if (values != null) { List<ITableRow> foundRows = new ArrayList<>(); for (int i = 0; i < m_table.getRowCount(); i++) { ITableRow row = m_table.getRow(i); if (ObjectUtility.isOneOf(getValue(row), values)) { foundRows.add(row); } } return foundRows; } return CollectionUtility.emptyArrayList(); }
/** * Synchronous lookup * * @return list of resulting {@link ILookupRow}s */ public <T> List<ILookupRow<T>> lookup(final ILookupRowProvider<T> provider, final ILookupCall<T> lookupCall) { if (lookupCall == null) { return CollectionUtility.emptyArrayList(); } beforeProvide(provider, lookupCall); final List<ILookupRow<T>> result = provider.provide(lookupCall); return afterProvide(provider, lookupCall, result); }
protected List<IMenu> execComputeTableEmptySpaceMenus() { T table = getTable(); if (table == null) { return CollectionUtility.emptyArrayList(); } return ActionUtility.getActions(table.getMenus(), ActionUtility.createMenuFilterMenuTypes(CollectionUtility.hashSet(TableMenuType.EmptySpace), false)); }
@Override public List<ITreeNode> callChildLookup(ITreeNode parentNode) { List<? extends ILookupRow<T>> data = null; ILookupCall<T> call = getLookupCall(); if (call != null) { call = BEANS.get(ILookupCallProvisioningService.class).newClonedInstance(call, new FormFieldProvisioningContext(AbstractTreeBox.this)); prepareLookupCall(call, parentNode); data = call.getDataByRec(); data = filterLookupResult(call, data); List<ITreeNode> subTree = new ArrayList<>(getTreeNodeBuilder().createTreeNodes(data, ITreeNode.STATUS_NON_CHANGED, false)); filterNewNodesRec(subTree, parentNode != null ? parentNode.getTreeLevel() + 1 : 0); return subTree; } return CollectionUtility.emptyArrayList(); }
@Override public List<ITreeNode> callCompleteTreeLookup() { List<? extends ILookupRow<T>> data = null; ILookupCall<T> call = getLookupCall(); if (call != null) { call = BEANS.get(ILookupCallProvisioningService.class).newClonedInstance(call, new FormFieldProvisioningContext(AbstractTreeBox.this)); prepareLookupCall(call, null); data = call.getDataByAll(); data = filterLookupResult(call, data); List<ITreeNode> subTree = getTreeNodeBuilder().createTreeNodes(data, ITreeNode.STATUS_NON_CHANGED, true); filterNewNodesRec(subTree, 0); return subTree; } return CollectionUtility.emptyArrayList(); }