Project

General

Profile

« Previous | Next » 

Revision 6ffb5f98

Added by Andreas Kohlbecker almost 5 years ago

fix #8220 TaxonNamePopupEditor to review or complete the exiting name to be registered

View differences:

src/main/java/eu/etaxonomy/cdm/vaadin/view/registration/RegistrationWorksetViewBean.java
112 112

  
113 113
    private UUID citationUuid;
114 114

  
115
    private Button addNewNameRegistrationButton;
115
    private GridLayout registrationsGrid;
116 116

  
117
    private LazyComboBox<TaxonName> existingNameCombobox;
117
    private RegistrationItem workingsetHeader;
118 118

  
119
    private GridLayout registrationsGrid;
119
    private Panel registrationListPanel;
120 120

  
121
    private Button addExistingNameButton;
121
    private Button addNewNameRegistrationButton;
122 122

  
123
    private Label existingNameRegistrationTypeLabel;
123
    private Button addExistingNameButton;
124 124

  
125
    private RegistrationItem workingsetHeader;
125
    private LazyComboBox<TaxonName> existingNameCombobox;
126 126

  
127
    private Panel registrationListPanel;
127
    private Label existingNameRegistrationTypeLabel;
128 128

  
129 129
    /**
130 130
     * uses the registrationId as key
......
140 140

  
141 141
    private String accessDeniedMessage;
142 142

  
143
    private Object existingNameEditor;
144

  
143 145
    public RegistrationWorksetViewBean() {
144 146
        super();
145 147
    }
......
261 263
        existingNameRegistrationTypeLabel = new Label();
262 264
        addExistingNameButton = new Button("existing name:");
263 265
        addExistingNameButton.setEnabled(false);
264
        addExistingNameButton.addClickListener(
265
                e -> getViewEventBus().publish(this, new RegistrationWorkingsetAction(
266
                        citationUuid,
267
                        RegistrationWorkingsetAction.Action.start
268
                )
269
             )
270
        );
266
        addExistingNameButton.addClickListener(e -> reviewExistingName());
271 267

  
272 268
        existingNameCombobox = new LazyComboBox<TaxonName>(TaxonName.class);
273 269
        existingNameCombobox.addValueChangeListener(
......
322 318
        return namesTypesPanel;
323 319
    }
324 320

  
321
    private void reviewExistingName() {
322
        // call commit to make the selection available
323
        existingNameCombobox.commit();
324
        UUID uuid = existingNameCombobox.getValue().getUuid();
325
        Stack<EditorActionContext> context = new Stack<EditorActionContext>();
326
        context.push(new EditorActionContext(
327
                    new TypedEntityReference<>(TaxonName.class, uuid),
328
                    this)
329
                    );
330
        getViewEventBus().publish(
331
                this,
332
                new TaxonNameEditorAction(
333
                        EditorActionType.EDIT,
334
                        uuid,
335
                        addExistingNameButton,
336
                        existingNameCombobox,
337
                        this,
338
                        context)
339
        );
340

  
341
    }
342

  
343
    /**
344
     * publishes an event to the {@link RegistrationWorkingsetPresenter}
345
     * @deprecated no longer used but kept for reference
346
     * TODO remove for version 5.8 when not used again.
347
     */
348
    @Deprecated
349
    private void triggerRegistrationForExistingName() {
350
        getViewEventBus().publish(this, new RegistrationWorkingsetAction(
351
                citationUuid,
352
                RegistrationWorkingsetAction.Action.start
353
                )
354
        );
355
    }
356

  
325 357

  
326 358
    protected int putRegistrationListComponent(int row, RegistrationDTO dto) {
327 359

  

Also available in: Unified diff