Normand Briere
2018-07-07 e416acb9b012b17d1efe49ad2199ea7132d874d1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package timeflow.app.actions;
 
import timeflow.model.*;
import timeflow.app.ui.*;
import timeflow.app.*;
 
import java.awt.event.*;
import javax.swing.*;
 
 
public class ReorderFieldsAction extends TimeflowAction {
 
   public ReorderFieldsAction(TimeflowApp app)
   {
       super(app, "Reorder Fields...", null, "Edit the order of fields");
   }
   
   @Override
   public void actionPerformed(ActionEvent e) {
       ReorderFieldsPanel panel=new ReorderFieldsPanel(getModel());
       Object[] options = {"Cancel", "Apply"};
       int n = JOptionPane.showOptionDialog(app,
                   panel,
                   "Reorder Fields",
                   JOptionPane.YES_NO_CANCEL_OPTION,
                   JOptionPane.PLAIN_MESSAGE,
                   null,
                   options,
                   "Apply");
       panel.detachFromModel();
       if (n==1)
       {
           panel.applyReordering();
           getModel().noteSchemaChange(this);
       }
   }
 
}