2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
10 package eu
.etaxonomy
.taxeditor
.editor
.view
.checklist
;
12 import java
.util
.ArrayList
;
13 import java
.util
.Arrays
;
14 import java
.util
.Collections
;
15 import java
.util
.HashMap
;
16 import java
.util
.List
;
18 import java
.util
.SortedSet
;
20 import org
.apache
.log4j
.Logger
;
21 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
22 import org
.eclipse
.core
.runtime
.IStatus
;
23 import org
.eclipse
.core
.runtime
.Status
;
24 import org
.eclipse
.core
.runtime
.jobs
.Job
;
25 import org
.eclipse
.jface
.viewers
.ISelection
;
26 import org
.eclipse
.jface
.viewers
.StructuredViewer
;
27 import org
.eclipse
.jface
.viewers
.TableViewer
;
28 import org
.eclipse
.jface
.viewers
.TableViewerColumn
;
29 import org
.eclipse
.swt
.SWT
;
30 import org
.eclipse
.swt
.events
.ModifyListener
;
31 import org
.eclipse
.swt
.events
.SelectionAdapter
;
32 import org
.eclipse
.swt
.events
.SelectionEvent
;
33 import org
.eclipse
.swt
.layout
.GridData
;
34 import org
.eclipse
.swt
.layout
.GridLayout
;
35 import org
.eclipse
.swt
.widgets
.Composite
;
36 import org
.eclipse
.swt
.widgets
.Display
;
37 import org
.eclipse
.swt
.widgets
.Label
;
38 import org
.eclipse
.swt
.widgets
.Menu
;
39 import org
.eclipse
.swt
.widgets
.MenuItem
;
40 import org
.eclipse
.swt
.widgets
.Table
;
41 import org
.eclipse
.swt
.widgets
.TableColumn
;
42 import org
.eclipse
.swt
.widgets
.Text
;
43 import org
.eclipse
.swt
.widgets
.ToolBar
;
44 import org
.eclipse
.swt
.widgets
.ToolItem
;
45 import org
.eclipse
.ui
.IEditorInput
;
46 import org
.eclipse
.ui
.IEditorSite
;
47 import org
.eclipse
.ui
.IMemento
;
48 import org
.eclipse
.ui
.ISelectionListener
;
49 import org
.eclipse
.ui
.ISelectionService
;
50 import org
.eclipse
.ui
.IWorkbenchPart
;
51 import org
.eclipse
.ui
.PartInitException
;
52 import org
.eclipse
.ui
.part
.EditorPart
;
53 import org
.eclipse
.ui
.progress
.IWorkbenchSiteProgressService
;
55 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
56 import eu
.etaxonomy
.cdm
.api
.conversation
.IConversationEnabled
;
57 import eu
.etaxonomy
.cdm
.api
.service
.ITaxonNodeService
;
58 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
59 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
60 import eu
.etaxonomy
.cdm
.model
.taxon
.Classification
;
61 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
62 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
63 import eu
.etaxonomy
.cdm
.persistence
.hibernate
.CdmDataChangeMap
;
64 import eu
.etaxonomy
.taxeditor
.editor
.EditorUtil
;
65 import eu
.etaxonomy
.taxeditor
.editor
.SimpleSelectionProvider
;
66 import eu
.etaxonomy
.taxeditor
.editor
.view
.checklist
.edit
.DistributionEditingSupport
;
67 import eu
.etaxonomy
.taxeditor
.editor
.view
.checklist
.filter
.ChecklistEditorFilter
;
68 import eu
.etaxonomy
.taxeditor
.editor
.view
.checklist
.listener
.ChecklistDropdownSelectionListener
;
69 import eu
.etaxonomy
.taxeditor
.editor
.view
.checklist
.listener
.ChecklistFocusListener
;
70 import eu
.etaxonomy
.taxeditor
.editor
.view
.checklist
.listener
.ChecklistModifyListener
;
71 import eu
.etaxonomy
.taxeditor
.model
.IContextListener
;
72 import eu
.etaxonomy
.taxeditor
.model
.IDirtyMarkable
;
73 import eu
.etaxonomy
.taxeditor
.model
.IPartContentHasDetails
;
74 import eu
.etaxonomy
.taxeditor
.model
.IPartContentHasFactualData
;
75 import eu
.etaxonomy
.taxeditor
.model
.MessagingUtils
;
76 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
77 import eu
.etaxonomy
.taxeditor
.preference
.Resources
;
78 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
82 * ChecklistViewPart class.
89 public class ChecklistEditor
extends EditorPart
implements ISelectionListener
, IPartContentHasFactualData
, IConversationEnabled
,
90 IContextListener
, IPartContentHasDetails
, IDirtyMarkable
{//, ICdmEntitySessionEnabled {
92 private static final Logger logger
= Logger
.getLogger(ChecklistEditor
.class);
94 * Key used for storing Checklist Editor View
96 private static final String CHECKLIST_EDITOR_MEMENTO_KEY
= "checklistEditor";
101 private class ChecklistJob
extends Job
{
103 private List
<TaxonNode
> taxonNodes
;
108 public ChecklistJob(String title
, List
<TaxonNode
> listTaxonNodes
) {
110 this.taxonNodes
= listTaxonNodes
;
118 * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.
122 public IStatus
run(final IProgressMonitor monitor
) {
124 logger
.debug("Begin of eclipse core runtime Job to Retrieve datasources");
125 monitor
.beginTask("Retrieving TaxonNodes", taxonNodes
.size() + 1);
127 final List
<Taxon
> taxonList
= new ArrayList
<Taxon
>();
129 for (TaxonNode taxonNode
: taxonNodes
) {
130 HibernateProxyHelper hh
= new HibernateProxyHelper();
131 Taxon taxon
= hh
.deproxy(taxonNode
.getTaxon(), Taxon
.class);
132 taxonList
.add(taxon
);
135 Display
.getDefault().asyncExec(new Runnable() {
139 viewer
.setInput(taxonList
);
148 return Status
.OK_STATUS
;
154 * <code>ID="eu.etaxonomy.taxeditor.store.datasource"{trunked}</code>
156 public static String ID
= "eu.etaxonomy.taxeditor.editor.view.checklist.ChecklistEditor";
158 private TableViewer viewer
;
160 private String partNameCache
;
162 private IWorkbenchSiteProgressService service
;
164 private ITaxonNodeService taxonNodeService
;
166 private ChecklistEditorComparator comparator
;
168 private ChecklistEditorInput checklistEditorInput
;
170 private SimpleSelectionProvider simpleSelectionProvider
;
172 private ISelectionService selectionService
;
174 private ConversationHolder conversation
;
176 private Integer countNodes
;
178 private List
<TaxonNode
> selectedTaxonNodes
;
180 private boolean dirty
;
182 private ChecklistEditorFilter filter
;
184 private Menu headerMenu
;
186 private Label statusLabel
;
188 // private final ICdmEntitySession cdmEntitySession;
190 private ChecklistLabelProvider labelProvider
;
192 private SortedSet
<DefinedTermBase
> terms
= null;
193 private ToolItem toolItem
;
194 private ChecklistDropdownSelectionListener dropListener
;
197 * @return the selectedTaxonNodes
199 public List
<TaxonNode
> getSelectedTaxonNodes() {
200 return selectedTaxonNodes
;
204 * @param selectedTaxonNodes
205 * the selectedTaxonNodes to set
207 public void setSelectedTaxonNodes(List
<TaxonNode
> selectedTaxonNodes
) {
208 this.selectedTaxonNodes
= selectedTaxonNodes
;
213 * Constructor for CdmDataSourceViewPart.
216 public ChecklistEditor() {
217 //cdmEntitySession = CdmStore.getCurrentSessionManager().newSession(this, true);
223 public void createPartControl(Composite parent
) {
224 service
= (IWorkbenchSiteProgressService
) getSite().getAdapter(IWorkbenchSiteProgressService
.class);
225 taxonNodeService
= CdmStore
.getService(ITaxonNodeService
.class);
226 selectionService
= getSite().getWorkbenchWindow().getSelectionService();
227 selectionService
.addSelectionListener(this);
228 viewer
= new TableViewer(parent
, SWT
.MULTI
| SWT
.H_SCROLL
| SWT
.V_SCROLL
| SWT
.FULL_SELECTION
);
229 labelProvider
= new ChecklistLabelProvider(this.viewer
);
231 terms
= labelProvider
.getNamedAreas();
233 MessagingUtils
.informationDialog("No Areas to display", "Please choose the areas you want to display. "
234 + "Therefore go to the preferences, choose the Checklist Editor and choose the areas in the Distribution Selection Wizard.");
238 filter
= new ChecklistEditorFilter();
239 createTopComposite(parent
);
246 private void createTopComposite(Composite parent
) {
247 GridLayout gridLayout
= new GridLayout(3, false);
248 gridLayout
.marginWidth
= 0;
249 gridLayout
.marginHeight
= 0;
250 parent
.setLayout(gridLayout
);
252 final Text searchText
= createSearchBar(parent
);
253 createToolbar(parent
);
255 getSite().setSelectionProvider(viewer
);
257 final ModifyListener modifyListener
= new ChecklistModifyListener(viewer
, filter
, searchText
);
259 searchText
.addFocusListener(new ChecklistFocusListener(searchText
, modifyListener
));
260 searchText
.addModifyListener(modifyListener
);
261 createGridDataForViewerLayout();
263 viewer
.addFilter(filter
);
266 viewer
.setContentProvider(new ChecklistContentProvider());
267 viewer
.setLabelProvider(this.labelProvider
);
268 comparator
= new ChecklistEditorComparator();
269 viewer
.setComparator(comparator
);
271 createStatusBar(parent
);
274 private void createGridDataForViewerLayout() {
275 GridData gridData
= new GridData();
276 gridData
.verticalAlignment
= GridData
.FILL
;
277 gridData
.horizontalSpan
= 3;
278 gridData
.grabExcessHorizontalSpace
= true;
279 gridData
.grabExcessVerticalSpace
= true;
280 gridData
.horizontalAlignment
= GridData
.FILL
;
281 viewer
.getControl().setLayoutData(gridData
);
288 private Text
createSearchBar(Composite parent
) {
289 Label searchLabel
= new Label(parent
, SWT
.NONE
);
290 searchLabel
.setText("Search: ");
291 final Text searchText
= new Text(parent
, SWT
.BORDER
| SWT
.SEARCH
| SWT
.ICON_SEARCH
| SWT
.CANCEL
);
292 searchText
.setLayoutData(new GridData(GridData
.GRAB_HORIZONTAL
| GridData
.HORIZONTAL_ALIGN_FILL
));
293 searchText
.setForeground(EditorUtil
.getColor(Resources
.SEARCH_VIEW_FOREGROUND
));
294 searchText
.setText("type filter text");
301 private void createToolbar(Composite parent
) {
302 ToolBar toolBar
= new ToolBar(parent
, SWT
.NONE
);
303 toolItem
= new ToolItem(toolBar
, SWT
.DROP_DOWN
| SWT
.BORDER
);
304 toolItem
.setText("Distribution Status");
305 toolItem
.setToolTipText("Show Distribution Status for selected Areas");
306 createToolbarItems();
307 toolItem
.addSelectionListener(dropListener
);
311 private void createToolbarItems() {
312 dropListener
= new ChecklistDropdownSelectionListener(toolItem
, this, terms
);
314 for (DefinedTermBase
<DefinedTermBase
> term
: terms
) {
316 dropListener
.add(term
);
321 private void createStatusBar(Composite composite
) {
322 GridData gridData
= new GridData();
323 gridData
.horizontalSpan
= 3;
324 gridData
.grabExcessHorizontalSpace
= true;
325 gridData
.horizontalAlignment
= GridData
.FILL
;
327 statusLabel
= new Label(composite
, SWT
.LEFT
);
328 statusLabel
.setText("Anzahl der Elemente: " + (countNodes
!= null ? countNodes
: "uknown"));
329 statusLabel
.setLayoutData(gridData
);
332 private void createTable() {
333 Table table
= viewer
.getTable();//new Table(parent, viewer.getTable().getStyle());
334 List
<String
> titles
= new ArrayList
<String
>();
335 List
<Integer
> bounds
= new ArrayList
<Integer
>();
336 if (PreferencesUtil
.isShowRankInChecklistEditor()){
337 Collections
.addAll(titles
, "Taxon", "Rank");
338 Collections
.addAll(bounds
, 300, 200);
340 Collections
.addAll(titles
, "Taxon");
341 Collections
.addAll(bounds
, 300);
345 Map
<Integer
, Boolean
> restoreValuesForColumnWidth
= restoreValuesForColumnWidth(titles
, bounds
);
346 createInitalDistributionColumns(table
, titles
, bounds
, restoreValuesForColumnWidth
);
347 table
.setSortDirection(SWT
.DOWN
);
348 table
.setHeaderVisible(true);
349 table
.setLinesVisible(true);
352 * This method creates initially the distribution columns for a table. It should only be called for creation.<br>
355 *<b>Notice:</b> If you want to add additional columns later please use <b>addTableViewerColumn()</b>
360 * @param restoreValuesForColumnWidth
362 private void createInitalDistributionColumns(Table table
,
363 List
<String
> titles
, List
<Integer
> bounds
, Map
<Integer
, Boolean
> restoreValuesForColumnWidth
) {
364 for (int columnIndex
= 0; columnIndex
< titles
.size(); columnIndex
++) {
365 TableViewerColumn column
= new TableViewerColumn(viewer
, SWT
.NONE
);
366 column
.getColumn().setText(titles
.get(columnIndex
));
367 column
.getColumn().setWidth(bounds
.get(columnIndex
));
368 column
.getColumn().setResizable(true);
369 column
.getColumn().setMoveable(true);
370 column
.getColumn().addSelectionListener(getSelectionAdapter(column
.getColumn(), columnIndex
));
371 if (columnIndex
== 0) {
372 table
.setSortColumn(column
.getColumn());
374 if (columnIndex
== 1 && PreferencesUtil
.isShowRankInChecklistEditor()) {
375 /** uncommented it for now because no rank editing is wanted **/
376 // column.setEditingSupport(new RankEditingSupport(viewer, this));
378 if ((columnIndex
== 1 && !PreferencesUtil
.isShowRankInChecklistEditor()) || columnIndex
>= 2 ) {
379 //read PrefrenceStore to setWidth according to last saved state
380 if(restoreValuesForColumnWidth
.get(columnIndex
)){
381 column
.getColumn().setWidth(50);
383 column
.getColumn().setWidth(50);
385 column
.setEditingSupport(new DistributionEditingSupport(viewer
, this, columnIndex
));
391 * This methods loads the last opened distribution columns for the table viewer from the prefrence store.<br>
393 * <b>Notice:</b> It adds also the TitleCache to the titles list for the header of each column.<p>
397 * @return Map<Integer, Boolean>
399 private Map
<Integer
, Boolean
> restoreValuesForColumnWidth(List
<String
> titles
,
400 List
<Integer
> bounds
) {
401 Map
<Integer
, Boolean
> restoreColumnWidth
= new HashMap
<Integer
, Boolean
>();
404 if (PreferencesUtil
.isShowRankInChecklistEditor()){
409 for (DefinedTermBase
<DefinedTermBase
> term
: terms
) {
411 restoreColumnWidth
.put(columnIndex
, PreferencesUtil
.getPreferenceStore().getBoolean(term
.getUuid().toString()));
412 if (PreferencesUtil
.isShowIdInVocabularyInChecklistEditor()){
413 if (term
.getIdInVocabulary() != null){
414 titles
.add(term
.getIdInVocabulary());
416 titles
.add(term
.getTitleCache());
419 titles
.add(term
.getTitleCache());
426 return restoreColumnWidth
;
430 * This method adds new DistributionColumns to an existing table.
437 private TableViewerColumn
addTableViewerColumn(String title
, int bound
, final int colNumber
) {
438 final TableViewerColumn viewerColumn
= new TableViewerColumn(viewer
, SWT
.NONE
);
439 final TableColumn column
= viewerColumn
.getColumn();
440 column
.setText(title
);
441 column
.setWidth(200);
442 viewerColumn
.setEditingSupport(new DistributionEditingSupport(viewer
, this, colNumber
));
443 column
.setResizable(true);
444 column
.setMoveable(true);
452 * pull data from database and set input for view
455 private void loadDataInput() {
456 Classification classification
= checklistEditorInput
.getClassification();
457 TaxonNode taxonNode
= checklistEditorInput
.getTaxonNode();
458 if (classification
!= null && taxonNode
== null) {
459 countNodes
= taxonNodeService
.countAllNodesForClassification(classification
);
460 statusLabel
.setText("Anzahl der Elemente: " + (countNodes
!= null ? countNodes
: "unknown"));
461 // This should not kill the view nor the editor if something goes
463 // TODO: don't load the whole taxonNode Object but rather a small
464 // and simple Solution
465 // FIXME: May be don't open classification which are greater than
467 selectedTaxonNodes
= taxonNodeService
.listAllNodesForClassification(classification
, 0, countNodes
);
468 getService().schedule(new ChecklistJob("loading Taxa", selectedTaxonNodes
), Job
.LONG
);
470 if (taxonNode
!= null) {
471 selectedTaxonNodes
= taxonNodeService
.loadChildNodesOfTaxonNode(taxonNode
, NODE_INIT_STRATEGY
, true, null);
472 getService().schedule(new ChecklistJob("loading Taxa", selectedTaxonNodes
), Job
.LONG
);
478 public void dispose() {
479 this.checklistEditorInput
.dispose();
482 conversation
.unregisterForDataStoreChanges(this);
483 conversation
.unbind();
485 //conversation.close();
491 public void setFocus() {
493 viewer
.getControl().setFocus();
499 * @see org.eclipse.ui.part.WorkbenchPart#showBusy(boolean)
503 public void showBusy(boolean busy
) {
504 super.showBusy(busy
);
505 // viewer.getTable().setEnabled(!busy);
507 partNameCache
= getPartName();
508 setPartName("Loading " + countNodes
+ " Taxa...");
510 if (partNameCache
!= null) {
511 setPartName(partNameCache
);
518 * Getter for the field <code>viewer</code>.
521 * @return a {@link org.eclipse.jface.viewers.StructuredViewer} object.
523 public StructuredViewer
getViewer() {
527 public void refresh() {
532 * This method should only be called for adding new Distribution columns and reloading the table.<br>
533 * It will hide the old distribution column and load the newly added columns.<br>
535 * <b>Notice:</b> for data update please use <b>refresh()</b>
538 @SuppressWarnings({ "unchecked", "rawtypes" })
539 public void reload(){
540 //create new Items for Dropdown menue
541 Table table
= viewer
.getTable();
542 table
.setRedraw(false);
543 SortedSet
<DefinedTermBase
> oldTerms
= terms
;
545 // if (PreferencesUtil.isShowIdInVocabularyInChecklistEditor()){
548 // terms = (SortedSet<DefinedTermBase>) labelProvider.getTermsOrderedByLabels(labelProvider.getNamedAreas(), CdmStore.getDefaultLanguage());
550 SortedSet
<DefinedTermBase
> newTerms
= labelProvider
.getNamedAreas();
551 toolItem
.removeSelectionListener(dropListener
);
552 hideDistributionColumns(oldTerms
);
553 createToolbarItems();
554 toolItem
.addSelectionListener(dropListener
);
555 for(DefinedTermBase term
:newTerms
){
556 int count
= viewer
.getTable().getColumnCount();
557 addTableViewerColumn(term
.getTitleCache(), 200, count
);
558 acitivateNewColumnInDropDownMenu(term
);
560 viewer
.setLabelProvider(labelProvider
);
561 getService().schedule(new ChecklistJob("loading Taxa", selectedTaxonNodes
), Job
.LONG
);
562 table
.setRedraw(true);
566 private void acitivateNewColumnInDropDownMenu(DefinedTermBase term
) {
567 Menu menu
= dropListener
.getMenu();
568 MenuItem
[] items
= menu
.getItems();
569 for(MenuItem item
: items
){
570 if(item
.getText().equalsIgnoreCase(term
.getTitleCache())){
571 item
.setSelection(true);
572 PreferencesUtil
.getPreferenceStore().setValue(term
.getUuid().toString(), true);
577 private void hideDistributionColumns(SortedSet
<DefinedTermBase
> oldTerms
) {
578 TableColumn
[] columns
= viewer
.getTable().getColumns();
579 for(int i
=4; i
<columns
.length
; i
++){
581 columns
[i
].dispose();
582 Menu menu
= dropListener
.getMenu();
583 int itemCount
= menu
.getItemCount();
584 MenuItem item
= menu
.getItem(i
-3);
585 item
.setSelection(false);
587 if(oldTerms
!= null){
588 for(DefinedTermBase term
: oldTerms
){
589 PreferencesUtil
.getPreferenceStore().setValue(term
.getUuid().toString(), false);
596 * Getter for the field <code>service</code>.
599 * @return the service
601 public IWorkbenchSiteProgressService
getService() {
605 private SelectionAdapter
getSelectionAdapter(final TableColumn column
, final int index
) {
606 SelectionAdapter selectionAdapter
= new SelectionAdapter() {
608 public void widgetSelected(SelectionEvent e
) {
609 comparator
.setColumn(index
);
610 int dir
= viewer
.getTable().getSortDirection();
611 if (viewer
.getTable().getSortColumn() == column
) {
612 dir
= dir
== SWT
.UP ? SWT
.DOWN
: SWT
.UP
;
616 viewer
.getTable().setSortDirection(dir
);
617 viewer
.getTable().setSortColumn(column
);
621 return selectionAdapter
;
625 public void doSave(IProgressMonitor monitor
) {
627 monitor
.beginTask("Saving Editor", 1);
628 if (!conversation
.isBound()) {
631 CdmStore
.getService(ITaxonNodeService
.class).merge(selectedTaxonNodes
, true);
632 //this.checklistEditorInput.merge();
633 conversation
.commit(true);
643 public void doSaveAs() {
647 public void init(IEditorSite site
, IEditorInput input
) throws PartInitException
{
650 if (input
instanceof ChecklistEditorInput
) {
651 checklistEditorInput
= (ChecklistEditorInput
) input
;
652 setPartName(getPartName() + ": " + checklistEditorInput
.getName());
653 conversation
= checklistEditorInput
.getConversation();
654 conversation
.registerForDataStoreChanges(this);
656 simpleSelectionProvider
= new SimpleSelectionProvider();
657 getSite().setSelectionProvider(simpleSelectionProvider
);
662 public boolean isSaveAsAllowed() {
669 * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.
670 * IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
673 public void selectionChanged(IWorkbenchPart part
, ISelection selection
) {
684 * eu.etaxonomy.taxeditor.model.IContextListener#contextAboutToStop(org.
685 * eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
689 public void contextAboutToStop(IMemento memento
, IProgressMonitor monitor
) {
697 * eu.etaxonomy.taxeditor.model.IContextListener#contextStop(org.eclipse
698 * .ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
701 public void contextStop(IMemento memento
, IProgressMonitor monitor
) {
702 // IStructuredSelection sel = (IStructuredSelection) this.viewer.getSelection();
703 // if (sel.isEmpty()) {
706 // memento = memento.createChild("tree-selections");
707 // Iterator iter = sel.iterator();
708 // while (iter.hasNext()) {
709 // String nodeName = (String) iter.next();
710 // memento.createChild("selected-nodes", nodeName);
718 * eu.etaxonomy.taxeditor.model.IContextListener#contextStart(org.eclipse
719 * .ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
722 public void contextStart(IMemento memento
, IProgressMonitor monitor
) {
730 * eu.etaxonomy.taxeditor.model.IContextListener#contextRefresh(org.eclipse
731 * .core.runtime.IProgressMonitor)
734 public void contextRefresh(IProgressMonitor monitor
) {
741 * eu.etaxonomy.taxeditor.model.IContextListener#workbenchShutdown(org.eclipse
742 * .ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
745 public void workbenchShutdown(IMemento memento
, IProgressMonitor monitor
) {
746 conversation
.clear();
747 conversation
.close();
751 private static final List
<String
> NODE_INIT_STRATEGY
= Arrays
.asList(new String
[] { "descriptions",
752 "descriptions.*", "description.state", "feature", "feature.*", "childNodes", "childNodes.taxon",
753 "childNodes.taxon.name", "taxonNodes", "taxonNodes.*", "taxonNodes.taxon.*", "taxon.*",
754 "taxon.descriptions", "taxon.sec", "taxon.name.*", "terms", "name.*",
755 "name.rank.representations", "name.status.type.representations", "stateData.$" });
761 * eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#changed(
765 public void changed(Object element
) {
766 if (element
!= null) {
767 viewer
.update(element
, null);
769 firePropertyChange(PROP_DIRTY
);
774 * @see eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#forceDirty()
777 public void forceDirty() {
781 public void setDirty(boolean dirty
) {
783 firePropertyChange(PROP_DIRTY
);
789 * @see org.eclipse.ui.forms.editor.FormEditor#isDirty()
792 public boolean isDirty() {
797 * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getCdmEntitySession()
802 // * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getRootEntities()
805 // public <T extends CdmBase> Collection<T> getRootEntities() {
806 // // TODO Auto-generated method stub
811 // * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
814 // public Map<Object, List<String>> getPropertyPathsMap() {
815 // // TODO Auto-generated method stub
820 * @return the labelProvider
822 public ChecklistLabelProvider
getLabelProvider() {
823 return labelProvider
;
827 * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
830 public void update(CdmDataChangeMap arg0
) {
831 // TODO Auto-generated method stub
836 * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
839 public ConversationHolder
getConversationHolder() {