labelN.setText("The size of the n-Grams (typically 3):");
labelN.setLayoutData(new GridData());
N = new Text(container, SWT.BORDER | SWT.SINGLE);
N.setText("" + Activator.getRuleEngine().getN());
N.addKeyListener(new KeyListener()
{
@Override
public void keyPressed(KeyEvent e)
{
}
@Override
public void keyReleased(KeyEvent e)
{
try
{
Integer.valueOf(N.getText());
int val = Integer.valueOf(N.getText()).intValue();
if( val < 1 )
{
setErrorMessage("Value for parameter \"N\" must be greater than 0");
inputNValid = false;
setPageComplete(inputNValid & inputCValid);
}
else
{
inputNValid = true;
setErrorMessage(null);
setPageComplete(inputNValid & inputCValid);
}
}
catch(NumberFormatException exception)
{
setErrorMessage("Integer value expected for parameter \"N\"");
inputNValid = false;
setPageComplete(inputNValid & inputCValid);
}
}
});
N.setLayoutData(new GridData(50, 20));
Label labelCorrelation = new Label(container, SWT.NULL);
labelCorrelation.setText("The minimum correlation if two items should match (min. 0, max. 1):");
labelCorrelation.setLayoutData(new GridData());
correlation = new Text(container, SWT.BORDER | SWT.SINGLE);
correlation.setText("" + Activator.getRuleEngine().getCorrelation());
correlation.addKeyListener(new KeyListener()
{
@Override
public void keyPressed(KeyEvent e)
{
}