Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 249482
Collapse All | Expand All

(-)UI/org/eclipse/rse/ui/filters/dialogs/SystemNewFilterWizardNamePage.java (-3 / +73 lines)
Lines 15-20 Link Here
15
 * David Dykstal (IBM) - [160403] filters should be connection private by default
15
 * David Dykstal (IBM) - [160403] filters should be connection private by default
16
 * David McKnight   (IBM)        - [225506] [api][breaking] RSE UI leaks non-API types
16
 * David McKnight   (IBM)        - [225506] [api][breaking] RSE UI leaks non-API types
17
 * David McKnight   (IBM)        - [226948] [api][regression] SystemNewFilterWizard.createNamePage() is no longer available
17
 * David McKnight   (IBM)        - [226948] [api][regression] SystemNewFilterWizard.createNamePage() is no longer available
18
 * David McKnight   (IBM)        - [249482] Duplicate Filters can be created if changing the filter pool
18
 *******************************************************************************/
19
 *******************************************************************************/
19
20
20
package org.eclipse.rse.ui.filters.dialogs;
21
package org.eclipse.rse.ui.filters.dialogs;
Lines 310-331 Link Here
310
		if (src == poolCombo)
311
		if (src == poolCombo)
311
		{
312
		{
312
		  	int selection = poolCombo.getSelectionIndex();
313
		  	int selection = poolCombo.getSelectionIndex();
313
		  	if ((selection >= 0) && (nameValidators!=null))
314
 			
315
		  	if ((selection >= 0) && (nameValidators!=null)){
314
		    	nameValidator = nameValidators[selection];
316
		    	nameValidator = nameValidators[selection];
317
		    	
318
	 			ISystemFilterPool currentPool = poolsToSelectFrom[selection];
319
	 			if  (currentPool == parentPool){ // if this is the connection-unique filter pool, set the uniqueCB
320
	 				uniqueCB.setSelection(true); 			
321
	 				poolCombo.setEnabled(false);
322
	 			} 			
323
		  	}
315
		}
324
		}
316
		else if (src == poolWrapperCombo)
325
		else if (src == poolWrapperCombo)
317
		{
326
		{
318
		  	int selection = poolWrapperCombo.getSelectionIndex();
327
		  	int selection = poolWrapperCombo.getSelectionIndex();
319
		  	if ((selection >= 0) && (nameValidators!=null))
328
 			
329
		  	if ((selection >= 0) && (nameValidators!=null)){
320
		    	nameValidator = nameValidators[selection];
330
		    	nameValidator = nameValidators[selection];
331
		    				  	
332
	 			ISystemFilterPoolWrapper currentPool = poolWrappers[selection];
333
	 			if  (currentPool == poolWrapperInformation.getPreSelectWrapper()){ // if this is the connection-unique filter pool, set the uniqueCB
334
	 				uniqueCB.setSelection(true); 				
335
	 				poolWrapperCombo.setEnabled(false);
336
	 			} 	
337
		  	}
321
		}
338
		}
322
		else if (src == uniqueCB)
339
		else if (src == uniqueCB)
323
		{
340
		{
324
			boolean selected = uniqueCB.getSelection();
341
			boolean selected = uniqueCB.getSelection();
325
			if (poolVerbiage != null)
342
			if (poolVerbiage != null)
326
			  	poolVerbiage.setEnabled(!selected);
343
			  	poolVerbiage.setEnabled(!selected);
327
			if (poolCombo != null)
344
			if (poolCombo != null){
328
			 	poolCombo.setEnabled(!selected);
345
			 	poolCombo.setEnabled(!selected);
346
			 	
347
			 				 				 	
348
			 	// if unique to connection then only connection-private filter pool can be used			 		
349
			 	// if it's not unique to connection, then the connection-private filter pool should not be selected
350
		 		boolean foundPool = false;
351
			 	int filterPoolSelectionIndex = 0;
352
		 		if (poolsToSelectFrom != null){
353
		 			
354
		 			int currentIndex = poolCombo.getSelectionIndex();
355
		 			ISystemFilterPool currentPool = poolsToSelectFrom[currentIndex];
356
		 			if (currentPool != parentPool && !selected){ 
357
		 				// then the current pool is okay
358
		 				filterPoolSelectionIndex = currentIndex;
359
		 			}
360
		 			else {
361
			 			for (int idx=0; idx<poolsToSelectFrom.length && !foundPool; idx++){
362
			 				ISystemFilterPool pool = poolsToSelectFrom[idx];
363
			 		
364
			 				boolean isConnectionUnique = pool == parentPool;
365
			 				
366
			 				if ((isConnectionUnique && selected) || (!isConnectionUnique && !selected)){			 				
367
			 					filterPoolSelectionIndex = idx;
368
		           	  			foundPool = true;		           	  			
369
		           	  		}
370
			 			}
371
			 			poolCombo.select(filterPoolSelectionIndex);
372
		 			}
373
		 		}
374
		 		else if (poolWrappers != null){
375
		 			int currentIndex = poolWrapperCombo.getSelectionIndex();
376
		 			ISystemFilterPoolWrapper currentPoolWrapper = poolWrappers[currentIndex];
377
		 			if (currentPoolWrapper == poolWrapperInformation.getPreSelectWrapper()){
378
		 				// then the current pool is okay
379
		 				filterPoolSelectionIndex = currentIndex;
380
		 			}
381
		 			else {
382
			 			for (int idx=0; idx<poolWrappers.length && !foundPool; idx++){
383
			 				
384
			 				boolean isConnectionUnique = poolWrapperInformation.getPreSelectWrapper() == poolWrappers[idx];
385
			 				if ((isConnectionUnique && selected) || (!isConnectionUnique && !selected)){			 				
386
			 					filterPoolSelectionIndex = idx;
387
		           	  			foundPool = true;		           	  			
388
		           	  		}
389
			 			}
390
			 			poolWrapperCombo.select(filterPoolSelectionIndex);
391
		 			}
392
		 		}
393
394
		 		if (nameValidators != null){
395
		 			nameValidator = nameValidators[filterPoolSelectionIndex];
396
		 		}
397
			 	
398
			}
329
			if (poolWrapperCombo != null)
399
			if (poolWrapperCombo != null)
330
				poolWrapperCombo.setEnabled(!selected);
400
				poolWrapperCombo.setEnabled(!selected);
331
			if (poolComboLabel != null)
401
			if (poolComboLabel != null)

Return to bug 249482