private void resetRowSelection(int row) { if (collectionConnector.getSelectedIndices() != null) { if (Arrays.binarySearch(collectionConnector.getSelectedIndices(), row) >= 0) { collectionConnector.setSelectedIndices(); } } }
/** * {@inheritDoc} */ @Override public int[] getSelectedIndices() { ICollectionConnector collectionConnector = getCollectionConnector(); if (collectionConnector != null) { return collectionConnector.getSelectedIndices(); } return null; }
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]); } } } });
/** * {@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]); } } } }
actionContext.put(ActionContextConstants.SELECTED_INDICES, ((ICollectionConnectorProvider) viewConnector) .getCollectionConnector().getSelectedIndices());
actionContext.put(ActionContextConstants.SELECTED_INDICES, ((ICollectionConnectorProvider) viewConnector) .getCollectionConnector().getSelectedIndices());
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { ICollectionConnector resultConnector = ((ICollectionConnectorProvider) getViewConnector(context)) .getCollectionConnector(); int[] resultSelectedIndices = resultConnector.getSelectedIndices(); if (resultSelectedIndices != null && resultSelectedIndices.length > 0) { Object selectedComponent = resultConnector.getChildConnector( resultSelectedIndices[0]).getConnectorValue(); context.put(ActionContextConstants.ACTION_PARAM, selectedComponent); } return super.execute(actionHandler, context); } }
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { ICollectionConnector resultConnector = ((ICollectionConnectorProvider) getViewConnector(context)) .getCollectionConnector(); int[] resultSelectedIndices = resultConnector.getSelectedIndices(); if (resultSelectedIndices != null && resultSelectedIndices.length > 0) { Object selectedComponent = resultConnector.getChildConnector( resultSelectedIndices[0]).getConnectorValue(); context.put(ActionContextConstants.ACTION_PARAM, selectedComponent); } return super.execute(actionHandler, context); } }
actionContext.put(ActionContextConstants.SELECTED_INDICES, ((ICollectionConnectorProvider) viewConnector) .getCollectionConnector().getSelectedIndices());
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { ICollectionConnector resultConnector = ((ICollectionConnectorProvider) getViewConnector(context)) .getCollectionConnector(); int[] resultSelectedIndices = resultConnector.getSelectedIndices(); if (resultSelectedIndices != null && resultSelectedIndices.length > 0) { Object selectedComponent = resultConnector.getChildConnector( resultSelectedIndices[0]).getConnectorValue(); context.put(ActionContextConstants.ACTION_PARAM, selectedComponent); } return super.execute(actionHandler, context); } }
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { ICollectionConnector resultConnector = ((ICollectionConnectorProvider) getViewConnector(context)) .getCollectionConnector(); int[] resultSelectedIndices = resultConnector.getSelectedIndices(); if (resultSelectedIndices != null && resultSelectedIndices.length > 0) { Object selectedComponent = resultConnector.getChildConnector( resultSelectedIndices[0]).getConnectorValue(); setActionParameter(selectedComponent, context); } return super.execute(actionHandler, context); } }
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { ICollectionConnector resultConnector = (ICollectionConnector) ((ICompositeValueConnector) getViewConnector(context)) .getChildConnector(IQueryComponent.QUERIED_COMPONENTS); int[] resultSelectedIndices = resultConnector.getSelectedIndices(); if (resultSelectedIndices != null && resultSelectedIndices.length > 0) { IEntity selectedEntity = (IEntity) resultConnector.getChildConnector( resultSelectedIndices[0]).getConnectorValue(); if (selectedEntity != null) { selectedEntity = getController(context).getApplicationSession().merge( selectedEntity, MergeMode.MERGE_KEEP); } context.put(ActionContextConstants.ACTION_PARAM, selectedEntity); } return super.execute(actionHandler, context); } }
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { ICollectionConnector resultConnector = (ICollectionConnector) ((ICompositeValueConnector) getViewConnector(context)) .getChildConnector(IQueryComponent.QUERIED_COMPONENTS); int[] resultSelectedIndices = resultConnector.getSelectedIndices(); if (resultSelectedIndices != null && resultSelectedIndices.length > 0) { IEntity selectedEntity = (IEntity) resultConnector.getChildConnector( resultSelectedIndices[0]).getConnectorValue(); if (selectedEntity != null) { selectedEntity = getController(context).getApplicationSession().merge( selectedEntity, MergeMode.MERGE_KEEP); } context.put(ActionContextConstants.ACTION_PARAM, selectedEntity); } return super.execute(actionHandler, context); } }
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { ICollectionConnector resultConnector = (ICollectionConnector) ((ICompositeValueConnector) getViewConnector(context)) .getChildConnector(IQueryComponent.QUERIED_COMPONENTS); int[] resultSelectedIndices = resultConnector.getSelectedIndices(); if (resultSelectedIndices != null && resultSelectedIndices.length > 0) { IEntity selectedEntity = (IEntity) resultConnector.getChildConnector( resultSelectedIndices[0]).getConnectorValue(); if (selectedEntity != null) { selectedEntity = getController(context).getApplicationSession().merge( selectedEntity, MergeMode.MERGE_KEEP); } context.put(ActionContextConstants.ACTION_PARAM, selectedEntity); } return super.execute(actionHandler, context); } }
/** * {@inheritDoc} */ @Override public boolean execute(IActionHandler actionHandler, Map<String, Object> context) { ICollectionConnector viewConnector = (ICollectionConnector) getViewConnector(context); int[] selectedIndices = viewConnector.getSelectedIndices(); ICollectionConnector collectionConnector = (ICollectionConnector) viewConnector .getModelConnector(); if (selectedIndices == null || selectedIndices.length == 0 || collectionConnector == null) { return false; } Object reportDescriptorOrReport = collectionConnector.getChildConnector( selectedIndices[0]).getConnectorValue(); IReport report = null; if (reportDescriptorOrReport instanceof IReport) { report = (IReport) reportDescriptorOrReport; } else if (reportDescriptorOrReport instanceof IReportDescriptor) { report = reportFactory.createReportInstance( (IReportDescriptor) reportDescriptorOrReport, getTranslationProvider(context), getLocale(context)); } context.put(ActionContextConstants.ACTION_PARAM, report); return super.execute(actionHandler, context); }
moduleConnector); if (moduleCollectionConnector != null) { int[] selectedIndices = moduleCollectionConnector.getSelectedIndices(); int selectedIndex = -1; if (selectedIndices == null || selectedIndices.length == 0) {
/** * Gets the report to execute out of the model connector. * <p> * {@inheritDoc} */ @Override protected IReport getReportToExecute(IActionHandler actionHandler, Map<String, Object> context) { ICollectionConnector viewConnector = (ICollectionConnector) getViewConnector(context); int[] selectedIndices = viewConnector.getSelectedIndices(); ICollectionConnector collectionConnector = (ICollectionConnector) viewConnector .getModelConnector(); if (selectedIndices == null || selectedIndices.length == 0 || collectionConnector == null) { return null; } Object reportDescriptorOrReport = collectionConnector.getChildConnector( selectedIndices[0]).getConnectorValue(); IReport report = null; if (reportDescriptorOrReport instanceof IReport) { report = (IReport) reportDescriptorOrReport; } else if (reportDescriptorOrReport instanceof IReportDescriptor) { report = getReportFactory().createReportInstance( (IReportDescriptor) reportDescriptorOrReport, getTranslationProvider(context), getLocale(context)); } return report; }
.getCollectionConnector(); int index = -1; int[] selectedIndices = collectionConnector.getSelectedIndices(); if (selectedIndices != null && selectedIndices.length > 0) { index = selectedIndices[0];