Project

General

Profile

« Previous | Next » 

Revision 44ba5690

Added by Katja Luther over 4 years ago

ref #8677: add distribution aggregation as long running task to editor

View differences:

eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle.properties
94 94
command.commandname.2 = Refresh Navigator
95 95
command.commandname.3 = Link with taxon
96 96

  
97
command.name.aggregateDistributionForSubtree = Aggregate distributions
eu.etaxonomy.taxeditor.navigation/OSGI-INF/l10n/bundle_de.properties
93 93
handledtoolitem.label.2 = Sync with taxon selectio
94 94
command.commandname.1 = Klassifikation duplizieren
95 95
command.commandname.2 = Navigator aktualisieren
96
command.commandname.3 = Mit Taxon verkn?pfen
96
command.commandname.3 = Mit Taxon verkn?pfen
97

  
98
command.name.aggregateDistributionForSubtree = Aggregiere Verbreitungsdaten
eu.etaxonomy.taxeditor.navigation/fragment.e4xmi
46 46
      <handlers xmi:id="_MAkIwL9TEemCian_vXpNsA" elementId="eu.etaxonomy.taxeditor.navigation.navigator.e4.handler.RemotingMoveFactualDataSetNameInSourceHandlerE4" contributionURI="bundleclass://eu.etaxonomy.taxeditor.navigation/eu.etaxonomy.taxeditor.navigation.navigator.e4.handler.RemotingMoveFactualDataSetNameInSourceHandlerE5" command="_7qhucL9SEemCian_vXpNsA"/>
47 47
      <handlers xmi:id="_ifvyoMWVEemX2v5WBCy_yg" elementId="eu.etaxonomy.taxeditor.navigation.handler.SetDoubtfulHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.navigation/eu.etaxonomy.taxeditor.navigation.navigator.e4.handler.SetDoubtfulHandler" command="_l5_r8MWVEemX2v5WBCy_yg"/>
48 48
      <handlers xmi:id="_QolHUMWWEemX2v5WBCy_yg" elementId="eu.etaxonomy.taxeditor.navigation.handler.removeDoubtfulFlagHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.navigation/eu.etaxonomy.taxeditor.navigation.navigator.e4.handler.RemoveDoubtfulHandler" command="_pr-IwMWVEemX2v5WBCy_yg"/>
49
      <handlers xmi:id="_3L71YAeiEeqoDLA2i4XAcA" elementId="eu.etaxonomy.taxeditor.navigation.handler.aggregateDistributions" contributionURI="bundleclass://eu.etaxonomy.taxeditor.navigation/eu.etaxonomy.taxeditor.navigation.navigator.e4.handler.AggregateDistributionForSubTreeHandler" command="_mIVKcAeiEeqoDLA2i4XAcA"/>
49 50
      <menus xsi:type="menu:PopupMenu" xmi:id="_XNXnkJIvEeeJAdt8ZUxyaw" elementId="eu.etaxonomy.taxeditor.navigator.popupmenu.taxonnavigator">
50 51
        <visibleWhen xsi:type="ui:CoreExpression" xmi:id="_5ydggKkeEeejedk4mZQIGw" coreExpressionId="isCdmStoreConnected"/>
51 52
        <children xsi:type="menu:Menu" xmi:id="_yzFmYJIvEeeJAdt8ZUxyaw" elementId="eu.etaxonomy.taxeditor.navigation.menu.new" label="%menu.label">
......
111 112
        <children xsi:type="menu:Menu" xmi:id="_o2JjUMBqEeevuODeDZxr4Q" elementId="eu.etaxonomy.taxeditor.navigation.menu.setforsubtree" label="%command.label.subtreeOperations">
112 113
          <children xsi:type="menu:HandledMenuItem" xmi:id="_SNIFsK5bEeeDTZvTg-vKRg" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.setpublishforsubtree" label="%command.label.setPublishForSubtree" command="_Jb45kK5bEeeDTZvTg-vKRg"/>
113 114
          <children xsi:type="menu:HandledMenuItem" xmi:id="_mLjosJIwEeeJAdt8ZUxyaw" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.setsecforsubtree" label="%command.label.setSecForSubtree" command="_uFj1YJIxEeeJAdt8ZUxyaw"/>
115
          <children xsi:type="menu:HandledMenuItem" xmi:id="_cwjGQAejEeqoDLA2i4XAcA" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.commandnameaggregatedistributionforsubtree" label="%command.name.aggregateDistributionForSubtree" command="_mIVKcAeiEeqoDLA2i4XAcA"/>
114 116
        </children>
115 117
        <children xsi:type="menu:Menu" xmi:id="_Nz3dkM1MEeiHbMP3rrIRKQ" elementId="eu.etaxonomy.taxeditor.navigation.menu.set" label="%command.label.nodeUpdates">
116 118
          <children xsi:type="menu:HandledMenuItem" xmi:id="_KGONkMWWEemX2v5WBCy_yg" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.setDoubtful" label="%command.label.setDoubtful" command="_l5_r8MWVEemX2v5WBCy_yg"/>
......
192 194
    <elements xsi:type="commands:Command" xmi:id="_7qhucL9SEemCian_vXpNsA" elementId="eu.etaxonomy.taxeditor.navigation.moveFactualDataSetNameInSource" commandName="%command.name.moveFactualDataSetNameInSource"/>
193 195
    <elements xsi:type="commands:Command" xmi:id="_l5_r8MWVEemX2v5WBCy_yg" elementId="eu.etaxonomy.taxeditor.navigation.command.setdoubtfulflag" commandName="%command.name.setDoubtful"/>
194 196
    <elements xsi:type="commands:Command" xmi:id="_pr-IwMWVEemX2v5WBCy_yg" elementId="eu.etaxonomy.taxeditor.navigation.command.removedoubtfulflag" commandName="%command.name.removeDoubtful"/>
197
    <elements xsi:type="commands:Command" xmi:id="_mIVKcAeiEeqoDLA2i4XAcA" elementId="eu.etaxonomy.taxeditor.navigation.command.commandnameaggregatedistributionforsubtree" commandName="%command.name.aggregateDistributionForSubtree"/>
195 198
  </fragments>
