Project

General

Profile

Revision eee3eb03

IDeee3eb03372ffda6b7b9bd9cbef78839d37858ef
Parent 97352439
Child 72614023

Added by Patrick Plitzner almost 2 years ago

ref #7010 Adapt bulk editor delete handler

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/e4/handler/DeleteHandlerE4.java
86 86
    private static final String CONFIRM_DELETION = Messages.DeleteHandler_CONFIRM;
87 87

  
88 88
    @Execute
89
    public void execute(@Named(IServiceConstants.ACTIVE_SELECTION)CdmBase object,
89
    public void execute(@Named(IServiceConstants.ACTIVE_SELECTION)Object selection,
90 90
            @Named(IServiceConstants.ACTIVE_PART)MPart activePart,
91 91
            @Named(IServiceConstants.ACTIVE_SHELL)Shell shell) {
92 92

  
93 93
        BulkEditorE4 editor= (BulkEditorE4) activePart.getObject();
94 94

  
95
        DeleteConfiguratorBase config = null;
96
        DeleteResult result = new DeleteResult();
97
        String errorMessage= OBJECT;
98 95
        if (editor.isDirty()){
99 96
            boolean proceed = MessageDialog.openQuestion(null,
100 97
                    "Save changes", "You have made changes that must be saved before this query can be executed. Would you like to proceed?");
......
104 101
                return ;
105 102
            }
106 103
        }
104
        if(selection instanceof Object[]){
105
            for (Object object: (Object[])selection) {
106
                if(object instanceof CdmBase){
107
                    delete((CdmBase) object, shell, editor);
108
                }
109
            }
110
        }
111
        else if(selection instanceof CdmBase){
112
            delete((CdmBase) selection, shell, editor);
113
        }
114

  
115
    }
116
        private void delete(CdmBase object, Shell shell, BulkEditorE4 editor){
117
            String errorMessage= OBJECT;
118
            DeleteConfiguratorBase config = null;
119
            DeleteResult result = new DeleteResult();
107 120
        try {
108 121
            ICdmRepository controller;
109 122
            controller = CdmStore.getCurrentApplicationConfiguration();

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)