| 1 |
|
package org.xmlhammer.gui.wizard; |
| 2 |
|
|
| 3 |
|
import javax.swing.ButtonGroup; |
| 4 |
|
import javax.swing.JRadioButton; |
| 5 |
|
import javax.swing.border.EmptyBorder; |
| 6 |
|
|
| 7 |
|
import org.bounce.FormLayout; |
| 8 |
|
import org.bounce.wizard.WizardPage; |
| 9 |
|
import org.xmlhammer.gui.util.wizard.HelpEnabledWizardPage; |
| 10 |
|
|
| 11 |
|
public class InputTypeSelectionPage extends HelpEnabledWizardPage { |
| 12 |
|
|
| 13 |
|
private static final long serialVersionUID = -1909903213579390495L; |
| 14 |
|
|
| 15 |
220 |
private InputFilterPage filterPage = null; |
| 16 |
220 |
private InputURIsPage urisPage = null; |
| 17 |
|
|
| 18 |
220 |
private JRadioButton selectInputFilter = null; |
| 19 |
220 |
private JRadioButton selectInputURIs = null; |
| 20 |
|
|
| 21 |
|
public InputTypeSelectionPage(String helpID, InputFilterPage filterPage, InputURIsPage urisPage) { |
| 22 |
220 |
super(new FormLayout(11, 5), helpID); |
| 23 |
|
|
| 24 |
220 |
setBorder(new EmptyBorder(20, 50, 10, 10)); |
| 25 |
|
|
| 26 |
220 |
selectInputFilter = new JRadioButton("Specify the input documents using a Filter"); |
| 27 |
220 |
selectInputURIs = new JRadioButton("Specify specific URIs for the input documents"); |
| 28 |
|
|
| 29 |
220 |
ButtonGroup group = new ButtonGroup(); |
| 30 |
220 |
group.add(selectInputFilter); |
| 31 |
220 |
group.add(selectInputURIs); |
| 32 |
|
|
| 33 |
220 |
selectInputFilter.setSelected(true); |
| 34 |
|
|
| 35 |
220 |
add(selectInputFilter, FormLayout.FULL); |
| 36 |
220 |
add(selectInputURIs, FormLayout.FULL); |
| 37 |
|
|
| 38 |
220 |
this.filterPage = filterPage; |
| 39 |
220 |
this.urisPage = urisPage; |
| 40 |
220 |
} |
| 41 |
|
|
| 42 |
|
public boolean isInputFilterSelected() { |
| 43 |
110 |
return selectInputFilter.isSelected(); |
| 44 |
|
} |
| 45 |
|
|
| 46 |
|
|
| 47 |
|
public void selectInputFilter() { |
| 48 |
0 |
selectInputFilter.setSelected(true); |
| 49 |
0 |
} |
| 50 |
|
|
| 51 |
|
|
| 52 |
|
public void selectInputURIs() { |
| 53 |
110 |
selectInputURIs.setSelected(true); |
| 54 |
110 |
} |
| 55 |
|
|
| 56 |
|
@Override |
| 57 |
|
public String getTitle() { |
| 58 |
330 |
return "Select Input Type"; |
| 59 |
|
} |
| 60 |
|
|
| 61 |
|
@Override |
| 62 |
|
public String getDescription() { |
| 63 |
330 |
return "Define the mechanism to use to specify input documents."; |
| 64 |
|
} |
| 65 |
|
|
| 66 |
|
@Override |
| 67 |
|
public WizardPage getNext() { |
| 68 |
550 |
if (selectInputFilter.isSelected()) { |
| 69 |
440 |
return filterPage; |
| 70 |
|
} |
| 71 |
|
|
| 72 |
110 |
return urisPage; |
| 73 |
|
} |
| 74 |
|
} |