196 199
  <fragments xsi:type="fragment:StringModelFragment" xmi:id="_3CbhIK25EeeykrJkROy5EA" featurename="children" parentElementId="eu.etaxonomy.navigation.menu.new" positionInList="after:eu.etaxonomy.taxeditor.editor.menuseparator.22">
197 200
    <elements xsi:type="menu:HandledMenuItem" xmi:id="_M9FakK26EeeykrJkROy5EA" elementId="eu.etaxonomy.taxeditor.navigation.handledmenuitem.commandlabel13" label="%command.label.13" tooltip="%command.label.13" command="_Nx06MJIvEeeJAdt8ZUxyaw">
eu.etaxonomy.taxeditor.navigation/src/main/java/eu/etaxonomy/taxeditor/navigation/navigator/e4/handler/AggregateDistributionForSubTreeHandler.java
1
/**
2
* Copyright (C) 2019 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
*/
9
package eu.etaxonomy.taxeditor.navigation.navigator.e4.handler;
10

  
11
import java.util.Collection;
12
import java.util.Iterator;
13

  
14
import javax.inject.Named;
15

  
16
import org.eclipse.core.commands.operations.AbstractOperation;
17
import org.eclipse.core.runtime.IStatus;
18
import org.eclipse.core.runtime.NullProgressMonitor;
19
import org.eclipse.core.runtime.Status;
20
import org.eclipse.e4.core.di.annotations.CanExecute;
21
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
22
import org.eclipse.e4.ui.model.application.ui.menu.MHandledMenuItem;
23
import org.eclipse.e4.ui.services.IServiceConstants;
24
import org.eclipse.jface.dialogs.MessageDialog;
25
import org.eclipse.jface.viewers.IStructuredSelection;
26
import org.eclipse.jface.viewers.TreeSelection;
27
import org.eclipse.jface.window.Window;
28
import org.eclipse.jface.wizard.WizardDialog;
29
import org.eclipse.swt.widgets.Shell;
30

  
31
import eu.etaxonomy.cdm.api.service.description.DescriptionAggregationConfigurationBase.AggregationMode;
32
import eu.etaxonomy.cdm.api.service.description.DistributionAggregationConfiguration;
33
import eu.etaxonomy.cdm.filter.TaxonNodeFilter;
34
import eu.etaxonomy.cdm.model.taxon.Classification;
35
import eu.etaxonomy.cdm.persistence.dto.TaxonNodeDto;
36
import eu.etaxonomy.taxeditor.editor.EditorUtil;
37
import eu.etaxonomy.taxeditor.navigation.l10n.Messages;
38
import eu.etaxonomy.taxeditor.navigation.navigator.TaxonNavigatorLabels;
39
import eu.etaxonomy.taxeditor.operation.e4.RemotingCdmHandlerE4;
40
import eu.etaxonomy.taxeditor.ui.dialog.configurator.DistributionAggregationConfiguratorWizard;
41
import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart;
42

  
43
/**
44
 * @author k.luther
45
 * @since 15.11.2019
46
 */
