JAL-1834 removed quotes around truncated strings with ellipsis
[jalview.git] / src / jalview / gui / AlignExportSettings.java
1 package jalview.gui;
2
3 import jalview.api.AlignExportSettingI;
4 import jalview.bin.Jalview;
5 import jalview.jbgui.GAlignExportSettings;
6 import jalview.util.MessageManager;
7
8 import java.awt.event.ActionEvent;
9 import java.awt.event.WindowAdapter;
10 import java.awt.event.WindowEvent;
11
12 import javax.swing.JDialog;
13 import javax.swing.JOptionPane;
14
15 @SuppressWarnings("serial")
16 public class AlignExportSettings extends GAlignExportSettings implements
17         AlignExportSettingI
18 {
19   boolean cancelled = false;
20
21   JDialog dialog;
22
23   public AlignExportSettings(boolean hasHiddenSeq, boolean hasHiddenCols,
24           String alignFileFormat)
25   {
26     super(hasHiddenSeq, hasHiddenCols, alignFileFormat);
27     if (!Jalview.isHeadlessMode() && isShowDialog())
28     {
29
30       JOptionPane pane = new JOptionPane(null, JOptionPane.DEFAULT_OPTION,
31               JOptionPane.DEFAULT_OPTION, null, new Object[]
32               { this });
33       dialog = pane.createDialog(Desktop.desktop,
34               MessageManager.getString("label.export_settings"));
35       dialog.addWindowListener(new WindowAdapter()
36       {
37         public void windowClosing(WindowEvent e)
38         {
39           cancelled = true;
40         }
41       });
42       dialog.pack();
43       dialog.setVisible(true);
44       dialog.setContentPane(this);
45       dialog.validate();
46
47     }
48   }
49
50
51   public void ok_actionPerformed(ActionEvent e)
52   {
53     cancelled = false;
54     dialog.setVisible(false);
55     dialog.dispose();
56   }
57
58   public void cancel_actionPerformed(ActionEvent e)
59   {
60     cancelled = true;
61     dialog.setVisible(false);
62     dialog.dispose();
63   }
64
65   @Override
66   public boolean isExportHiddenSequences()
67   {
68     return chkHiddenSeqs.isSelected();
69   }
70
71   @Override
72   public boolean isExportHiddenColumns()
73   {
74     return chkHiddenCols.isSelected();
75   }
76
77   @Override
78   public boolean isExportAnnotations()
79   {
80     return chkExportAnnots.isSelected();
81   }
82
83   @Override
84   public boolean isExportFeatures()
85   {
86     return chkExportFeats.isSelected();
87   }
88
89   @Override
90   public boolean isExportGroups()
91   {
92     return chkExportGrps.isSelected();
93   }
94
95   public boolean isCancelled()
96   {
97     return cancelled;
98   }
99
100 }