1
|
|
2
|
package eu.etaxonomy.taxeditor.editor.workingSet.handler;
|
3
|
|
4
|
import javax.inject.Named;
|
5
|
|
6
|
import org.eclipse.e4.core.di.annotations.Execute;
|
7
|
import org.eclipse.e4.ui.model.application.ui.basic.MPart;
|
8
|
import org.eclipse.e4.ui.services.IServiceConstants;
|
9
|
|
10
|
import eu.etaxonomy.cdm.api.service.IWorkingSetService;
|
11
|
import eu.etaxonomy.cdm.model.description.WorkingSet;
|
12
|
import eu.etaxonomy.taxeditor.editor.l10n.Messages;
|
13
|
import eu.etaxonomy.taxeditor.editor.workingSet.WorkingSetNavigator;
|
14
|
import eu.etaxonomy.taxeditor.store.CdmStore;
|
15
|
|
16
|
public class CreateWorkingSetHandler {
|
17
|
|
18
|
@Execute
|
19
|
public void execute(@Named(IServiceConstants.ACTIVE_PART)MPart activePart) {
|
20
|
WorkingSetNavigator navigator = (WorkingSetNavigator) activePart.getObject();
|
21
|
WorkingSet workingSet = WorkingSet.NewInstance();
|
22
|
workingSet.setLabel(Messages.CreateWorkingSetHandler_NEW_WORKING_SET);
|
23
|
CdmStore.getService(IWorkingSetService.class).merge(workingSet, true);
|
24
|
navigator.getConversationHolder().commit();
|
25
|
navigator.addWorkingSet(workingSet);
|
26
|
}
|
27
|
|
28
|
}
|