47
public class AggregateDistributionForSubTreeHandler extends RemotingCdmHandlerE4 {
48

  
49

  
50

  
51
    private TaxonNodeDto taxonNode;
52
    private DistributionAggregationConfiguration configurator;
53
    private static final String NO = Messages.NO;
54
    private static final String CANCEL = Messages.RemotingMoveTaxonNodeHandler_CANCEL;
55
    private static final String YES = Messages.YES;
56

  
57
    /**
58
     * @param label
59
     */
60
    public AggregateDistributionForSubTreeHandler() {
61
        super("");
62

  
63
    }
64

  
65

  
66
    @Override
67
    public IStatus allowOperations(IStructuredSelection selection, Shell shell, MPart activePart,
68
            MHandledMenuItem menuItem) {
69
     // check that only a single taxon tree node has been selected
70
        if(selection.size() > 1) {  }
71

  
72
        // check for no taxon tree node selected
73
        if(selection.size() == 0) {
74
            return new Status(IStatus.ERROR,
75
                    "unknown", //$NON-NLS-1$
76
                    TaxonNavigatorLabels.NO_TAXON_SELECTION_MESSAGE);
77
        }
78

  
79
        // check that selected object is a taxon node
80
        Object obj = selection.iterator().next();
81
        if(obj instanceof TaxonNodeDto) {
82
             taxonNode = (TaxonNodeDto)obj;
83
        } else if(obj instanceof Classification){
84
            taxonNode = new TaxonNodeDto(((Classification)obj).getRootNode());
85
        }else{
86
            return new Status(IStatus.ERROR,
87
                    "unknown", //$NON-NLS-1$
88
                    TaxonNavigatorLabels.SELECTED_OBJECT_NOT_TREE_NODE_MESSAGE);
89
        }
90
        Collection<IE4SavablePart> dirtyParts = EditorUtil.checkForTaxonChanges(null, partService);
91

  
92
        if (dirtyParts != null && !dirtyParts.isEmpty()){
93
            String[] buttonLables = {YES, NO,CANCEL};
94
            MessageDialog dialog = new MessageDialog(null,  Messages.SetPublishFlagForSubtreeHandlerE4_UnsavedChanges, null, Messages.SetPublishFlagForSubtreeHandlerE4_UnsavedChangesQuestion, MessageDialog.QUESTION_WITH_CANCEL, buttonLables, 0);
95
            dialog.open();
96
            int returnCode = dialog.getReturnCode();
97
            boolean proceed = false;
98
            if (returnCode == 0){
99
                proceed = true;
100
            }else if (returnCode == 2){
101
                return Status.CANCEL_STATUS;
102
            }
103

  
104
            Iterator<IE4SavablePart> partIterator = dirtyParts.iterator();
105
            while( partIterator.hasNext() ){
106
                IE4SavablePart part = partIterator.next();
107
                if (proceed) {
108
                    if (part != null){
109
                        part.save(new NullProgressMonitor());
110
                    }
111
                }
112
            }
113
        }
114

  
115

  
116
        configurator = DistributionAggregationConfiguration.NewInstance(AggregationMode.byAreasAndRanks(), null, TaxonNodeFilter.NewSubtreeInstance(taxonNode.getUuid()), null);
117
        DistributionAggregationConfiguratorWizard wizard = new DistributionAggregationConfiguratorWizard(configurator);
118

  
119
        WizardDialog dialog = new WizardDialog(shell, wizard);
120

  
121
        if (dialog.open() == Window.OK) {
122
            return Status.OK_STATUS;
123
        }else{
124
            return Status.CANCEL_STATUS;
125
        }
126
    }
127

  
128
    @Override
129
    public AbstractOperation prepareOperation(IStructuredSelection selection, Shell shell, MPart activePart,
130
            MHandledMenuItem menuItem) {
131
        // TODO Auto-generated method stub
132
        return null;
133
    }
134

  
135
    @Override
136
    public void onComplete() {
137
        // TODO Auto-generated method stub
138

  
139
    }
140

  
141
    @Override
142
    protected Object getTrigger() {
143
        // TODO Auto-generated method stub
144
        return null;
145
    }
146

  
147
    @CanExecute
148
    private boolean canExecute(@Named(IServiceConstants.ACTIVE_SELECTION)TreeSelection selection, MHandledMenuItem menuItem){
149
        boolean canExecute = false;
150
        canExecute = selection.size()==1
151
                && selection.getFirstElement() instanceof TaxonNodeDto;
152
        menuItem.setVisible(canExecute);
153
        return canExecute;
154
    }
155

  
156
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/Messages.java
699 699
    public static String FactualData_description;
700 700

  
701 701

  
702
    public static String DistributionAggregationConfiguration_aggregateToHigherRanks;
703
    public static String DistributionAggregationConfiguration_aggregateToHigherRanks_tooltip;
704
    public static String DistributionAggregationConfiguration_ClearExistingDistributions;
705
    public static String DistributionAggregationConfiguration_AggregationMode;
706
    public static String DistributionAggregationConfiguration_SuperArea;
707
    public static String DistributionAggregationConfiguration_StatusOrder;
708

  
709
    public static String SetAggregationConfiguration_Title;
710

  
711

  
702 712

  
703 713

  
704 714

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties
529 529
Preference_update=Update
530 530
FactualData_showModifier=Show modifier
531 531
FactualData_showModifier_FreeText=Show modifier freetext
532
FactualData_description=If a preference is not selectable, there is a serverside preference not allowed to override.
532
FactualData_description=If a preference is not selectable, there is a serverside preference not allowed to override.
533

  
534
DistributionAggregationConfiguration_aggregateToHigherRanks=Aggregate to higher ranks
535
DistributionAggregationConfiguration_aggregateToHigherRanks_tooltip=Aggregate to higher ranks
536
DistributionAggregationConfiguration_ClearExistingDistributions=Clear existing distributions
537
DistributionAggregationConfiguration_AggregationMode=Aggregation mode
538
DistributionAggregationConfiguration_SuperArea=Choose super areas
539
DistributionAggregationConfiguration_StatusOrder=Choose status order
540

  
541
SetAggregationConfiguration_Title=Aggregation configuration;
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties
529 529
Preference_update=Aktualisieren
530 530
FactualData_showModifier=Zeige Modifier
531 531
FactualData_showModifier_FreeText=Zeige Freitext-Modifier
532
FactualData_description=Wenn die Pr?ferenz nicht ausgew?hlt werden kann, dann gibt es eine serverseitige Pr?ferenz, die das ?berschreiben nicht erlaubt.
532
FactualData_description=Wenn die Pr?ferenz nicht ausgew?hlt werden kann, dann gibt es eine serverseitige Pr?ferenz, die das ?berschreiben nicht erlaubt.
533

  
534
DistributionAggregationConfiguration_aggregateToHigherRanks=Aggregiere zu h?heren R?ngen
535
DistributionAggregationConfiguration_aggregateToHigherRanks_tooltip=Aggregiere zu h?heren R?ngen
536
DistributionAggregationConfiguration_ClearExistingDistributions=L?sche existierende Verbreitungen
537
DistributionAggregationConfiguration_AggregationMode=Aggregationsmodus
538
DistributionAggregationConfiguration_SuperArea=W?hle Super Areale
539
DistributionAggregationConfiguration_StatusOrder=W?hle die Status Sortierung
540

  
541
SetAggregationConfiguration_Title=Aggregations Konfiguration;
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AbstractTermSelectionWizardPage.java
66 66

  
67 67
    protected abstract String getCheckedValuesFromPreferences();
68 68

  
69
    protected CheckboxTreeViewer getViewer(){
69
    public CheckboxTreeViewer getViewer(){
70 70
        return treeComposite.getViewer();
71 71
    }
72 72

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/preference/wizard/AvailableDistributionPage.java
39 39
 */
40 40
public class AvailableDistributionPage extends AbstractTermSelectionWizardPage<TermDto> {
41 41

  
42
    protected AvailableDistributionPage(String pageName) {
42
    public AvailableDistributionPage(String pageName) {
43 43
        super(pageName, TermType.NamedArea);
44 44
        this.localPref = true;
45 45

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/SuperAreaSelectionWizard.java
1
/**
2
* Copyright (C) 2019 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
*/
9
package eu.etaxonomy.taxeditor.ui.dialog;
10

  
11
import java.util.ArrayList;
12
import java.util.Arrays;
13
import java.util.UUID;
14

  
15
import org.apache.commons.collections.CollectionUtils;
16
import org.eclipse.jface.wizard.Wizard;
17

  
18
import eu.etaxonomy.cdm.api.service.description.DistributionAggregationConfiguration;
19
import eu.etaxonomy.cdm.persistence.dto.TermDto;
20
import eu.etaxonomy.cdm.persistence.dto.TermVocabularyDto;
21
import eu.etaxonomy.taxeditor.l10n.Messages;
22
import eu.etaxonomy.taxeditor.preference.wizard.AvailableDistributionPage;
23

  
24
/**
25
 * @author k.luther
26
 * @since 25.11.2019
27
 */
28
public class SuperAreaSelectionWizard extends Wizard {
29

  
30

  
31

  
32
       // private ConversationHolder conversation;
33
        private final AvailableDistributionPage aPage;
34
        DistributionAggregationConfiguration configurator;
35

  
36
        public SuperAreaSelectionWizard(DistributionAggregationConfiguration configurator) {
37
            setWindowTitle(Messages.AvailableDistributionWizard_WINDOW_TITLE);
38
            // TODO if preferenceStore has elements checked load elements in wizard
39
            aPage = new AvailableDistributionPage(Messages.AvailableDistributionWizard_PAGE_TITLE);
40
            this.configurator = configurator;
41
        }
42

  
43
        @Override
44
        public boolean performFinish() {
45
            // TODO: get Selection and save in EditorPreferences
46
            if (!checkNoneChecked()) {
47
                Object[] checkedElements = aPage.getViewer().getCheckedElements();
48
                Object[] grayedElements = aPage.getViewer().getGrayedElements();
49
                ArrayList checkedList = new ArrayList(Arrays.asList(checkedElements));
50
                ArrayList grayedList = new ArrayList(Arrays.asList(grayedElements));
51
                checkedList = (ArrayList) CollectionUtils.subtract(checkedList, grayedList);
52
                ArrayList<TermDto> listUIIDChecked = new ArrayList<TermDto>();
53
                ArrayList<UUID> listUIIDGrayed = new ArrayList<UUID>();
54
                for (Object o : checkedList) {
55
                    if (o instanceof TermDto) {
56
                        listUIIDChecked.add((TermDto) o);
57

  
58
                    }else if(o instanceof TermVocabularyDto){
59
                        TermVocabularyDto termVocDto = (TermVocabularyDto) o;
60
                        listUIIDGrayed.add(termVocDto.getUuid());
61
                    }
62
                }
63
//                for (Object o : grayedList) {
64
//                    if (o instanceof TermDto) {
65
//                        listUIIDChecked.add(((TermDto) o).getUuid());
66
//
67
//                    }else if(o instanceof TermVocabularyDto){
68
//                        TermVocabularyDto termVocDto = (TermVocabularyDto) o;
69
//                        listUIIDGrayed.add(termVocDto.getUuid());
70
//                    }
71
//                }
72

  
73
               configurator.setSuperAreas(listUIIDChecked);
74

  
75

  
76
                return true;
77
            } else {
78
                return false;
79
            }
80
        }
81

  
82
        @Override
83
        public void addPages() {
84
            addPage(aPage);
85
        }
86

  
87
        private boolean checkNoneChecked() {
88

  
89
            if (aPage.getViewer().getCheckedElements().length == 0) {
90
                aPage.setMessage(Messages.AvailableDistributionWizard_CHECK_MESSAGE, aPage.WARNING);
91
                return true;
92
            } else {
93
                aPage.setMessage(null);
94
                return false;
95
            }
96
        }
97
    //
98
//        @Override
99
//        public ConversationHolder getConversationHolder() {
100
//            if (conversation == null) {
101
//                conversation = CdmStore.createConversation();
102
//            }
103
//            return conversation;
104
//        }
105
    //
106
//        @Override
107
//        public void update(CdmDataChangeMap changeEvents) {
108
//        }
109
    }
110

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/DistributionAggregationConfiguratorWizard.java
1
/**
2
* Copyright (C) 2019 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
*/
9
package eu.etaxonomy.taxeditor.ui.dialog.configurator;
10

  
11
import java.util.UUID;
12

  
13
import org.eclipse.jface.wizard.Wizard;
14

  
15
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
16
import eu.etaxonomy.cdm.api.service.description.DistributionAggregationConfiguration;
17
import eu.etaxonomy.cdm.api.service.longrunningService.ILongRunningTasksService;
18
import eu.etaxonomy.cdm.filter.TaxonNodeFilter;
19
import eu.etaxonomy.taxeditor.l10n.Messages;
20

  
21
/**
22
 * @author k.luther
23
 * @since 15.11.2019
24
 */
25
public class DistributionAggregationConfiguratorWizard extends Wizard {
26
    private final DistributionAggregationConfiguration configurator;
27
    private DistributionAggregationWizardPage page;
28
    private ILongRunningTasksService longRunningTaskService;
29

  
30
    public DistributionAggregationConfiguratorWizard(DistributionAggregationConfiguration config) {
31
        super();
32
        this.configurator = config;
33
        setNeedsProgressMonitor(true);
34
        this.setWindowTitle(Messages.SetAggregationConfiguration_Title);
35
        longRunningTaskService = CdmApplicationState.getLongRunningTasksService();
36
    }
37

  
38

  
39
    @Override
40
    public boolean performFinish() {
41

  
42
        configurator.setAggregatingSourceTypes(page.getSourceTypes());
43
        configurator.setStatusOrder(page.getStatusOrder());
44
        if (page.useSubtree()){
45
            configurator.setTaxonNodeFilter(TaxonNodeFilter.NewSubtreeInstance(page.getSubTreeNode()));
46
        } else if (page.useClassification()){
47
            configurator.setTaxonNodeFilter(TaxonNodeFilter.NewClassificationInstance(page.getSelectedClassification()));
48
        } else if (page.useTaxonNode()){
49
            configurator.setTaxonNodeFilter(TaxonNodeFilter.NewTaxonNodeInstance(page.getSubTreeNode()));
50
        }
51
        configurator.getTaxonNodeFilter().setIncludeUnpublished(page.useUnpublishedData());
52
        configurator.getTaxonNodeFilter().setRankMax(page.getHigherRank());
53
        configurator.getTaxonNodeFilter().setRankMin(page.getLowerRank());
54
        configurator.setAggregationMode(page.getAggregationMode());
55

  
56
        UUID uuid = longRunningTaskService.invoke(configurator);
57

  
58

  
59
        return true;
60
    }
61

  
62

  
63
    @Override
64
    public void addPages() {
65
        page = new DistributionAggregationWizardPage(configurator);
66
        addPage(page);
67

  
68
    }
69

  
70

  
71
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/DistributionAggregationWizardPage.java
1
/**
2
* Copyright (C) 2019 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
*/
9
package eu.etaxonomy.taxeditor.ui.dialog.configurator;
10

  
11
import java.util.ArrayList;
12
import java.util.Arrays;
13
import java.util.Collections;
14
import java.util.Comparator;
15
import java.util.EnumSet;
16
import java.util.HashMap;
17
import java.util.List;
18
import java.util.Map;
19

  
20
import org.apache.commons.lang.StringUtils;
21
import org.eclipse.jface.layout.GridLayoutFactory;
22
import org.eclipse.jface.viewers.ArrayContentProvider;
23
import org.eclipse.jface.viewers.CheckStateChangedEvent;
24
import org.eclipse.jface.viewers.CheckboxTableViewer;
25
import org.eclipse.jface.viewers.ICheckStateListener;
26
import org.eclipse.jface.wizard.WizardDialog;
27
import org.eclipse.jface.wizard.WizardPage;
28
import org.eclipse.swt.SWT;
29
import org.eclipse.swt.events.SelectionAdapter;
30
import org.eclipse.swt.events.SelectionEvent;
31
import org.eclipse.swt.events.SelectionListener;
32
import org.eclipse.swt.layout.GridData;
33
import org.eclipse.swt.layout.GridLayout;
34
import org.eclipse.swt.widgets.Button;
35
import org.eclipse.swt.widgets.Combo;
36
import org.eclipse.swt.widgets.Composite;
37
import org.eclipse.swt.widgets.Event;
38
import org.eclipse.swt.widgets.Label;
39
import org.eclipse.swt.widgets.Listener;
40

  
41
import eu.etaxonomy.cdm.api.application.CdmApplicationState;
42
import eu.etaxonomy.cdm.api.service.IClassificationService;
43
import eu.etaxonomy.cdm.api.service.ITermTreeService;
44
import eu.etaxonomy.cdm.api.service.description.DescriptionAggregationConfigurationBase.AggregationMode;
45
import eu.etaxonomy.cdm.api.service.description.DescriptionAggregationConfigurationBase.SourceMode;
46
import eu.etaxonomy.cdm.api.service.description.DistributionAggregationConfiguration;
47
import eu.etaxonomy.cdm.filter.LogicFilter;
48
import eu.etaxonomy.cdm.model.name.Rank;
49
import eu.etaxonomy.cdm.model.name.TaxonName;
50
import eu.etaxonomy.cdm.model.reference.OriginalSourceType;
51
import eu.etaxonomy.cdm.model.taxon.Classification;
52
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
53
import eu.etaxonomy.cdm.model.term.TermTree;
54
import eu.etaxonomy.cdm.model.term.TermType;
55
import eu.etaxonomy.taxeditor.l10n.Messages;
56
import eu.etaxonomy.taxeditor.store.CdmStore;
57
import eu.etaxonomy.taxeditor.store.StoreUtil;
58
import eu.etaxonomy.taxeditor.ui.dialog.SuperAreaSelectionWizard;
59

  
60
/**
61
 * @author k.luther
62
 * @since 15.11.2019
63
 */
64
public class DistributionAggregationWizardPage extends WizardPage implements Listener, SelectionListener{
65

  
66
    private DistributionAggregationConfiguration configurator;
67

  
68
    private Combo comboHigherRank;
69
    private Combo comboLowerRank;
70

  
71
    private Combo comboSourceMode;
72

  
73
    private Combo comboAggregationMode;
74

  
75
    private Button btnSelectSuperAreas;
76
    private Combo comboStatusOrder;
77

  
78

  
79
    private Combo comboClassificationSelection;
80
    private List<Classification> classifications;
81
    private Classification selectedClassification;
82

  
83

  
84

  
85
    private Button checkUseSelectedTaxonNode;
86
    private Button checkUseSelectedClassification;
87
    private Button checkUseSelectedSubtree;
88

  
89

  
90
    private Button checkExportUnpublished;
91

  
92
    private TaxonNode subTreeNode;
93
    private CheckboxTableViewer sourceTypeViewer;
94
    Object[] checkedElements;
95
    Map<String, OriginalSourceType> typeMap = new HashMap();
96

  
97

  
98
    /**
99
     * @param pageName
100
     */
101
    public DistributionAggregationWizardPage(DistributionAggregationConfiguration configurator) {
102
        super("Set Publish Flag Configuration");
103
        this.configurator = configurator;
104

  
105
        this.setDescription(Messages.SetPublishConfiguration_Description_Configurator);
106

  
107
    }
108

  
109

  
110
    @Override
111
    public void createControl(Composite parent) {
112
        final Composite composite = new Composite(parent, SWT.NULL);
113
        checkExportUnpublished = new Button(composite,  SWT.CHECK);
114
        checkExportUnpublished.setText("Export unpublished taxa");
115
        GridData gridDataCheckUnpublished = new GridData(GridData.FILL_HORIZONTAL);
116
        gridDataCheckUnpublished.horizontalSpan = 2;
117

  
118

  
119
        Label separator = new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
120
        GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
121
        gridData.horizontalSpan = 2;
122
        gridData.verticalIndent = 5;
123
        separator.setLayoutData(gridData);
124

  
125
        String taxonStr = "";
126
        int count = configurator.getTaxonNodeFilter().getSubtreeFilter().size();
127
       // TaxonNode node = null;
128
        for (LogicFilter<TaxonNode> filter: configurator.getTaxonNodeFilter().getSubtreeFilter()){
129
            subTreeNode = CdmApplicationState.getCurrentAppConfig().getTaxonNodeService().load(filter.getUuid());
130
            count--;
131
            if (subTreeNode.hasTaxon()){
132
                taxonStr += subTreeNode.getTaxon().getName().getTitleCache();
133
                if (count>0){
134
                    taxonStr += ", ";
135
                }
136
            }
137
        }
138
        if (StringUtils.isNotBlank(taxonStr)){
139
            checkUseSelectedTaxonNode= new Button(composite,  SWT.RADIO);
140
            checkUseSelectedTaxonNode.setText("Aggregation only for ("+  taxonStr+")");
141
            checkUseSelectedTaxonNode.addListener(SWT.Selection, new Listener() {
142
                @Override
143
                public void handleEvent(Event e) {
144
                    Button b = (Button) e.widget;
145
                    GridData data = (GridData)  comboClassificationSelection.getLayoutData();
146
                    data.exclude = b.getSelection();
147
                    comboClassificationSelection.setEnabled(!data.exclude);
148
                    updateHigherRankCombo();
149
                }
150

  
151

  
152
            });
153

  
154
            checkUseSelectedSubtree= new Button(composite,  SWT.RADIO);
155
            checkUseSelectedSubtree.setText("Aggregation for selected subtree(s) ("+  taxonStr+")");
156
            checkUseSelectedSubtree.addListener(SWT.Selection, new Listener() {
157
                @Override
158
                public void handleEvent(Event e) {
159
                    Button b = (Button) e.widget;
160
                    GridData data = (GridData)  comboClassificationSelection.getLayoutData();
161
                    data.exclude = b.getSelection();
162
                    comboClassificationSelection.setEnabled(!data.exclude);
163

  
164
                    updateHigherRankCombo();
165
               }
166
            });
167

  
168
        }
169

  
170

  
171
          checkUseSelectedClassification= new Button(composite,  SWT.RADIO);
172
          checkUseSelectedClassification.setText("Export selected classification");
173
          checkUseSelectedClassification.addListener(SWT.Selection, new Listener() {
174
               @Override
175
               public void handleEvent(Event e) {
176
                   Button b = (Button) e.widget;
177
                   GridData data = (GridData)  comboClassificationSelection.getLayoutData();
178
                   data.exclude = b.getSelection();
179
                   comboClassificationSelection.setEnabled(data.exclude);
180
                   updateHigherRankCombo();
181
                  }
182
            });
183

  
184

  
185
            GridLayoutFactory.fillDefaults();
186

  
187
            if (subTreeNode!= null){
188
                selectedClassification = subTreeNode.getClassification();
189
            }
190
            GridData gridDataClassificationCombo = new GridData();
191
            gridDataClassificationCombo = new GridData(GridData.BEGINNING, GridData.CENTER, true, false);
192
            gridDataClassificationCombo.horizontalIndent = 5;
193
//          classificationSelection.setLayoutData(gridData);
194

  
195
            comboClassificationSelection = new Combo(composite, SWT.BORDER| SWT.READ_ONLY);
196
            comboClassificationSelection.setLayoutData(gridDataClassificationCombo);
197
            classifications = CdmStore.getService(IClassificationService.class).list(null, null, null, null, null);
198
            Collections.sort(classifications, new Comparator<Classification>() {
199

  
200
                @Override
201
                public int compare(Classification o1, Classification o2) {
202
                    if (o1.equals(o2)){
203
                        return 0;
204
                    }
205
                    int result = o1.getTitleCache().compareTo(o2.getTitleCache());
206
                    if (result == 0){
207
                        return o1.getUuid().compareTo(o2.getUuid());
208
                    }
209
                    return result;
210
                }
211
            });
212
            for(Classification tree : classifications){
213
                comboClassificationSelection.add(tree.getName().getText(), classifications.indexOf(tree));
214

  
215
            }
216

  
217
            comboClassificationSelection.select(classifications.indexOf(selectedClassification));
218

  
219
            // TODO remember last selection
220
            comboClassificationSelection.addSelectionListener(this);
221

  
222
            if (StringUtils.isNotBlank(taxonStr)){
223
                checkUseSelectedTaxonNode.setSelection(true);
224
                comboClassificationSelection.setEnabled(false);
225
            }else{
226
                checkUseSelectedClassification.setSelection(true);
227
            }
228
            separator = new Label(composite, SWT.HORIZONTAL | SWT.SEPARATOR);
229
            gridData = new GridData(GridData.FILL_HORIZONTAL);
230
            gridData.horizontalSpan = 2;
231
            gridData.verticalIndent = 5;
232
            separator.setLayoutData(gridData);
233

  
234
/*
235
 *
236

  
237
    TaxonNodeFilter parameter
238
        subtrees (TaxonNode) - if started from navigator by taxon node kontext menu, this should be prefilled
239
        upperRank and lower rank, both are optional, but upperRank should not show ranks above the rank of the selected taxonnode (if any selected)
240
        includeUnpublished (not yet fully implemented but definetely needed)
241
        taxonNodes: if we want to allow to update single taxonNodes (without subtree) we can use this, maybe the UI can have a checkbox "on subtree/on taxon only" to switch between subtrees/taxonNodes
242

  
243

  
244
    statusOrder: this is a link on all TermTree in the DB, which can be created with TaxEditor now. If empty the default ordering of the vocabulary for PresenceAbsenceTerm is taken, so if you want you can also add this vocabulary to the selection list
245

  
246
    SourceMode: List of the available enum of same name, a human readable version is still missing
247

  
248
    aggregatingSourceTypes: source types to use for aggregation, by default it is the both PrimaryXXX
249

  
250
 */
251
        GridLayout gridLayout = new GridLayout();
252
        gridLayout.numColumns = 1;
253

  
254
        composite.setLayout(gridLayout);
255
        final Composite control = new Composite(composite, SWT.NULL);
256
        GridLayout gridLayoutControl = new GridLayout();
257
        gridLayoutControl.numColumns = 2;
258
        control.setLayout(gridLayoutControl);
259
        control.setLayoutData(new GridData(SWT.FILL, SWT.LEFT, true, true));
260

  
261
        Label higherRankLabel = new Label(control, SWT.NULL);
262
        higherRankLabel.setText("Higher rank");
263
        comboHigherRank = new Combo(control, SWT.BORDER | SWT.READ_ONLY);
264
        updateHigherRankCombo();
265
        comboHigherRank.addListener(SWT.Selection, this);
266
        Label lowerRankLabel = new Label(control, SWT.NULL);
267
        lowerRankLabel.setText("Lower rank");
268
        comboLowerRank = new Combo(control, SWT.BORDER | SWT.READ_ONLY);
269
        updateLowerRankCombo();
270
        comboLowerRank.addListener(SWT.Selection, this);
271

  
272
        Label sourceModeLabel = new Label(control, SWT.NULL);
273
        sourceModeLabel.setText("Source mode");
274
        comboSourceMode = new Combo(control,  SWT.BORDER| SWT.READ_ONLY);
275
        comboSourceMode.setText(Messages.DistributionAggregationConfiguration_AggregationMode);
276
        for (SourceMode mode :SourceMode.values()){
277
            comboSourceMode.add(mode.toString());
278
            comboSourceMode.setData(mode.toString(), mode);
279
        }
280

  
281
        comboSourceMode.addSelectionListener(this);
282

  
283
        Label aggregationModeLabel = new Label(control, SWT.NULL);
284
        aggregationModeLabel.setText("Aggregation mode");
285
        comboAggregationMode = new Combo(control,  SWT.BORDER| SWT.READ_ONLY);
286
        comboAggregationMode.setText(Messages.DistributionAggregationConfiguration_AggregationMode);
287
//        for (AggregationMode mode: AggregationMode.values()){
288
//            comboAggregationMode.add(mode.toString());
289
//            comboAggregationMode.setData(mode.toString(), mode);
290
//        }
291
        comboAggregationMode.add("ranks");
292
        comboAggregationMode.setData("ranks", AggregationMode.byRanks());
293

  
294
        comboAggregationMode.add("areas and ranks");
295
        comboAggregationMode.setData("areas and ranks", AggregationMode.byAreasAndRanks());
296

  
297
        comboAggregationMode.add("areas");
298
        comboAggregationMode.setData("areas", AggregationMode.byAreas());
299

  
300

  
301
        comboAggregationMode.addSelectionListener(this);
302

  
303
        Label sourceTypeLabel = new Label(control, SWT.NULL);
304
        sourceTypeLabel.setText("Source type");
305

  
306
        sourceTypeViewer = CheckboxTableViewer.newCheckList(control, SWT.BORDER | SWT.SINGLE);
307
        sourceTypeViewer.setContentProvider(new ArrayContentProvider());
308

  
309

  
310
        sourceTypeViewer.addCheckStateListener(new ICheckStateListener(){
311
            @Override
312
            public void checkStateChanged(    CheckStateChangedEvent event){
313
                checkedElements=sourceTypeViewer.getCheckedElements();
314
                getWizard().getContainer().updateButtons();
315
              }
316
        });
317

  
318
        List<String> typeStrings = new ArrayList<>();
319
        Arrays.stream(OriginalSourceType.values()).forEach(p ->typeMap.put(p.getMessage(), p));
320
        Arrays.stream(OriginalSourceType.values()).forEach(p ->typeStrings.add(p.getMessage()));
321
        sourceTypeViewer.setInput(typeStrings);
322
        sourceTypeViewer.setChecked(OriginalSourceType.PrimaryMediaSource.getMessage(), true);
323
        sourceTypeViewer.setChecked(OriginalSourceType.PrimaryTaxonomicSource.getMessage(), true);
324

  
325
        //aggregation mode
326

  
327

  
328

  
329
        Label selectStatusLabel = new Label(control, SWT.NULL);
330
        selectStatusLabel.setText("Status order");
331
        comboStatusOrder = new Combo(control, SWT.PUSH );
332

  
333
        for (TermTree tree: CdmStore.getService(ITermTreeService.class).list(TermType.PresenceAbsenceTerm, null, 0, null,null)){
334
            comboStatusOrder.add(tree.getTitleCache());
335
            comboStatusOrder.setData(tree.getTitleCache(), tree);
336
        }
337
        comboStatusOrder.setText(Messages.DistributionAggregationConfiguration_StatusOrder);
338
        comboStatusOrder.addSelectionListener(this);
339

  
340
        Button buttonSuperArea = new Button(control, SWT.PUSH );
341
        GridData gridData2 = new GridData();
342
        gridData2.horizontalSpan = 1;
343
        gridData2.horizontalAlignment = SWT.RIGHT;
344

  
345
        buttonSuperArea.setLayoutData(gridData2);
346

  
347

  
348
        buttonSuperArea.setText("Select Super Areas");
349
//        buttonSuperArea.setToolTipText(Messages.ChecklistEditor_DIST_STATUS_TOOLTIP);
350
        buttonSuperArea.addSelectionListener(new SelectionAdapter() {
351
            @Override
352
            public void widgetSelected(SelectionEvent event) {
353
                SuperAreaSelectionWizard availableDistributionWizard = new SuperAreaSelectionWizard(configurator);
354
                WizardDialog dialog = new WizardDialog(StoreUtil.getShell(),
355
                        availableDistributionWizard);
356

  
357
                int open = dialog.open();
358

  
359
            }
360
        });
361

  
362
        GridLayoutFactory.fillDefaults();
363

  
364

  
365

  
366
        setControl(composite);
367

  
368
    }
369

  
370

  
371

  
372

  
373

  
374

  
375
    @Override
376
    public void widgetSelected(SelectionEvent e) {
377
        if (e.getSource().equals(comboSourceMode)){
378

  
379
            configurator.setToParentSourceMode((SourceMode)comboSourceMode.getData(comboSourceMode.getText()));
380
            configurator.setWithinTaxonSourceMode((SourceMode)comboSourceMode.getData(comboSourceMode.getText()));
381
        }
382

  
383

  
384
    }
385

  
386

  
387
    @Override
388
    public void widgetDefaultSelected(SelectionEvent e) {
389
        // TODO Auto-generated method stub
390

  
391
    }
392

  
393

  
394
    @Override
395
    public void handleEvent(Event event) {
396
        if (event.widget.equals(comboHigherRank)){
397
            updateLowerRankCombo();
398
        }
399
        if (event.widget.equals(selectedClassification)){
400
            updateHigherRankCombo();
401
            updateLowerRankCombo();
402
        }
403
        if (event.widget.equals(this.checkUseSelectedClassification)){
404
            updateHigherRankCombo();
405
            updateLowerRankCombo();
406
        }
407
        if (event.widget.equals(this.checkUseSelectedSubtree)){
408
            updateHigherRankCombo();
409
            updateLowerRankCombo();
410
        }
411
        if (event.widget.equals(this.checkUseSelectedTaxonNode)){
412
            updateHigherRankCombo();
413
            updateLowerRankCombo();
414
        }
415

  
416
    }
417

  
418
    private void updateHigherRankCombo() {
419
        comboHigherRank.removeAll();
420

  
421
        TaxonName name = null;
422
        if (subTreeNode != null){
423
            if (subTreeNode.getTaxon() != null){
424
                name = subTreeNode.getTaxon().getName();
425
            }
426
        }
427
        comboHigherRank.add("");
428
        if (name != null){
429
            for (Rank rank: CdmStore.getTermManager().getPreferredTerms(Rank.class)){
430
                if (useClassification()){
431
                    comboHigherRank.add(rank.getLabel());
432
                    comboHigherRank.setData(rank.getLabel(), rank);
433
                }else if (name != null && name.getRank().isHigher(rank)){
434
                    comboHigherRank.add(rank.getLabel());
435
                    comboHigherRank.setData(rank.getLabel(), rank);
436
                }
437

  
438
            }
439
        }else{
440
            for (Rank rank: CdmStore.getTermManager().getPreferredTerms(Rank.class)){
441
                comboHigherRank.add(rank.getLabel());
442
                comboHigherRank.setData(rank.getLabel(), rank);
443
            }
444
        }
445

  
446
    }
447

  
448

  
449
   private void updateLowerRankCombo() {
450
       comboLowerRank.removeAll();
451
       TaxonName name = null;
452
       if (subTreeNode != null){
453
           if (subTreeNode.getTaxon() != null){
454
               name = subTreeNode.getTaxon().getName();
455
           }
456
       }
457
       comboLowerRank.add("");
458
       for (Rank rank: CdmStore.getTermManager().getPreferredTerms(Rank.class)){
459
           if (subTreeNode == null && (comboHigherRank.getText() == null || (comboHigherRank.getData(comboHigherRank.getText()) != null && ((Rank)comboHigherRank.getData(comboHigherRank.getText())).isHigher(rank)))){
460
               comboLowerRank.add(rank.getLabel());
461
               comboLowerRank.setData(rank.getLabel(), rank);
462
           }else if (name == null || name.getRank().isHigher(rank)) {
463
               if(StringUtils.isBlank(comboHigherRank.getText()) || comboHigherRank.getData(comboHigherRank.getText()) != null && ((Rank)comboHigherRank.getData(comboHigherRank.getText())).isHigher(rank)){
464
               // the rank is lower than higher rank and lower than the rank of the subtree name
465
                   comboLowerRank.add(rank.getLabel());
466
                   comboLowerRank.setData(rank.getLabel(), rank);
467
               }
468
           }
469
       }
470

  
471

  
472
   }
473

  
474
   public Rank getHigherRank(){
475
       if (StringUtils.isNotBlank(comboHigherRank.getText())){
476
           return (Rank)comboHigherRank.getData(comboHigherRank.getText());
477
       }
478
       return null;
479
   }
480

  
481
   public Rank getLowerRank(){
482
       if (StringUtils.isNotBlank(comboLowerRank.getText())){
483
           return (Rank)comboLowerRank.getData(comboLowerRank.getText());
484
       }
485
       return null;
486
   }
487

  
488
   public SourceMode getSourceMode(){
489
       if (StringUtils.isNotBlank(comboSourceMode.getText())){
490
           return (SourceMode)comboSourceMode.getData(comboSourceMode.getText());
491
       }
492
       return null;
493
   }
494

  
495
   public TermTree getStatusOrder(){
496
       if (StringUtils.isNotBlank(comboStatusOrder.getText())){
497
           return (TermTree)comboStatusOrder.getData(comboStatusOrder.getText());
498
       }
499
       return null;
500
   }
501

  
502
   public boolean useClassification(){
503
       return checkUseSelectedClassification.getSelection();
504
   }
505

  
506
   public boolean useSubtree(){
507
       return checkUseSelectedSubtree.getSelection();
508
   }
509

  
510
   public boolean useTaxonNode(){
511
       return checkUseSelectedTaxonNode.getSelection();
512
   }
513

  
514
   public boolean useUnpublishedData(){
515
       return checkExportUnpublished.getSelection();
516
   }
517

  
518
   public EnumSet<OriginalSourceType> getSourceTypes(){
519
       List<OriginalSourceType> list = new ArrayList<>();
520
       for (Object o: sourceTypeViewer.getCheckedElements()){
521
           String string = null;
522
           if (o instanceof String){
523
               string = (String)o;
524
           }
525
           if (string != null){
526
               list.add(typeMap.get(string));
527
           }
528
       }
529

  
530
       return EnumSet.copyOf(list);
531
   }
532

  
533
   public List<AggregationMode> getAggregationMode(){
534
       return (List<AggregationMode>) comboAggregationMode.getData(comboAggregationMode.getText());
535
   }
536

  
537

  
538
    public Classification getSelectedClassification() {
539
        return selectedClassification;
540
    }
541

  
542

  
543
    public TaxonNode getSubTreeNode() {
544
        return subTreeNode;
545
    }
546
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/PublishSubTreeConfiguratorWizardPage.java
24 24
import org.eclipse.swt.widgets.Combo;
25 25
import org.eclipse.swt.widgets.Composite;
26 26
import org.eclipse.swt.widgets.Display;
27
import org.eclipse.swt.widgets.Event;
28 27
import org.eclipse.swt.widgets.Label;
29
import org.eclipse.swt.widgets.Listener;
30 28

  
31 29
import eu.etaxonomy.cdm.api.service.config.PublishForSubtreeConfigurator;
32 30
import eu.etaxonomy.taxeditor.l10n.Messages;
......
37 35
 * @date 10.10.2017
38 36
 *
39 37
 */
40
public class PublishSubTreeConfiguratorWizardPage extends WizardPage implements Listener, SelectionListener {
38
public class PublishSubTreeConfiguratorWizardPage extends WizardPage implements SelectionListener {
41 39

  
42 40
    private DataBindingContext m_bindingContext;
43 41

  
......
127 125
        setControl(composite);
128 126
    }
129 127

  
130
    /* (non-Javadoc)
131
     * @see org.eclipse.swt.widgets.Listener#handleEvent(org.eclipse.swt.widgets.Event)
132
     */
133
    @Override
134
    public void handleEvent(Event event) {
135
        // TODO Auto-generated method stub
136 128

  
137
    }
138 129

  
139 130
    protected DataBindingContext initDataBindings() {
140 131
        DataBindingContext bindingContext = new DataBindingContext();
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/configurator/SetSecundumConfiguratorWizardPage.java
239 239

  
240 240
    }
241 241

  
242
//    /**
243
//     * {@inheritDoc}
244
//     */
245
//    @Override
246
//    public AbstractCdmDetailElement createElement(ICdmFormElement rootElement) {
247
//        // TODO Auto-generated method stub
248
//        return null;
249
//    }
242

  
250 243

  
251 244

  
252 245

  

Also available in: Unified diff