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
.name
;
12 import java
.util
.ArrayList
;
13 import java
.util
.HashMap
;
14 import java
.util
.HashSet
;
15 import java
.util
.List
;
19 import org
.apache
.log4j
.Logger
;
20 import org
.eclipse
.core
.commands
.operations
.IUndoContext
;
21 import org
.eclipse
.core
.runtime
.IAdaptable
;
22 import org
.eclipse
.core
.runtime
.IProgressMonitor
;
23 import org
.eclipse
.core
.runtime
.OperationCanceledException
;
24 import org
.eclipse
.jface
.action
.MenuManager
;
25 import org
.eclipse
.jface
.dialogs
.MessageDialog
;
26 import org
.eclipse
.jface
.viewers
.ISelection
;
27 import org
.eclipse
.jface
.viewers
.ISelectionProvider
;
28 import org
.eclipse
.jface
.viewers
.StructuredSelection
;
29 import org
.eclipse
.swt
.dnd
.DND
;
30 import org
.eclipse
.swt
.dnd
.DropTarget
;
31 import org
.eclipse
.swt
.dnd
.Transfer
;
32 import org
.eclipse
.swt
.widgets
.Composite
;
33 import org
.eclipse
.swt
.widgets
.Menu
;
34 import org
.eclipse
.ui
.IEditorInput
;
35 import org
.eclipse
.ui
.IEditorSite
;
36 import org
.eclipse
.ui
.ISelectionListener
;
37 import org
.eclipse
.ui
.ISelectionService
;
38 import org
.eclipse
.ui
.IWorkbenchPart
;
39 import org
.eclipse
.ui
.IWorkbenchPartReference
;
40 import org
.eclipse
.ui
.PartInitException
;
41 import org
.eclipse
.ui
.forms
.ManagedForm
;
42 import org
.eclipse
.ui
.forms
.widgets
.FormToolkit
;
43 import org
.eclipse
.ui
.forms
.widgets
.ScrolledForm
;
44 import org
.eclipse
.ui
.forms
.widgets
.TableWrapLayout
;
45 import org
.eclipse
.ui
.part
.EditorPart
;
47 import eu
.etaxonomy
.cdm
.api
.conversation
.ConversationHolder
;
48 import eu
.etaxonomy
.cdm
.api
.conversation
.IConversationEnabled
;
49 import eu
.etaxonomy
.cdm
.hibernate
.HibernateProxyHelper
;
50 import eu
.etaxonomy
.cdm
.model
.common
.CdmBase
;
51 import eu
.etaxonomy
.cdm
.model
.name
.HomotypicalGroup
;
52 import eu
.etaxonomy
.cdm
.model
.taxon
.Taxon
;
53 import eu
.etaxonomy
.cdm
.model
.taxon
.TaxonBase
;
54 import eu
.etaxonomy
.cdm
.persistence
.hibernate
.CdmDataChangeMap
;
55 import eu
.etaxonomy
.taxeditor
.editor
.CdmDataTransfer
;
56 import eu
.etaxonomy
.taxeditor
.editor
.EditorUtil
;
57 import eu
.etaxonomy
.taxeditor
.editor
.IDropTargetable
;
58 import eu
.etaxonomy
.taxeditor
.editor
.IMultiPageTaxonEditorPage
;
59 import eu
.etaxonomy
.taxeditor
.editor
.MultiPageTaxonEditor
;
60 import eu
.etaxonomy
.taxeditor
.editor
.SimpleSelectionProvider
;
61 import eu
.etaxonomy
.taxeditor
.editor
.TaxonEditorInput
;
62 import eu
.etaxonomy
.taxeditor
.model
.IPartChangeListener
;
63 import eu
.etaxonomy
.taxeditor
.model
.IPartContentHasDetails
;
64 import eu
.etaxonomy
.taxeditor
.model
.TaxeditorPartService
;
65 import eu
.etaxonomy
.taxeditor
.operation
.IPostOperationEnabled
;
66 import eu
.etaxonomy
.taxeditor
.preference
.Resources
;
69 * <p>TaxonNameEditor class.</p>
76 public class TaxonNameEditor
extends EditorPart
implements IMultiPageTaxonEditorPage
, IAdaptable
, IConversationEnabled
, IPostOperationEnabled
, IPartContentHasDetails
, IPartChangeListener
77 , ISelectionListener
, IDropTargetable
{
79 private static final Logger logger
= Logger
.getLogger(TaxonNameEditor
.class);
83 public HomotypicalGroup homotypicalGroup
;
84 public HomotypicalSynonymGroup group
;
86 public Tupel(HomotypicalGroup homotypicalGroup
, HomotypicalSynonymGroup group
){
87 this.homotypicalGroup
= homotypicalGroup
;
93 /** Constant <code>ID="eu.etaxonomy.taxeditor.taxonNameEditor"</code> */
94 public static final String ID
= "eu.etaxonomy.taxeditor.taxonNameEditor";
98 private ManagedForm managedForm
;
99 private ScrolledForm scrolledForm
;
100 private Composite parent
;
101 private ISelectionProvider provider
;
103 private MultiPageTaxonEditor editor
;
105 private AbstractGroupedContainer selectedObject
;
107 private AcceptedNameContainer acceptedNameContainer
;
109 private ConversationHolder conversation
;
111 private MenuManager menuManager
;
115 private List
<Tupel
> heterotypicSynonymGroupTupel
= new ArrayList
<Tupel
>();
117 private MisappliedGroup misappliedGroup
;
119 private ConceptGroup conceptGroup
;
122 private DropTarget target
;
124 private ISelectionService selectionService
;
126 private ContainerFactory containerFactory
;
128 private HomotypicalSynonymGroup homotypicalSynonymGroup
;
130 private AbstractGroupedContainer objectAffectedByLastOperation
;
133 * <p>Constructor for TaxonNameEditor.</p>
135 * @param editor a {@link eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor} object.
137 public TaxonNameEditor(MultiPageTaxonEditor editor
){
138 this.editor
= editor
;
139 conversation
= editor
.getConversationHolder();
141 containerFactory
= ContainerFactory
.getInstance();
147 * <p>getUndoContext</p>
149 * @return a {@link org.eclipse.core.commands.operations.IUndoContext} object.
151 public IUndoContext
getUndoContext() {
152 return editor
.getUndoContext();
156 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
159 public void createPartControl(Composite composite
) {
160 selectionService
= getSite().getWorkbenchWindow().getSelectionService();
161 selectionService
.addSelectionListener(this);
163 createManagedForm(composite
);
165 TaxeditorPartService
.getInstance().addListener(TaxeditorPartService
.PART_ACTIVATED
, this);
169 * <p>createManagedForm</p>
171 * @param composite a {@link org.eclipse.swt.widgets.Composite} object.
173 protected void createManagedForm(Composite composite
) {
175 managedForm
= new ManagedForm(composite
) {
177 public void dirtyStateChanged() {
178 firePropertyChange(PROP_DIRTY
);
180 public boolean setInput(Object input
) {
181 if (input
instanceof AbstractGroupedContainer
) {
182 selectedObject
= (AbstractGroupedContainer
) input
;
183 provider
.setSelection(new StructuredSelection(selectedObject
.getData()));
185 return super.setInput(input
);
190 scrolledForm
= managedForm
.getForm();
191 parent
= scrolledForm
.getBody();
193 // register the context menu
194 menuManager
= new MenuManager();
195 ISelectionProvider selectionProvider
= getSite().getSelectionProvider();
196 getSite().registerContextMenu(TaxonNameEditor
.ID
, menuManager
, selectionProvider
);
198 parent
.setData(taxon
);
200 TableWrapLayout layout
= new TableWrapLayout();
201 layout
.leftMargin
= 0;
202 layout
.rightMargin
= 0;
203 layout
.topMargin
= 0;
204 layout
.bottomMargin
= 0;
206 layout
.verticalSpacing
= 0;
207 layout
.horizontalSpacing
= 0;
209 parent
.setLayout(layout
);
210 parent
.setBackground(EditorUtil
.getColor(Resources
.COLOR_COMPOSITE_BACKGROUND
));
212 createNameComposites();
220 * <p>createNameComposites</p>
222 protected void createNameComposites(){
223 containerFactory
.createAcceptedTaxonsHomotypicGroup(this);
225 containerFactory
.createHeterotypicSynonymGroups(this);
227 containerFactory
.createMisapplicationGroup(this);
229 containerFactory
.createConceptGroup(this);
231 // disabling for testing
232 for(AbstractGroupedContainer container
: getGroupedContainers()){
233 container
.setMenu(getMenu());
236 managedForm
.reflow(true);
240 * <p>Getter for the field <code>taxon</code>.</p>
242 * @return a {@link eu.etaxonomy.cdm.model.taxon.Taxon} object.
244 public Taxon
getTaxon() {
245 return (Taxon
) HibernateProxyHelper
.deproxy(taxon
);
251 public void setDirty() {
252 managedForm
.dirtyStateChanged();
258 * @see org.eclipse.ui.part.WorkbenchPart#setFocus()
262 public void setFocus(){
263 getSelectedObject().setSelected();
267 public void setInput(IEditorInput input
){
268 this.setInputWithNotify(input
);
273 * @see eu.etaxonomy.cdm.api.conversation.IConversationEnabled#getConversationHolder()
276 * <p>getConversationHolder</p>
278 * @return a {@link eu.etaxonomy.cdm.api.conversation.ConversationHolder} object.
280 public ConversationHolder
getConversationHolder(){
286 * @see eu.etaxonomy.cdm.persistence.hibernate.ICdmPostCrudObserver#update(eu.etaxonomy.cdm.persistence.hibernate.CdmCrudEvent)
289 public void update(CdmDataChangeMap events
) {
294 * Redraws this editor
295 * return true on success
299 public boolean redraw(){
306 * Redraws the editor controls
308 public boolean redraw(boolean focus
) {
310 createNameComposites();
319 private AbstractGroupedContainer
getContainerForData(CdmBase data
) {
320 if(data
== null && (selectedObject
!= null && ! selectedObject
.getControl().isDisposed())){
321 return selectedObject
;
324 List
<AbstractGroupedContainer
> groupedContainers
= getGroupedContainers();
325 for(AbstractGroupedContainer container
: groupedContainers
){
326 if(container
.getData().equals(data
)){
330 return acceptedNameContainer
;
334 * <p>getMultiPageTaxonEditor</p>
336 * @return a {@link eu.etaxonomy.taxeditor.editor.MultiPageTaxonEditor} object.
338 public MultiPageTaxonEditor
getMultiPageTaxonEditor() {
345 * @see eu.etaxonomy.taxeditor.store.operations.IPostOperationEnabled#postOperation()
348 public boolean postOperation(CdmBase objectAffectedByOperation
) {
350 editor
.changed(objectAffectedByOperation
);
354 objectAffectedByLastOperation
= getContainerForData(objectAffectedByOperation
);
360 private CdmBase
getSelectedData() {
361 if(selectedObject
!= null){
362 return selectedObject
.getData();
368 * <p>Getter for the field <code>managedForm</code>.</p>
370 * @return the managedForm
372 public ManagedForm
getManagedForm() {
379 * @return a {@link org.eclipse.swt.widgets.Composite} object.
381 public Composite
getControl() {
382 return this.getManagedForm().getForm().getBody();
387 * <p>Getter for the field <code>menu</code>.</p>
391 public Menu
getMenu() {
392 if(menu
== null || menu
.isDisposed()){
393 // Creating the menu because it was either not initialised or disposed while refreshing the editor
394 menu
= menuManager
.createContextMenu(parent
);
400 * <p>checkForEmptyNames</p>
402 * @return true if there are empty names
404 public boolean checkForEmptyNames() {
405 for(AbstractGroupedContainer container
: getGroupedContainers()){
406 if(container
.getName() == null || container
.getName().getTitleCache().equals("")){
407 MessageDialog
.openWarning(EditorUtil
.getShell(), "No Name Specified", "An attempt was made to save a taxon or synonym with " +
408 "an empty name. Operation was cancelled.");
417 public void doSave(IProgressMonitor monitor
) {
419 monitor
.beginTask("Saving names", getGroupedContainers().size());
422 // check for empty names
423 for(AbstractGroupedContainer container
: getGroupedContainers()){
425 monitor
.subTask("Saving composite: " + container
.getTaxonBase().getTitleCache());
426 container
.persistName();
428 // In case the progress monitor was canceled throw an exception.
429 if (monitor
.isCanceled()) {
430 throw new OperationCanceledException();
433 // Otherwise declare this step as done.
439 // Stop the progress monitor.
447 public void doSaveAs() {}
451 public void init(IEditorSite site
, IEditorInput input
)
452 throws PartInitException
{
454 if (!(input
instanceof IEditorInput
))
455 throw new PartInitException(
456 "Invalid Input: Must be IEditorInput");
458 if (input
.getAdapter(Taxon
.class) != null) {
459 taxon
= (Taxon
) input
.getAdapter(Taxon
.class);
461 throw new PartInitException(
462 "Invalid Input: Taxon cannot be null");
468 provider
= new SimpleSelectionProvider();
469 getSite().setSelectionProvider(provider
);
471 logger
.trace("New Editor instance created.");
477 private void createDragSupport() {
478 // Listen for names being dragged outside of existing homotypic groups -
479 // user wants to create a new group
480 Transfer
[] types
= new Transfer
[] {CdmDataTransfer
.getInstance()};
481 int operations
= DND
.DROP_MOVE
;
483 target
= new DropTarget(parent
, operations
);
484 target
.setTransfer(types
);
485 target
.addDropListener(new NameEditorDropTargetListener(this));
490 * <p>Getter for the field <code>acceptedNameContainer</code>.</p>
492 * @return a {@link eu.etaxonomy.taxeditor.editor.name.AcceptedNameContainer} object.
494 public AcceptedNameContainer
getAcceptedNameContainer() {
495 return acceptedNameContainer
;
499 * <p>getSynonymGroup</p>
501 * @param homotypicalGroup a {@link eu.etaxonomy.cdm.model.name.HomotypicalGroup} object.
502 * @return a {@link eu.etaxonomy.taxeditor.editor.name.HomotypicalSynonymGroup} object.
504 public HomotypicalSynonymGroup
getSynonymGroup(HomotypicalGroup homotypicalGroup
) {
505 if(getHomotypicSynonymGroup() != null && getHomotypicSynonymGroup().getGroup().equals(homotypicalGroup
)){
506 return getHomotypicSynonymGroup();
509 for(Tupel tupel
: heterotypicSynonymGroupTupel
){
510 if(tupel
.homotypicalGroup
.equals(homotypicalGroup
)){
519 * <p>Getter for the field <code>conceptGroup</code>.</p>
521 * @return a {@link eu.etaxonomy.taxeditor.editor.name.ConceptGroup} object.
523 public ConceptGroup
getConceptGroup() {
528 * <p>getDirtyNames</p>
530 * @return a Set containing all composites that have been edited
532 public Set
<AbstractGroupedContainer
> getDirtyNames(){
533 Set
<AbstractGroupedContainer
> dirtyNames
= new HashSet
<AbstractGroupedContainer
>();
535 for(AbstractGroupedContainer composite
: getGroupedContainers()){
536 if(composite
.isDirty()){
537 dirtyNames
.add(composite
);
545 * <p>getGroupedContainers</p>
547 * @return a {@link java.util.List} object.
549 public List
<AbstractGroupedContainer
> getGroupedContainers(){
550 List
<AbstractGroupedContainer
> groupedComposites
= new ArrayList
<AbstractGroupedContainer
>();
552 for(AbstractGroup group
: getAllGroups()){
553 groupedComposites
.addAll(group
.getGroupedContainers());
556 return groupedComposites
;
560 * <p>getAllGroups</p>
562 * @return a {@link java.util.List} object.
564 public List
<AbstractGroup
> getAllGroups(){
565 List
<AbstractGroup
> allGroups
= new ArrayList
<AbstractGroup
>();
567 allGroups
.add(getHomotypicSynonymGroup());
569 allGroups
.addAll(getHeterotypicSynonymGroups());
571 if(misappliedGroup
!= null){
572 allGroups
.add(misappliedGroup
);
575 if(conceptGroup
!= null){
576 allGroups
.add(conceptGroup
);
583 * @see org.eclipse.ui.part.EditorPart#isDirty()
587 public boolean isDirty() {
588 return editor
.isDirty();
592 * @see org.eclipse.ui.part.WorkbenchPart#dispose()
596 public void dispose() {
601 * @see org.eclipse.ui.part.EditorPart#isSaveAsAllowed()
605 public boolean isSaveAsAllowed() {
611 * @see org.eclipse.ui.ISelectionListener#selectionChanged(org.eclipse.ui.IWorkbenchPart, org.eclipse.jface.viewers.ISelection)
614 public void selectionChanged(IWorkbenchPart part
, ISelection selection
) {
619 * <p>removeContainer</p>
621 * @param container a {@link eu.etaxonomy.taxeditor.editor.name.AbstractGroupedContainer} object.
623 public void removeContainer(AbstractGroupedContainer container
) {
628 * <p>addCompositeForTaxonBase</p>
630 * @param taxonBase a {@link eu.etaxonomy.cdm.model.taxon.TaxonBase} object.
631 * @param target a {@link eu.etaxonomy.taxeditor.editor.IDropTargetable} object.
633 public void addCompositeForTaxonBase(TaxonBase taxonBase
, IDropTargetable target
) {
635 // if(target instanceof AbstractGroup){
636 // ((AbstractGroup) target).redraw();
637 // }else if(target instanceof TaxonNameEditor){
638 // if(taxonBase instanceof Synonym){
639 // Synonym synonym = (Synonym) taxonBase;
640 // HomotypicalSynonymGroup group = new HomotypicalSynonymGroup(this, synonym.getHomotypicGroup());
641 // ContainerFactory.getInstance().createHeterotypicSynonymGroup(this, group);
645 // if(taxonBase instanceof Synonym && target instanceof HomotypicalSynonymGroup){
646 // new SynonymContainer(this, (HomotypicalSynonymGroup) target, (Synonym) taxonBase);
647 // }else if(taxonBase instanceof Synonym && target instanceof TaxonNameEditor){
648 // Synonym synonym = (Synonym) taxonBase;
649 // HomotypicalSynonymGroup group = new HomotypicalSynonymGroup(this, synonym.getHomotypicGroup());
651 // new SynonymContainer(this, group, (Synonym) taxonBase);
656 // else if(target instanceof MisappliedGroup){
657 // Taxon taxon = (Taxon) taxonBase;
659 // if (taxon.isMisapplication()){
660 // containerFactory.createMisapplication(this, taxon);
661 // }else if(! taxon.equals(this.taxon)){
662 // throw new RuntimeException("Unsupported operands");
668 * <p>getNameEditor</p>
670 * @return a {@link eu.etaxonomy.taxeditor.editor.name.TaxonNameEditor} object.
672 public TaxonNameEditor
getNameEditor() {
677 * <p>Getter for the field <code>selectedObject</code>.</p>
679 * @return a {@link eu.etaxonomy.taxeditor.editor.name.AbstractGroupedContainer} object.
681 public AbstractGroupedContainer
getSelectedObject(){
682 TaxonEditorInput input
= (TaxonEditorInput
) editor
.getEditorInput();
683 if(input
.getInitiallySelectedTaxonBase() != null){
685 TaxonBase initiallySelectedTaxonBase
= input
.getInitiallySelectedTaxonBase();
686 AbstractGroupedContainer container
= getContainerForData(initiallySelectedTaxonBase
);
687 if(container
!= null){
688 // input.setInitiallySelectedTaxonBase(null);
692 if(selectedObject
!= null){
693 return selectedObject
;
696 return acceptedNameContainer
;
702 public void dragEntered() {
704 getControl().setBackground(EditorUtil
.getColor(Resources
.COLOR_DRAG_ENTER
));
710 public void dragLeft() {
711 getControl().setBackground(EditorUtil
.getColor(Resources
.COLOR_COMPOSITE_BACKGROUND
));
715 * <p>Setter for the field <code>conceptGroup</code>.</p>
717 * @param conceptGroup a {@link eu.etaxonomy.taxeditor.editor.name.ConceptGroup} object.
719 public void setConceptGroup(ConceptGroup conceptGroup
) {
720 this.conceptGroup
= conceptGroup
;
724 * <p>setMisapplicationsGroup</p>
726 * @param misappliedGroup a {@link eu.etaxonomy.taxeditor.editor.name.MisappliedGroup} object.
728 public void setMisapplicationsGroup(MisappliedGroup misappliedGroup
) {
729 this.misappliedGroup
= misappliedGroup
;
734 * @see eu.etaxonomy.taxeditor.editor.IMultiPageTaxonEditorPage#isRedrawing()
741 public boolean isRedrawing() {
748 * @return a {@link org.eclipse.ui.forms.widgets.FormToolkit} object.
750 public FormToolkit
getToolkit() {
751 return managedForm
.getToolkit();
755 * <p>getHeterotypicSynonymGroups</p>
757 * @return a {@link java.util.List} object.
759 public List
<HomotypicalSynonymGroup
> getHeterotypicSynonymGroups(){
760 List
<HomotypicalSynonymGroup
> list
= new ArrayList
<HomotypicalSynonymGroup
>(heterotypicSynonymGroupTupel
.size());
762 for(Tupel tupel
: heterotypicSynonymGroupTupel
){
763 list
.add(tupel
.group
);
770 * <p>getHeterotypicSynonymGroupsMap</p>
772 * @return a {@link java.util.Map} object.
774 public Map
<HomotypicalGroup
, HomotypicalSynonymGroup
> getHeterotypicSynonymGroupsMap(){
775 Map
<HomotypicalGroup
, HomotypicalSynonymGroup
> map
= new HashMap
<HomotypicalGroup
, HomotypicalSynonymGroup
>(heterotypicSynonymGroupTupel
.size());
777 for(Tupel tupel
: heterotypicSynonymGroupTupel
){
778 map
.put(tupel
.homotypicalGroup
, tupel
.group
);
785 * <p>clearHeterotypicSynonymGroups</p>
787 public void clearHeterotypicSynonymGroups(){
788 heterotypicSynonymGroupTupel
.clear();
792 * <p>addHeterotypicSynonymGroup</p>
794 * @param group a {@link eu.etaxonomy.taxeditor.editor.name.HomotypicalSynonymGroup} object.
796 public void addHeterotypicSynonymGroup(HomotypicalSynonymGroup group
) {
797 heterotypicSynonymGroupTupel
.add(new Tupel(group
.getGroup(), group
));
801 * <p>removeHeterotypicSynonymGroup</p>
803 * @param group a {@link eu.etaxonomy.cdm.model.name.HomotypicalGroup} object.
805 public void removeHeterotypicSynonymGroup(HomotypicalGroup group
) {
806 Tupel shouldBeRemoved
= null;
807 for(Tupel tupel
: heterotypicSynonymGroupTupel
){
808 if(tupel
.group
.equals(group
)){
809 shouldBeRemoved
= tupel
;
814 if(shouldBeRemoved
!= null){
815 heterotypicSynonymGroupTupel
.remove(shouldBeRemoved
);
822 * <p>getHomotypicSynonymGroup</p>
824 * @return a {@link eu.etaxonomy.taxeditor.editor.name.HomotypicalSynonymGroup} object.
826 public HomotypicalSynonymGroup
getHomotypicSynonymGroup() {
827 return homotypicalSynonymGroup
;
833 * <p>setHomotypicSynonymGroup</p>
835 * @param homotypicalSynonymGroup a {@link eu.etaxonomy.taxeditor.editor.name.HomotypicalSynonymGroup} object.
837 public void setHomotypicSynonymGroup(
838 HomotypicalSynonymGroup homotypicalSynonymGroup
) {
839 this.homotypicalSynonymGroup
= homotypicalSynonymGroup
;
843 * <p>Setter for the field <code>acceptedNameContainer</code>.</p>
845 * @param acceptedNameContainer a {@link eu.etaxonomy.taxeditor.editor.name.AcceptedNameContainer} object.
847 public void setAcceptedNameContainer(
848 AcceptedNameContainer acceptedNameContainer
) {
849 this.acceptedNameContainer
= acceptedNameContainer
;
853 * <p>Getter for the field <code>misappliedGroup</code>.</p>
855 * @return a {@link eu.etaxonomy.taxeditor.editor.name.MisappliedGroup} object.
857 public MisappliedGroup
getMisappliedGroup() {
858 return misappliedGroup
;
861 // TODO not very useful at the moment
867 public boolean isActive(){
870 IWorkbenchPart activePart
= EditorUtil
.getActivePart();
871 return editor
.equals(activePart
);
879 public boolean onComplete() {
880 objectAffectedByLastOperation
.setSelected();
887 public void partChanged(Integer eventType
, IWorkbenchPartReference partRef
) {
888 if(! partRef
.getPart(false).equals(editor
)){
889 // getSelectedObject().colorSelected(AbstractGroupedContainer.SELECTED_NO_FOCUS);