Color backYellow = new Color(composite.getDisplay(), 231, 231, 191);
Color[] labelColors =new Color[] {backYellow, composite.getDisplay().getSystemColor(SWT.COLOR_WHITE) };
//*-- add the index directory selector
GridData indexGd = new GridData(); indexGd.grabExcessHorizontalSpace = false; indexGd.horizontalAlignment = GridData.FILL;
CLabel indexLabel = new CLabel(composite, SWT.LEFT); indexLabel.setText("Lucene index dir.: ");
indexLabel.setBackground( labelColors, new int[] {100} );
indexLabel.setLayoutData(indexGd);
final Text indexText = new Text(composite, SWT.SINGLE | SWT.BORDER);
indexText.setText( ( (CrawlConfigWizard) getWizard() ).crawlConfig.getIndexDir() );
if (indexText.getText().length() == 0)
indexText.setText(Constants.MUSTRU_HOME + Constants.fs + "data" + Constants.fs + "index");
GridData indexTextGd = new GridData(); indexTextGd.horizontalAlignment = GridData.BEGINNING;
indexTextGd.minimumWidth = 350; indexTextGd.grabExcessHorizontalSpace = true;
indexText.setEditable(false);
indexText.setLayoutData(indexTextGd);
Button indexButton = new Button(composite, SWT.PUSH); indexButton.setText("Browse");
GridData indexButtonGd = new GridData(); indexButtonGd.horizontalAlignment = GridData.BEGINNING;
indexButtonGd.grabExcessHorizontalSpace = false;
indexButton.setLayoutData(indexButtonGd);
indexButton.addListener( SWT.Selection, new Listener() {
public void handleEvent(Event e)
{
DirectoryDialog dd = new DirectoryDialog(composite.getShell());
dd.setMessage("Please select the Lucene index directory");
String dir = dd.open();
if (dir != null)
{ indexText.setText(dir);( (CrawlConfigWizard) getWizard() ).crawlConfig.setIndexDir(dir); }
}
});
//*-- description of the Lucene index dir.
GridData indexDescrGd = new GridData(); indexDescrGd.grabExcessHorizontalSpace = true;
indexDescrGd.horizontalAlignment = GridData.FILL; indexDescrGd.horizontalSpan = 3;
indexDescrGd.widthHint = 350;
Text indexDescrText = new Text(composite, SWT.LEFT | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | SWT.H_SCROLL);
indexDescrText.setEditable(false);
indexDescrText.setText("The Lucene index directory is where one or more indexes will be stored. If there are " + Constants.NEWLINE +
"sub-directories in this directory, a multisearcher will be created to scan all index. Otherwise, a " + Constants.NEWLINE +
"single index reader will be used. The files in this directory can become quite large.");
indexDescrText.setLayoutData(indexDescrGd);
//*-- add the database directory selector
GridData dbGd = new GridData(); dbGd.grabExcessHorizontalSpace = false; dbGd.horizontalAlignment = GridData.FILL;
CLabel dbLabel = new CLabel(composite, SWT.LEFT); dbLabel.setText("Berkeley DB dir.: ");
dbLabel.setBackground( labelColors, new int[] {100} );
dbLabel.setLayoutData(dbGd);
final Text dbText = new Text(composite, SWT.SINGLE | SWT.BORDER);
dbText.setText( ( (CrawlConfigWizard) getWizard() ).crawlConfig.getDbDir() );
if (dbText.getText().length() == 0)
dbText.setText(Constants.MUSTRU_HOME + Constants.fs + "data" + Constants.fs + "bdb");
GridData dbTextGd = new GridData(); dbTextGd.horizontalAlignment = GridData.BEGINNING;
dbTextGd.minimumWidth = 350; dbTextGd.grabExcessHorizontalSpace = true;
dbText.setEditable(false);
dbText.setLayoutData(dbTextGd);
Button dbButton = new Button(composite, SWT.PUSH); dbButton.setText("Browse");
GridData dbButtonGd = new GridData(); dbButtonGd.horizontalAlignment = GridData.BEGINNING;
dbButtonGd.grabExcessHorizontalSpace = false;
dbButton.setLayoutData(dbButtonGd);
dbButton.addListener( SWT.Selection, new Listener() {
public void handleEvent(Event e)
{
DirectoryDialog dd = new DirectoryDialog(composite.getShell());
dd.setMessage("Please select the Berekeley DB directory");
String dir = dd.open();
if (dir != null)
{ dbText.setText(dir); ( (CrawlConfigWizard) getWizard() ).crawlConfig.setDbDir(dir); }
}
});
//*-- description of the Berkeley DB dir.
GridData dbDescrGd = new GridData(); dbDescrGd.grabExcessHorizontalSpace = true;
dbDescrGd.horizontalAlignment = GridData.FILL; dbDescrGd.horizontalSpan = 3;
dbDescrGd.widthHint = 350;
Text dbDescrText = new Text(composite, SWT.LEFT | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | SWT.H_SCROLL);
dbDescrText.setEditable(false);
dbDescrText.setText("The Berkeley database directory contains the log and data files for the database. " + Constants.NEWLINE +
"For a large database, there will be many files and sufficient space will be required in this directory.");
dbDescrText.setLayoutData(dbDescrGd);
//*-- add the web directory selector
GridData webGd = new GridData(); webGd.grabExcessHorizontalSpace = false; webGd.horizontalAlignment = GridData.FILL;
CLabel webLabel = new CLabel(composite, SWT.LEFT); webLabel.setText("Web Server Root dir.: ");
webLabel.setBackground( labelColors, new int[] {100} );
webLabel.setLayoutData(dbGd);
final Text webText = new Text(composite, SWT.SINGLE | SWT.BORDER);
webText.setText( ( (CrawlConfigWizard) getWizard() ).crawlConfig.getWebDir() );
GridData webTextGd = new GridData(); webTextGd.horizontalAlignment = GridData.BEGINNING;
webTextGd.minimumWidth = 350; webTextGd.grabExcessHorizontalSpace = true;