| /** |
| * |
| * Copyright (c) 2011, 2016 - Loetz GmbH&Co.KG (69115 Heidelberg, Germany) |
| * |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v1.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v10.html |
| * |
| * Contributors: |
| * Christophe Loetz (Loetz GmbH&Co.KG) - initial implementation |
| */ |
| package org.eclipse.osbp.utils.common; |
| |
| import org.eclipse.osbp.eventbroker.EventBrokerMsg; |
| |
| |
| public interface IEntityIdModificationListenerView { |
| |
| /** |
| * Each time, the view is refreshed, the list of previous listened entity ids should be reseted! |
| */ |
| public void resetListeningForEntityIdsModifications(); |
| |
| /** |
| * Each implementation should react on the refresh, due to modification of the entity and id, |
| * in the correct way depending on the view context! |
| * <br> |
| * <b>Important:</b> If the view should be refreshed, call {@link #resetListeningForEntityIdsModifications()}! |
| * @param entity name of the modified entity, all dots will be replaced by slash |
| * @param id primary key of the modified entity |
| */ |
| public void refreshViewDueToModifiedEntityId(String entity, Object id); |
| |
| /** |
| * Add relevant entity name and primary key that are rendered inside this report, |
| * so that any change of their entities can be listened! |
| * |
| * <b>If an entity wasn't rendered at this time, it can't be listened, |
| * even if it will be contained after it's change the next time!</b> |
| * @param entityName, all dots will be replaced by slash |
| * @param primaryKey |
| */ |
| public void addEntityIdToModifyListener(String entityName, Object primaryKey); |
| |
| /** |
| * Remove relevant entity name and primary key that are rendered inside this report, |
| * so that any change of their entities can be listened! |
| * |
| * <b>If an entity wasn't rendered at this time, it can't be listened, |
| * even if it will be contained after it's change the next time!</b> |
| * @param entityName, all dots will be replaced by slash |
| * @param primaryKey |
| */ |
| public void removeEntityIdFromModifyListener(String entityName, Object primaryKey); |
| |
| /** |
| * checks for the event broker message if the sent entity id should do a refresh view |
| * @param message |
| * @param doRefresh if true, the refresh will be forced inside |
| * @return true if it should do a refresh |
| */ |
| public boolean checkOnModifiedEntityId(EventBrokerMsg message, boolean doRefresh); |
| |
| /** |
| * checks for the event broker message if the sent entity id should do a refresh view |
| * @param entityName, all dots will be replaced by slash |
| * @param id |
| * @param doRefresh if true, the refresh will be forced inside |
| * @return true if it should do a refresh |
| */ |
| public boolean checkOnModifiedEntityId(String entityName, Object id, boolean doRefresh); |
| } |