package eu.etaxonomy.taxeditor.navigation.key.polytomous;
import java.util.List;
+import java.util.Map;
import org.eclipse.core.commands.Command;
import org.eclipse.core.commands.common.NotDefinedException;
import org.eclipse.ui.handlers.IHandlerService;
import org.eclipse.ui.part.ViewPart;
+import eu.etaxonomy.cdm.api.application.CdmApplicationState;
import eu.etaxonomy.cdm.api.application.CdmChangeEvent;
+import eu.etaxonomy.cdm.api.application.CdmChangeEvent.Action;
+import eu.etaxonomy.cdm.api.application.ICdmChangeListener;
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
import eu.etaxonomy.cdm.api.conversation.IConversationEnabled;
import eu.etaxonomy.cdm.api.service.IPolytomousKeyService;
*
*/
public class PolytomousKeyViewPart extends ViewPart implements
- IConversationEnabled, ICdmEntitySessionEnabled, IPostOperationEnabled {
+ IConversationEnabled, ICdmEntitySessionEnabled, IPostOperationEnabled,
+ ICdmChangeListener {
private class FilterModifyListener implements ModifyListener{
@Override
conversation = CdmStore.createConversation();
conversation.registerForDataStoreChanges(this);
cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
+ CdmApplicationState.getCurrentDataChangeService().register(this);
List<PolytomousKey> input = CdmStore.getService(IPolytomousKeyService.class).list(PolytomousKey.class, null, null, null, null);
if(!viewer.getControl().isDisposed()){
if(cdmEntitySession != null) {
cdmEntitySession.dispose();
}
+ CdmApplicationState.getCurrentDataChangeService().unregister(this);
super.dispose();
}
*/
@Override
public boolean postOperation(CdmBase objectAffectedByOperation) {
+ getConversationHolder().bind();
+ getConversationHolder().commit(true);
viewer.refresh();
return true;
}
*/
@Override
public void onChange(CdmChangeEvent event) {
- // TODO Auto-generated method stub
+ if(event.getAction() == Action.Delete && PolytomousKey.class.equals(event.getEntityType())) {
+ refresh();
+ }
+
+ }
+ /* (non-Javadoc)
+ * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
+ */
+ @Override
+ public Map<Object, List<String>> getPropertyPathsMap() {
+ // TODO Auto-generated method stub
+ return null;
}
}