3 * Copyright (C) 2007 EDIT
4 * European Distributed Institute of Taxonomy
5 * http://www.e-taxonomy.eu
7 * The contents of this file are subject to the Mozilla Public License Version 1.1
8 * See LICENSE.TXT at the top of this package for the full license terms.
11 package eu
.etaxonomy
.taxeditor
.editor
.view
.checklist
;
13 import java
.util
.ArrayList
;
14 import java
.util
.Arrays
;
15 import java
.util
.Collection
;
16 import java
.util
.Collections
;
17 import java
.util
.HashMap
;
18 import java
.util
.List
;
20 import java
.util
.SortedSet
;
22 import org
.apache
.log4j
.Logger
;
23 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
24 import org
.eclipse
.core
.runtime
.IStatus
;
25 import org
.eclipse
.core
.runtime
.Status
;
26 import org
.eclipse
.core
.runtime
.jobs
.Job
;
27 import org
.eclipse
.jface
.viewers
.ISelection
;
28 import org
.eclipse
.jface
.viewers
.StructuredViewer
;
29 import org
.eclipse
.jface
.viewers
.TableViewer
;
30 import org
.eclipse
.jface
.viewers
.TableViewerColumn
;
31 import org
.eclipse
.swt
.SWT
;
32 import org
.eclipse
.swt
.events
.ModifyListener
;
33 import org
.eclipse
.swt
.events
.SelectionAdapter
;
34 import org
.eclipse
.swt
.events
.SelectionEvent
;
35 import org
.eclipse
.swt
.layout
.GridData
;
36 import org
.eclipse
.swt
.layout
.GridLayout
;
37 import org
.eclipse
.swt
.widgets
.Composite
;
38 import org
.eclipse
.swt
.widgets
.Display
;
39 import org
.eclipse
.swt
.widgets
.Label
;
40 import org
.eclipse
.swt
.widgets
.Menu
;
41 import org
.eclipse
.swt
.widgets
.MenuItem
;
42 import org
.eclipse
.swt
.widgets
.Table
;
43 import org
.eclipse
.swt
.widgets
.TableColumn
;
44 import org
.eclipse
.swt
.widgets
.Text
;
45 import org
.eclipse
.swt
.widgets
.ToolBar
;
46 import org
.eclipse
.swt
.widgets
.ToolItem
;
47 import org
.eclipse
.ui
.IEditorInput
;
48 import org
.eclipse
.ui
.IEditorSite
;
49 import org
.eclipse
.ui
.IMemento
;
50 import org
.eclipse
.ui
.ISelectionListener
;
51 import org
.eclipse
.ui
.ISelectionService
;
52 import org
.eclipse
.ui
.IWorkbenchPart
;
53 import org
.eclipse
.ui
.PartInitException
;
54 import org
.eclipse
.ui
.part
.EditorPart
;
55 import org
.eclipse
.ui
.progress
.IWorkbenchSiteProgressService
;
57 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
58 import eu
.etaxonomy
.cdm
.api
.conversation
.IConversationEnabled
;
59 import eu
.etaxonomy
.cdm
.api
.service
.ITaxonNodeService
;
60 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
61 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
62 import eu
.etaxonomy
.cdm
.model
.common
.DefinedTermBase
;
63 import eu
.etaxonomy
.cdm
.model
.taxon
.Classification
;
64 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
65 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonNode
;
66 import eu
.etaxonomy
.cdm
.persistence
.hibernate
.CdmDataChangeMap
;
67 import eu
.etaxonomy
.taxeditor
.editor
.EditorUtil
;
68 import eu
.etaxonomy
.taxeditor
.editor
.SimpleSelectionProvider
;
69 import eu
.etaxonomy
.taxeditor
.editor
.view
.checklist
.edit
.DistributionEditingSupport
;
70 import eu
.etaxonomy
.taxeditor
.editor
.view
.checklist
.filter
.ChecklistEditorFilter
;
71 import eu
.etaxonomy
.taxeditor
.editor
.view
.checklist
.listener
.ChecklistDropdownSelectionListener
;
72 import eu
.etaxonomy
.taxeditor
.editor
.view
.checklist
.listener
.ChecklistFocusListener
;
73 import eu
.etaxonomy
.taxeditor
.editor
.view
.checklist
.listener
.ChecklistModifyListener
;
74 import eu
.etaxonomy
.taxeditor
.model
.IContextListener
;
75 import eu
.etaxonomy
.taxeditor
.model
.IDirtyMarkable
;
76 import eu
.etaxonomy
.taxeditor
.model
.IPartContentHasDetails
;
77 import eu
.etaxonomy
.taxeditor
.model
.IPartContentHasFactualData
;
78 import eu
.etaxonomy
.taxeditor
.preference
.PreferencesUtil
;
79 import eu
.etaxonomy
.taxeditor
.preference
.Resources
;
80 import eu
.etaxonomy
.taxeditor
.session
.ICdmEntitySession
;
81 import eu
.etaxonomy
.taxeditor
.session
.ICdmEntitySessionEnabled
;
82 import eu
.etaxonomy
.taxeditor
.store
.CdmStore
;
86 * ChecklistViewPart class.
93 public class ChecklistEditor
extends EditorPart
implements ISelectionListener
, IPartContentHasFactualData
,
94 IConversationEnabled
, IContextListener
, IPartContentHasDetails
, IDirtyMarkable
, ICdmEntitySessionEnabled
{
96 private static final Logger logger
= Logger
.getLogger(ChecklistEditor
.class);
98 * Key used for storing Checklist Editor View
100 private static final String CHECKLIST_EDITOR_MEMENTO_KEY
= "checklistEditor";
102 private class ChecklistJob
extends Job
{
104 private List
<TaxonNode
> taxonNodes
;
109 public ChecklistJob(String title
, List
<TaxonNode
> listTaxonNodes
) {
111 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 SortedSet
<DefinedTermBase
> terms
= null;
191 private ToolItem toolItem
;
192 private ChecklistDropdownSelectionListener dropListener
;
195 * @return the selectedTaxonNodes
197 public List
<TaxonNode
> getSelectedTaxonNodes() {
198 return selectedTaxonNodes
;
202 * @param selectedTaxonNodes
203 * the selectedTaxonNodes to set
205 public void setSelectedTaxonNodes(List
<TaxonNode
> selectedTaxonNodes
) {
206 this.selectedTaxonNodes
= selectedTaxonNodes
;
211 * Constructor for CdmDataSourceViewPart.
214 public ChecklistEditor() {
215 cdmEntitySession
= CdmStore
.getCurrentSessionManager().newSession(this, true);
220 public void createPartControl(Composite parent
) {
221 service
= (IWorkbenchSiteProgressService
) getSite().getAdapter(IWorkbenchSiteProgressService
.class);
222 taxonNodeService
= CdmStore
.getService(ITaxonNodeService
.class);
223 selectionService
= getSite().getWorkbenchWindow().getSelectionService();
224 selectionService
.addSelectionListener(this);
225 filter
= new ChecklistEditorFilter();
226 ChecklistLabelProvider labelProvider
= new ChecklistLabelProvider();
227 terms
= (SortedSet
<DefinedTermBase
>) labelProvider
.getTermsOrderedByLabels(labelProvider
.getNamedAreas(),
228 CdmStore
.getDefaultLanguage());
229 createTopComposite(parent
);
236 private void createTopComposite(Composite parent
) {
237 GridLayout gridLayout
= new GridLayout(3, false);
238 gridLayout
.marginWidth
= 0;
239 gridLayout
.marginHeight
= 0;
240 parent
.setLayout(gridLayout
);
242 final Text searchText
= createSearchBar(parent
);
243 createToolbar(parent
);
244 viewer
= new TableViewer(parent
, SWT
.MULTI
| SWT
.H_SCROLL
| SWT
.V_SCROLL
| SWT
.FULL_SELECTION
);
245 getSite().setSelectionProvider(viewer
);
247 final ModifyListener modifyListener
= new ChecklistModifyListener(viewer
, filter
, searchText
);
249 searchText
.addFocusListener(new ChecklistFocusListener(searchText
, modifyListener
));
250 searchText
.addModifyListener(modifyListener
);
251 createGridDataForViewerLayout();
253 viewer
.addFilter(filter
);
256 viewer
.setContentProvider(new ChecklistContentProvider());
257 viewer
.setLabelProvider(new ChecklistLabelProvider(viewer
));
258 comparator
= new ChecklistEditorComparator();
259 viewer
.setComparator(comparator
);
261 createStatusBar(parent
);
264 private void createGridDataForViewerLayout() {
265 GridData gridData
= new GridData();
266 gridData
.verticalAlignment
= GridData
.FILL
;
267 gridData
.horizontalSpan
= 3;
268 gridData
.grabExcessHorizontalSpace
= true;
269 gridData
.grabExcessVerticalSpace
= true;
270 gridData
.horizontalAlignment
= GridData
.FILL
;
271 viewer
.getControl().setLayoutData(gridData
);
278 private Text
createSearchBar(Composite parent
) {
279 Label searchLabel
= new Label(parent
, SWT
.NONE
);
280 searchLabel
.setText("Search: ");
281 final Text searchText
= new Text(parent
, SWT
.BORDER
| SWT
.SEARCH
| SWT
.ICON_SEARCH
| SWT
.CANCEL
);
282 searchText
.setLayoutData(new GridData(GridData
.GRAB_HORIZONTAL
| GridData
.HORIZONTAL_ALIGN_FILL
));
283 searchText
.setForeground(EditorUtil
.getColor(Resources
.SEARCH_VIEW_FOREGROUND
));
284 searchText
.setText("type filter text");
291 private void createToolbar(Composite parent
) {
292 ToolBar toolBar
= new ToolBar(parent
, SWT
.NONE
);
293 toolItem
= new ToolItem(toolBar
, SWT
.DROP_DOWN
| SWT
.BORDER
);
294 toolItem
.setText("Distribution Status");
295 toolItem
.setToolTipText("Show Distribution Status for selected Areas");
296 createToolbarItems();
297 toolItem
.addSelectionListener(dropListener
);
301 private void createToolbarItems() {
302 dropListener
= new ChecklistDropdownSelectionListener(toolItem
, this, terms
);
303 for (DefinedTermBase
<DefinedTermBase
> term
: terms
) {
305 dropListener
.add(term
);
310 private void createStatusBar(Composite composite
) {
311 GridData gridData
= new GridData();
312 gridData
.horizontalSpan
= 3;
313 gridData
.grabExcessHorizontalSpace
= true;
314 gridData
.horizontalAlignment
= GridData
.FILL
;
316 statusLabel
= new Label(composite
, SWT
.LEFT
);
317 statusLabel
.setText("Anzahl der Elemente: " + (countNodes
!= null ? countNodes
: "uknown"));
318 statusLabel
.setLayoutData(gridData
);
321 private void createTable() {
322 Table table
= viewer
.getTable();//new Table(parent, viewer.getTable().getStyle());
323 List
<String
> titles
= new ArrayList
<String
>();
324 Collections
.addAll(titles
, "Taxon", "Author", "Rank");
325 List
<Integer
> bounds
= new ArrayList
<Integer
>();
326 Collections
.addAll(bounds
, 300, 200, 200);
327 Map
<Integer
, Boolean
> restoreValuesForColumnWidth
= restoreValuesForColumnWidth(titles
, bounds
);
328 createInitalDistributionColumns(table
, titles
, bounds
, restoreValuesForColumnWidth
);
329 table
.setSortDirection(SWT
.DOWN
);
330 table
.setHeaderVisible(true);
331 table
.setLinesVisible(true);
334 * This method creates initially the distribution columns for a table. It should only be called for creation.<br>
337 *<b>Notice:</b> If you want to add additional columns later please use <b>addTableViewerColumn()</b>
342 * @param restoreValuesForColumnWidth
344 private void createInitalDistributionColumns(Table table
,
345 List
<String
> titles
, List
<Integer
> bounds
,
346 Map
<Integer
, Boolean
> restoreValuesForColumnWidth
) {
347 for (int columnIndex
= 0; columnIndex
< titles
.size(); columnIndex
++) {
348 TableViewerColumn column
= new TableViewerColumn(viewer
, SWT
.NONE
);
349 column
.getColumn().setText(titles
.get(columnIndex
));
350 column
.getColumn().setWidth(bounds
.get(columnIndex
));
351 column
.getColumn().setResizable(true);
352 column
.getColumn().setMoveable(true);
353 column
.getColumn().addSelectionListener(getSelectionAdapter(column
.getColumn(), columnIndex
));
354 if (columnIndex
== 1) {
355 table
.setSortColumn(column
.getColumn());
357 if (columnIndex
== 2) {
358 /** uncommented it for now because no rank editing is wanted **/
359 // column.setEditingSupport(new RankEditingSupport(viewer, this));
361 if (columnIndex
>= 3) {
362 //read PrefrenceStore to setWidth according to last saved state
363 if(restoreValuesForColumnWidth
.get(columnIndex
)){
364 column
.getColumn().setWidth(100);
366 column
.getColumn().setWidth(0);
368 column
.setEditingSupport(new DistributionEditingSupport(viewer
, this, columnIndex
));
374 * This methods loads the last opened distribution columns for the table viewer from the prefrence store.<br>
376 * <b>Notice:</b> It adds also the TitleCache to the titles list for the header of each column.<p>
380 * @return Map<Integer, Boolean>
382 private Map
<Integer
, Boolean
> restoreValuesForColumnWidth(List
<String
> titles
,
383 List
<Integer
> bounds
) {
384 Map
<Integer
, Boolean
> restoreColumnWidth
= new HashMap
<Integer
, Boolean
>();
387 for (DefinedTermBase
<DefinedTermBase
> term
: terms
) {
389 restoreColumnWidth
.put(columnIndex
, PreferencesUtil
.getPreferenceStore().getBoolean(term
.getUuid().toString()));
390 titles
.add(term
.getTitleCache());
396 return restoreColumnWidth
;
400 * This method adds new DistributionColumns to an existing table.
407 private TableViewerColumn
addTableViewerColumn(String title
, int bound
, final int colNumber
) {
408 final TableViewerColumn viewerColumn
= new TableViewerColumn(viewer
, SWT
.NONE
);
409 final TableColumn column
= viewerColumn
.getColumn();
410 column
.setText(title
);
411 column
.setWidth(200);
412 viewerColumn
.setEditingSupport(new DistributionEditingSupport(viewer
, this, colNumber
));
413 column
.setResizable(true);
414 column
.setMoveable(true);
422 * pull data from database and set input for view
425 private void loadDataInput() {
426 Classification classification
= checklistEditorInput
.getClassification();
427 TaxonNode taxonNode
= checklistEditorInput
.getTaxonNode();
428 if (classification
!= null && taxonNode
== null) {
429 countNodes
= taxonNodeService
.countAllNodesForClassification(classification
);
430 statusLabel
.setText("Anzahl der Elemente: " + (countNodes
!= null ? countNodes
: "uknown"));
431 // This should not kill the view nor the editor if something goes
433 // TODO: don't load the whole taxonNode Object but rather a small
434 // and simple Solution
435 // FIXME: May be don't open classification which are greater than
437 selectedTaxonNodes
= taxonNodeService
.listAllNodesForClassification(classification
, 0, countNodes
);
438 getService().schedule(new ChecklistJob("loading Taxa", selectedTaxonNodes
), Job
.LONG
);
440 if (taxonNode
!= null) {
441 selectedTaxonNodes
= taxonNodeService
.loadChildNodesOfTaxonNode(taxonNode
, NODE_INIT_STRATEGY
, true, null);
442 getService().schedule(new ChecklistJob("loading Taxa", selectedTaxonNodes
), Job
.LONG
);
448 public void dispose() {
449 cdmEntitySession
.dispose();
455 public void setFocus() {
456 cdmEntitySession
.bind();
457 viewer
.getControl().setFocus();
463 * @see org.eclipse.ui.part.WorkbenchPart#showBusy(boolean)
467 public void showBusy(boolean busy
) {
468 super.showBusy(busy
);
469 // viewer.getTable().setEnabled(!busy);
471 partNameCache
= getPartName();
472 setPartName("Loading " + countNodes
+ " Taxa...");
474 if (partNameCache
!= null) {
475 setPartName(partNameCache
);
482 * Getter for the field <code>viewer</code>.
485 * @return a {@link org.eclipse.jface.viewers.StructuredViewer} object.
487 public StructuredViewer
getViewer() {
491 public void refresh() {
496 * This method should only be called for adding new Distribution columns and reloading the table.<br>
497 * It will hide the old distribution column and load the newly added columns.<br>
499 * <b>Notice:</b> for data update please use <b>refresh()</b>
502 @SuppressWarnings({ "unchecked", "rawtypes" })
503 public void reload(){
504 //create new Items for Dropdown menue
505 Table table
= viewer
.getTable();
506 table
.setRedraw(false);
507 SortedSet
<DefinedTermBase
> oldTerms
= terms
;
508 ChecklistLabelProvider labelProvider
= new ChecklistLabelProvider();
509 terms
= (SortedSet
<DefinedTermBase
>) labelProvider
.getTermsOrderedByLabels(labelProvider
.getNamedAreas(), CdmStore
.getDefaultLanguage());
510 SortedSet
<DefinedTermBase
> newTerms
= terms
;
511 toolItem
.removeSelectionListener(dropListener
);
512 hideDistributionColumns(oldTerms
);
513 createToolbarItems();
514 toolItem
.addSelectionListener(dropListener
);
515 for(DefinedTermBase term
:newTerms
){
516 int count
= viewer
.getTable().getColumnCount();
517 addTableViewerColumn(term
.getTitleCache(), 200, count
);
518 acitivateNewColumnInDropDownMenu(term
);
520 viewer
.setLabelProvider(new ChecklistLabelProvider(viewer
));
521 getService().schedule(new ChecklistJob("loading Taxa", selectedTaxonNodes
), Job
.LONG
);
522 table
.setRedraw(true);
526 private void acitivateNewColumnInDropDownMenu(DefinedTermBase term
) {
527 Menu menu
= dropListener
.getMenu();
528 MenuItem
[] items
= menu
.getItems();
529 for(MenuItem item
: items
){
530 if(item
.getText().equalsIgnoreCase(term
.getTitleCache())){
531 item
.setSelection(true);
532 PreferencesUtil
.getPreferenceStore().setValue(term
.getUuid().toString(), true);
537 private void hideDistributionColumns(SortedSet
<DefinedTermBase
> oldTerms
) {
538 TableColumn
[] columns
= viewer
.getTable().getColumns();
539 for(int i
=4; i
<columns
.length
; i
++){
541 columns
[i
].dispose();
542 Menu menu
= dropListener
.getMenu();
543 int itemCount
= menu
.getItemCount();
544 MenuItem item
= menu
.getItem(i
-3);
545 item
.setSelection(false);
547 if(oldTerms
!= null){
548 for(DefinedTermBase term
: oldTerms
){
549 PreferencesUtil
.getPreferenceStore().setValue(term
.getUuid().toString(), false);
556 * Getter for the field <code>service</code>.
559 * @return the service
561 public IWorkbenchSiteProgressService
getService() {
565 private SelectionAdapter
getSelectionAdapter(final TableColumn column
, final int index
) {
566 SelectionAdapter selectionAdapter
= new SelectionAdapter() {
568 public void widgetSelected(SelectionEvent e
) {
569 comparator
.setColumn(index
);
570 int dir
= viewer
.getTable().getSortDirection();
571 if (viewer
.getTable().getSortColumn() == column
) {
572 dir
= dir
== SWT
.UP ? SWT
.DOWN
: SWT
.UP
;
576 viewer
.getTable().setSortDirection(dir
);
577 viewer
.getTable().setSortColumn(column
);
581 return selectionAdapter
;
585 public void doSave(IProgressMonitor monitor
) {
587 monitor
.beginTask("Saving Editor", 1);
588 getConversationHolder().bind();
589 getConversationHolder().commit(true);
599 public void doSaveAs() {
603 public void init(IEditorSite site
, IEditorInput input
) throws PartInitException
{
606 if (input
instanceof ChecklistEditorInput
) {
607 checklistEditorInput
= (ChecklistEditorInput
) input
;
608 setPartName(getPartName() + ": " + checklistEditorInput
.getName());
609 conversation
= ((ChecklistEditorInput
) input
).getConversationHolder();
611 simpleSelectionProvider
= new SimpleSelectionProvider();
612 getSite().setSelectionProvider(simpleSelectionProvider
);
616 public boolean isSaveAsAllowed() {
623 * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.
624 * IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
627 public void selectionChanged(IWorkbenchPart part
, ISelection selection
) {
634 * eu.etaxonomy.cdm.persistence.hibernate.ICdmPostDataChangeObserver#update
635 * (eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap)
638 public void update(CdmDataChangeMap changeEvents
) {
646 * eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder
650 public ConversationHolder
getConversationHolder() {
658 * eu.etaxonomy.taxeditor.model.IContextListener#contextAboutToStop(org.
659 * eclipse.ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
663 public void contextAboutToStop(IMemento memento
, IProgressMonitor monitor
) {
671 * eu.etaxonomy.taxeditor.model.IContextListener#contextStop(org.eclipse
672 * .ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
675 public void contextStop(IMemento memento
, IProgressMonitor monitor
) {
676 // IStructuredSelection sel = (IStructuredSelection) this.viewer.getSelection();
677 // if (sel.isEmpty()) {
680 // memento = memento.createChild("tree-selections");
681 // Iterator iter = sel.iterator();
682 // while (iter.hasNext()) {
683 // String nodeName = (String) iter.next();
684 // memento.createChild("selected-nodes", nodeName);
692 * eu.etaxonomy.taxeditor.model.IContextListener#contextStart(org.eclipse
693 * .ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
696 public void contextStart(IMemento memento
, IProgressMonitor monitor
) {
704 * eu.etaxonomy.taxeditor.model.IContextListener#contextRefresh(org.eclipse
705 * .core.runtime.IProgressMonitor)
708 public void contextRefresh(IProgressMonitor monitor
) {
715 * eu.etaxonomy.taxeditor.model.IContextListener#workbenchShutdown(org.eclipse
716 * .ui.IMemento, org.eclipse.core.runtime.IProgressMonitor)
719 public void workbenchShutdown(IMemento memento
, IProgressMonitor monitor
) {
720 conversation
.clear();
721 conversation
.close();
725 private static final List
<String
> NODE_INIT_STRATEGY
= Arrays
.asList(new String
[] { "descriptions",
726 "descriptions.*", "description.state", "feature", "feature.*", "childNodes", "childNodes.taxon",
727 "childNodes.taxon.name", "taxonNodes", "taxonNodes.*", "taxonNodes.taxon.*", "taxon.*",
728 "taxon.descriptions", "taxon.sec", "taxon.name.*", "taxon.synonymRelations", "terms", "name.*",
729 "name.rank.representations", "name.status.type.representations", "sources.$", "stateData.$" });
735 * eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#changed(
739 public void changed(Object element
) {
740 if (element
!= null) {
741 viewer
.update(element
, null);
743 firePropertyChange(PROP_DIRTY
);
748 * @see eu.etaxonomy.taxeditor.model.IDirtyMarkableSelectionProvider#forceDirty()
751 public void forceDirty() {
755 public void setDirty(boolean dirty
) {
757 firePropertyChange(PROP_DIRTY
);
763 * @see org.eclipse.ui.forms.editor.FormEditor#isDirty()
766 public boolean isDirty() {
771 * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getCdmEntitySession()
774 public ICdmEntitySession
getCdmEntitySession() {
775 // TODO Auto-generated method stub
780 * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getRootEntities()
783 public <T
extends CdmBase
> Collection
<T
> getRootEntities() {
784 // TODO Auto-generated method stub
789 * @see eu.etaxonomy.taxeditor.session.ICdmEntitySessionEnabled#getPropertyPathsMap()
792 public Map
<Object
, List
<String
>> getPropertyPathsMap() {
793 // TODO Auto-generated method stub