/** * {@inheritDoc} */ @Override public ModelCollectionPropertyConnector getModelConnector( Map<String, Object> context) { return (ModelCollectionPropertyConnector) ((ICollectionConnector) context .get(ActionContextConstants.SOURCE_VIEW_CONNECTOR)).getModelConnector(); }
public void connectorValueChange(@SuppressWarnings("unused") ConnectorValueChangeEvent evt) { if (collectionConnector.getModelConnector() != null) { ((EmbeddedModelProvider) ((IModelGate) clonedGate) .getModelProvider()) .setModel(((IModelValueConnector) collectionConnector .getModelConnector()).getModelProvider() .getModel()); } else { ((EmbeddedModelProvider) ((IModelGate) clonedGate) .getModelProvider()).setModel(null); } } });
public void connectorValueChange(@SuppressWarnings("unused") ConnectorValueChangeEvent evt) { if (collectionConnector.getModelConnector() != null) { ((EmbeddedModelProvider) ((IModelGate) clonedGate) .getModelProvider()) .setModel(((IModelValueConnector) collectionConnector .getModelConnector()).getModelProvider() .getModel()); } else { ((EmbeddedModelProvider) ((IModelGate) clonedGate) .getModelProvider()).setModel(null); } } });
public void connectorValueChange(@SuppressWarnings("unused") ConnectorValueChangeEvent evt) { if (collectionConnector.getModelConnector() != null) { ((EmbeddedModelProvider) ((IModelGate) clonedGate) .getModelProvider()) .setModel(((IModelValueConnector) collectionConnector .getModelConnector()).getModelProvider() .getModel()); } else { ((EmbeddedModelProvider) ((IModelGate) clonedGate) .getModelProvider()).setModel(null); } } });
/** * {@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); }
/** * 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; }