Project

General

Profile

« Previous | Next » 

Revision 09152959

Added by Ben Stöver over 8 years ago

Test implementation of Copy action added to AlignmentEditor.

View differences:

eu.etaxonomy.taxeditor.molecular/src/main/java/eu/etaxonomy/taxeditor/molecular/editor/AlignmentEditor.java
52 52
import org.biojava.bio.chromatogram.ChromatogramFactory;
53 53
import org.biojava.bio.chromatogram.UnsupportedChromatogramFormatException;
54 54
import org.eclipse.core.runtime.IProgressMonitor;
55
import org.eclipse.jface.action.Action;
55 56
import org.eclipse.swt.SWT;
56 57
import org.eclipse.swt.widgets.Composite;
57 58
import org.eclipse.ui.IActionBars;
......
60 61
import org.eclipse.ui.IEditorSite;
61 62
import org.eclipse.ui.PartInitException;
62 63
import org.eclipse.ui.PlatformUI;
64
import org.eclipse.ui.actions.ActionFactory;
63 65
import org.eclipse.ui.commands.ICommandService;
64 66
import org.eclipse.ui.part.EditorPart;
65 67

  
......
442 444
    public void init(IEditorSite site, IEditorInput input) throws PartInitException {
443 445
        setSite(site);
444 446
        setInput(input);
447
        System.out.println("AlignmentEditor.init(): " + ActionFactory.COPY.getId());
448
        site.getActionBars().setGlobalActionHandler(ActionFactory.COPY.getId(), new Action(ActionFactory.COPY.getId()) {
449
            @Override
450
            public boolean isEnabled() {
451
                System.out.println("isEnabled()");
452
                return true;
453
            }
454

  
455
            @Override
456
            public void run() {
457
                System.out.println("run");
458
                    super.run();
459
                }
460
            });
445 461
    }
446 462

  
447 463

  
......
691 707

  
692 708
		if (tokens != null) {  // If either an edited sequence or a pherogram URI was provided.
693 709
		    provider.insertTokensAt(id, 0, tokens);
694
		    
710

  
695 711
		    if (pherogramProvider != null) {
696 712
		        // Create pherogram area:
697 713
		        PherogramArea pherogramArea = new PherogramArea(getReadsArea().getContentArea(),
698 714
		                new PherogramAreaModel(pherogramProvider));
699
	
715

  
700 716
		        // Set position properties and shifts:
701 717
		        PherogramAreaModel model = pherogramArea.getModel();
702 718
		        if ((firstSeqPos != null) && (leftCutPos != null)) {

Also available in: Unified diff