Skip to content

Commit

Permalink
Fix dialog bug
Browse files Browse the repository at this point in the history
  • Loading branch information
latinojoel committed Dec 9, 2014
1 parent bcccd3a commit 7f45935
Showing 1 changed file with 7 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;

import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
Expand Down Expand Up @@ -99,7 +96,7 @@ public class PushNotificationDialog extends BaseStepDialog implements StepDialog
private CTabFolder wTabFolder;
private CTabItem wMainOptionsTab, wPropTab;
private TableView wLocalizedArguments, wCustomFields;
private Map<String, Integer> inputFields = new HashMap<String, Integer>();
private String[] inputFields;
private List<ColumnInfo> fieldColumns = new ArrayList<ColumnInfo>();
private Shell parent;

Expand Down Expand Up @@ -774,16 +771,12 @@ public void run() {
try {
final RowMetaInterface row = transMeta.getPrevStepFields(stepMeta);
// Remember these fields...
int i = 0;
if (row != null) {
for (String fieldName : row.getFieldNames()) {
inputFields.put(fieldName, i);
i++;
}
inputFields = row.getFieldNames();
}
setComboBoxes();
} catch (KettleException e) {
logError(BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Message"));
logDebug(BaseMessages.getString(PKG, "System.Dialog.GetFieldsFailed.Message"));
}
}
}
Expand Down Expand Up @@ -1118,13 +1111,10 @@ private void get(TableView tableView) {
*/
private void setComboBoxes() {
// Something was changed in the row.
final Map<String, Integer> fields = inputFields;
final Set<String> keySet = fields.keySet();
if (keySet != null && keySet.toArray().length > 0) {
final String[] fieldNames = (String[]) keySet.toArray();
Const.sortStrings(fieldNames);
ciFieldsCustomFields[1].setComboValues(fieldNames);
ciFieldsLocalizedArgument[0].setComboValues(fieldNames);
if (inputFields != null && inputFields.length > 0) {
Const.sortStrings(inputFields);
ciFieldsCustomFields[1].setComboValues(inputFields);
ciFieldsLocalizedArgument[0].setComboValues(inputFields);
}
}

Expand Down

0 comments on commit 7f45935

Please sign in to comment.