Project

General

Profile

« Previous | Next » 

Revision 1d892040

Added by Patrick Plitzner over 6 years ago

ref #6913 Remove IEditorInput dependency from checklist editor input

View differences:

eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/ChecklistEditorInput.java
13 13
import java.util.List;
14 14
import java.util.UUID;
15 15

  
16
import org.eclipse.jface.resource.ImageDescriptor;
17
import org.eclipse.ui.IEditorInput;
18 16
import org.eclipse.ui.IMemento;
19 17
import org.eclipse.ui.IPersistable;
20
import org.eclipse.ui.IPersistableElement;
21 18

  
22 19
import eu.etaxonomy.cdm.api.conversation.ConversationHolder;
23 20
import eu.etaxonomy.cdm.api.service.ITaxonNodeService;
......
36 33
 * @date 25.04.2014
37 34
 *
38 35
 */
39
public class ChecklistEditorInput extends CdmEntitySessionInput implements IEditorInput, IPersistable {
36
public class ChecklistEditorInput extends CdmEntitySessionInput implements IPersistable {
40 37

  
41 38
    /**
42 39
     * The selected classification
......
97 94

  
98 95

  
99 96

  
100
    /* (non-Javadoc)
101
     * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
102
     */
103
    @Override
104
    public Object getAdapter(Class adapter) {
105
        // TODO Auto-generated method stub
106
        return null;
107
    }
108

  
109
    /* (non-Javadoc)
110
     * @see org.eclipse.ui.IEditorInput#exists()
111
     */
112
    @Override
113
    public boolean exists() {
114
        return false;
115
    }
116

  
117
    /* (non-Javadoc)
118
     * @see org.eclipse.ui.IEditorInput#getImageDescriptor()
119
     */
120
    @Override
121
    public ImageDescriptor getImageDescriptor() {
122
        // TODO Auto-generated method stub
123
        return null;
124
    }
125

  
126 97
    public List<Taxon> getTaxa() {
127 98
		return taxa;
128 99
	}
129 100

  
130
    /* (non-Javadoc)
131
     * @see org.eclipse.ui.IEditorInput#getName()
132
     */
133
    @Override
134 101
    public String getName() {
135 102
        if(taxonNode != null && taxonNode.getTaxon()!=null){
136 103
            return taxonNode.getTaxon().getName().getTitleCache();
......
139 106
        }
140 107
    }
141 108

  
142
    /* (non-Javadoc)
143
     * @see org.eclipse.ui.IEditorInput#getPersistable()
144
     */
145
    @Override
146
    public IPersistableElement getPersistable() {
147
        return null;
148
    }
149

  
150
    /* (non-Javadoc)
151
     * @see org.eclipse.ui.IEditorInput#getToolTipText()
152
     */
153
    @Override
154
    public String getToolTipText() {
155
        return classification.getTitleCache();
156
    }
157 109

  
158 110
    /**
159 111
     * @return the taxonNode
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/view/checklist/e4/ChecklistEditorE4.java
51 51
import org.eclipse.swt.widgets.Text;
52 52
import org.eclipse.swt.widgets.ToolBar;
53 53
import org.eclipse.swt.widgets.ToolItem;
54
import org.eclipse.ui.IEditorInput;
55 54
import org.eclipse.ui.IMemento;
56 55
import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
57 56

  
......
673 672

  
674 673
    }
675 674

  
676
    public void init(IEditorInput input) {
677
        if (input instanceof ChecklistEditorInput) {
678
            checklistEditorInput = (ChecklistEditorInput) input;
679
            thisPart.setLabel(DISTRIBUTION_EDITOR+": " + checklistEditorInput.getName());
680
            conversation = checklistEditorInput.getConversation();
681
            conversation.registerForDataStoreChanges(this);
682
        }
675
    public void init(ChecklistEditorInput input) {
676
        checklistEditorInput = input;
677
        thisPart.setLabel(DISTRIBUTION_EDITOR+": " + checklistEditorInput.getName());
678
        conversation = checklistEditorInput.getConversation();
679
        conversation.registerForDataStoreChanges(this);
680

  
683 681
        //propagate selection
684 682
        selectionChangedListener = (event -> selService.setSelection(
685 683
               DistributionEditorHelper.getDistributionForColumn(event)));

Also available in: Unified diff