Revision 607cfd81
Added by Patrick Plitzner about 7 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeEditor.java | ||
---|---|---|
19 | 19 |
import javax.annotation.PostConstruct; |
20 | 20 |
import javax.annotation.PreDestroy; |
21 | 21 |
import javax.inject.Inject; |
22 |
import javax.inject.Named; |
|
23 | 22 |
|
24 | 23 |
import org.eclipse.core.runtime.IStatus; |
25 |
import org.eclipse.e4.core.di.annotations.Optional; |
|
26 | 24 |
import org.eclipse.e4.ui.di.Focus; |
27 | 25 |
import org.eclipse.e4.ui.di.Persist; |
28 | 26 |
import org.eclipse.e4.ui.model.application.ui.MDirtyable; |
29 |
import org.eclipse.e4.ui.services.IServiceConstants; |
|
30 | 27 |
import org.eclipse.e4.ui.workbench.modeling.ESelectionService; |
31 | 28 |
import org.eclipse.jface.viewers.ISelectionChangedListener; |
32 | 29 |
import org.eclipse.jface.viewers.IStructuredSelection; |
... | ... | |
38 | 35 |
import org.eclipse.swt.events.SelectionAdapter; |
39 | 36 |
import org.eclipse.swt.events.SelectionEvent; |
40 | 37 |
import org.eclipse.swt.widgets.Composite; |
41 |
import org.eclipse.swt.widgets.Shell; |
|
42 | 38 |
|
43 | 39 |
import eu.etaxonomy.cdm.api.conversation.ConversationHolder; |
44 | 40 |
import eu.etaxonomy.cdm.api.service.IFeatureNodeService; |
... | ... | |
82 | 78 |
|
83 | 79 |
/** {@inheritDoc} */ |
84 | 80 |
@PostConstruct |
85 |
public void createControl(Composite parent, @Optional@Named(IServiceConstants.ACTIVE_SHELL) Shell shell){
|
|
81 |
public void createControl(Composite parent){ |
|
86 | 82 |
if (CdmStore.isActive()){ |
87 | 83 |
if(conversation == null){ |
88 | 84 |
conversation = CdmStore.createConversation(); |
... | ... | |
108 | 104 |
} |
109 | 105 |
|
110 | 106 |
} |
111 |
FeatureTree tree = FeatureTreeSelectionDialog.select(shell, conversation, null);
|
|
107 |
FeatureTree tree = FeatureTreeSelectionDialog.select(composite.getDisplay().getActiveShell(), conversation, null);
|
|
112 | 108 |
if (tree != null) { |
113 | 109 |
composite.setSelectedTree(tree, FeatureTreeEditor.this); |
114 | 110 |
} |
115 | 111 |
} |
116 |
}, new AddButtonListener(), new RemoveSelectionListener(), new FeatureTreeExportListener(shell, composite));
|
|
112 |
}, new AddButtonListener(), new RemoveSelectionListener(), new FeatureTreeExportListener(composite.getDisplay().getActiveShell(), composite));
|
|
117 | 113 |
} |
118 | 114 |
|
119 | 115 |
public void setDirty(boolean isDirty){ |
Also available in: Unified diff
ref #6694 Refactor shell access