10
10
*/
11
11
package ts .eclipse .ide .internal .ui .preferences ;
12
12
13
+ import java .util .ArrayList ;
14
+ import java .util .List ;
15
+
13
16
import org .eclipse .core .resources .IProject ;
14
17
import org .eclipse .jface .dialogs .ControlEnableState ;
15
18
import org .eclipse .swt .SWT ;
@@ -111,15 +114,18 @@ public void widgetSelected(SelectionEvent e) {
111
114
112
115
// Create combo of embedded node.js
113
116
ITypeScriptRepository [] respositories = TypeScriptCorePlugin .getTypeScriptRepositoryManager ().getRepositories ();
114
- String [] values = new String [ respositories . length ] ;
115
- String [] labels = new String [ respositories . length ] ;
116
- int i = 0 ;
117
+ List < String > values = new ArrayList < String >() ;
118
+ List < String > labels = new ArrayList < String >() ;
119
+ String label = null ;
117
120
for (ITypeScriptRepository repository : respositories ) {
118
- values [i ] = repository .getName ();
119
- labels [i ] = getRepositoryLabel (repository );
120
- i ++;
121
+ label = getRepositoryLabel (repository );
122
+ if (label != null ) {
123
+ values .add (repository .getName ());
124
+ labels .add (label );
125
+ }
121
126
}
122
- embeddedComboBox = newComboControl (parent , getEmbeddedTypescriptKey (), values , labels );
127
+ embeddedComboBox = newComboControl (parent , getEmbeddedTypescriptKey (),
128
+ values .toArray (new String [values .size ()]), labels .toArray (new String [labels .size ()]));
123
129
embeddedComboBox .setLayoutData (new GridData (GridData .FILL_HORIZONTAL ));
124
130
}
125
131
@@ -138,8 +144,8 @@ public void widgetSelected(SelectionEvent e) {
138
144
}
139
145
});
140
146
141
- installedComboBox = newComboControl (parent , getInstalledTypescriptPathKey (), getDefaultPaths (), getDefaultPaths (),
142
- false );
147
+ installedComboBox = newComboControl (parent , getInstalledTypescriptPathKey (), getDefaultPaths (),
148
+ getDefaultPaths (), false );
143
149
installedComboBox .setLayoutData (new GridData (GridData .FILL_HORIZONTAL ));
144
150
145
151
// Create Browse buttons.
0 commit comments