|
1 |
// $Id$
|
|
2 |
/**
|
|
3 |
* Copyright (C) 2016 EDIT
|
|
4 |
* European Distributed Institute of Taxonomy
|
|
5 |
* http://www.e-taxonomy.eu
|
|
6 |
*
|
|
7 |
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
|
8 |
* See LICENSE.TXT at the top of this package for the full license terms.
|
|
9 |
*/
|
|
10 |
package eu.etaxonomy.taxeditor.molecular.io;
|
|
11 |
|
|
12 |
|
|
13 |
import org.eclipse.jface.wizard.WizardPage;
|
|
14 |
import org.eclipse.swt.SWT;
|
|
15 |
import org.eclipse.swt.events.SelectionAdapter;
|
|
16 |
import org.eclipse.swt.events.SelectionEvent;
|
|
17 |
import org.eclipse.swt.layout.FormAttachment;
|
|
18 |
import org.eclipse.swt.layout.FormData;
|
|
19 |
import org.eclipse.swt.layout.FormLayout;
|
|
20 |
import org.eclipse.swt.widgets.Button;
|
|
21 |
import org.eclipse.swt.widgets.Composite;
|
|
22 |
import org.eclipse.swt.widgets.Text;
|
|
23 |
|
|
24 |
|
|
25 |
|
|
26 |
/**
|
|
27 |
* Wizard page that allows to specify which parts of a single read alignment shall be exported to an alignment file.
|
|
28 |
*
|
|
29 |
* @author Ben Stöver
|
|
30 |
* @date 18.04.2016
|
|
31 |
*/
|
|
32 |
public class ExportSingleReadAlignmentWizardPage extends WizardPage {
|
|
33 |
private Text consensusSequenceNameTextField;
|
|
34 |
private Button exportConsensusSequenceCB;
|
|
35 |
private Button exportSingleReadsCB;
|
|
36 |
|
|
37 |
|
|
38 |
/**
|
|
39 |
* Create the wizard.
|
|
40 |
*/
|
|
41 |
public ExportSingleReadAlignmentWizardPage() {
|
|
42 |
super("SingleReadSequencesExport"); //TODO Which pageName should be used here? Any conventions?
|
|
43 |
setTitle("Sequence export");
|
|
44 |
setDescription("Defines which sequences of the single read alignment shall be exported.");
|
|
45 |
}
|
|
46 |
|
|
47 |
|
|
48 |
/**
|
|
49 |
* Create contents of the wizard.
|
|
50 |
*
|
|
51 |
* @param parent the parent component
|
|
52 |
*/
|
|
53 |
@Override
|
|
54 |
public void createControl(Composite parent) {
|
|
55 |
Composite container = new Composite(parent, SWT.NULL);
|
|
56 |
|
|
57 |
setControl(container);
|
|
58 |
container.setLayout(new FormLayout());
|
|
59 |
|
|
60 |
exportSingleReadsCB = new Button(container, SWT.CHECK);
|
|
61 |
exportSingleReadsCB.setSelection(true);
|
|
62 |
FormData fd_exportSingleReadsCB = new FormData();
|
|
63 |
fd_exportSingleReadsCB.top = new FormAttachment(0, 10);
|
|
64 |
fd_exportSingleReadsCB.left = new FormAttachment(0, 10);
|
|
65 |
exportSingleReadsCB.setLayoutData(fd_exportSingleReadsCB);
|
|
66 |
exportSingleReadsCB.setText("Export single reads");
|
|
67 |
|
|
68 |
exportConsensusSequenceCB = new Button(container, SWT.CHECK);
|
|
69 |
exportConsensusSequenceCB.setSelection(true);
|
|
70 |
exportConsensusSequenceCB.addSelectionListener(new SelectionAdapter() {
|
|
71 |
@Override
|
|
72 |
public void widgetSelected(SelectionEvent e) {
|
|
73 |
consensusSequenceNameTextField.setEnabled(exportConsensusSequenceCB.getSelection());
|
|
74 |
}
|
|
75 |
});
|
|
76 |
FormData fd_exportConsensusSequenceCB = new FormData();
|
|
77 |
fd_exportConsensusSequenceCB.top = new FormAttachment(exportSingleReadsCB, 6);
|
|
78 |
fd_exportConsensusSequenceCB.left = new FormAttachment(exportSingleReadsCB, 0, SWT.LEFT);
|
|
79 |
exportConsensusSequenceCB.setLayoutData(fd_exportConsensusSequenceCB);
|
|
80 |
exportConsensusSequenceCB.setText("Export consensus sequence");
|
|
81 |
|
|
82 |
consensusSequenceNameTextField = new Text(container, SWT.BORDER);
|
|
83 |
consensusSequenceNameTextField.setText("ConsensusSequence");
|
|
84 |
FormData fd_consensusSequenceNameTextField = new FormData();
|
|
85 |
fd_consensusSequenceNameTextField.bottom = new FormAttachment(30);
|
|
86 |
fd_consensusSequenceNameTextField.right = new FormAttachment(28);
|
|
87 |
fd_consensusSequenceNameTextField.top = new FormAttachment(0, 62);
|
|
88 |
fd_consensusSequenceNameTextField.left = new FormAttachment(0, 32);
|
|
89 |
consensusSequenceNameTextField.setLayoutData(fd_consensusSequenceNameTextField);
|
|
90 |
}
|
|
91 |
}
|
Initial version of ExportSingleReadAlignmentWizardPage added.