Revision 1ffa011f
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/editor/definedterm/e4/DefinedTermEditorE4.java | ||
---|---|---|
12 | 12 |
import javax.annotation.PreDestroy; |
13 | 13 |
import javax.inject.Inject; |
14 | 14 |
|
15 |
import org.eclipse.core.runtime.IProgressMonitor; |
|
15 | 16 |
import org.eclipse.e4.ui.di.Focus; |
16 | 17 |
import org.eclipse.e4.ui.di.Persist; |
17 | 18 |
import org.eclipse.e4.ui.model.application.ui.MDirtyable; |
... | ... | |
39 | 40 |
import eu.etaxonomy.taxeditor.editor.definedterm.input.TermEditorInput; |
40 | 41 |
import eu.etaxonomy.taxeditor.model.AbstractUtility; |
41 | 42 |
import eu.etaxonomy.taxeditor.model.IDirtyMarkable; |
43 |
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails; |
|
44 |
import eu.etaxonomy.taxeditor.model.IPartContentHasSupplementalData; |
|
42 | 45 |
import eu.etaxonomy.taxeditor.operation.IPostOperationEnabled; |
43 | 46 |
import eu.etaxonomy.taxeditor.store.CdmStore; |
44 | 47 |
import eu.etaxonomy.taxeditor.ui.element.LayoutConstants; |
48 |
import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart; |
|
45 | 49 |
|
46 | 50 |
/** |
47 | 51 |
* |
... | ... | |
49 | 53 |
* @since Aug 22, 2017 |
50 | 54 |
* |
51 | 55 |
*/ |
52 |
public class DefinedTermEditorE4 implements IConversationEnabled, IDirtyMarkable, IPostOperationEnabled { |
|
56 |
public class DefinedTermEditorE4 implements IConversationEnabled, IDirtyMarkable, IPostOperationEnabled, |
|
57 |
IPartContentHasDetails, IPartContentHasSupplementalData, IE4SavablePart { |
|
53 | 58 |
|
54 | 59 |
public static final String OPEN_COMMAND_ID = "eu.etaxonomy.taxeditor.store.openDefinedTermEditor"; |
55 | 60 |
|
... | ... | |
129 | 134 |
viewer.setInput(input.getVocabularies()); |
130 | 135 |
} |
131 | 136 |
|
132 |
@Persist |
|
133 |
public void doSave() { |
|
137 |
@Override |
|
138 |
@Persist |
|
139 |
public void save(IProgressMonitor monitor) { |
|
134 | 140 |
getConversationHolder().commit(); |
135 | 141 |
input.merge(); |
136 | 142 |
setDirty(false); |
... | ... | |
144 | 150 |
|
145 | 151 |
@Focus |
146 | 152 |
public void setFocus() { |
147 |
viewer.getControl().setFocus(); |
|
148 |
getConversationHolder().bind(); |
|
153 |
if(viewer!=null){ |
|
154 |
viewer.getControl().setFocus(); |
|
155 |
} |
|
156 |
if(conversation!=null){ |
|
157 |
conversation.bind(); |
|
158 |
} |
|
149 | 159 |
if(input!=null){ |
150 | 160 |
input.bind(); |
151 | 161 |
} |
... | ... | |
209 | 219 |
|
210 | 220 |
@PreDestroy |
211 | 221 |
public void dispose() { |
212 |
input.dispose(); |
|
222 |
if(input!=null){ |
|
223 |
input.dispose(); |
|
224 |
} |
|
213 | 225 |
} |
214 | 226 |
|
215 | 227 |
public TermEditorInput getDefinedTermEditorInput() { |
216 | 228 |
return input; |
217 | 229 |
} |
230 |
|
|
218 | 231 |
} |
Also available in: Unified diff
ref #6922 Enable details and supp.Data view for term editor