Project

General

Profile

Revision 5e008e49

ID5e008e493bbb4aeb2da462b3e5978dff82280f1e
Parent 22b92234
Child 794e59a4

Added by Patrick Plitzner over 4 years ago

fix #6483 Restructure view and bulk editor menu

  • move specimen editor (hierarchy) to bulk editor menu
  • move user and group menu item to admin menu

View differences:

eu.etaxonomy.taxeditor.application/plugin.xml
244 244
               </and>
245 245
            </visibleWhen>
246 246
         </command>
247
         <dynamic
248
               class="eu.etaxonomy.taxeditor.admin.UserGroupContributionItem"
249
               id="eu.etaxonomy.taxeditor.admin.UserGroupContributionItem">
250
            <visibleWhen
251
                  checkEnabled="true">
252
               <and>
253
                  <reference
254
                        definitionId="hasROLE_PROJECT_MANAGER">
255
                  </reference>
256
                  <reference
257
                        definitionId="isCdmStoreConnected">
258
                  </reference>
259
               </and>
260
            </visibleWhen>
261
         </dynamic>
247 262
      </menuContribution>
248 263
      <menuContribution
249 264
            locationURI="menu:org.eclipse.ui.main.menu.help">
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/admin/UserGroupContributionItem.java
1
// $Id$
2
/**
3
* Copyright (C) 2017 EDIT
4
* European Distributed Institute of Taxonomy
5
* http://www.e-taxonomy.eu
6
*
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10
package eu.etaxonomy.taxeditor.admin;
11

  
12
import java.util.ArrayList;
13
import java.util.List;
14

  
15
import org.eclipse.jface.action.IContributionItem;
16

  
17
import eu.etaxonomy.taxeditor.bulkeditor.command.OpenBulkEditorContributionItem;
18
import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputType;
19

  
20
/**
21
 * @author pplitzner
22
 * @date Mar 9, 2017
23
 *
24
 */
25
public class UserGroupContributionItem extends OpenBulkEditorContributionItem {
26

  
27
    /** {@inheritDoc} */
28
    @Override
29
    protected IContributionItem[] getContributionItems() {
30
        List<IContributionItem> contributionItems = new ArrayList<IContributionItem>();
31
        contributionItems.add(BulkEditorInputType.USER.createContributionItem());
32
        contributionItems.add(BulkEditorInputType.GROUP.createContributionItem());
33
        return contributionItems.toArray(new IContributionItem[contributionItems.size()]);
34
    }
35
}
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/bulkeditor/command/OpenBulkEditorContributionItem.java
10 10
package eu.etaxonomy.taxeditor.bulkeditor.command;
11 11

  
12 12
import java.util.ArrayList;
13
import java.util.HashMap;
14 13
import java.util.List;
15
import java.util.Map;
16 14

  
17 15
import org.eclipse.jface.action.IContributionItem;
18 16
import org.eclipse.jface.action.Separator;
19
import org.eclipse.swt.SWT;
20
import org.eclipse.ui.PlatformUI;
21 17
import org.eclipse.ui.actions.CompoundContributionItem;
22
import org.eclipse.ui.menus.CommandContributionItem;
23
import org.eclipse.ui.menus.CommandContributionItemParameter;
24 18

  
25
import eu.etaxonomy.taxeditor.bulkeditor.IBulkEditorConstants;
26 19
import eu.etaxonomy.taxeditor.bulkeditor.input.BulkEditorInputType;
27 20

  
28 21
/**
29
 * <p>
30
 * OpenBulkEditorContributionItem class.
31
 * </p>
32 22
 *
33 23
 * @author p.ciardelli
34 24
 * @created 19.08.2009
......
36 26
 */
