View Javadoc

1   /***
2    * Created on Oct 18, 2005, Copyright UC Regents
3    */
4   package org.telscenter.pas.ui.dialog;
5   
6   import java.awt.BorderLayout;
7   import java.awt.Dimension;
8   
9   import javax.swing.BorderFactory;
10  import javax.swing.Box;
11  import javax.swing.BoxLayout;
12  import javax.swing.JPanel;
13  
14  import org.telscenter.pas.steps.actions.DialogSaveAction;
15  import org.telscenter.pas.steps.actions.LeaveStudentAssessmentAction;
16  
17  
18  /***
19   * @author anthonyperritano
20   *
21   */
22  public class PasSaveStudentAssesmentDialogUI extends PasMessageDialogUI {
23  
24  	
25  	private LeaveStudentAssessmentAction leaveAction;
26  
27  	public PasSaveStudentAssesmentDialogUI(LeaveStudentAssessmentAction leaveAction) {
28  		super();
29  		this.leaveAction = leaveAction;
30  		
31  	}
32  
33  	protected void addButtonActions() {
34  		getCancelButton().setAction(new DialogSaveAction("Continue Working"));
35  		getOkButton().setAction(leaveAction);
36  	}
37  	
38  	protected void arrangeButtons() {
39  //		buttonPanel = new JPanel(new EqualsLayout(
40  //				EqualsLayout.HORIZONTAL, EqualsLayout.RIGHT, 1));
41  		buttonPanel = new JPanel(new BorderLayout(0,0));
42  		
43  		JPanel innerPanel = new JPanel();
44  		innerPanel.setLayout(new BoxLayout(innerPanel, BoxLayout.X_AXIS));
45  		innerPanel.setOpaque(false);
46  		innerPanel.add(okButton);
47  		innerPanel.add(Box.createRigidArea(new Dimension(5, 0)));
48  		innerPanel.add(cancelButton);
49  		buttonPanel.add(innerPanel,BorderLayout.EAST);
50  		buttonPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 5, 5));
51  		buttonPanel.setOpaque(false);
52  	}
53  }