Revision b2f76600
Added by Patrick Plitzner over 10 years ago
- linked DerivateSearch with DerivateView via double-click (selection does not yet work)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/campanula/derivatesearch/DerivateSearchCompositeController.java | ||
---|---|---|
11 | 11 |
|
12 | 12 |
import java.util.List; |
13 | 13 |
|
14 |
import org.eclipse.core.commands.ExecutionException; |
|
15 |
import org.eclipse.core.commands.NotEnabledException; |
|
16 |
import org.eclipse.core.commands.NotHandledException; |
|
17 |
import org.eclipse.core.commands.common.NotDefinedException; |
|
14 | 18 |
import org.eclipse.jface.viewers.ArrayContentProvider; |
15 | 19 |
import org.eclipse.jface.viewers.DoubleClickEvent; |
16 | 20 |
import org.eclipse.jface.viewers.IDoubleClickListener; |
... | ... | |
18 | 22 |
import org.eclipse.swt.SWT; |
19 | 23 |
import org.eclipse.swt.events.KeyAdapter; |
20 | 24 |
import org.eclipse.swt.events.KeyEvent; |
25 |
import org.eclipse.ui.handlers.IHandlerService; |
|
21 | 26 |
|
27 |
import eu.etaxonomy.cdm.api.facade.DerivedUnitFacadeCacheStrategy; |
|
22 | 28 |
import eu.etaxonomy.cdm.api.service.config.IIdentifiableEntityServiceConfigurator; |
23 | 29 |
import eu.etaxonomy.cdm.api.service.config.IdentifiableServiceConfiguratorImpl; |
24 | 30 |
import eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase; |
31 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
|
25 | 32 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
26 | 33 |
|
27 | 34 |
/** |
... | ... | |
31 | 38 |
*/ |
32 | 39 |
public class DerivateSearchCompositeController { |
33 | 40 |
|
34 |
private DerivateSearchComposite derivateSearchComposite; |
|
35 |
private IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase<?>> configurator;
|
|
41 |
private final DerivateSearchComposite derivateSearchComposite;
|
|
42 |
private IIdentifiableEntityServiceConfigurator<SpecimenOrObservationBase<DerivedUnitFacadeCacheStrategy>> configurator;
|
|
36 | 43 |
|
37 | 44 |
/** |
38 | 45 |
* @param derivateSearchComposite |
... | ... | |
63 | 70 |
resultViewer.addDoubleClickListener(new IDoubleClickListener() { |
64 | 71 |
@Override |
65 | 72 |
public void doubleClick(DoubleClickEvent event) { |
66 |
// PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(input, editorId); |
|
73 |
String commandId = "eu.etaxonomy.taxeditor.editor.handler.openDerivateView"; |
|
74 |
|
|
75 |
IHandlerService handlerService = (IHandlerService) AbstractUtility.getService(IHandlerService.class); |
|
76 |
try { |
|
77 |
handlerService.executeCommand(commandId, null); |
|
78 |
} catch (ExecutionException e) { |
|
79 |
AbstractUtility.error(DerivateSearchCompositeController.class, e); |
|
80 |
} catch (NotDefinedException e) { |
|
81 |
AbstractUtility.error(DerivateSearchCompositeController.class, e); |
|
82 |
} catch (NotEnabledException e) { |
|
83 |
AbstractUtility.error(DerivateSearchCompositeController.class, e); |
|
84 |
} catch (NotHandledException e) { |
|
85 |
AbstractUtility.error(DerivateSearchCompositeController.class, e); |
|
86 |
} |
|
87 |
|
|
67 | 88 |
} |
68 | 89 |
}); |
69 | 90 |
|
70 |
configurator = new IdentifiableServiceConfiguratorImpl<SpecimenOrObservationBase<?>>();
|
|
91 |
configurator = new IdentifiableServiceConfiguratorImpl<SpecimenOrObservationBase<DerivedUnitFacadeCacheStrategy>>();
|
|
71 | 92 |
} |
72 | 93 |
|
73 | 94 |
private void searchDerivates(String searchString){ |
Also available in: Unified diff