1   /**
2    * JHylaFax - A java client for HylaFAX.
3    *
4    * Copyright (C) 2005 by Steffen Pingel <steffenp@gmx.de>
5    *
6    * This program is free software; you can redistribute it and/or modify
7    * it under the terms of the GNU General Public License as published by
8    * the Free Software Foundation; either version 2 of the License, or
9    * (at your option) any later version.
10   *
11   * This program is distributed in the hope that it will be useful,
12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14   * GNU General Public License for more details.
15   *
16   * You should have received a copy of the GNU General Public License
17   * along with this program; if not, write to the Free Software
18   * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19   */
20  package net.sf.jhylafax;
21  
22  import static net.sf.jhylafax.JHylaFAX.i18n;
23  import net.sf.jhylafax.fax.FaxJob;
24  
25  import org.xnap.commons.gui.DefaultDialog;
26  
27  /**
28   * A dialog for editing properties of a fax job.
29   * 
30   * @author Steffen Pingel
31   */
32  public class JobDialog extends DefaultDialog implements LocaleChangeListener {
33  
34  	private JobPanel jobPanel;
35  	private FaxJob job;
36  	
37  	public JobDialog(FaxJob job) {
38  		super(BUTTON_OKAY | BUTTON_CANCEL);
39  	
40  		this.job = job;
41  		
42  		setTitle(i18n.tr("Job"));
43  		
44  		jobPanel = new JobPanel(true);
45  		setMainComponent(jobPanel);
46  		
47  		updateLabels();
48  		pack();
49  	}
50  	
51  	@Override
52  	public boolean apply() {
53  		jobPanel.applyTo(job);
54  		return true;
55  	}
56  	
57  	public JobPanel getJobPanel() {
58  		return jobPanel;
59  	}
60  	
61  	public void revert() {
62  		jobPanel.revertFrom(job);
63  	}
64  	
65  	public void updateLabels() {
66  		jobPanel.updateLabels();
67  	}
68  
69  }