Revision 22b4b462
Added by Patrick Plitzner almost 7 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/featuretree/e4/FeatureTreeEditor.java | ||
---|---|---|
22 | 22 |
import javax.inject.Named; |
23 | 23 |
|
24 | 24 |
import org.eclipse.core.runtime.IStatus; |
25 |
import org.eclipse.e4.core.di.annotations.Optional; |
|
25 | 26 |
import org.eclipse.e4.ui.di.Focus; |
26 | 27 |
import org.eclipse.e4.ui.di.Persist; |
27 | 28 |
import org.eclipse.e4.ui.model.application.ui.MDirtyable; |
... | ... | |
72 | 73 |
@Inject |
73 | 74 |
private MDirtyable dirty; |
74 | 75 |
|
75 |
private Shell shell; |
|
76 |
|
|
77 | 76 |
private FeatureTreeEditorComposite composite; |
78 | 77 |
|
79 | 78 |
@Inject |
... | ... | |
82 | 81 |
|
83 | 82 |
/** {@inheritDoc} */ |
84 | 83 |
@PostConstruct |
85 |
public void createControl(Composite parent) {
|
|
84 |
public void createControl(Composite parent, @Optional@Named(IServiceConstants.ACTIVE_SHELL) Shell shell){
|
|
86 | 85 |
if (CdmStore.isActive()){ |
87 | 86 |
if(conversation == null){ |
88 | 87 |
conversation = CdmStore.createConversation(); |
... | ... | |
140 | 139 |
} |
141 | 140 |
|
142 | 141 |
@Focus |
143 |
public void focus(@Named(IServiceConstants.ACTIVE_SHELL) Shell shell){ |
|
144 |
this.shell = shell; |
|
142 |
public void focus(){ |
|
145 | 143 |
if(composite!=null){ |
146 | 144 |
composite.getViewer().getControl().setFocus(); |
147 | 145 |
} |
... | ... | |
210 | 208 |
public void widgetSelected(SelectionEvent e) { |
211 | 209 |
AvailableFeaturesWizard wizard = new AvailableFeaturesWizard( |
212 | 210 |
composite.getFeatureTree()); |
213 |
WizardDialog dialog = new WizardDialog(shell, wizard);
|
|
211 |
WizardDialog dialog = new WizardDialog(e.widget.getDisplay().getActiveShell(), wizard);
|
|
214 | 212 |
|
215 | 213 |
if (dialog.open() == IStatus.OK) { |
216 | 214 |
FeatureNode parent = ((FeatureTree) composite.getViewer().getInput()).getRoot(); |
Also available in: Unified diff
ref #6774 minor UI tweaks, shell handling and code refactoring