Project

General

Profile

« Previous | Next » 

Revision 940e1f09

Added by Andreas Müller about 3 years ago

cleanup

View differences:

eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/defaultHandler/OpenBulkEditorForIdentifiableEntityE4.java
25 25

  
26 26
public class OpenBulkEditorForIdentifiableEntityE4 extends DefaultOpenHandlerBaseE4<Object>{
27 27

  
28
//    @Override
29
//    protected IdentifiableEntity getEntity(UUID uuid) {
30
//        return CdmStore.getCommonService().find(IdentifiableEntity.class, uuid);
31
//    }
32

  
33 28
    @Override
34 29
    protected void open(Object entity, Shell shell, EPartService partService) {
35 30
        @SuppressWarnings("rawtypes")
36 31
        AbstractBulkEditorInput input = null;
37 32
        if (entity instanceof UuidAndTitleCache){
38
            input = AbstractBulkEditorInput.NewInstance(((UuidAndTitleCache)entity).getType(), ((UuidAndTitleCache)entity).getUuid());
33
            input = AbstractBulkEditorInput.NewInstance(((UuidAndTitleCache<?>)entity).getType(), ((UuidAndTitleCache<?>)entity).getUuid());
39 34
        }else if (entity instanceof IdentifiableEntity){
40 35
            input = AbstractBulkEditorInput.NewInstance((IdentifiableEntity)entity);
41 36
        }
......
59 54
            || entity instanceof TaxonBase
60 55
            || entity instanceof Media
61 56
            ;
62

  
63 57
   }
64 58

  
65 59
    @Override
66 60
    protected String getPartId() {
67 61
        return eu.etaxonomy.taxeditor.bulkeditor.AppModelId.PARTDESCRIPTOR_BULKEDITOR_EDITOR;
68 62
    }
69

  
70
}
63
}
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/handler/defaultHandler/OpenBulkEditorForTaxonNodeHandler.java
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
1 9
package eu.etaxonomy.taxeditor.bulkeditor.handler.defaultHandler;
2 10

  
3 11
import org.eclipse.e4.ui.workbench.modeling.EPartService;
......
12 20

  
13 21
public class OpenBulkEditorForTaxonNodeHandler extends DefaultOpenHandlerBaseE4<TaxonNodeDto> {
14 22

  
15
//    @Override
16
//    protected TaxonNode getEntity(UUID uuid) {
17
//        return CdmStore.getService(ITaxonNodeService.class).load(uuid);
18
//    }
19

  
20 23
    @Override
21 24
    protected void open(TaxonNodeDto entity, Shell shell, EPartService partService) {
22
        AbstractBulkEditorInput input = TaxonEditorInput.getInstance();
25
        AbstractBulkEditorInput<?> input = TaxonEditorInput.getInstance();
23 26
        input.setEntityUuid(entity.getTaxonUuid());
24 27
        BulkEditorUtil.openBulkEditor(input, modelService, partService, application);
25 28
    }
26 29

  
27
    /**
28
     * {@inheritDoc}
29
     */
30 30
    @Override
31 31
    protected boolean canExecute(Object selection) {
32 32
        if (((IStructuredSelection)selection).getFirstElement() instanceof TaxonNodeDto && ((IStructuredSelection)selection).size() == 1){
......
39 39
    protected String getPartId() {
40 40
        return eu.etaxonomy.taxeditor.bulkeditor.AppModelId.PARTDESCRIPTOR_BULKEDITOR_EDITOR;
41 41
    }
42

  
43
}
42
}
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/input/AbstractBulkEditorInput.java
75 75

  
76 76
    private Set<T> saveCandidates = new HashSet<>();
77 77

  
78

  
79 78
	private Set<T> markedMergeCandidates = new HashSet<>();
80 79
	private T markedMergeTarget = null;
81 80

  
......
99 98
	public static AbstractBulkEditorInput<?> NewInstance(IdentifiableEntity entity) {
100 99

  
101 100
		BulkEditorInputType inputType = BulkEditorInputType.getByType(entity.getClass());
102

  
103 101
		AbstractBulkEditorInput<?> editorInput = NewInstance(inputType);
104

  
105 102
		editorInput.setEntityUuid(entity.getUuid());
106

  
107 103
		return editorInput;
108 104
	}
109 105

  
110 106
	public static AbstractBulkEditorInput<?> NewInstance(Class clazz, UUID uuid) {
111 107

  
112 108
        BulkEditorInputType inputType = BulkEditorInputType.getByType(clazz);
113

  
114 109
        AbstractBulkEditorInput<?> editorInput = NewInstance(inputType);
115

  
116 110
        editorInput.setEntityUuid(uuid);
117

  
118 111
        return editorInput;
119 112
    }
120 113

  
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
210 210
    }
