2121import java .util .Iterator ;
2222import java .util .Map ;
2323
24- import javax .swing .AbstractAction ;
24+ import javax .swing .Box ;
2525import javax .swing .BoxLayout ;
2626import javax .swing .DefaultCellEditor ;
2727import javax .swing .JButton ;
@@ -100,10 +100,8 @@ private final void createColumnSelectionTab() {
100100 m_appendColsCB = new JCheckBox ("Append columns to input table spec" );
101101 newtableCBPanel .add (m_appendColsCB , BorderLayout .WEST );
102102
103- JButton addButton = new JButton (new AbstractAction () {
104-
105- private static final long serialVersionUID = -743704737927962277L ;
106-
103+ JButton addButton = new JButton ("Add Output Column" );
104+ addButton .addActionListener ( new ActionListener () {
107105 public void actionPerformed (final ActionEvent e ) {
108106 String name ;
109107 ScriptNodeOutputColumnsTableModel model = ((ScriptNodeOutputColumnsTableModel ) m_table
@@ -126,12 +124,9 @@ public void actionPerformed(final ActionEvent e) {
126124 model .addRow (name , "String" );
127125 }
128126 });
129- addButton .setText ("Add Output Column" );
130-
131- JButton removeButton = new JButton (new AbstractAction () {
132-
133- private static final long serialVersionUID = 743704737927962277L ;
134127
128+ JButton removeButton = new JButton ("Remove Output Column" );
129+ removeButton .addActionListener ( new ActionListener () {
135130 public void actionPerformed (final ActionEvent e ) {
136131 int [] selectedRows = m_table .getSelectedRows ();
137132 logger .debug ("selectedRows = " + selectedRows );
@@ -148,10 +143,41 @@ public void actionPerformed(final ActionEvent e) {
148143 }
149144 }
150145 });
151- removeButton .setText ("Remove Output Column" );
146+
147+ JButton upButton = new JButton ("Up" );
148+ upButton .addActionListener (new ActionListener () {
149+ public void actionPerformed (final ActionEvent e ) {
150+ int [] selectedRows = m_table .getSelectedRows ();
151+ logger .debug ("selectedRows = " + selectedRows );
152+
153+ if (selectedRows .length == 0 ) {
154+ return ;
155+ }
156+ ((ScriptNodeOutputColumnsTableModel ) m_table .getModel ())
157+ .moveRowsUp (selectedRows );
158+ }
159+ });
160+
161+ JButton downButton = new JButton ("Down" );
162+ downButton .addActionListener (new ActionListener () {
163+ public void actionPerformed (final ActionEvent e ) {
164+ int [] selectedRows = m_table .getSelectedRows ();
165+ logger .debug ("selectedRows = " + selectedRows );
166+
167+ if (selectedRows .length == 0 ) {
168+ return ;
169+ }
170+
171+ ((ScriptNodeOutputColumnsTableModel ) m_table .getModel ())
172+ .moveRowsDown (selectedRows );
173+ }
174+ });
152175
153176 outputButtonPanel .add (addButton );
154177 outputButtonPanel .add (removeButton );
178+ outputButtonPanel .add (Box .createHorizontalStrut (40 ));
179+ outputButtonPanel .add (upButton );
180+ outputButtonPanel .add (downButton );
155181
156182 m_table = new JTable ();
157183 m_table .putClientProperty ("terminateEditOnFocusLost" , Boolean .TRUE );
@@ -211,9 +237,8 @@ private final void createScriptTab() {
211237 JPanel scriptButtonPanel = new JPanel ();
212238
213239 // script load button
214- JButton scriptButton = new JButton (new AbstractAction () {
215-
216- private static final long serialVersionUID = 6097485154386131768L ;
240+ JButton scriptButton = new JButton ("Load Script from File" );
241+ scriptButton .addActionListener ( new ActionListener () {
217242 private JFileChooser fileChooser = new JFileChooser ();
218243
219244 public void actionPerformed (final ActionEvent e ) {
@@ -252,7 +277,6 @@ public void actionPerformed(final ActionEvent e) {
252277 clearErrorHighlight ();
253278 }
254279 });
255- scriptButton .setText ("Load Script from File" );
256280 scriptButtonPanel .add (scriptButton );
257281
258282 JPanel scriptMainPanel = new JPanel (new BorderLayout ());
@@ -273,7 +297,9 @@ public void actionPerformed(final ActionEvent e) {
273297
274298 JPanel inputColumnsPanel = new JPanel ();
275299 inputColumnsPanel .setLayout (new BoxLayout (inputColumnsPanel , BoxLayout .PAGE_AXIS ));
276- inputColumnsPanel .setMinimumSize (new Dimension (20 , 150 ));
300+
301+ if (num > 0 )
302+ inputColumnsPanel .setMinimumSize (new Dimension (20 , 150 ));
277303
278304 for (int i = 0 ; i < num ; i ++) {
279305 inputColumnsPanel .add (addColumnPane (
0 commit comments