return;
}
if (lines[2] == null){
lines[2] = "Nothing Entered ";
}
epiMaker = new EpiMaker();
epiMaker.commentWriter(pluginInterface, lines);
shell.close() ;
shell.dispose();
readEpifile();
}
});
//Button for Cancel
Button cancel = new Button(shell, SWT.PUSH);
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = 1;
cancel.setLayoutData( gridData);
cancel.setText("Cancel");
cancel.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
shell.close() ;
shell.dispose() ;
}
});
//Spacer to increase size even though we are going to call pack
Label spacer = new Label(shell, SWT.PUSH);
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.horizontalSpan = 1;
spacer.setLayoutData( gridData);
spacer.setText(" ");
//Listener for 'Enter'
line2.addKeyListener(new KeyListener() {
public void keyPressed(KeyEvent e) {
int escPressed=0;
switch (e.character){
case SWT.CR: escPressed=1;break;
}
if (escPressed == 1){
lines[1]=line1.getText();
lines[2]=line2.getText();
if (lines[1] == null){
shell.close();
shell.dispose();
return;
}
if (lines[2] == null){
lines[2] = "Nothing Entered ";
}
epiMaker = new EpiMaker();
epiMaker.commentWriter(pluginInterface, lines);
shell.close() ;
shell.dispose();
readEpifile();
}