37 27
public class OpenBulkEditorContributionItem extends CompoundContributionItem {
38 28

  
39
    /**
40
     * <p>
41
     * Constructor for OpenBulkEditorContributionItem.
42
     * </p>
43
     */
44 29
    public OpenBulkEditorContributionItem() {
45 30
    }
46 31

  
47
    /**
48
     * <p>
49
     * Constructor for OpenBulkEditorContributionItem.
50
     * </p>
51
     *
52
     * @param id
53
     *            a {@link java.lang.String} object.
54
     */
55 32
    public OpenBulkEditorContributionItem(String id) {
56 33
        super(id);
57 34
    }
58 35

  
59
    /*
60
     * (non-Javadoc)
61
     *
62
     * @see
63
     * org.eclipse.ui.actions.CompoundContributionItem#getContributionItems()
64
     */
65 36
    /** {@inheritDoc} */
66 37
    @Override
67 38
    protected IContributionItem[] getContributionItems() {
......
75 46
        contributionItems.add(BulkEditorInputType.NAME.createContributionItem());
76 47
        contributionItems.add(BulkEditorInputType.TAXON.createContributionItem());
77 48
        contributionItems.add(new Separator(groupName));
78
        contributionItems.add(BulkEditorInputType.OCCURRENCE.createContributionItem());
79
        contributionItems.add(new Separator(groupName));
80 49
        contributionItems.add(BulkEditorInputType.MEDIA.createContributionItem());
81 50
        contributionItems.add(new Separator(groupName));
82
        contributionItems.add(BulkEditorInputType.USER.createContributionItem());
83
        contributionItems.add(BulkEditorInputType.GROUP.createContributionItem());
51
        contributionItems.add(BulkEditorInputType.OCCURRENCE.createContributionItem());
84 52
        return contributionItems.toArray(new IContributionItem[contributionItems.size()]);
85 53
    }
86 54

  
87
    /**
88
     * @param key
89
     * @param object
90
     * @return
91
     */
92
    private IContributionItem createContributionItem(String label, String inputType) {
93
        CommandContributionItemParameter parameter = new CommandContributionItemParameter(PlatformUI.getWorkbench().getActiveWorkbenchWindow(), null, IBulkEditorConstants.DYNAMIC_OPEN_MENU_ID, SWT.NONE);
94

  
95
        parameter.label = label;
96

  
97
        Map<String, String> parameters = new HashMap<String, String>();
98
        parameters.put(IBulkEditorConstants.INPUT_TYPE_PARAMETER_ID, inputType);
99
        parameter.parameters = parameters;
100

  
101
        return new CommandContributionItem(parameter);
102
    }
103 55
}
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/l10n/messages.properties
2 2
BulkEditorInputType_1=References
3 3
BulkEditorInputType_2=Names
4 4
BulkEditorInputType_3=Name Relationships
5
BulkEditorInputType_4=Specimen and Observations
5
BulkEditorInputType_4=Specimen and Observations (bulk)
6 6
BulkEditorInputType_5=Users
7 7
BulkEditorInputType_6=Groups
8 8
BulkEditorInputType_7=Taxa
eu.etaxonomy.taxeditor.bulkeditor/src/main/java/eu/etaxonomy/taxeditor/l10n/messages_de.properties
2 2
BulkEditorInputType_1=Referenzen
3 3
BulkEditorInputType_2=Namen
4 4
BulkEditorInputType_3=Namensbeziehungen
5
BulkEditorInputType_4=Belege und Beobachtungen
5
BulkEditorInputType_4=Belege und Beobachtungen (bulk)
6 6
BulkEditorInputType_5=Nutzer
7 7
BulkEditorInputType_6=Nutzergruppen
8 8
BulkEditorInputType_7=Taxa
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin.properties
171 171
command.name.51 = delete
172 172

  
173 173
editor.name.DERIVATIVE_EDITOR = Specimen Editor
174
command.label.DERIVATIVE_EDITOR = Specimen Editor
174
command.label.DERIVATIVE_EDITOR = Specimen Editor (hierarchy)
175 175
command.label.LINK_WITH_TAXON_SELECTION = Link with taxon selection
176 176
command.label.UNLINK_FROM_TAXON_SELECTION = Unlink from taxon selection
177 177
command.label.REUSE_SINGLE_READ_HERE = Reuse single read here
eu.etaxonomy.taxeditor.editor/OSGI-INF/l10n/plugin_de.properties
168 168
command.name.57 = Setze als Basionym der homotypischen Gruppe
169 169

  
170 170
editor.name.DERIVATIVE_EDITOR = Specimen-Editor
171
command.label.DERIVATIVE_EDITOR = Specimen-Editor
171
command.label.DERIVATIVE_EDITOR = Specimen-Editor (Hierarchie)
172 172
command.label.LINK_WITH_TAXON_SELECTION = Verkn?pfe mit Taxonauswahl
173 173
command.label.UNLINK_FROM_TAXON_SELECTION = Verkn?pfung mit Taxonauswahl aufheben
174 174
command.label.REUSE_SINGLE_READ_HERE = Single-Read hier wiederverwenden
eu.etaxonomy.taxeditor.editor/plugin.xml
367 367
               </and>
368 368
            </visibleWhen>
369 369
         </command>
370
         <separator
371
               name="eu.etaxonomy.taxeditor.store.separator_derivative_start"
372
               visible="true">
373
         </separator>
374
         <command
375
               commandId="eu.etaxonomy.taxeditor.editor.openSpecimenEditorFromMenu"
376
               label="%command.label.DERIVATIVE_EDITOR"
377
               style="push">
378
            <visibleWhen
379
                  checkEnabled="true">
380
               <reference
381
                     definitionId="isCdmStoreConnected">
382
               </reference>
383
            </visibleWhen>
384
         </command>
385
         <separator
386
               name="eu.etaxonomy.taxeditor.editor.separator1"
387
               visible="true">
388
         </separator>
389 370
      </menuContribution>
390 371
      <menuContribution
391 372
            locationURI="menu:eu.etaxonomy.taxeditor.menu.showView?before=eu.etaxonomy.taxeditor.store.showViewMenu.internal">
......
1160 1141
            </command>
1161 1142
         </toolbar>
1162 1143
      </menuContribution>
1144
      <menuContribution
1145
            allPopups="false"
1146
            locationURI="menu:bulkeditor.menus.openmenu">
1147
         <command
1148
               commandId="eu.etaxonomy.taxeditor.editor.openSpecimenEditorFromMenu"
1149
               label="%command.label.DERIVATIVE_EDITOR"
1150
               style="push">
1151
            <visibleWhen
1152
                  checkEnabled="true">
1153
               <reference
1154
                     definitionId="isCdmStoreConnected">
1155
               </reference>
1156
            </visibleWhen>
1157
         </command>
1158
      </menuContribution>
1163 1159
   </extension>
1164 1160
   <extension
1165 1161
         point="org.eclipse.ui.handlers">

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)