Revision 9d33fde3
Added by Niels Hoffmann almost 13 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/AbstractCdmEditorViewPart.java | ||
---|---|---|
10 | 10 |
import eu.etaxonomy.taxeditor.store.StoreUtil; |
11 | 11 |
|
12 | 12 |
/** |
13 |
* <p>Abstract AbstractCdmEditorViewPart class.</p> |
|
14 |
* |
|
13 |
* <p> |
|
14 |
* Abstract AbstractCdmEditorViewPart class. |
|
15 |
* </p> |
|
16 |
* |
|
15 | 17 |
* @author n.hoffmann |
16 | 18 |
* @created Sep 21, 2010 |
17 | 19 |
* @version 1.0 |
18 | 20 |
*/ |
19 | 21 |
public abstract class AbstractCdmEditorViewPart extends AbstractCdmViewPart { |
20 | 22 |
|
21 |
/* (non-Javadoc) |
|
22 |
* @see eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#createPartControl(org.eclipse.swt.widgets.Composite) |
|
23 |
/* |
|
24 |
* (non-Javadoc) |
|
25 |
* |
|
26 |
* @see |
|
27 |
* eu.etaxonomy.taxeditor.model.AbstractCdmViewPart#createPartControl(org |
|
28 |
* .eclipse.swt.widgets.Composite) |
|
23 | 29 |
*/ |
24 | 30 |
/** {@inheritDoc} */ |
25 | 31 |
@Override |
26 | 32 |
public void createPartControl(Composite parent) { |
27 |
|
|
33 |
|
|
28 | 34 |
super.createPartControl(parent); |
29 |
|
|
35 |
|
|
30 | 36 |
// show viewer if there is an open editor |
31 |
// if(getEditor() != null){
|
|
32 |
// showViewer(getEditor(), new StructuredSelection(getInitialInput()));
|
|
33 |
// }
|
|
37 |
// if(getEditor() != null){
|
|
38 |
// showViewer(getEditor(), new StructuredSelection(getInitialInput()));
|
|
39 |
// }
|
|
34 | 40 |
} |
35 |
|
|
41 |
|
|
36 | 42 |
/** |
37 |
* <p>getEditor</p> |
|
38 |
* |
|
43 |
* <p> |
|
44 |
* getEditor |
|
45 |
* </p> |
|
46 |
* |
|
39 | 47 |
* @return the currently active editor |
40 | 48 |
*/ |
41 |
public IEditorPart getEditor(){ |
|
49 |
public IEditorPart getEditor() {
|
|
42 | 50 |
return StoreUtil.getActiveEditor(); |
43 | 51 |
} |
44 |
|
|
52 |
|
|
45 | 53 |
/** {@inheritDoc} */ |
46 |
public void changed(Object object){ |
|
47 |
if(part instanceof AbstractCdmViewPart){ |
|
54 |
@Override |
|
55 |
public void changed(Object object) { |
|
56 |
if (part instanceof AbstractCdmViewPart) { |
|
48 | 57 |
((AbstractCdmViewPart) part).changed(object); |
49 |
}else{ |
|
50 |
if(getEditor() != null && getEditor() instanceof IDirtyMarkableSelectionProvider){ |
|
51 |
|
|
52 |
((IDirtyMarkableSelectionProvider) getEditor()).changed(object); |
|
53 |
|
|
58 |
} else { |
|
59 |
IEditorPart editor = getEditor(); |
|
60 |
if (editor != null |
|
61 |
&& editor instanceof IDirtyMarkableSelectionProvider) { |
|
62 |
|
|
63 |
((IDirtyMarkableSelectionProvider) editor).changed(object); |
|
64 |
|
|
54 | 65 |
} |
55 | 66 |
} |
56 | 67 |
} |
Also available in: Unified diff
Working on the polytomous key editor