Project

General

Profile

« Previous | Next » 

Revision 68061e15

Added by Patrick Plitzner over 6 years ago

ref #6925 Set active part in utility class

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/AbstractCdmEditorViewPart.java
7 7
import org.eclipse.jface.viewers.IStructuredSelection;
8 8
import org.eclipse.swt.widgets.Composite;
9 9
import org.eclipse.swt.widgets.Display;
10
import org.eclipse.ui.IEditorPart;
11 10
import org.eclipse.ui.IWorkbenchPart;
12 11

  
13
import eu.etaxonomy.taxeditor.editor.ISecuredEditor;
14
import eu.etaxonomy.taxeditor.model.AbstractUtility;
15 12
import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
16 13
import eu.etaxonomy.taxeditor.workbench.part.ISelectionElementEditingPart;
17 14

  
......
120 117
        isInDelay = false;
121 118
    }
122 119

  
123
    /**
124
     * <p>
125
     * getEditor
126
     * </p>
127
     *
128
     * @return the currently active editor
129
     */
130
    public IEditorPart getEditor() {
131
        return AbstractUtility.getActiveEditor();
132
    }
120
//    /**
121
//     * <p>
122
//     * getEditor
123
//     * </p>
124
//     *
125
//     * @return the currently active editor
126
//     */
127
//    public IEditorPart getEditor() {
128
////        return AbstractUtility.getActiveEditor();
129
//    }
133 130

  
134 131
    /**
135 132
     * {@inheritDoc}
......
145 142
    public void setFocus() {
146 143
        super.setFocus();
147 144

  
148
        if(getEditor() != null && ISecuredEditor.class.isAssignableFrom(getEditor().getClass())){
149
            boolean doEnable = ((ISecuredEditor)getEditor()).permissionsSatisfied();
150
            setEnabled(doEnable);
151
        }
145
//        if(getEditor() != null && ISecuredEditor.class.isAssignableFrom(getEditor().getClass())){
146
//            boolean doEnable = ((ISecuredEditor)getEditor()).permissionsSatisfied();
147
//            setEnabled(doEnable);
148
//        }
152 149
    }
153 150

  
154 151
    /**
......
167 164
            ((IDirtyMarkable) part).changed(object);
168 165
        }
169 166
        else {
170
            IEditorPart editor = getEditor();
171
            if (editor != null && editor instanceof IDirtyMarkable) {
172
                ((IDirtyMarkable) editor).changed(object);
173
            }
167
//            IEditorPart editor = getEditor();
168
//            if (editor != null && editor instanceof IDirtyMarkable) {
169
//                ((IDirtyMarkable) editor).changed(object);
170
//            }
174 171
        }
175 172
    }
176 173

  

Also available in: Unified diff