211 211

  
212 212
    private static void openNameEditor_internal(TaxonEditorInputE4 input, EModelService modelService, EPartService partService, MApplication application) {
213
        TaxonBase taxonBase = input.getTaxon();
213
        TaxonBase<?> taxonBase = input.getTaxon();
214 214
        TaxonNode node = input.getTaxonNode();
215 215
        if(taxonBase==null){
216 216
            return;
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/descriptiveDataSet/handler/OpenCharacterMatrixHandler.java
1

  
1
/**
2
* Copyright (C) 2007 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
2 9
package eu.etaxonomy.taxeditor.editor.descriptiveDataSet.handler;
3 10

  
4 11
import org.eclipse.e4.ui.workbench.modeling.EPartService;
......
11 18

  
12 19
public class OpenCharacterMatrixHandler extends DefaultOpenHandlerBaseE4<DescriptiveDataSet>{
13 20

  
14
    /**
15
     * {@inheritDoc}
16
     */
17
//    @Override
18
//    protected DescriptiveDataSet getEntity(UUID uuid) {
19
//        return CdmStore.getService(IDescriptiveDataSetService.class).load(uuid);
20
//    }
21

  
22 21
    @Override
23 22
    protected void open(DescriptiveDataSet entity, Shell shell, EPartService partService) {
24 23
        EditorUtil.openCharacterMatrix(entity.getUuid(), modelService, partService, application);
25 24
    }
26 25

  
27
    /**
28
     * {@inheritDoc}
29
     */
30 26
    @Override
31 27
    protected boolean canExecute(Object entity) {
32 28
        return true;
......
36 32
    protected String getPartId() {
37 33
        return AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_DESCRIPTIVEDATASET_MATRIX_CHARACTERMATRIXPART;
38 34
    }
39

  
40

  
41 35
}
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/handler/defaultHandler/DefaultOpenTaxonEditorForTaxonNodeHandler.java
33 33

  
34 34
    @Override
35 35
    protected boolean canExecute(Object selection) {
36
        if (((IStructuredSelection)selection).getFirstElement() instanceof TaxonNodeDto){
36
        if (selection instanceof IStructuredSelection &&
37
                ((IStructuredSelection)selection).getFirstElement() instanceof TaxonNodeDto){
37 38
            return ((TaxonNodeDto)((IStructuredSelection)selection).getFirstElement()).getTaxonUuid() != null;
38 39
        }
39 40
        return false ;
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/defaultHandler/e4/DefaultOpenHandlerBaseE4.java
43 43
        Object transientData = menuItem.getTransientData().get(commandId+".uuid");
44 44

  
45 45
        if (transientData instanceof IStructuredSelection){
46

  
47 46
            for (Object element: ((IStructuredSelection)transientData).toArray()) {
48 47
               open((T)element, shell, partService);
49 48
            }
50 49
        }else if (transientData instanceof UuidAndTitleCache || transientData instanceof CdmBase){
51
//            T entity = getEntity(((UuidAndTitleCache)transientData).getUuid());
52 50
            open((T)transientData, shell, partService);
53 51
        }
54 52
    }
......
72 70
        return canExecute;
73 71
    }
74 72

  
75
//    protected abstract T getEntity(UUID uuid);
76

  
77 73
    protected abstract void open(T entity, Shell shell, EPartService partService) throws Exception;
78 74

  
79 75
    protected abstract boolean canExecute(Object entity);
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/defaultHandler/e4/DefaultOpenTaxonNodeWizardHandlerE4.java
32 32
/**
33 33
 * @author k.luther
34 34
 * @date 22.03.2016
35
 *
36 35
 */
37 36
public class DefaultOpenTaxonNodeWizardHandlerE4 extends DefaultOpenHandlerBaseE4<TaxonNodeDto> {
38 37

  
39
//    @Override
40
//    protected TaxonNode getEntity(UUID uuid) {
41
//        return CdmStore.getService(ITaxonNodeService.class).load(uuid);
42
//    }
43

  
44 38
    @Override
45 39
    protected void open(TaxonNodeDto entity, Shell shell, EPartService partService) {
46 40
        Collection<MPart> dirtyParts = partService.getDirtyParts();
......
72 66
            EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAVIGATOR, taxonNodeWizard.getEntity().getParent());
73 67
            EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAME_EDITOR, entity.getTaxonUuid());
74 68
        }
75

  
76 69
    }
77 70

  
78 71
    @Override
......
82 75
        }
83 76
        return false;
84 77
    }
85

  
86

  
87

  
88 78
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/handler/e4/OpenDistributionPerAreaStatusWizardHandler.java
20 20
/**
21 21
 * @author k.luther
22 22
 * @since 19.11.2018
23
 *
24 23
 */
25 24
public class OpenDistributionPerAreaStatusWizardHandler {
25

  
26 26
    String commandID = "eu.etaxonomy.taxeditor.handler.e4.OpenDistributionPerAreaStatusWizardHandler";
27 27

  
28 28
    @Execute
29 29
    public void execute(@Named(IServiceConstants.ACTIVE_SHELL)Shell shell) {
30 30

  
31 31
        AvailableDistributionPerAreaStatusWizard wizard = new AvailableDistributionPerAreaStatusWizard();
32

  
33
        WizardDialog dialog = new WizardDialog(shell,
34
                wizard);
35

  
32
        WizardDialog dialog = new WizardDialog(shell, wizard);
36 33
        dialog.open();
37 34
    }
38
}
35
}

Also available in: Unified diff