219 break;
220 }
221
222 JNIEnv *env = GetEnv();
223 jobjectArray retValue;
224
225 if (!ret) {
226 jclass jc = env->FindClass("java/lang/String");
227 if (CheckAndClearException(env)) return NULL;
228 JLClass cls(env, jc);
229 retValue = env->NewObjectArray(0, cls, NULL);
230 if (CheckAndClearException(env)) return NULL;
231 } else {
232 files.calculateLength(); // the result is stored in the files variable
233 retValue = ConvertFiles(files);
234 }
235
236 jclass jc = env->FindClass("com/sun/glass/ui/CommonDialogs");
237 JLClass cls(env, jc);
238 if (CheckAndClearException(env)) return NULL;
239 return env->CallStaticObjectMethod(cls, javaIDs.CommonDialogs.createFileChooserResult,
240 retValue, jFilters, (jint)(ofn.nFilterIndex - 1));
241 }
242
243 /***********************************
244 * SHBrowseForFolder implementation
245 ***********************************/
246
247 // Implemented in the same way as shown in the example from:
248 // http://msdn.microsoft.com/en-us/library/bb762115%28v=vs.85%29.aspx
249
250 int CALLBACK FolderChooserCallbackProc(HWND hwnd, UINT uMsg,
251 LPARAM lParam,
252 LPARAM lpData)
253 {
254 if (uMsg == BFFM_INITIALIZED) {
255 SendMessage(hwnd, BFFM_SETSELECTION, TRUE, lpData);
256 }
257
258 return 0;
259 }
260
|
219 break;
220 }
221
222 JNIEnv *env = GetEnv();
223 jobjectArray retValue;
224
225 if (!ret) {
226 jclass jc = env->FindClass("java/lang/String");
227 if (CheckAndClearException(env)) return NULL;
228 JLClass cls(env, jc);
229 retValue = env->NewObjectArray(0, cls, NULL);
230 if (CheckAndClearException(env)) return NULL;
231 } else {
232 files.calculateLength(); // the result is stored in the files variable
233 retValue = ConvertFiles(files);
234 }
235
236 jclass jc = env->FindClass("com/sun/glass/ui/CommonDialogs");
237 JLClass cls(env, jc);
238 if (CheckAndClearException(env)) return NULL;
239 jobject jobj = env->CallStaticObjectMethod(cls, javaIDs.CommonDialogs.createFileChooserResult,
240 retValue, jFilters, (jint)(ofn.nFilterIndex - 1));
241 if (CheckAndClearException(env)) return NULL;
242 return jobj;
243 }
244
245 /***********************************
246 * SHBrowseForFolder implementation
247 ***********************************/
248
249 // Implemented in the same way as shown in the example from:
250 // http://msdn.microsoft.com/en-us/library/bb762115%28v=vs.85%29.aspx
251
252 int CALLBACK FolderChooserCallbackProc(HWND hwnd, UINT uMsg,
253 LPARAM lParam,
254 LPARAM lpData)
255 {
256 if (uMsg == BFFM_INITIALIZED) {
257 SendMessage(hwnd, BFFM_SETSELECTION, TRUE, lpData);
258 }
259
260 return 0;
261 }
262
|