Project

General

Profile

« Previous | Next » 

Revision 5f709cc6

Added by Andreas Müller over 1 year ago

cleanup

View differences:

eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/LifeCycleManager.java
1
// $Id$
2 1
/**
3 2
* Copyright (C) 2017 EDIT
4 3
* European Distributed Institute of Taxonomy
......
156 155
                .getActiveWorkbenchWindow();
157 156
        if (PreferencesUtil.getBooleanValue(PreferencePredicate.ShowChecklistPerspective.getKey())){
158 157

  
159

  
160 158
            IPerspectiveRegistry registry = workbench.getPerspectiveRegistry();
161 159
            IWorkbenchPage page = window.getActivePage();
162 160
            page.setPerspective(registry.findPerspectiveWithId("eu.etaxonomy.taxeditor.perspective.checklistperspective"));
......
164 162
            EditorUtil.setMediaVisible(false);
165 163
        }else{
166 164

  
167

  
168 165
            IPerspectiveRegistry registry = workbench.getPerspectiveRegistry();
169 166
            IWorkbenchPage page = window.getActivePage();
170 167
            page.setPerspective(registry.findPerspectiveWithId("eu.etaxonomy.taxeditor.application.perspective.taxonomic"));
......
173 170
        hideParts();
174 171

  
175 172
        PreferencesUtil.checkNomenclaturalCode();
176

  
177 173
    }
178 174

  
179
    /**
180
     * {@inheritDoc}
181
     */
182 175
    @Override
183 176
    public void contextRefresh(IProgressMonitor monitor) {
184 177
    }
185 178

  
186
    /**
187
     * {@inheritDoc}
188
     */
189 179
    @Override
190 180
    public void workbenchShutdown(IMemento memento, IProgressMonitor monitor) {
191 181
    }
192

  
193
}
182
}
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/EditorUtil.java
166 166
        }
167 167

  
168 168
        return partService.showPart(part, PartState.ACTIVATE);
169

  
170 169
    }
171 170

  
172 171
    public static MPart showPart(String partId, EModelService modelService, EPartService partService){
......
275 274

  
276 275
    public static Collection<MPart> checkForChanges(UUID taxonUUID, EPartService partService ){
277 276
        Collection<MPart> parts = partService.getParts();
278
        Collection<MPart> dirtyParts = new HashSet();
277
        Collection<MPart> dirtyParts = new HashSet<>();
279 278
        //check if part is already opened
280 279
        boolean isDirty = false;
281 280
        for (MPart part : parts) {
......
364 363
        EditorUtil.mediaVisible = mediaVisible;
365 364
    }
366 365

  
367
    /**
368
	 * <p>
369
	 * forceUserSave
370
	 * </p>
371
	 *
372
	 * @param editor
373
	 *            a {@link org.eclipse.ui.IEditorPart} object.
374
	 * @param shell
375
	 *            a {@link org.eclipse.swt.widgets.Shell} object.
376
	 * @return a boolean.
377
	 */
378 366
	public static boolean forceUserSave(IEditorPart editor, Shell shell) {
379 367
		if (editor.isDirty()) {
380 368

  
eu.etaxonomy.taxeditor.editor/src/main/java/eu/etaxonomy/taxeditor/editor/name/e4/TaxonEditor.java
389 389
        input.merge();
390 390

  
391 391
        dirty.setDirty(false);
392
        
392

  
393 393
        EventUtility.postEvent(WorkbenchEventConstants.REFRESH_NAVIGATOR, new TaxonNodeDto(input.getTaxonNode().getParent()));
394 394
        EventUtility.postEvent(WorkbenchEventConstants.SAVE_TAXON, true);
395 395
        // Stop the progress monitor.
......
788 788
        return input.getTaxonNode();
789 789
    }
790 790

  
791
	
791

  
792 792
}
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/AbstractCdmDataViewer.java
40 40
 * @date 18.07.2017
41 41
 */
42 42
public abstract class AbstractCdmDataViewer extends Viewer {
43
	
43

  
44 44
	private static final Logger logger = LogManager.getLogger();
45 45

  
46 46

  
......
112 112
			formFactory.dispose();
113 113
			formFactory = null;
114 114
		}
115
		formFactory =  new CdmFormFactory(Display.getCurrent(), this);
115
		formFactory = new CdmFormFactory(Display.getCurrent(), this);
116 116
		ContextInjectionFactory.inject(formFactory, context);
117 117
	}
118 118

  
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsPartE4.java
30 30
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
31 31
import eu.etaxonomy.taxeditor.view.e4.AbstractCdmEditorPartE4;
32 32
import eu.etaxonomy.taxeditor.view.e4.supplementaldata.SupplementalDataPartE4;
33
import eu.etaxonomy.taxeditor.workbench.part.ISelectionElementEditingPart;
34 33

  
35 34
/**
36 35
 * @author pplitzner
......
90 89
            viewer.setSelection(structuredSelection, false);
91 90

  
92 91
            showViewer(structuredSelection, activePart, viewer);
93
            
92

  
94 93
            return;
95 94
        }
96 95
        else{
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/e4/details/DetailsViewerE4.java
64 64
import eu.etaxonomy.cdm.model.term.TermVocabulary;
65 65
import eu.etaxonomy.cdm.persistence.dto.TermNodeDto;
66 66
import eu.etaxonomy.cdm.persistence.dto.TermTreeDto;
67
import eu.etaxonomy.cdm.persistence.hibernate.CdmDataChangeMap;
68 67
import eu.etaxonomy.taxeditor.editor.IBulkEditor;
69 68
import eu.etaxonomy.taxeditor.editor.IDistributionEditorPart;
70 69
import eu.etaxonomy.taxeditor.event.WorkbenchEventConstants;
......
177 176
    }
178 177
    // START HACK TO MAKE THE DERIVED UNIT FACADE WORK
179 178
    // since we are getting implementations of DerivedUnitBase from the bulk
180
    // editor
181
    // and not derived unit facade objects,
182

  
179
    // editor and not derived unit facade objects,
183 180
    @Override
184 181
    public void setInput(Object input) {
185 182

  
......
208 205
            input = DerivedUnitFacade.NewInstance(SpecimenOrObservationType.FieldUnit, (FieldUnit) input);
209 206
        }
210 207
        super.setInput(input);
211

  
212

  
213 208
    }
214 209

  
215 210
    @Override
......
985 980
        addPart(termMediaSection);
986 981
    }
987 982

  
988
   
983

  
989 984
    @Inject
990 985
    @Optional
991 986
    private void updateView(@UIEventTopic(WorkbenchEventConstants.REFRESH_DETAILS)boolean refresh){

Also available in: Unified diff