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 147435
Collapse All | Expand All

(-)src/org/eclipse/hyades/trace/ui/internal/core/TraceHostUI.java (-11 / +13 lines)
Lines 246-253 Link Here
246
			}
246
			}
247
			if (exist>0)
247
			if (exist>0)
248
			{
248
			{
249
249
				int index = _list.getSelectionIndex();
250
				_list.select(exist>=_list.getItemCount()?exist-1:exist);
250
				_list.select(exist>=index?index:exist);
251
			}
251
			}
252
			else
252
			else
253
			{
253
			{
Lines 278-283 Link Here
278
			if (text.equals(_list.getItem(idx).getText()))
278
			if (text.equals(_list.getItem(idx).getText()))
279
			{	
279
			{	
280
				_list.select(idx);
280
				_list.select(idx);
281
				setHostText();
281
				return;
282
				return;
282
			}
283
			}
283
		}
284
		}
Lines 287-292 Link Here
287
		item.setImage(CommonUITraceImages.INSTANCE.getImage(CommonUITraceImages.IMG_UI_NODE));
288
		item.setImage(CommonUITraceImages.INSTANCE.getImage(CommonUITraceImages.IMG_UI_NODE));
288
289
289
		_list.setSelection(new TableItem[] { item });
290
		_list.setSelection(new TableItem[] { item });
291
		setHostText();
290
	}
292
	}
291
293
292
	public void editHost(String text) {
294
	public void editHost(String text) {
Lines 488-501 Link Here
488
		
490
		
489
		_host.setText("");
491
		_host.setText("");
490
		_port.setText("");
492
		_port.setText("");
491
		
493
		setDefaultHost();
492
		if(_list.getItemCount() > 0)
493
		{
494
			if(i-1 > 0 && i-1<_list.getSelectionCount())
495
				_list.select(i-1);
496
			else
497
				_list.select(0);			
498
		}
499
	}
494
	}
500
495
501
	private void testConnection() {
496
	private void testConnection() {
Lines 647-652 Link Here
647
642
648
		String hosts = store.getString(CommonUIConstants.HOST_KEY);
643
		String hosts = store.getString(CommonUIConstants.HOST_KEY);
649
		addHosts(hosts);
644
		addHosts(hosts);
645
		setDefaultHost();
650
		setHostText();
646
		setHostText();
651
		
647
		
652
		enableButtons();
648
		enableButtons();
Lines 659-665 Link Here
659
	public void reset() {
655
	public void reset() {
660
		_list.removeAll();
656
		_list.removeAll();
661
	}
657
	}
662
658
	/**
659
	 * Set the Default Selected host in Hosts List as Localhost:port (i.e. index 1 ) 
660
	 */
661
	public void setDefaultHost(){
662
		_list.select(1);
663
		setHostText();
664
	}
663
	/**
665
	/**
664
	 * Sent when default selection occurs in the control.
666
	 * Sent when default selection occurs in the control.
665
	 * <p>
667
	 * <p>

Return to bug 147435