private void childClicked(MouseEvent evt) { ICollectionConnector collectionConnector = (ICollectionConnector) repeaterView.getConnector(); Component child = (Component) evt.getSource(); int index = -1; while (index < 0 && child != null) { index = Arrays.asList(container.getComponents()).indexOf(child); child = child.getParent(); } if (index >= 0) { collectionConnector.setSelectedIndices(new int[]{index}, index); } else { collectionConnector.setSelectedIndices(new int[0], -1); } }
/** * {@inheritDoc} */ @Override public void setSelectedIndices(int... selectedIndices) { ICollectionConnector collectionConnector = getCollectionConnector(); if (collectionConnector != null) { collectionConnector.setSelectedIndices(selectedIndices); } }
/** * {@inheritDoc} */ @Override public void setSelectedIndices(int[] selectedIndices, int leadingIndex) { ICollectionConnector collectionConnector = getCollectionConnector(); if (collectionConnector != null) { collectionConnector.setSelectedIndices(selectedIndices, leadingIndex); } } }
private void resetRowSelection(int row) { if (collectionConnector.getSelectedIndices() != null) { if (Arrays.binarySearch(collectionConnector.getSelectedIndices(), row) >= 0) { collectionConnector.setSelectedIndices(); } } }
public void run() { if (row < getRowCount()) { fireTableRowsUpdated(row, row); } if (collectionConnector.getSelectedIndices() != null) { if (Arrays.binarySearch(collectionConnector.getSelectedIndices(), row) >= 0) { collectionConnector.setSelectedIndices(new int[0]); } } } });
resultConnector.setSelectedIndices(ArrayUtils.toPrimitive(indices.toArray(new Integer[]{}), 0));
/** * Selects indices on the view collection connector based on the * <code>ActionContextConstants.SELECTED_INDICES</code> context value. * <p> * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { ICollectionConnector collectionConnector = (ICollectionConnector) getSourceViewConnector(context); if (collectionConnector == null) { collectionConnector = (ICollectionConnector) getViewConnector(context); } int[] connectorSelection = (int[]) context .get(ActionContextConstants.SELECTED_INDICES); collectionConnector.setSelectedIndices(connectorSelection); return super.execute(actionHandler, context); } }
/** * {@inheritDoc} */ public void valueChange( @SuppressWarnings("unused") ValueChangeEvent evt) { if (row < getRowCount()) { fireTableRowsUpdated(row, row); } if (collectionConnector.getSelectedIndices() != null) { if (Arrays.binarySearch(collectionConnector.getSelectedIndices(), row) >= 0) { collectionConnector.setSelectedIndices(new int[0]); } } } }
/** * {@inheritDoc} */ public void connectorValueChange(@SuppressWarnings("unused") ConnectorValueChangeEvent evt) { if (row < getRowCount()) { fireTableRowsUpdated(row, row); } if (collectionConnector.getSelectedIndices() != null) { if (Arrays.binarySearch(collectionConnector.getSelectedIndices(), row) >= 0) { collectionConnector.setSelectedIndices(new int[0]); } } } }
/** * {@inheritDoc} */ public void connectorValueChange(@SuppressWarnings("unused") ConnectorValueChangeEvent evt) { if (row < getRowCount()) { fireTableRowsUpdated(row, row); } if (collectionConnector.getSelectedIndices() != null) { if (Arrays.binarySearch(collectionConnector.getSelectedIndices(), row) >= 0) { collectionConnector.setSelectedIndices(new int[0]); } } } }
/** * Selects indices on the module view collection connector based on the * <code>ActionContextConstants.SELECTED_INDICES</code> context value. * <p> * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { ICompositeValueConnector moduleConnector = getModuleConnector(context); ICollectionConnector parentModuleCollectionConnector = ((ICollectionConnectorProvider) moduleConnector .getParentConnector().getParentConnector()).getCollectionConnector(); parentModuleCollectionConnector.setSelectedIndices(new int[0]); int[] connectorSelection = (int[]) context .get(ActionContextConstants.SELECTED_INDICES); if (moduleConnector instanceof ICollectionConnectorProvider) { ICollectionConnector collectionConnector = ((ICollectionConnectorProvider) moduleConnector) .getCollectionConnector(); collectionConnector.setSelectedIndices(connectorSelection); } return super.execute(actionHandler, context); } }
ICollectionConnector connector = connectorIndicesPair.getKey(); int[] indices = connectorIndicesPair.getValue(); connector.setSelectedIndices(indices); ICollectionConnector connector = connectorIndicesPair.getKey(); int[] indices = connectorIndicesPair.getValue(); connector.setSelectedIndices(indices);
ICollectionConnector connector = connectorIndicesPair.getKey(); int[] indices = connectorIndicesPair.getValue(); connector.setSelectedIndices(indices); ICollectionConnector connector = connectorIndicesPair.getKey(); int[] indices = connectorIndicesPair.getValue(); connector.setSelectedIndices(indices); atLeastOneSelected = true;
public void run() { Collection<?> oldCollection = null; if (evt.getOldValue() instanceof Collection) { oldCollection = (Collection<?>) evt.getOldValue(); } Collection<?> newCollection = (Collection<?>) evt.getNewValue(); int oldCollectionSize = 0; int newCollectionSize = 0; if (oldCollection != null) { oldCollectionSize = oldCollection.size(); } if (newCollection != null) { newCollectionSize = newCollection.size(); } if (newCollectionSize > oldCollectionSize) { fireTableRowsInserted(oldCollectionSize, newCollectionSize - 1); for (int row = oldCollectionSize; row < newCollectionSize; row++) { bindChildRowConnector(row); } } else if (newCollectionSize < oldCollectionSize) { fireTableRowsDeleted(newCollectionSize, oldCollectionSize - 1); } if (evt.getNewValue() != null && !((Collection<?>) evt.getNewValue()).isEmpty()) { collectionConnector.setSelectedIndices(new int[] {0}); } } });
collectionConnector.setSelectedIndices(new int[] {0});
collectionConnector.setSelectedIndices(new int[] {0});
moduleCollectionConnector.setSelectedIndices(new int[]{selectedIndex}, selectedIndex);
@SuppressWarnings("ConstantConditions") private Object[] synchWorkspaceNavigatorSelection(ICollectionConnectorListProvider navigatorConnector, Module module) { Object[] result = null; int moduleModelIndex = -1; for (ICollectionConnector childCollectionConnector : navigatorConnector.getCollectionConnectors()) { for (int i = 0; i < childCollectionConnector.getChildConnectorCount(); i++) { IValueConnector childConnector = childCollectionConnector.getChildConnector(i); if (module != null && module.equals(childConnector.getConnectorValue())) { moduleModelIndex = i; } if (childConnector instanceof ICollectionConnectorListProvider) { Object[] subResult = synchWorkspaceNavigatorSelection((ICollectionConnectorListProvider) childConnector, module); if (subResult != null) { result = subResult; } } } if (moduleModelIndex >= 0) { result = new Object[]{childCollectionConnector, moduleModelIndex}; } else { childCollectionConnector.setSelectedIndices(null, -1); } } return result; }
connector.setSelectedIndices(null, -1);
collectionConnector.setSelectedIndices(index); actionHandler.execute(getOnSuccessAction(), context); } else {