Lines 28-33
import javax.swing.BorderFactory;
Link Here
|
28 |
import javax.swing.ButtonGroup; |
28 |
import javax.swing.ButtonGroup; |
29 |
import javax.swing.JCheckBox; |
29 |
import javax.swing.JCheckBox; |
30 |
import javax.swing.JComboBox; |
30 |
import javax.swing.JComboBox; |
|
|
31 |
import javax.swing.JComponent; |
31 |
import javax.swing.JLabel; |
32 |
import javax.swing.JLabel; |
32 |
import javax.swing.JOptionPane; |
33 |
import javax.swing.JOptionPane; |
33 |
import javax.swing.JPanel; |
34 |
import javax.swing.JPanel; |
Lines 74-79
public class HTMLAssertionGui extends AbstractAssertionGui implements KeyListene
Link Here
|
74 |
|
75 |
|
75 |
private FilePanel filePanel = null; |
76 |
private FilePanel filePanel = null; |
76 |
|
77 |
|
|
|
78 |
private JCheckBox useJsoup = null; |
79 |
|
80 |
private VerticalPanel formatPanel; |
81 |
|
77 |
/** |
82 |
/** |
78 |
* The constructor. |
83 |
* The constructor. |
79 |
*/ |
84 |
*/ |
Lines 144-149
public class HTMLAssertionGui extends AbstractAssertionGui implements KeyListene
Link Here
|
144 |
((HTMLAssertion) inElement).setXML(); |
149 |
((HTMLAssertion) inElement).setXML(); |
145 |
} |
150 |
} |
146 |
((HTMLAssertion) inElement).setFilename(filePanel.getFilename()); |
151 |
((HTMLAssertion) inElement).setFilename(filePanel.getFilename()); |
|
|
152 |
|
153 |
((HTMLAssertion) inElement).setUseJsoup(useJsoup.isSelected()); |
147 |
} |
154 |
} |
148 |
|
155 |
|
149 |
/** |
156 |
/** |
Lines 162-167
public class HTMLAssertionGui extends AbstractAssertionGui implements KeyListene
Link Here
|
162 |
warningThresholdField.setText("0"); //$NON-NLS-1$ |
169 |
warningThresholdField.setText("0"); //$NON-NLS-1$ |
163 |
filePanel.setFilename(""); //$NON-NLS-1$ |
170 |
filePanel.setFilename(""); //$NON-NLS-1$ |
164 |
errorsOnly.setSelected(false); |
171 |
errorsOnly.setSelected(false); |
|
|
172 |
useJsoup.setSelected(false); |
165 |
} |
173 |
} |
166 |
|
174 |
|
167 |
/** |
175 |
/** |
Lines 192-197
public class HTMLAssertionGui extends AbstractAssertionGui implements KeyListene
Link Here
|
192 |
warningThresholdField.setEditable(true); |
200 |
warningThresholdField.setEditable(true); |
193 |
} |
201 |
} |
194 |
filePanel.setFilename(lAssertion.getFilename()); |
202 |
filePanel.setFilename(lAssertion.getFilename()); |
|
|
203 |
useJsoup.setSelected(lAssertion.getUseJsoup()); |
204 |
setJsoupDependentFlags(); |
195 |
} |
205 |
} |
196 |
|
206 |
|
197 |
/** |
207 |
/** |
Lines 210-215
public class HTMLAssertionGui extends AbstractAssertionGui implements KeyListene
Link Here
|
210 |
VerticalPanel assertionPanel = new VerticalPanel(); |
220 |
VerticalPanel assertionPanel = new VerticalPanel(); |
211 |
assertionPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Tidy Settings")); |
221 |
assertionPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Tidy Settings")); |
212 |
|
222 |
|
|
|
223 |
useJsoup = new JCheckBox("Use Jsoup"); |
224 |
useJsoup.addActionListener(this); |
225 |
assertionPanel.add(useJsoup); |
226 |
|
213 |
// doctype |
227 |
// doctype |
214 |
HorizontalPanel docTypePanel = new HorizontalPanel(); |
228 |
HorizontalPanel docTypePanel = new HorizontalPanel(); |
215 |
docTypeBox = new JComboBox<>(new String[] { "omit", "auto", "strict", "loose" }); |
229 |
docTypeBox = new JComboBox<>(new String[] { "omit", "auto", "strict", "loose" }); |
Lines 220-226
public class HTMLAssertionGui extends AbstractAssertionGui implements KeyListene
Link Here
|
220 |
assertionPanel.add(docTypePanel); |
234 |
assertionPanel.add(docTypePanel); |
221 |
|
235 |
|
222 |
// format (HTML, XHTML, XML) |
236 |
// format (HTML, XHTML, XML) |
223 |
VerticalPanel formatPanel = new VerticalPanel(); |
237 |
formatPanel = new VerticalPanel(); |
224 |
formatPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Format")); |
238 |
formatPanel.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), "Format")); |
225 |
htmlRadioButton = new JRadioButton("HTML", true); //$NON-NLS-1$ |
239 |
htmlRadioButton = new JRadioButton("HTML", true); //$NON-NLS-1$ |
226 |
xhtmlRadioButton = new JRadioButton("XHTML", false); //$NON-NLS-1$ |
240 |
xhtmlRadioButton = new JRadioButton("XHTML", false); //$NON-NLS-1$ |
Lines 275-280
public class HTMLAssertionGui extends AbstractAssertionGui implements KeyListene
Link Here
|
275 |
warningThresholdField.setEnabled(true); |
289 |
warningThresholdField.setEnabled(true); |
276 |
warningThresholdField.setEditable(true); |
290 |
warningThresholdField.setEditable(true); |
277 |
} |
291 |
} |
|
|
292 |
setJsoupDependentFlags(); |
293 |
} |
294 |
|
295 |
private void setJsoupDependentFlags() { |
296 |
boolean jsoupFlag = !useJsoup.isSelected(); |
297 |
docTypeBox.setEditable(jsoupFlag); |
298 |
docTypeBox.setEnabled(jsoupFlag); |
299 |
filePanel.setEnabled(jsoupFlag); |
300 |
filePanel.enableFile(jsoupFlag); |
301 |
formatPanel.setEnabled(jsoupFlag); |
302 |
htmlRadioButton.setEnabled(jsoupFlag); |
303 |
xhtmlRadioButton.setEnabled(jsoupFlag); |
304 |
xmlRadioButton.setEnabled(jsoupFlag); |
305 |
errorsOnly.setEnabled(jsoupFlag); |
278 |
} |
306 |
} |
279 |
|
307 |
|
280 |
@Override |
308 |
@Override |
281 |
- |
|
|