View | Details | Raw Unified | Return to bug 228774
Collapse All | Expand All

(-)UI/org/eclipse/rse/internal/ui/view/SystemTableViewPart.java (-143 / +139 lines)
Lines 1-15 Link Here
1
/********************************************************************************
1
/********************************************************************************
2
 * Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved.
2
 * Copyright (c) 2002, 2008 IBM Corporation and others. All rights reserved.
3
 * This program and the accompanying materials are made available under the terms
3
 * This program and the accompanying materials are made available under the terms
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is 
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is
5
 * available at http://www.eclipse.org/legal/epl-v10.html
5
 * available at http://www.eclipse.org/legal/epl-v10.html
6
 * 
6
 *
7
 * Initial Contributors:
7
 * Initial Contributors:
8
 * The following IBM employees contributed to the Remote System Explorer
8
 * The following IBM employees contributed to the Remote System Explorer
9
 * component that contains this file: David McKnight, Kushal Munir, 
9
 * component that contains this file: David McKnight, Kushal Munir,
10
 * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, 
10
 * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
11
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
11
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
12
 * 
12
 *
13
 * Contributors:
13
 * Contributors:
14
 * Michael Berger (IBM) - 146339 Added refresh action graphic.
14
 * Michael Berger (IBM) - 146339 Added refresh action graphic.
15
 * David Dykstal (IBM) - moved SystemsPreferencesManager to a new package
15
 * David Dykstal (IBM) - moved SystemsPreferencesManager to a new package
Lines 31-37 Link Here
31
 * David McKnight   (IBM)        - [225506] [api][breaking] RSE UI leaks non-API types
31
 * David McKnight   (IBM)        - [225506] [api][breaking] RSE UI leaks non-API types
32
 * Xuan Chen        (IBM)        - [225685] NPE when running archive testcases
32
 * Xuan Chen        (IBM)        - [225685] NPE when running archive testcases
33
 * David McKnight   (IBM)        - [225506] [api][breaking] RSE UI leaks non-API type
33
 * David McKnight   (IBM)        - [225506] [api][breaking] RSE UI leaks non-API type
34
 ********************************************************************************/
34
 * Martin Oberhuber (Wind River) - [228774] Improve ElementComparer Performance
35
*******************************************************/
35
36
36
package org.eclipse.rse.internal.ui.view;
37
package org.eclipse.rse.internal.ui.view;
37
38
Lines 144-154 Link Here
144
145
145
	class BrowseAction extends Action
146
	class BrowseAction extends Action
146
	{
147
	{
147
		
148
148
		public BrowseAction()
149
		public BrowseAction()
149
		{
150
		{
150
		}
151
		}
151
		
152
152
		public BrowseAction(String label, ImageDescriptor des)
153
		public BrowseAction(String label, ImageDescriptor des)
153
		{
154
		{
154
			super(label, des);
155
			super(label, des);
Lines 317-329 Link Here
317
			_isLocked = !_isLocked;
318
			_isLocked = !_isLocked;
318
			showLock();
319
			showLock();
319
		}
320
		}
320
		
321
321
		/**
322
		/**
322
		 * Returns the label depending on lock state.
323
		 * Returns the label depending on lock state.
323
		 * @return the label.
324
		 * @return the label.
324
		 */
325
		 */
325
		public String determineLabel() {
326
		public String determineLabel() {
326
			
327
327
			if (!_isLocked) {
328
			if (!_isLocked) {
328
				return SystemResources.ACTION_LOCK_LABEL;
329
				return SystemResources.ACTION_LOCK_LABEL;
329
			}
330
			}
Lines 331-348 Link Here
331
				return SystemResources.ACTION_UNLOCK_LABEL;
332
				return SystemResources.ACTION_UNLOCK_LABEL;
332
			}
333
			}
333
		}
334
		}
334
		
335
335
		/**
336
		/**
336
		 * Returns the tooltip depending on lock state.
337
		 * Returns the tooltip depending on lock state.
337
		 * @return the tooltip.
338
		 * @return the tooltip.
338
		 */
339
		 */
339
		public String determineTooltip() {
340
		public String determineTooltip() {
340
			
341
341
			if (!_isLocked) {
342
			if (!_isLocked) {
342
				return SystemResources.ACTION_LOCK_TOOLTIP;
343
				return SystemResources.ACTION_LOCK_TOOLTIP;
343
			}
344
			}
344
			else {
345
			else {
345
				return SystemResources.ACTION_UNLOCK_TOOLTIP;				
346
				return SystemResources.ACTION_UNLOCK_TOOLTIP;
346
			}
347
			}
347
		}
348
		}
348
	}
349
	}
Lines 351-357 Link Here
351
	{
352
	{
352
		public RefreshAction()
353
		public RefreshAction()
353
		{
354
		{
354
			super(SystemResources.ACTION_REFRESH_TABLE_LABLE, 
355
			super(SystemResources.ACTION_REFRESH_TABLE_LABLE,
355
					//RSEUIPlugin.getDefault().getImageDescriptor(ICON_SYSTEM_REFRESH_ID));
356
					//RSEUIPlugin.getDefault().getImageDescriptor(ICON_SYSTEM_REFRESH_ID));
356
					RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_REFRESH_ID));
357
					RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_REFRESH_ID));
357
			setToolTipText(SystemResources.ACTION_REFRESH_TABLE_TOOLTIP);
358
			setToolTipText(SystemResources.ACTION_REFRESH_TABLE_TOOLTIP);
Lines 402-408 Link Here
402
			_viewer.setSelection(_viewer.getSelection());
403
			_viewer.setSelection(_viewer.getSelection());
403
		}
404
		}
404
	}
405
	}
405
	
406
406
	class SelectInputAction extends BrowseAction
407
	class SelectInputAction extends BrowseAction
407
	{
408
	{
408
		public SelectInputAction()
409
		public SelectInputAction()
Lines 410-431 Link Here
410
			super(SystemResources.ACTION_SELECT_INPUT_LABEL, null);
411
			super(SystemResources.ACTION_SELECT_INPUT_LABEL, null);
411
			setToolTipText(SystemResources.ACTION_SELECT_INPUT_TOOLTIP);
412
			setToolTipText(SystemResources.ACTION_SELECT_INPUT_TOOLTIP);
412
		}
413
		}
413
		
414
414
		public void checkEnabledState()
415
		public void checkEnabledState()
415
		{
416
		{
416
			setEnabled(true);	
417
			setEnabled(true);
417
		}
418
		}
418
		
419
419
		public void run()
420
		public void run()
420
		{
421
		{
421
			
422
422
			SystemSelectAnythingDialog dlg = new SystemSelectAnythingDialog(_viewer.getShell(), SystemResources.ACTION_SELECT_INPUT_DLG);
423
			SystemSelectAnythingDialog dlg = new SystemSelectAnythingDialog(_viewer.getShell(), SystemResources.ACTION_SELECT_INPUT_DLG);
423
			
424
424
			SystemActionViewerFilter filter = new SystemActionViewerFilter();
425
			SystemActionViewerFilter filter = new SystemActionViewerFilter();
425
			Class[] types = {Object.class};
426
			Class[] types = {Object.class};
426
			filter.addFilterCriterion(types, "hasChildren", "true"); //$NON-NLS-1$ //$NON-NLS-2$	
427
			filter.addFilterCriterion(types, "hasChildren", "true"); //$NON-NLS-1$ //$NON-NLS-2$
427
			dlg.setViewerFilter(filter);
428
			dlg.setViewerFilter(filter);
428
			
429
429
			Object inputObject = _viewer.getInput();
430
			Object inputObject = _viewer.getInput();
430
			if (inputObject == null)
431
			if (inputObject == null)
431
			{
432
			{
Lines 436-442 Link Here
436
			{
437
			{
437
				Object selected = dlg.getSelectedObject();
438
				Object selected = dlg.getSelectedObject();
438
				if (selected != null && selected instanceof IAdaptable)
439
				if (selected != null && selected instanceof IAdaptable)
439
				{					
440
				{
440
					IAdaptable adaptable = (IAdaptable)selected;
441
					IAdaptable adaptable = (IAdaptable)selected;
441
					((ISystemViewElementAdapter)adaptable.getAdapter(ISystemViewElementAdapter.class)).setViewer(_viewer);
442
					((ISystemViewElementAdapter)adaptable.getAdapter(ISystemViewElementAdapter.class)).setViewer(_viewer);
442
					setInput(adaptable);
443
					setInput(adaptable);
Lines 674-680 Link Here
674
			final String objectID = memento.getString(TAG_TABLE_VIEW_OBJECT_ID);
675
			final String objectID = memento.getString(TAG_TABLE_VIEW_OBJECT_ID);
675
676
676
			ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
677
			ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
677
			
678
678
			Object input = null;
679
			Object input = null;
679
			if (subsystemId == null)
680
			if (subsystemId == null)
680
			{
681
			{
Lines 686-692 Link Here
686
				}
687
				}
687
				else
688
				else
688
				{
689
				{
689
				    // 191288 we now use registry instead of registry ui as input 
690
				    // 191288 we now use registry instead of registry ui as input
690
					input = registry;
691
					input = registry;
691
				}
692
				}
692
			}
693
			}
Lines 722-728 Link Here
722
			} // end else
723
			} // end else
723
			return runWithInput(monitor, input, memento);
724
			return runWithInput(monitor, input, memento);
724
		}
725
		}
725
			
726
726
		private class RunOnceConnectedOnMainThread implements Runnable
727
		private class RunOnceConnectedOnMainThread implements Runnable
727
		{
728
		{
728
			private IMemento _inmemento;
729
			private IMemento _inmemento;
Lines 738-750 Link Here
738
				_filterID = filterID;
739
				_filterID = filterID;
739
				_objectID = objectID;
740
				_objectID = objectID;
740
			}
741
			}
741
			
742
742
			public void run()
743
			public void run()
743
			{
744
			{
744
				runOnceConnected(new NullProgressMonitor(), _inmemento, _input, _subSystem, _filterID, _objectID);
745
				runOnceConnected(new NullProgressMonitor(), _inmemento, _input, _subSystem, _filterID, _objectID);
745
			}
746
			}
746
		}
747
		}
747
		
748
748
		public IStatus runOnceConnected(IProgressMonitor monitor, IMemento memento, Object input, ISubSystem subsystem, String filterID, String objectID)
749
		public IStatus runOnceConnected(IProgressMonitor monitor, IMemento memento, Object input, ISubSystem subsystem, String filterID, String objectID)
749
		{
750
		{
750
			if (subsystem.isConnected()) {
751
			if (subsystem.isConnected()) {
Lines 798-811 Link Here
798
			}
799
			}
799
			return Status.OK_STATUS;
800
			return Status.OK_STATUS;
800
		}
801
		}
801
	
802
802
	}
803
	}
803
	
804
804
805
805
806
806
	private class SelectColumnsAction extends BrowseAction
807
	private class SelectColumnsAction extends BrowseAction
807
	{
808
	{
808
	    
809
809
	    class SelectColumnsDialog extends SystemPromptDialog
810
	    class SelectColumnsDialog extends SystemPromptDialog
810
		{
811
		{
811
	        private ISystemViewElementAdapter _adapter;
812
	        private ISystemViewElementAdapter _adapter;
Lines 813-827 Link Here
813
			private IPropertyDescriptor[] _uniqueDescriptors;
814
			private IPropertyDescriptor[] _uniqueDescriptors;
814
			private ArrayList _currentDisplayedDescriptors;
815
			private ArrayList _currentDisplayedDescriptors;
815
			private ArrayList _availableDescriptors;
816
			private ArrayList _availableDescriptors;
816
			
817
817
			private List _availableList;
818
			private List _availableList;
818
			private List _displayedList;
819
			private List _displayedList;
819
			
820
820
			private Button _addButton;
821
			private Button _addButton;
821
			private Button _removeButton;
822
			private Button _removeButton;
822
			private Button _upButton;
823
			private Button _upButton;
823
			private Button _downButton;
824
			private Button _downButton;
824
			
825
825
826
826
			public SelectColumnsDialog(Shell shell, ISystemViewElementAdapter viewAdapter, ISystemTableViewColumnManager columnManager)
827
			public SelectColumnsDialog(Shell shell, ISystemViewElementAdapter viewAdapter, ISystemTableViewColumnManager columnManager)
827
			{
828
			{
Lines 852-865 Link Here
852
			{
853
			{
853
			    Widget source = e.widget;
854
			    Widget source = e.widget;
854
			    if (source == _addButton)
855
			    if (source == _addButton)
855
			    { 
856
			    {
856
			        int[] toAdd = _availableList.getSelectionIndices();
857
			        int[] toAdd = _availableList.getSelectionIndices();
857
			        addToDisplay(toAdd);	        	        
858
			        addToDisplay(toAdd);
858
			    }
859
			    }
859
			    else if (source == _removeButton)
860
			    else if (source == _removeButton)
860
			    {
861
			    {
861
			        int[] toAdd = _displayedList.getSelectionIndices();
862
			        int[] toAdd = _displayedList.getSelectionIndices();
862
			        removeFromDisplay(toAdd);	   
863
			        removeFromDisplay(toAdd);
863
			    }
864
			    }
864
			    else if (source == _upButton)
865
			    else if (source == _upButton)
865
			    {
866
			    {
Lines 873-883 Link Here
873
			        moveDown(index);
874
			        moveDown(index);
874
			        _displayedList.select(index + 1);
875
			        _displayedList.select(index + 1);
875
			    }
876
			    }
876
			    
877
877
			    // update button enable states
878
			    // update button enable states
878
			    updateEnableStates();
879
			    updateEnableStates();
879
			}
880
			}
880
			
881
881
			public IPropertyDescriptor[] getDisplayedColumns()
882
			public IPropertyDescriptor[] getDisplayedColumns()
882
			{
883
			{
883
			    IPropertyDescriptor[] displayedColumns = new IPropertyDescriptor[_currentDisplayedDescriptors.size()];
884
			    IPropertyDescriptor[] displayedColumns = new IPropertyDescriptor[_currentDisplayedDescriptors.size()];
Lines 887-900 Link Here
887
			    }
888
			    }
888
			    return displayedColumns;
889
			    return displayedColumns;
889
			}
890
			}
890
			
891
891
			private void updateEnableStates()
892
			private void updateEnableStates()
892
			{
893
			{
893
			    boolean enableAdd = false;
894
			    boolean enableAdd = false;
894
			    boolean enableRemove = false;
895
			    boolean enableRemove = false;
895
			    boolean enableUp = false;
896
			    boolean enableUp = false;
896
			    boolean enableDown = false;
897
			    boolean enableDown = false;
897
			    
898
898
			    int[] availableSelected = _availableList.getSelectionIndices();
899
			    int[] availableSelected = _availableList.getSelectionIndices();
899
			    for (int i = 0; i < availableSelected.length; i++)
900
			    for (int i = 0; i < availableSelected.length; i++)
900
			    {
901
			    {
Lines 905-915 Link Here
905
			            enableAdd = true;
906
			            enableAdd = true;
906
			        }
907
			        }
907
			    }
908
			    }
908
			    
909
909
			    if (_displayedList.getSelectionCount()>0)
910
			    if (_displayedList.getSelectionCount()>0)
910
			    {
911
			    {
911
			        enableRemove = true;
912
			        enableRemove = true;
912
			        
913
913
			        int index = _displayedList.getSelectionIndex();
914
			        int index = _displayedList.getSelectionIndex();
914
			        if (index > 0)
915
			        if (index > 0)
915
			        {
916
			        {
Lines 920-982 Link Here
920
			            enableDown = true;
921
			            enableDown = true;
921
			        }
922
			        }
922
			    }
923
			    }
923
			    
924
924
			    _addButton.setEnabled(enableAdd);
925
			    _addButton.setEnabled(enableAdd);
925
			    _removeButton.setEnabled(enableRemove);
926
			    _removeButton.setEnabled(enableRemove);
926
			    _upButton.setEnabled(enableUp);
927
			    _upButton.setEnabled(enableUp);
927
			    _downButton.setEnabled(enableDown);
928
			    _downButton.setEnabled(enableDown);
928
			    
929
929
			}
930
			}
930
			
931
931
			private void moveUp(int index)
932
			private void moveUp(int index)
932
			{
933
			{
933
			    Object obj = _currentDisplayedDescriptors.remove(index);
934
			    Object obj = _currentDisplayedDescriptors.remove(index);
934
		        _currentDisplayedDescriptors.add(index - 1, obj);
935
		        _currentDisplayedDescriptors.add(index - 1, obj);
935
		        refreshDisplayedList();
936
		        refreshDisplayedList();
936
			}
937
			}
937
			
938
938
			private void moveDown(int index)
939
			private void moveDown(int index)
939
			{
940
			{
940
			    Object obj = _currentDisplayedDescriptors.remove(index);
941
			    Object obj = _currentDisplayedDescriptors.remove(index);
941
		        _currentDisplayedDescriptors.add(index + 1, obj);
942
		        _currentDisplayedDescriptors.add(index + 1, obj);
942
		        
943
943
		        refreshDisplayedList();
944
		        refreshDisplayedList();
944
			}
945
			}
945
			
946
946
			private void addToDisplay(int[] toAdd)
947
			private void addToDisplay(int[] toAdd)
947
			{
948
			{
948
			    ArrayList added = new ArrayList();
949
			    ArrayList added = new ArrayList();
949
			    for (int i = 0; i < toAdd.length; i++)
950
			    for (int i = 0; i < toAdd.length; i++)
950
			    {
951
			    {
951
			        int index = toAdd[i];
952
			        int index = toAdd[i];
952
			        
953
953
			        IPropertyDescriptor descriptor = (IPropertyDescriptor)_availableDescriptors.get(index);
954
			        IPropertyDescriptor descriptor = (IPropertyDescriptor)_availableDescriptors.get(index);
954
			        
955
955
			        if (!_currentDisplayedDescriptors.contains(descriptor))
956
			        if (!_currentDisplayedDescriptors.contains(descriptor))
956
			        {
957
			        {
957
			            _currentDisplayedDescriptors.add(descriptor);
958
			            _currentDisplayedDescriptors.add(descriptor);
958
			            added.add(descriptor);
959
			            added.add(descriptor);
959
			        }			            
960
			        }
960
			    }
961
			    }
961
			    
962
962
			    for (int i = 0; i < added.size(); i++)
963
			    for (int i = 0; i < added.size(); i++)
963
			    {			       
964
			    {
964
			      _availableDescriptors.remove(added.get(i));			       			            
965
			      _availableDescriptors.remove(added.get(i));
965
			    }
966
			    }
966
			    
967
967
			    
968
968
			    refreshAvailableList();
969
			    refreshAvailableList();
969
			    refreshDisplayedList();
970
			    refreshDisplayedList();
970
			  
971
971
			}
972
			}
972
			
973
973
			private void removeFromDisplay(int[] toRemove)
974
			private void removeFromDisplay(int[] toRemove)
974
			{
975
			{
975
			    for (int i = 0; i < toRemove.length; i++)
976
			    for (int i = 0; i < toRemove.length; i++)
976
			    {
977
			    {
977
			        int index = toRemove[i];
978
			        int index = toRemove[i];
978
			        IPropertyDescriptor descriptor = (IPropertyDescriptor)_currentDisplayedDescriptors.get(index);
979
			        IPropertyDescriptor descriptor = (IPropertyDescriptor)_currentDisplayedDescriptors.get(index);
979
			        _currentDisplayedDescriptors.remove(index);			    
980
			        _currentDisplayedDescriptors.remove(index);
980
			        _availableDescriptors.add(descriptor);
981
			        _availableDescriptors.add(descriptor);
981
			    }
982
			    }
982
			    refreshDisplayedList();
983
			    refreshDisplayedList();
Lines 998-1035 Link Here
998
			public Control createInner(Composite parent)
999
			public Control createInner(Composite parent)
999
			{
1000
			{
1000
				Composite main = SystemWidgetHelpers.createComposite(parent, 1);
1001
				Composite main = SystemWidgetHelpers.createComposite(parent, 1);
1001
				
1002
1002
1003
1003
				Composite c = SystemWidgetHelpers.createComposite(main, 4);
1004
				Composite c = SystemWidgetHelpers.createComposite(main, 4);
1004
				c.setLayoutData(new GridData(GridData.FILL_BOTH));
1005
				c.setLayoutData(new GridData(GridData.FILL_BOTH));
1005
				_availableList = SystemWidgetHelpers.createListBox(c, SystemResources.RESID_TABLE_SELECT_COLUMNS_AVAILABLE_LABEL, this, true);
1006
				_availableList = SystemWidgetHelpers.createListBox(c, SystemResources.RESID_TABLE_SELECT_COLUMNS_AVAILABLE_LABEL, this, true);
1006
				
1007
1007
				Composite addRemoveComposite = SystemWidgetHelpers.createComposite(c, 1);
1008
				Composite addRemoveComposite = SystemWidgetHelpers.createComposite(c, 1);
1008
				addRemoveComposite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_CENTER));
1009
				addRemoveComposite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_CENTER));
1009
				_addButton = SystemWidgetHelpers.createPushButton(addRemoveComposite,
1010
				_addButton = SystemWidgetHelpers.createPushButton(addRemoveComposite,
1010
				        SystemResources.RESID_TABLE_SELECT_COLUMNS_ADD_LABEL, 
1011
				        SystemResources.RESID_TABLE_SELECT_COLUMNS_ADD_LABEL,
1011
				        this);
1012
				        this);
1012
				_addButton.setToolTipText(SystemResources.RESID_TABLE_SELECT_COLUMNS_ADD_TOOLTIP);
1013
				_addButton.setToolTipText(SystemResources.RESID_TABLE_SELECT_COLUMNS_ADD_TOOLTIP);
1013
				
1014
1014
				_removeButton = SystemWidgetHelpers.createPushButton(addRemoveComposite, 
1015
				_removeButton = SystemWidgetHelpers.createPushButton(addRemoveComposite,
1015
				        SystemResources.RESID_TABLE_SELECT_COLUMNS_REMOVE_LABEL,
1016
				        SystemResources.RESID_TABLE_SELECT_COLUMNS_REMOVE_LABEL,
1016
				        this);
1017
				        this);
1017
				_removeButton.setToolTipText(SystemResources.RESID_TABLE_SELECT_COLUMNS_REMOVE_TOOLTIP);
1018
				_removeButton.setToolTipText(SystemResources.RESID_TABLE_SELECT_COLUMNS_REMOVE_TOOLTIP);
1018
				
1019
1019
				_displayedList = SystemWidgetHelpers.createListBox(c, SystemResources.RESID_TABLE_SELECT_COLUMNS_DISPLAYED_LABEL, this, false);
1020
				_displayedList = SystemWidgetHelpers.createListBox(c, SystemResources.RESID_TABLE_SELECT_COLUMNS_DISPLAYED_LABEL, this, false);
1020
				
1021
1021
				Composite upDownComposite = SystemWidgetHelpers.createComposite(c, 1);
1022
				Composite upDownComposite = SystemWidgetHelpers.createComposite(c, 1);
1022
				upDownComposite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_CENTER));
1023
				upDownComposite.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_CENTER));
1023
				_upButton = SystemWidgetHelpers.createPushButton(upDownComposite, 
1024
				_upButton = SystemWidgetHelpers.createPushButton(upDownComposite,
1024
				        SystemResources.RESID_TABLE_SELECT_COLUMNS_UP_LABEL,
1025
				        SystemResources.RESID_TABLE_SELECT_COLUMNS_UP_LABEL,
1025
				        this);
1026
				        this);
1026
				_upButton.setToolTipText(SystemResources.RESID_TABLE_SELECT_COLUMNS_UP_TOOLTIP);
1027
				_upButton.setToolTipText(SystemResources.RESID_TABLE_SELECT_COLUMNS_UP_TOOLTIP);
1027
				
1028
1028
				_downButton = SystemWidgetHelpers.createPushButton(upDownComposite, 
1029
				_downButton = SystemWidgetHelpers.createPushButton(upDownComposite,
1029
				        SystemResources.RESID_TABLE_SELECT_COLUMNS_DOWN_LABEL, 
1030
				        SystemResources.RESID_TABLE_SELECT_COLUMNS_DOWN_LABEL,
1030
				        this);
1031
				        this);
1031
				_downButton.setToolTipText(SystemResources.RESID_TABLE_SELECT_COLUMNS_DOWN_TOOLTIP);
1032
				_downButton.setToolTipText(SystemResources.RESID_TABLE_SELECT_COLUMNS_DOWN_TOOLTIP);
1032
				
1033
1033
				initLists();
1034
				initLists();
1034
1035
1035
				setHelp();
1036
				setHelp();
Lines 1042-1048 Link Here
1042
			   refreshDisplayedList();
1043
			   refreshDisplayedList();
1043
			   updateEnableStates();
1044
			   updateEnableStates();
1044
			}
1045
			}
1045
			
1046
1046
			private void refreshAvailableList()
1047
			private void refreshAvailableList()
1047
			{
1048
			{
1048
			    _availableList.removeAll();
1049
			    _availableList.removeAll();
Lines 1053-1080 Link Here
1053
			        _availableList.add(descriptor.getDisplayName());
1054
			        _availableList.add(descriptor.getDisplayName());
1054
			    }
1055
			    }
1055
			}
1056
			}
1056
			
1057
1057
			private void refreshDisplayedList()
1058
			private void refreshDisplayedList()
1058
			{
1059
			{
1059
			    _displayedList.removeAll();
1060
			    _displayedList.removeAll();
1060
			    // initialize display list
1061
			    // initialize display list
1061
			    for (int i = 0; i < _currentDisplayedDescriptors.size(); i++)
1062
			    for (int i = 0; i < _currentDisplayedDescriptors.size(); i++)
1062
			    {
1063
			    {
1063
		
1064
1064
			        Object obj = _currentDisplayedDescriptors.get(i);
1065
			        Object obj = _currentDisplayedDescriptors.get(i);
1065
			        if (obj != null && obj instanceof IPropertyDescriptor)
1066
			        if (obj != null && obj instanceof IPropertyDescriptor)
1066
			        {
1067
			        {
1067
			            _displayedList.add(((IPropertyDescriptor)obj).getDisplayName());
1068
			            _displayedList.add(((IPropertyDescriptor)obj).getDisplayName());
1068
			        }
1069
			        }
1069
			    }  
1070
			    }
1070
			}
1071
			}
1071
			
1072
1072
			private void setHelp()
1073
			private void setHelp()
1073
			{
1074
			{
1074
				setHelp(RSEUIPlugin.HELPPREFIX + "gntc0000"); //$NON-NLS-1$
1075
				setHelp(RSEUIPlugin.HELPPREFIX + "gntc0000"); //$NON-NLS-1$
1075
			}
1076
			}
1076
		}
1077
		}
1077
	    
1078
1078
		public SelectColumnsAction()
1079
		public SelectColumnsAction()
1079
		{
1080
		{
1080
			super(SystemResources.ACTION_SELECTCOLUMNS_LABEL, null);
1081
			super(SystemResources.ACTION_SELECTCOLUMNS_LABEL, null);
Lines 1095-1101 Link Here
1095
		}
1096
		}
1096
		public void run()
1097
		public void run()
1097
		{
1098
		{
1098
		    ISystemTableViewColumnManager mgr = _viewer.getColumnManager();		    
1099
		    ISystemTableViewColumnManager mgr = _viewer.getColumnManager();
1099
		    ISystemViewElementAdapter adapter = _viewer.getAdapterForContents();
1100
		    ISystemViewElementAdapter adapter = _viewer.getAdapterForContents();
1100
		    SelectColumnsDialog dlg = new SelectColumnsDialog(getShell(), adapter, mgr);
1101
		    SelectColumnsDialog dlg = new SelectColumnsDialog(getShell(), adapter, mgr);
1101
		    if (dlg.open() == Window.OK)
1102
		    if (dlg.open() == Window.OK)
Lines 1121-1133 Link Here
1121
	private LockAction _lockAction = null;
1122
	private LockAction _lockAction = null;
1122
	private RefreshAction _refreshAction = null;
1123
	private RefreshAction _refreshAction = null;
1123
	private SystemRefreshAction _refreshSelectionAction = null;
1124
	private SystemRefreshAction _refreshSelectionAction = null;
1124
 
1125
1125
	private SelectInputAction _selectInputAction = null;
1126
	private SelectInputAction _selectInputAction = null;
1126
	private PositionToAction _positionToAction = null;
1127
	private PositionToAction _positionToAction = null;
1127
	private SubSetAction _subsetAction = null;
1128
	private SubSetAction _subsetAction = null;
1128
	private SystemTablePrintAction _printTableAction = null;
1129
	private SystemTablePrintAction _printTableAction = null;
1129
	private SelectColumnsAction _selectColumnsAction = null;
1130
	private SelectColumnsAction _selectColumnsAction = null;
1130
	
1131
1131
	// common actions
1132
	// common actions
1132
	private SystemCopyToClipboardAction _copyAction;
1133
	private SystemCopyToClipboardAction _copyAction;
1133
	private SystemPasteFromClipboardAction _pasteAction;
1134
	private SystemPasteFromClipboardAction _pasteAction;
Lines 1144-1151 Link Here
1144
	private String _message, _errorMessage;
1145
	private String _message, _errorMessage;
1145
	private SystemMessage sysErrorMessage;
1146
	private SystemMessage sysErrorMessage;
1146
	private IStatusLineManager _statusLine = null;
1147
	private IStatusLineManager _statusLine = null;
1147
	
1148
1148
	// constants			
1149
	// constants
1149
	public static final String ID = "org.eclipse.rse.ui.view.systemTableView"; // matches id in plugin.xml, view tag	 //$NON-NLS-1$
1150
	public static final String ID = "org.eclipse.rse.ui.view.systemTableView"; // matches id in plugin.xml, view tag	 //$NON-NLS-1$
1150
1151
1151
	// Restore memento tags
1152
	// Restore memento tags
Lines 1182-1188 Link Here
1182
	{
1183
	{
1183
		return _viewer;
1184
		return _viewer;
1184
	}
1185
	}
1185
	
1186
1186
	public Viewer getRSEViewer()
1187
	public Viewer getRSEViewer()
1187
	{
1188
	{
1188
		return _viewer;
1189
		return _viewer;
Lines 1195-1201 Link Here
1195
		ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
1196
		ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
1196
		registry.addSystemResourceChangeListener(this);
1197
		registry.addSystemResourceChangeListener(this);
1197
		registry.addSystemRemoteChangeListener(this);
1198
		registry.addSystemRemoteChangeListener(this);
1198
		
1199
1199
		Table table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
1200
		Table table = new Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION | SWT.HIDE_SELECTION);
1200
		_viewer = new SystemTableView(table, this);
1201
		_viewer = new SystemTableView(table, this);
1201
1202
Lines 1220-1226 Link Here
1220
		_browseHistory = new ArrayList();
1221
		_browseHistory = new ArrayList();
1221
		_browsePosition = 0;
1222
		_browsePosition = 0;
1222
1223
1223
		// register global edit actions 		
1224
		// register global edit actions
1224
		Clipboard clipboard = RSEUIPlugin.getTheSystemRegistryUI().getSystemClipboard();
1225
		Clipboard clipboard = RSEUIPlugin.getTheSystemRegistryUI().getSystemClipboard();
1225
1226
1226
		CellEditorActionHandler editorActionHandler = new CellEditorActionHandler(getViewSite().getActionBars());
1227
		CellEditorActionHandler editorActionHandler = new CellEditorActionHandler(getViewSite().getActionBars());
Lines 1234-1246 Link Here
1234
		editorActionHandler.setPasteAction(_pasteAction);
1235
		editorActionHandler.setPasteAction(_pasteAction);
1235
		editorActionHandler.setDeleteAction(_deleteAction);
1236
		editorActionHandler.setDeleteAction(_deleteAction);
1236
		editorActionHandler.setSelectAllAction(new SelectAllAction());
1237
		editorActionHandler.setSelectAllAction(new SelectAllAction());
1237
		
1238
1238
		// register rename action as a global handler
1239
		// register rename action as a global handler
1239
		getViewSite().getActionBars().setGlobalActionHandler(ActionFactory.RENAME.getId(), _renameAction);
1240
		getViewSite().getActionBars().setGlobalActionHandler(ActionFactory.RENAME.getId(), _renameAction);
1240
		
1241
1241
1242
1242
		SystemWidgetHelpers.setHelp(_viewer.getControl(), RSEUIPlugin.HELPPREFIX + "sysd0000"); //$NON-NLS-1$
1243
		SystemWidgetHelpers.setHelp(_viewer.getControl(), RSEUIPlugin.HELPPREFIX + "sysd0000"); //$NON-NLS-1$
1243
		
1244
1244
		getSite().registerContextMenu(_viewer.getContextMenuManager(), _viewer);
1245
		getSite().registerContextMenu(_viewer.getContextMenuManager(), _viewer);
1245
	}
1246
	}
1246
1247
Lines 1290-1296 Link Here
1290
		ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
1291
		ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
1291
		registry.removeSystemRemoteChangeListener(this);
1292
		registry.removeSystemRemoteChangeListener(this);
1292
		registry.removeSystemResourceChangeListener(this);
1293
		registry.removeSystemResourceChangeListener(this);
1293
	
1294
1294
		if (_viewer != null)
1295
		if (_viewer != null)
1295
		{
1296
		{
1296
			_viewer.dispose();
1297
			_viewer.dispose();
Lines 1311-1317 Link Here
1311
		if (adapter != null)
1312
		if (adapter != null)
1312
		{
1313
		{
1313
			alreadyHandled = adapter.handleDoubleClick(element);
1314
			alreadyHandled = adapter.handleDoubleClick(element);
1314
			
1315
1315
			if (!alreadyHandled && adapter.hasChildren((IAdaptable)element))
1316
			if (!alreadyHandled && adapter.hasChildren((IAdaptable)element))
1316
			{
1317
			{
1317
				setInput((IAdaptable) element);
1318
				setInput((IAdaptable) element);
Lines 1390-1398 Link Here
1390
	_refreshSelectionAction = new SystemRefreshAction(getShell());
1391
	_refreshSelectionAction = new SystemRefreshAction(getShell());
1391
		actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), _refreshSelectionAction);
1392
		actionBars.setGlobalActionHandler(ActionFactory.REFRESH.getId(), _refreshSelectionAction);
1392
		_refreshSelectionAction.setSelectionProvider(_viewer);
1393
		_refreshSelectionAction.setSelectionProvider(_viewer);
1393
		
1394
1394
		_statusLine = actionBars.getStatusLineManager();
1395
		_statusLine = actionBars.getStatusLineManager();
1395
		
1396
1396
		addToolBarItems(toolBarManager);
1397
		addToolBarItems(toolBarManager);
1397
		addToolBarMenuItems(menuMgr);
1398
		addToolBarMenuItems(menuMgr);
1398
	}
1399
	}
Lines 1406-1413 Link Here
1406
		menuManager.add(new Separator("Filter")); //$NON-NLS-1$
1407
		menuManager.add(new Separator("Filter")); //$NON-NLS-1$
1407
		menuManager.add(_positionToAction);
1408
		menuManager.add(_positionToAction);
1408
		menuManager.add(_subsetAction);
1409
		menuManager.add(_subsetAction);
1409
		
1410
1410
	//DKM - this action is useless - remove it	
1411
	//DKM - this action is useless - remove it
1411
	//	menuManager.add(new Separator("Print"));
1412
	//	menuManager.add(new Separator("Print"));
1412
	//	menuManager.add(_printTableAction);
1413
	//	menuManager.add(_printTableAction);
1413
1414
Lines 1421-1428 Link Here
1421
1422
1422
		toolBarManager.add(_lockAction);
1423
		toolBarManager.add(_lockAction);
1423
		toolBarManager.add(_refreshAction);
1424
		toolBarManager.add(_refreshAction);
1424
	
1425
1425
		
1426
1426
		toolBarManager.add(new Separator("Navigate")); //$NON-NLS-1$
1427
		toolBarManager.add(new Separator("Navigate")); //$NON-NLS-1$
1427
		// only support history when we're locked
1428
		// only support history when we're locked
1428
		if (_isLocked)
1429
		if (_isLocked)
Lines 1467-1473 Link Here
1467
		if (_currentItem != null)
1468
		if (_currentItem != null)
1468
		{
1469
		{
1469
			IAdaptable item = _currentItem.getObject();
1470
			IAdaptable item = _currentItem.getObject();
1470
			
1471
1471
			ISystemViewElementAdapter adapter1 = (ISystemViewElementAdapter)object.getAdapter(ISystemViewElementAdapter.class);
1472
			ISystemViewElementAdapter adapter1 = (ISystemViewElementAdapter)object.getAdapter(ISystemViewElementAdapter.class);
1472
			ISystemViewElementAdapter adapter2 = (ISystemViewElementAdapter)item.getAdapter(ISystemViewElementAdapter.class);
1473
			ISystemViewElementAdapter adapter2 = (ISystemViewElementAdapter)item.getAdapter(ISystemViewElementAdapter.class);
1473
			if (adapter1 == adapter2)
1474
			if (adapter1 == adapter2)
Lines 1501-1507 Link Here
1501
		{
1502
		{
1502
			setTitle(object);
1503
			setTitle(object);
1503
			_viewer.setInput(object);
1504
			_viewer.setInput(object);
1504
		
1505
1505
			if (_refreshSelectionAction != null)
1506
			if (_refreshSelectionAction != null)
1506
			{
1507
			{
1507
				_refreshSelectionAction.updateSelection(new StructuredSelection(object));
1508
				_refreshSelectionAction.updateSelection(new StructuredSelection(object));
Lines 1519-1525 Link Here
1519
				}
1520
				}
1520
1521
1521
				_currentItem = new HistoryItem(object, filters);
1522
				_currentItem = new HistoryItem(object, filters);
1522
				
1523
1523
1524
1524
				_browseHistory.add(_currentItem);
1525
				_browseHistory.add(_currentItem);
1525
				_browsePosition = _browseHistory.lastIndexOf(_currentItem);
1526
				_browsePosition = _browseHistory.lastIndexOf(_currentItem);
Lines 1544-1550 Link Here
1544
			String type = va.getType(object);
1545
			String type = va.getType(object);
1545
			String name = va.getName(object);
1546
			String name = va.getName(object);
1546
			//setPartName(type + " " + name);
1547
			//setPartName(type + " " + name);
1547
			
1548
1548
			setContentDescription(type + " "+ name); //$NON-NLS-1$
1549
			setContentDescription(type + " "+ name); //$NON-NLS-1$
1549
1550
1550
			//SystemTableViewProvider provider = (SystemTableViewProvider) _viewer.getContentProvider();
1551
			//SystemTableViewProvider provider = (SystemTableViewProvider) _viewer.getContentProvider();
Lines 1577-1588 Link Here
1577
  	  			// Update the history to remove all references to object
1578
  	  			// Update the history to remove all references to object
1578
  	  			removeFromHistory(multi[i]);
1579
  	  			removeFromHistory(multi[i]);
1579
  	  		}
1580
  	  		}
1580
  	  		break;  
1581
  	  		break;
1581
  	    default:
1582
  	    default:
1582
  	    	break;
1583
  	    	break;
1583
		}
1584
		}
1584
	}
1585
	}
1585
	
1586
1586
	protected void removeFromHistory(Object c)
1587
	protected void removeFromHistory(Object c)
1587
	{
1588
	{
1588
	    // if the object is in history, remove it since it's been deleted
1589
	    // if the object is in history, remove it since it's been deleted
Lines 1605-1616 Link Here
1605
	            // 	Since we are removing an item the size decreased by one so i
1606
	            // 	Since we are removing an item the size decreased by one so i
1606
	            // needs to decrease by one or we will skip elements in _browseHistory
1607
	            // needs to decrease by one or we will skip elements in _browseHistory
1607
	            i--;
1608
	            i--;
1608
	        } 
1609
	        }
1609
	    }
1610
	    }
1610
	    
1611
1611
	    if (_currentItem != null) {
1612
	    if (_currentItem != null) {
1612
	    	Object currentObject = _currentItem.getObject();
1613
	    	Object currentObject = _currentItem.getObject();
1613
	    
1614
1614
		    // Update the input of the viewer to the closest item in the history
1615
		    // Update the input of the viewer to the closest item in the history
1615
		    // that still exists if the current viewer item has been deleted.
1616
		    // that still exists if the current viewer item has been deleted.
1616
		    if (c == currentObject || c.equals(currentObject) || isParentOf(c,currentObject))
1617
		    if (c == currentObject || c.equals(currentObject) || isParentOf(c,currentObject))
Lines 1628-1634 Link Here
1628
	        }
1629
	        }
1629
	    }
1630
	    }
1630
	}
1631
	}
1631
	
1632
1632
	protected boolean isParentOf(Object parent, Object child) {
1633
	protected boolean isParentOf(Object parent, Object child) {
1633
		if (parent instanceof IAdaptable && child instanceof IAdaptable) {
1634
		if (parent instanceof IAdaptable && child instanceof IAdaptable) {
1634
			ISystemDragDropAdapter adapterParent = (ISystemDragDropAdapter) ((IAdaptable)parent).getAdapter(ISystemDragDropAdapter.class);
1635
			ISystemDragDropAdapter adapterParent = (ISystemDragDropAdapter) ((IAdaptable)parent).getAdapter(ISystemDragDropAdapter.class);
Lines 1636-1643 Link Here
1636
			// Check that both parent and child are from the same SubSystem
1637
			// Check that both parent and child are from the same SubSystem
1637
			if (adapterParent != null && adapterChild != null &&
1638
			if (adapterParent != null && adapterChild != null &&
1638
					adapterParent.getSubSystem(parent) == adapterChild.getSubSystem(child)) {
1639
					adapterParent.getSubSystem(parent) == adapterChild.getSubSystem(child)) {
1639
				String parentAbsoluteName = adapterParent.getAbsoluteName(parent);  
1640
				String parentAbsoluteName = adapterParent.getAbsoluteName(parent);
1640
				String childAbsoluteName = adapterChild.getAbsoluteName(child); 
1641
				String childAbsoluteName = adapterChild.getAbsoluteName(child);
1641
				// Check if the child's absolute name starts with the parents absolute name
1642
				// Check if the child's absolute name starts with the parents absolute name
1642
				// if it does then parent is the parent of child.
1643
				// if it does then parent is the parent of child.
1643
				if(childAbsoluteName != null && childAbsoluteName.startsWith(parentAbsoluteName)) {
1644
				if(childAbsoluteName != null && childAbsoluteName.startsWith(parentAbsoluteName)) {
Lines 1647-1654 Link Here
1647
		}
1648
		}
1648
		return false;
1649
		return false;
1649
	}
1650
	}
1650
	
1651
1651
	
1652
1652
	/**
1653
	/**
1653
	 * This is the method in your class that will be called when a remote resource
1654
	 * This is the method in your class that will be called when a remote resource
1654
	 *  changes. You will be called after the resource is changed.
1655
	 *  changes. You will be called after the resource is changed.
Lines 1666-1687 Link Here
1666
		}
1667
		}
1667
1668
1668
		Object child = event.getResource();
1669
		Object child = event.getResource();
1669
		
1670
1670
		
1671
1671
		Object input = _viewer.getInput();
1672
		Object input = _viewer.getInput();
1672
		
1673
1673
		ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
1674
		String[] oldNames = event.getOldNames();
1674
		
1675
		// right now assuming only one resource
1675
		boolean referToSameObject = false;
1676
		String oldName = (oldNames == null) ? null : oldNames[0];
1676
		if (registry instanceof SystemRegistry)
1677
		boolean referToSameObject = SystemRegistry.isSameObjectByAbsoluteName(input, null, child, oldName);
1677
		{			
1678
1678
			String[] oldNames = event.getOldNames();
1679
			String oldName = (oldNames == null)? null : oldNames[0];
1680
			referToSameObject = ((SystemRegistry)registry).isSameObjectByAbsoluteName(input, null, child, oldName); // right now assuming only one resource
1681
		}
1682
		
1683
		if (input == child || child instanceof java.util.List || referToSameObject)
1679
		if (input == child || child instanceof java.util.List || referToSameObject)
1684
		{ 
1680
		{
1685
			switch (eventType)
1681
			switch (eventType)
1686
			{
1682
			{
1687
				// --------------------------
1683
				// --------------------------
Lines 1689-1719 Link Here
1689
				// --------------------------
1685
				// --------------------------
1690
				case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CHANGED :
1686
				case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CHANGED :
1691
					break;
1687
					break;
1692
	
1688
1693
					// --------------------------
1689
					// --------------------------
1694
					// REMOTE RESOURCE CREATED...
1690
					// REMOTE RESOURCE CREATED...
1695
					// --------------------------
1691
					// --------------------------
1696
				case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CREATED :
1692
				case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CREATED :
1697
					break;
1693
					break;
1698
	
1694
1699
					// --------------------------
1695
					// --------------------------
1700
					// REMOTE RESOURCE DELETED...
1696
					// REMOTE RESOURCE DELETED...
1701
					// --------------------------
1697
					// --------------------------
1702
				case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED :
1698
				case ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED :
1703
					{				    
1699
					{
1704
				    	if (child instanceof java.util.List)
1700
				    	if (child instanceof java.util.List)
1705
				    	{
1701
				    	{
1706
				    		java.util.List list = (java.util.List)child;
1702
				    		java.util.List list = (java.util.List)child;
1707
				    	    for (int v = 0; v < list.size(); v++)
1703
				    	    for (int v = 0; v < list.size(); v++)
1708
				    	    {
1704
				    	    {
1709
				    	        Object c = list.get(v);
1705
				    	        Object c = list.get(v);
1710
				    	        
1706
1711
				    	        removeFromHistory(c);			
1707
				    	        removeFromHistory(c);
1712
				    	        /*
1708
				    	        /*
1713
				    	        if (c == input)
1709
				    	        if (c == input)
1714
				    	        {				    	         				    	            			    	            
1710
				    	        {
1715
				    	            setInput((IAdaptable)null, null, false);
1711
				    	            setInput((IAdaptable)null, null, false);
1716
				    	          
1712
1717
				    	            return;
1713
				    	            return;
1718
				    	        }
1714
				    	        }
1719
				    	        */
1715
				    	        */
Lines 1723-1734 Link Here
1723
				    	{
1719
				    	{
1724
				    	    removeFromHistory(child);
1720
				    	    removeFromHistory(child);
1725
				    	    //setInput((IAdaptable)null);
1721
				    	    //setInput((IAdaptable)null);
1726
				    	   
1722
1727
				    	    return;
1723
				    	    return;
1728
				    	}
1724
				    	}
1729
					}
1725
					}
1730
					break;
1726
					break;
1731
	
1727
1732
					// --------------------------
1728
					// --------------------------
1733
					// REMOTE RESOURCE RENAMED...
1729
					// REMOTE RESOURCE RENAMED...
1734
					// --------------------------
1730
					// --------------------------
Lines 1736-1747 Link Here
1736
					{
1732
					{
1737
				    	setInput((IAdaptable)child);
1733
				    	setInput((IAdaptable)child);
1738
					}
1734
					}
1739
	
1735
1740
					break;
1736
					break;
1741
			}
1737
			}
1742
		}
1738
		}
1743
	}
1739
	}
1744
	
1740
1745
	public Shell getShell()
1741
	public Shell getShell()
1746
	{
1742
	{
1747
		return _viewer.getShell();
1743
		return _viewer.getShell();
Lines 1762-1768 Link Here
1762
	* within the part controls.
1758
	* within the part controls.
1763
	* <p>
1759
	* <p>
1764
	* The parent's default implementation will ignore the memento and initialize
1760
	* The parent's default implementation will ignore the memento and initialize
1765
	* the view in a fresh state.  Subclasses may override the implementation to 
1761
	* the view in a fresh state.  Subclasses may override the implementation to
1766
	* perform any state restoration as needed.
1762
	* perform any state restoration as needed.
1767
	*/
1763
	*/
1768
	public void init(IViewSite site, IMemento memento) throws PartInitException
1764
	public void init(IViewSite site, IMemento memento) throws PartInitException
Lines 1780-1791 Link Here
1780
	 * Method declared on IViewPart.
1776
	 * Method declared on IViewPart.
1781
	 */
1777
	 */
1782
	public void saveState(IMemento memento)
1778
	public void saveState(IMemento memento)
1783
	{				  
1779
	{
1784
		super.saveState(memento);
1780
		super.saveState(memento);
1785
1781
1786
		if (!SystemPreferencesManager.getRememberState())
1782
		if (!SystemPreferencesManager.getRememberState())
1787
			return;
1783
			return;
1788
			
1784
1789
		if (_viewer != null)
1785
		if (_viewer != null)
1790
		{
1786
		{
1791
			Object input = _viewer.getInput();
1787
			Object input = _viewer.getInput();
Lines 1794-1800 Link Here
1794
			{
1790
			{
1795
				if (input instanceof ISystemRegistry)
1791
				if (input instanceof ISystemRegistry)
1796
				{
1792
				{
1797
					
1793
1798
				}
1794
				}
1799
				else if (input instanceof IHost)
1795
				else if (input instanceof IHost)
1800
				{
1796
				{
Lines 1863-1870 Link Here
1863
			}
1859
			}
1864
		}
1860
		}
1865
	}
1861
	}
1866
	
1862
1867
	
1863
1868
//	 -------------------------------
1864
//	 -------------------------------
1869
	// ISystemMessageLine interface...
1865
	// ISystemMessageLine interface...
1870
	// -------------------------------
1866
	// -------------------------------
Lines 1951-1957 Link Here
1951
		if (_statusLine != null)
1947
		if (_statusLine != null)
1952
			_statusLine.setMessage(message);
1948
			_statusLine.setMessage(message);
1953
	}
1949
	}
1954
	/** 
1950
	/**
1955
	 *If the message line currently displays an error,
1951
	 *If the message line currently displays an error,
1956
	 * the message is stored and will be shown after a call to clearErrorMessage
1952
	 * the message is stored and will be shown after a call to clearErrorMessage
1957
	 */
1953
	 */
(-)UI/org/eclipse/rse/internal/ui/view/ElementComparer.java (-30 / +32 lines)
Lines 1-43 Link Here
1
/********************************************************************************
1
/********************************************************************************
2
 * Copyright (c) 2007, 2008 IBM Corporation and others. All rights reserved.
2
 * Copyright (c) 2007, 2008 IBM Corporation and others. All rights reserved.
3
 * This program and the accompanying materials are made available under the terms
3
 * This program and the accompanying materials are made available under the terms
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is 
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is
5
 * available at http://www.eclipse.org/legal/epl-v10.html 
5
 * available at http://www.eclipse.org/legal/epl-v10.html
6
 * 
6
 *
7
 * Initial Contributors:
7
 * Initial Contributors:
8
 * The following IBM employees contributed to the Remote System Explorer
8
 * The following IBM employees contributed to the Remote System Explorer
9
 * component that contains this file: David McKnight, Kushal Munir, 
9
 * component that contains this file: David McKnight, Kushal Munir,
10
 * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, 
10
 * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
11
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
11
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
12
 * 
12
 *
13
 * Contributors:
13
 * Contributors:
14
 * Kevin Doyle (IBM) - [195537] Move ElementComparer From SystemView to Separate File
14
 * Kevin Doyle (IBM) - [195537] Move ElementComparer From SystemView to Separate File
15
 * Martin Oberhuber (Wind River) - [215820] Move SystemRegistry implementation to Core
15
 * Martin Oberhuber (Wind River) - [215820] Move SystemRegistry implementation to Core
16
 * David Dykstal (IBM) - [225911] Exception received after deleting a profile containing a connection
16
 * David Dykstal (IBM) - [225911] Exception received after deleting a profile containing a connection
17
 * David Dykstal (IBM) - [228774] [regression] AssertionFailedException when connecting to New Connection
17
 * David Dykstal (IBM) - [228774] [regression] AssertionFailedException when connecting to New Connection
18
 * Martin Oberhuber (Wind River) - [228774] Improve ElementComparer Performance
18
 ********************************************************************************/
19
 ********************************************************************************/
19
20
20
package org.eclipse.rse.internal.ui.view;
21
package org.eclipse.rse.internal.ui.view;
21
22
22
import org.eclipse.core.runtime.IAdaptable;
23
import org.eclipse.jface.viewers.IElementComparer;
23
import org.eclipse.jface.viewers.IElementComparer;
24
import org.eclipse.rse.core.RSECorePlugin;
24
import org.eclipse.rse.core.subsystems.ISystemDragDropAdapter;
25
import org.eclipse.rse.core.model.ISystemRegistry;
26
import org.eclipse.rse.internal.core.model.SystemRegistry;
25
import org.eclipse.rse.internal.core.model.SystemRegistry;
27
import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
28
26
29
/**
27
/**
30
 * An implememtation of an element comparer for the system view.
28
 * An implementation of an element comparer for the system view.
31
 */
29
 */
32
public class ElementComparer implements IElementComparer {
30
public class ElementComparer implements IElementComparer {
33
	
31
34
	public boolean equals(Object a, Object b) {
32
	public boolean equals(Object a, Object b) {
35
		boolean result = false;
33
		// equal if same absolute name in same subsystem;
36
		ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
34
		// or, when adapters are not found, both are the same instance.
37
		if (registry instanceof SystemRegistry) {
35
		return SystemRegistry.isSameObjectByAbsoluteName(a, null, b, null);
38
			result = ((SystemRegistry) registry).isSameObjectByAbsoluteName(a, null, b, null);
39
		}
40
		return result;
41
	}
36
	}
42
37
43
	public int hashCode(Object element) {
38
	public int hashCode(Object element) {
Lines 46-72 Link Here
46
		 * Since one adapter is typically used for many elements in RSE,
41
		 * Since one adapter is typically used for many elements in RSE,
47
		 * performance would be better if the original Element's hashCode
42
		 * performance would be better if the original Element's hashCode
48
		 * were used rather than the adapter's hashCode. The problem with
43
		 * were used rather than the adapter's hashCode. The problem with
49
		 * this is, that if the remote object changes, it cannot be 
44
		 * this is, that if the remote object changes, it cannot be
50
		 * identified any more.
45
		 * identified any more.
51
		 * Note that currently the hashCode of the object can change 
46
		 * Note that currently the hashCode of the object can change
52
		 * over time if properties are modified (this is probably a bug).
47
		 * over time if properties are modified (this is probably a bug).
53
		 * Therefore, if there is no absolute name, play it safe and return the adapter's hashCode which won't ever change.
48
		 * Therefore, if there is no absolute name, play it safe and return the adapter's hashCode which won't ever change.
54
		 */
49
		 */
55
		int result = 0;
50
		int result = 0;
56
		if (element != null) {
51
		if (element != null) {
57
			if (element instanceof IAdaptable) {
52
			ISystemDragDropAdapter dda = SystemRegistry.getSystemDragDropAdapter(element);
58
				ISystemViewElementAdapter ident = (ISystemViewElementAdapter) ((IAdaptable) element).getAdapter(ISystemViewElementAdapter.class);
53
			if (dda != null) {
59
				if (ident != null) {
54
				// adapter available
60
					String absName = ident.getAbsoluteName(element);
55
				String absName = dda.getAbsoluteName(element);
61
					if (absName != null) {
56
				if (absName != null) {
62
						result = absName.hashCode();
57
					result = absName.hashCode();
63
					} else {
64
						result = ident.hashCode();
65
					}
66
				} else {
58
				} else {
67
					result = element.hashCode();
59
					result = dda.hashCode();
68
				}
60
				}
69
			} else {
61
			} else {
62
				// --MOB: Usually, we should fall back to constant hashcode 0
63
				// here if no adapter is available, in order to ensure constant
64
				// hashcode even if object properties change. But as a matter of
65
				// fact, those elements that we have in the SystemView and which
66
				// do not have an adapter registered, are very few; and they are
67
				// always constant over their lifetime, such as the "Pending..."
68
				// node for instance. We therefore return the element's hashcode
69
				// here, along with the corresponding equals() code above,
70
				// which falls back to Object equality if no adapter is
71
				// available.
70
				result = element.hashCode();
72
				result = element.hashCode();
71
			}
73
			}
72
		}
74
		}
(-)src/org/eclipse/rse/internal/core/model/SystemRegistry.java (-295 / +295 lines)
Lines 1-28 Link Here
1
/********************************************************************************
1
/********************************************************************************
2
 * Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
2
 * Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
3
 * This program and the accompanying materials are made available under the terms
3
 * This program and the accompanying materials are made available under the terms
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is 
4
 * of the Eclipse Public License v1.0 which accompanies this distribution, and is
5
 * available at http://www.eclipse.org/legal/epl-v10.html
5
 * available at http://www.eclipse.org/legal/epl-v10.html
6
 * 
6
 *
7
 * Initial Contributors:
7
 * Initial Contributors:
8
 * The following IBM employees contributed to the Remote System Explorer
8
 * The following IBM employees contributed to the Remote System Explorer
9
 * component that contains this file: David McKnight, Kushal Munir, 
9
 * component that contains this file: David McKnight, Kushal Munir,
10
 * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson, 
10
 * Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
11
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
11
 * Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
12
 * 
12
 *
13
 * Contributors:
13
 * Contributors:
14
 * Michael Scharf (Wind River) - patch for an NPE in getSubSystemConfigurations()
14
 * Michael Scharf (Wind River) - patch for an NPE in getSubSystemConfigurations()
15
 * David Dykstal (IBM) - moved SystemsPreferencesManager to a new package
15
 * David Dykstal (IBM) - moved SystemsPreferencesManager to a new package
16
 * Uwe Stieber (Wind River) - bugfixing
16
 * Uwe Stieber (Wind River) - bugfixing
17
 * David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies
17
 * David Dykstal (IBM) - 168977: refactoring IConnectorService and ServerLauncher hierarchies
18
 * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType 
18
 * Martin Oberhuber (Wind River) - [175262] IHost.getSystemType() should return IRSESystemType
19
 * David Dykstal (IBM) - 142806: refactoring persistence framework
19
 * David Dykstal (IBM) - 142806: refactoring persistence framework
20
 * Tobias Schwarz (Wind River) - [183134] getLocalHost() does not return Local
20
 * Tobias Schwarz (Wind River) - [183134] getLocalHost() does not return Local
21
 * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
21
 * Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
22
 * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
22
 * Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
23
 * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
23
 * Martin Oberhuber (Wind River) - [177523] Unify singleton getter methods
24
 * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
24
 * Martin Oberhuber (Wind River) - [186128] Move IProgressMonitor last in all API
25
 * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty() 
25
 * Martin Oberhuber (Wind River) - [186640] Add IRSESystemType.testProperty()
26
 * Martin Oberhuber (Wind River) - [186748] Move ISubSystemConfigurationAdapter from UI/rse.core.subsystems.util
26
 * Martin Oberhuber (Wind River) - [186748] Move ISubSystemConfigurationAdapter from UI/rse.core.subsystems.util
27
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
27
 * Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
28
 * Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
28
 * Martin Oberhuber (Wind River) - [186779] Fix IRSESystemType.getAdapter()
Lines 48-53 Link Here
48
 * David McKnight   (IBM)        - [224313] [api] Create RSE Events for MOVE and COPY holding both source and destination fields
48
 * David McKnight   (IBM)        - [224313] [api] Create RSE Events for MOVE and COPY holding both source and destination fields
49
 * David Dykstal (IBM) - [200735][Persistence] Delete a profile that contains a connection and restart, profile is back without connections
49
 * David Dykstal (IBM) - [200735][Persistence] Delete a profile that contains a connection and restart, profile is back without connections
50
 * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI
50
 * David Dykstal (IBM) - [168976][api] move ISystemNewConnectionWizardPage from core to UI
51
 * Martin Oberhuber (Wind River) - [228774] Improve ElementComparer Performance
51
 ********************************************************************************/
52
 ********************************************************************************/
52
53
53
package org.eclipse.rse.internal.core.model;
54
package org.eclipse.rse.internal.core.model;
Lines 60-65 Link Here
60
import java.util.Vector;
61
import java.util.Vector;
61
62
62
import org.eclipse.core.runtime.IAdaptable;
63
import org.eclipse.core.runtime.IAdaptable;
64
import org.eclipse.core.runtime.IAdapterManager;
63
import org.eclipse.core.runtime.IProgressMonitor;
65
import org.eclipse.core.runtime.IProgressMonitor;
64
import org.eclipse.core.runtime.IStatus;
66
import org.eclipse.core.runtime.IStatus;
65
import org.eclipse.core.runtime.Platform;
67
import org.eclipse.core.runtime.Platform;
Lines 88-96 Link Here
88
import org.eclipse.rse.core.filters.SystemFilterReference;
90
import org.eclipse.rse.core.filters.SystemFilterReference;
89
import org.eclipse.rse.core.model.IHost;
91
import org.eclipse.rse.core.model.IHost;
90
import org.eclipse.rse.core.model.ISubSystemConfigurationCategories;
92
import org.eclipse.rse.core.model.ISubSystemConfigurationCategories;
93
import org.eclipse.rse.core.model.ISubSystemConfigurator;
91
import org.eclipse.rse.core.model.ISystemContainer;
94
import org.eclipse.rse.core.model.ISystemContainer;
92
import org.eclipse.rse.core.model.ISystemHostPool;
95
import org.eclipse.rse.core.model.ISystemHostPool;
93
import org.eclipse.rse.core.model.ISubSystemConfigurator;
94
import org.eclipse.rse.core.model.ISystemProfile;
96
import org.eclipse.rse.core.model.ISystemProfile;
95
import org.eclipse.rse.core.model.ISystemProfileManager;
97
import org.eclipse.rse.core.model.ISystemProfileManager;
96
import org.eclipse.rse.core.model.ISystemRegistry;
98
import org.eclipse.rse.core.model.ISystemRegistry;
Lines 126-132 Link Here
126
128
127
	private ISubSystemConfigurationProxy[] subsystemConfigurationProxies = null;
129
	private ISubSystemConfigurationProxy[] subsystemConfigurationProxies = null;
128
	private boolean errorLoadingFactory = false;
130
	private boolean errorLoadingFactory = false;
129
	
131
130
	//For ISystemViewInputProvider
132
	//For ISystemViewInputProvider
131
	private Object viewer = null;
133
	private Object viewer = null;
132
134
Lines 134-145 Link Here
134
	 * Constructor.
136
	 * Constructor.
135
	 * This is protected as the singleton instance should be retrieved by
137
	 * This is protected as the singleton instance should be retrieved by
136
	 *  calling getSystemRegistry().
138
	 *  calling getSystemRegistry().
137
	 * @param logfilePath Root folder. Where to place the log file. 
139
	 * @param logfilePath Root folder. Where to place the log file.
138
	 */
140
	 */
139
	protected SystemRegistry(String logfilePath)
141
	protected SystemRegistry(String logfilePath)
140
	{
142
	{
141
		super();
143
		super();
142
	
144
143
		// get initial shell
145
		// get initial shell
144
		//FIXME - this can cause problems - don't think we should do this here anyway
146
		//FIXME - this can cause problems - don't think we should do this here anyway
145
		//getShell(); // will quietly fail in headless mode. Phil
147
		//getShell(); // will quietly fail in headless mode. Phil
Lines 162-168 Link Here
162
164
163
	/**
165
	/**
164
	 * Return singleton instance. Must be used on first instantiate.
166
	 * Return singleton instance. Must be used on first instantiate.
165
	 * @param logfilePath Root folder. Where to place the log file. 
167
	 * @param logfilePath Root folder. Where to place the log file.
166
	 */
168
	 */
167
	public static SystemRegistry getInstance(String logfilePath)
169
	public static SystemRegistry getInstance(String logfilePath)
168
	{
170
	{
Lines 170-176 Link Here
170
			new SystemRegistry(logfilePath);
172
			new SystemRegistry(logfilePath);
171
		return registry;
173
		return registry;
172
	}
174
	}
173
	
175
174
	/**
176
	/**
175
	 * Return singleton instance assuming it already exists.
177
	 * Return singleton instance assuming it already exists.
176
	 */
178
	 */
Lines 219-227 Link Here
219
		  	     subsystemConfigurationProxies[idx].isSubSystemConfigurationActive())
221
		  	     subsystemConfigurationProxies[idx].isSubSystemConfigurationActive())
220
		  	 {
222
		  	 {
221
		  	   SubSystemConfiguration factory = subsystemConfigurationProxies[idx].getSubSystemConfiguration();
223
		  	   SubSystemConfiguration factory = subsystemConfigurationProxies[idx].getSubSystemConfiguration();
222
		  	   if (factory != null)          	   
224
		  	   if (factory != null)
223
		  	   {
225
		  	   {
224
		         SubSystem[] sss = factory.getSubSystems(selectedConnection, SubSystemConfiguration.LAZILY);               
226
		         SubSystem[] sss = factory.getSubSystems(selectedConnection, SubSystemConfiguration.LAZILY);
225
		         if ((sss != null) && (sss.length>0))
227
		         if ((sss != null) && (sss.length>0))
226
		           hasSubsystems = true;
228
		           hasSubsystems = true;
227
		  	   }
229
		  	   }
Lines 231-243 Link Here
231
		  	 else
233
		  	 else
232
		  	   hasSubsystems = true;
234
		  	   hasSubsystems = true;
233
		  }
235
		  }
234
		}  
236
		}
235
		else
237
		else
236
		  hasSubsystems = true;  	
238
		  hasSubsystems = true;
237
		return hasSubsystems;
239
		return hasSubsystems;
238
		*/
240
		*/
239
	}
241
	}
240
	
242
241
	/*
243
	/*
242
	 * (non-Javadoc)
244
	 * (non-Javadoc)
243
	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
245
	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
Lines 255-263 Link Here
255
	 * Private method used by RSEUIPlugin to tell registry all registered subsystem
257
	 * Private method used by RSEUIPlugin to tell registry all registered subsystem
256
	 * factories. This way, all code can use this registry to access them versus the
258
	 * factories. This way, all code can use this registry to access them versus the
257
	 * RSEUIPlugin.
259
	 * RSEUIPlugin.
258
	 * 
260
	 *
259
	 * Proxies must be set sorted by priority, then ID in order to get deterministic
261
	 * Proxies must be set sorted by priority, then ID in order to get deterministic
260
	 * results for all getSubSystemConfiguration*() queries. 
262
	 * results for all getSubSystemConfiguration*() queries.
261
	 */
263
	 */
262
	public void setSubSystemConfigurationProxies(ISubSystemConfigurationProxy[] proxies)
264
	public void setSubSystemConfigurationProxies(ISubSystemConfigurationProxy[] proxies)
263
	{
265
	{
Lines 354-360 Link Here
354
		ISubSystemConfiguration[] result = (ISubSystemConfiguration[]) configurations.toArray(new ISubSystemConfiguration[configurations.size()]);
356
		ISubSystemConfiguration[] result = (ISubSystemConfiguration[]) configurations.toArray(new ISubSystemConfiguration[configurations.size()]);
355
		return result;
357
		return result;
356
	}
358
	}
357
	
359
358
	// ----------------------------
360
	// ----------------------------
359
	// PROFILE METHODS...
361
	// PROFILE METHODS...
360
	// ----------------------------
362
	// ----------------------------
Lines 391-397 Link Here
391
		ISystemProfile profile = mgr.createSystemProfile(profileName, makeActive);
393
		ISystemProfile profile = mgr.createSystemProfile(profileName, makeActive);
392
		if (makeActive)
394
		if (makeActive)
393
		{
395
		{
394
			//fireEvent(new SystemResourceChangeEvent(profile,ISystemResourceChangeEvent.EVENT_ADD,this));    	  
396
			//fireEvent(new SystemResourceChangeEvent(profile,ISystemResourceChangeEvent.EVENT_ADD,this));
395
		}
397
		}
396
		fireModelChangeEvent(
398
		fireModelChangeEvent(
397
				ISystemModelChangeEvents.SYSTEM_RESOURCE_ADDED,
399
				ISystemModelChangeEvents.SYSTEM_RESOURCE_ADDED,
Lines 474-480 Link Here
474
			}
476
			}
475
		}
477
		}
476
		////Listening to events now
478
		////Listening to events now
477
		//SystemPreferencesManager.setConnectionNamesOrder(); // update preferences order list                
479
		//SystemPreferencesManager.setConnectionNamesOrder(); // update preferences order list
478
		//boolean namesQualifed = SystemPreferencesManager.getQualifyConnectionNames();
480
		//boolean namesQualifed = SystemPreferencesManager.getQualifyConnectionNames();
479
		//if (namesQualifed)
481
		//if (namesQualifed)
480
		//	setQualifiedHostNames(namesQualifed); // causes refresh events to be fired
482
		//	setQualifiedHostNames(namesQualifed); // causes refresh events to be fired
Lines 497-503 Link Here
497
		String oldName = profile.getName();
499
		String oldName = profile.getName();
498
		IHost[] newConns = null;
500
		IHost[] newConns = null;
499
501
500
		//RSECorePlugin.getDefault().getLogger().logDebugMessage(this.getClass().getName(), "Start of system profile copy. From: "+oldName+" to: "+newName+", makeActive: "+makeActive);             
502
		//RSECorePlugin.getDefault().getLogger().logDebugMessage(this.getClass().getName(), "Start of system profile copy. From: "+oldName+" to: "+newName+", makeActive: "+makeActive);
501
		// STEP 0: BRING ALL IMPACTED SUBSYSTEM FACTORIES TO LIFE NOW, BEFORE CREATING THE NEW PROFILE.
503
		// STEP 0: BRING ALL IMPACTED SUBSYSTEM FACTORIES TO LIFE NOW, BEFORE CREATING THE NEW PROFILE.
502
		// IF WE DO NOT DO THIS NOW, THEN THEY WILL CREATE A FILTER POOL MGR FOR THE NEW PROFILE AS THEY COME
504
		// IF WE DO NOT DO THIS NOW, THEN THEY WILL CREATE A FILTER POOL MGR FOR THE NEW PROFILE AS THEY COME
503
		// TO LIFE... SOMETHING WE DON'T WANT!
505
		// TO LIFE... SOMETHING WE DON'T WANT!
Lines 665-671 Link Here
665
		ISystemProfileManager manager = getSystemProfileManager();
667
		ISystemProfileManager manager = getSystemProfileManager();
666
		ISystemProfile defaultProfile = manager.getDefaultPrivateSystemProfile();
668
		ISystemProfile defaultProfile = manager.getDefaultPrivateSystemProfile();
667
		if (profile != defaultProfile) {
669
		if (profile != defaultProfile) {
668
			// Test if there are any filter pools in this profile that are referenced by another active profile...    	
670
			// Test if there are any filter pools in this profile that are referenced by another active profile...
669
			Vector activeReferenceVector = new Vector();
671
			Vector activeReferenceVector = new Vector();
670
			if (!makeActive && (subsystemConfigurationProxies != null)) {
672
			if (!makeActive && (subsystemConfigurationProxies != null)) {
671
				for (int idx = 0; idx < subsystemConfigurationProxies.length; idx++) {
673
				for (int idx = 0; idx < subsystemConfigurationProxies.length; idx++) {
Lines 747-760 Link Here
747
		}
749
		}
748
		return (IConnectorService[]) services.toArray(new IConnectorService[services.size()]);
750
		return (IConnectorService[]) services.toArray(new IConnectorService[services.size()]);
749
	}
751
	}
750
	
752
751
	/* (non-Javadoc)
753
	/* (non-Javadoc)
752
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getSubSystems(org.eclipse.rse.core.model.IHost, boolean)
754
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getSubSystems(org.eclipse.rse.core.model.IHost, boolean)
753
	 */
755
	 */
754
	public ISubSystem[] getSubSystems(IHost host, boolean force) {
756
	public ISubSystem[] getSubSystems(IHost host, boolean force) {
755
		return getSubSystems(host);
757
		return getSubSystems(host);
756
	}
758
	}
757
	
759
758
	/* (non-Javadoc)
760
	/* (non-Javadoc)
759
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getSubSystems(org.eclipse.rse.core.model.IHost)
761
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getSubSystems(org.eclipse.rse.core.model.IHost)
760
	 */
762
	 */
Lines 784-792 Link Here
784
	/**
786
	/**
785
	 * Resolve a subsystem from it's absolute name.  The absolute name of a subsystem
787
	 * Resolve a subsystem from it's absolute name.  The absolute name of a subsystem
786
	 * is denoted by <I>profileName</I>.<I>connectionName</I>:<I>subsystemConfigurationId</I>
788
	 * is denoted by <I>profileName</I>.<I>connectionName</I>:<I>subsystemConfigurationId</I>
787
	 * 
789
	 *
788
	 * @param absoluteSubSystemName the name of the subsystem
790
	 * @param absoluteSubSystemName the name of the subsystem
789
	 * 
791
	 *
790
	 * @return the subsystem
792
	 * @return the subsystem
791
	 */
793
	 */
792
	public ISubSystem getSubSystem(String absoluteSubSystemName)
794
	public ISubSystem getSubSystem(String absoluteSubSystemName)
Lines 800-806 Link Here
800
			String srcProfileName = absoluteSubSystemName.substring(0, profileDelim);
802
			String srcProfileName = absoluteSubSystemName.substring(0, profileDelim);
801
			String srcConnectionName = absoluteSubSystemName.substring(profileDelim + 1, connectionDelim);
803
			String srcConnectionName = absoluteSubSystemName.substring(profileDelim + 1, connectionDelim);
802
			String srcSubSystemConfigurationId = absoluteSubSystemName.substring(connectionDelim + 1, absoluteSubSystemName.length());
804
			String srcSubSystemConfigurationId = absoluteSubSystemName.substring(connectionDelim + 1, absoluteSubSystemName.length());
803
			
805
804
			ISystemProfile profile = getSystemProfile(srcProfileName);
806
			ISystemProfile profile = getSystemProfile(srcProfileName);
805
			return getSubSystem(profile, srcConnectionName, srcSubSystemConfigurationId);
807
			return getSubSystem(profile, srcConnectionName, srcSubSystemConfigurationId);
806
		}
808
		}
Lines 810-825 Link Here
810
812
811
	/**
813
	/**
812
	 * Resolve a subsystem from it's profile, connection and subsystem name.
814
	 * Resolve a subsystem from it's profile, connection and subsystem name.
813
	 * 
815
	 *
814
	 * @param profile the profile to search
816
	 * @param profile the profile to search
815
	 * @param srcConnectionName the name of the connection
817
	 * @param srcConnectionName the name of the connection
816
	 * @param subsystemConfigurationId the factory Id of the subsystem
818
	 * @param subsystemConfigurationId the factory Id of the subsystem
817
	 * 
819
	 *
818
	 * @return the subsystem
820
	 * @return the subsystem
819
	 */
821
	 */
820
	public ISubSystem getSubSystem(ISystemProfile profile, String srcConnectionName, String subsystemConfigurationId)
822
	public ISubSystem getSubSystem(ISystemProfile profile, String srcConnectionName, String subsystemConfigurationId)
821
	{
823
	{
822
		// find the src connection    	    	
824
		// find the src connection
823
		IHost[] connections = getHostsByProfile(profile);
825
		IHost[] connections = getHostsByProfile(profile);
824
		if (connections == null)
826
		if (connections == null)
825
		{
827
		{
Lines 878-974 Link Here
878
		dataStream.append(factoryId);
880
		dataStream.append(factoryId);
879
		return dataStream.toString();
881
		return dataStream.toString();
880
	}
882
	}
881
	
883
884
	/**
885
	 * Adapt the given element to an adapter that allows reading the element's
886
	 * absolute name and parent subsystem.
887
	 *
888
	 * @param element an element to adapt.
889
	 * @return the requested adapter, or <code>null</code> if the element is
890
	 *         not adaptable as needed.
891
	 * @since org.eclipse.rse.core 3.0
892
	 */
893
	public static ISystemDragDropAdapter getSystemDragDropAdapter(Object element) {
894
		Object adapter = null;
895
		if (element instanceof IAdaptable) {
896
			IAdaptable adaptable = (IAdaptable) element;
897
			adapter = adaptable.getAdapter(ISystemDragDropAdapter.class);
898
			if (adapter == null) {
899
				adapter = Platform.getAdapterManager().getAdapter(element, "org.eclipse.rse.ui.view.ISystemViewElementAdapter"); //$NON-NLS-1$
900
				if (adapter == null) {
901
					return null;
902
				}
903
				assert false : "Found ISystemViewElementAdapter but no ISystemDragDropAdapter"; //$NON-NLS-1$
904
			}
905
		} else {
906
			IAdapterManager am = Platform.getAdapterManager();
907
			adapter = am.getAdapter(element, ISystemDragDropAdapter.class.getName());
908
			if (adapter == null) {
909
				adapter = am.getAdapter(element, "org.eclipse.rse.ui.view.ISystemViewElementAdapter"); //$NON-NLS-1$
910
				if (adapter == null) {
911
					return null;
912
				}
913
				assert false : "Found ISystemViewElementAdapter but no ISystemDragDropAdapter"; //$NON-NLS-1$
914
			}
915
		}
916
		// At this point, we know for sure that we can adapt!
917
		return (ISystemDragDropAdapter) adapter;
918
	}
919
882
	/**
920
	/**
883
	 * Check if two objects refers to the same system object by comparing it absoluteName with its subsystem id.
921
	 * Check if two objects refers to the same system object by comparing their
884
	 * 
922
	 * absolute Names and subsystem id's.
923
	 *
885
	 * @param firstObject the first object to compare
924
	 * @param firstObject the first object to compare
886
	 * @param firstObjectFullName the full name of the firstObject.  If null, get the full name from the firstObject
925
	 * @param firstObjectFullName the full name of the firstObject. If null, get
926
	 *            the full name from the firstObject
887
	 * @param secondObject the second object to compare
927
	 * @param secondObject the second object to compare
888
	 * @param secondObjectFullName the full name of the secondObject. If null, get the full name from the secondObject
928
	 * @param secondObjectFullName the full name of the secondObject. If null,
929
	 *            get the full name from the secondObject
930
	 * @return <code>true</code> if the objects to be compared are the same
931
	 *         instance; or, if both objects are non-null and adaptable to an
932
	 *         RSE ISystemDragDropAdapter each, and those adapters do return a
933
	 *         valid absolute name that's the same for both elements, and both
934
	 *         elements belong to the same subsystem instance. Otherwise,
935
	 *         <code>false</code> in all other cases.
889
	 */
936
	 */
890
	public boolean isSameObjectByAbsoluteName(Object firstObject, String firstObjectFullName, Object secondObject, String secondObjectFullName)
937
	public static boolean isSameObjectByAbsoluteName(Object firstObject, String firstObjectFullName, Object secondObject, String secondObjectFullName)
891
	{
938
	{
892
		if (firstObject == secondObject)
939
		if (firstObject == secondObject) {
893
		{
894
			return true;
940
			return true;
895
		}
941
		}
896
		String firstObjectAbsoluteNameWithSubSystemId = null;
942
		ISystemDragDropAdapter adA = null;
897
		
943
		ISystemDragDropAdapter adB = null;
898
		//Simply doing comparason of if two object is equal is not enough
944
		if (firstObjectFullName == null) {
899
		//If two different objects, but if their absoluate path (with subsystem id)
945
			adA = getSystemDragDropAdapter(firstObject);
900
		//are the same, they refer to the same remote object.
946
			if (adA != null) {
901
		
947
				firstObjectFullName = adA.getAbsoluteName(firstObject);
902
		if(firstObject instanceof IAdaptable) 
948
			}
903
		{
949
		}
904
			ISystemDragDropAdapter adapter = null;
950
		if (secondObjectFullName == null) {
905
	    	
951
			adB = getSystemDragDropAdapter(secondObject);
906
			adapter = (ISystemDragDropAdapter)((IAdaptable)firstObject).getAdapter(ISystemDragDropAdapter.class);
952
			if (adB != null) {
907
			String subSystemId = null; 
953
				secondObjectFullName = adB.getAbsoluteName(secondObject);
908
      	
954
			}
909
      	  	if (adapter != null ) {
955
		}
910
      		  // first need to check subsystems
956
		if (firstObjectFullName != null && firstObjectFullName.equals(secondObjectFullName)) {
911
      		  ISubSystem subSystem = adapter.getSubSystem(firstObject);
957
			// full names exist and are the same: compare the subsystems
912
      		  if (null != subSystem)
958
			if (adA == null) { // firstFullName was passed in
913
      		  {
959
				adA = getSystemDragDropAdapter(firstObject);
914
      			  subSystemId = getAbsoluteNameForSubSystem(subSystem);
960
				assert adA != null : "full name \"" + firstObjectFullName + "\" has no ISystemDragDropAdapter!"; //$NON-NLS-1$ //$NON-NLS-2$
915
      		  }
961
				assert firstObjectFullName.equals(adA.getAbsoluteName(firstObject)) : "full name \"" + firstObjectFullName + "\" differs from adapter response: " + adA.getAbsoluteName(firstObject); //$NON-NLS-1$ //$NON-NLS-2$
916
      		  else
962
			}
917
      		  {
963
			if (adB == null) { // secondFullName was passed in
918
      			  subSystemId = "";  //$NON-NLS-1$
964
				adB = getSystemDragDropAdapter(secondObject);
919
      		  }
965
				assert adB != null : "full name \"" + secondObjectFullName + "\" has no ISystemDragDropAdapter!"; //$NON-NLS-1$ //$NON-NLS-2$
920
      		
966
				assert secondObjectFullName.equals(adB.getAbsoluteName(secondObject)) : "full name \"" + firstObjectFullName + "\" differs from adapter response: " + adB.getAbsoluteName(secondObject); //$NON-NLS-1$ //$NON-NLS-2$
921
      		  if (firstObjectFullName != null)
967
			}
922
      		  {
968
			ISubSystem ssA = adA.getSubSystem(firstObject);
923
      			firstObjectAbsoluteNameWithSubSystemId = subSystemId + ":" + firstObjectFullName; //$NON-NLS-1$
969
			ISubSystem ssB = adB.getSubSystem(secondObject);
924
      		  }
970
			return ssA == ssB;
925
      		  else
926
      		  {
927
      			  String absolutePath = adapter.getAbsoluteName(firstObject);
928
      			  firstObjectAbsoluteNameWithSubSystemId = subSystemId + ":" + absolutePath;  //$NON-NLS-1$
929
      		  }
930
      			 
931
	      }
932
        }
933
		
934
		
935
		String secondObjectAbsoluteNameWithSubSystemId = null;
936
		if(secondObject instanceof IAdaptable) 
937
		{
938
			ISystemDragDropAdapter adapter = null;
939
	    	
940
			adapter = (ISystemDragDropAdapter)((IAdaptable)secondObject).getAdapter(ISystemDragDropAdapter.class);
941
			String subSystemId = null; 
942
      	
943
      	  	if (adapter != null ) {
944
      		  // first need to check subsystems
945
      		  ISubSystem subSystem = adapter.getSubSystem(secondObject);
946
      		  if (null != subSystem)
947
    		  {
948
    			  subSystemId = getAbsoluteNameForSubSystem(subSystem);
949
    		  }
950
    		  else
951
    		  {
952
    			  subSystemId = "";  //$NON-NLS-1$
953
    		  }
954
      		  if (secondObjectFullName != null)
955
    		  {
956
    			secondObjectAbsoluteNameWithSubSystemId = subSystemId + ":" + secondObjectFullName; //$NON-NLS-1$
957
    		  }
958
    		  else
959
    		  {
960
    			  String absolutePath = adapter.getAbsoluteName(secondObject);
961
    			  secondObjectAbsoluteNameWithSubSystemId = subSystemId + ":" + absolutePath;  //$NON-NLS-1$
962
    		  }
963
      			 
964
	      }
965
        }
966
		
967
		if (firstObjectAbsoluteNameWithSubSystemId != null && firstObjectAbsoluteNameWithSubSystemId.equals(secondObjectAbsoluteNameWithSubSystemId))
968
		{
969
			return true;
970
		}
971
		}
971
		
972
		return false;
972
		return false;
973
	}
973
	}
974
974
Lines 981-990 Link Here
981
	 	StringBuffer dataStream = new StringBuffer();
981
	 	StringBuffer dataStream = new StringBuffer();
982
982
983
		String profileName = connection.getSystemProfileName();
983
		String profileName = connection.getSystemProfileName();
984
		String connectionName = connection.getAliasName();  
984
		String connectionName = connection.getAliasName();
985
		
985
986
		dataStream.append(profileName);
986
		dataStream.append(profileName);
987
		dataStream.append("."); //$NON-NLS-1$
987
		dataStream.append(".");
988
		dataStream.append(connectionName);
988
		dataStream.append(connectionName);
989
		return dataStream.toString();
989
		return dataStream.toString();
990
	}
990
	}
Lines 1002-1012 Link Here
1002
			if (subsystemInterface.isInstance(ss))
1002
			if (subsystemInterface.isInstance(ss))
1003
			{
1003
			{
1004
				matches.add(ss);
1004
				matches.add(ss);
1005
			}						
1005
			}
1006
		}
1006
		}
1007
		return (ISubSystem[])matches.toArray(new ISubSystem[matches.size()]);
1007
		return (ISubSystem[])matches.toArray(new ISubSystem[matches.size()]);
1008
	}
1008
	}
1009
	
1009
1010
	/* (non-Javadoc)
1010
	/* (non-Javadoc)
1011
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getServiceSubSystems(org.eclipse.rse.core.model.IHost, java.lang.Class)
1011
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getServiceSubSystems(org.eclipse.rse.core.model.IHost, java.lang.Class)
1012
	 */
1012
	 */
Lines 1047-1053 Link Here
1047
		else
1047
		else
1048
			return (new ISubSystem[0]);
1048
			return (new ISubSystem[0]);
1049
	}
1049
	}
1050
	
1050
1051
	public ISubSystemConfiguration[] getSubSystemConfigurations() {
1051
	public ISubSystemConfiguration[] getSubSystemConfigurations() {
1052
		// fixed Bugzilla Bug 160115 - added non-null guard for config
1052
		// fixed Bugzilla Bug 160115 - added non-null guard for config
1053
		Vector v = new Vector();
1053
		Vector v = new Vector();
Lines 1065-1071 Link Here
1065
		v.toArray(result);
1065
		v.toArray(result);
1066
		return result;
1066
		return result;
1067
	}
1067
	}
1068
	
1068
1069
	/**
1069
	/**
1070
	 * Return Vector of subsystem factories that apply to a given system connection
1070
	 * Return Vector of subsystem factories that apply to a given system connection
1071
	 */
1071
	 */
Lines 1144-1150 Link Here
1144
		ISystemHostPool result = SystemHostPool.getSystemHostPool(profile);
1144
		ISystemHostPool result = SystemHostPool.getSystemHostPool(profile);
1145
		return result;
1145
		return result;
1146
	}
1146
	}
1147
	
1147
1148
	/**
1148
	/**
1149
	 * Return connection pools for active profiles. One per.
1149
	 * Return connection pools for active profiles. One per.
1150
	 */
1150
	 */
Lines 1168-1180 Link Here
1168
	// ----------------------------
1168
	// ----------------------------
1169
	// PUBLIC CONNECTION METHODS...
1169
	// PUBLIC CONNECTION METHODS...
1170
	// ----------------------------
1170
	// ----------------------------
1171
	
1171
1172
	/**
1172
	/**
1173
	 * Return the first connection to localhost we can find. While we always create a default one in
1173
	 * Return the first connection to localhost we can find. While we always create a default one in
1174
	 *  the user's profile, it is possible that this profile is not active or the connection was deleted.
1174
	 *  the user's profile, it is possible that this profile is not active or the connection was deleted.
1175
	 *  However, since any connection to localHost will usually do, we just search all active profiles
1175
	 *  However, since any connection to localHost will usually do, we just search all active profiles
1176
	 *  until we find one, and return it. <br>
1176
	 *  until we find one, and return it. <br>
1177
	 * If no localhost connection is found, this will return null. If one is needed, it can be created 
1177
	 * If no localhost connection is found, this will return null. If one is needed, it can be created
1178
	 *  easily by calling {@link #createLocalHost(ISystemProfile, String, String)}.
1178
	 *  easily by calling {@link #createLocalHost(ISystemProfile, String, String)}.
1179
	 */
1179
	 */
1180
	public IHost getLocalHost()
1180
	public IHost getLocalHost()
Lines 1200-1214 Link Here
1200
			if (conns != null) {
1200
			if (conns != null) {
1201
				for (int jdx = 0; jdx < conns.length; jdx++) {
1201
				for (int jdx = 0; jdx < conns.length; jdx++) {
1202
					//ISystemHostPool ensures that we never have "null" hosts.
1202
					//ISystemHostPool ensures that we never have "null" hosts.
1203
					assert conns[jdx]!=null : "Null host in pool "+pools[idx].getName()+" at "+jdx; //$NON-NLS-1$ //$NON-NLS-2$
1203
					assert conns[jdx]!=null : "Null host in pool "+pools[idx].getName()+" at "+jdx;
1204
					hosts.add(conns[jdx]);
1204
					hosts.add(conns[jdx]);
1205
				}
1205
				}
1206
			}
1206
			}
1207
		}
1207
		}
1208
		IHost[] allConns = (IHost[])hosts.toArray(new IHost[hosts.size()]); 
1208
		IHost[] allConns = (IHost[])hosts.toArray(new IHost[hosts.size()]);
1209
		return allConns;
1209
		return allConns;
1210
	}
1210
	}
1211
	
1211
1212
	/*
1212
	/*
1213
	 * (non-Javadoc)
1213
	 * (non-Javadoc)
1214
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getHostsByProfile(org.eclipse.rse.core.model.ISystemProfile)
1214
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getHostsByProfile(org.eclipse.rse.core.model.ISystemProfile)
Lines 1218-1231 Link Here
1218
		ISystemHostPool pool = getHostPool(profile);
1218
		ISystemHostPool pool = getHostPool(profile);
1219
		return pool.getHosts();
1219
		return pool.getHosts();
1220
	}
1220
	}
1221
	
1221
1222
	/*
1222
	/*
1223
	 * (non-Javadoc)
1223
	 * (non-Javadoc)
1224
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getHostsBySubSystemConfiguration(org.eclipse.rse.core.subsystems.ISubSystemConfiguration)
1224
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getHostsBySubSystemConfiguration(org.eclipse.rse.core.subsystems.ISubSystemConfiguration)
1225
	 */
1225
	 */
1226
	public IHost[] getHostsBySubSystemConfiguration(ISubSystemConfiguration factory)
1226
	public IHost[] getHostsBySubSystemConfiguration(ISubSystemConfiguration factory)
1227
	{
1227
	{
1228
		/* The following algorithm failed because factory.getSubSystems() only returns 
1228
		/* The following algorithm failed because factory.getSubSystems() only returns
1229
		 *  subsystems that have been restored, which are only those that have been
1229
		 *  subsystems that have been restored, which are only those that have been
1230
		 *  expanded.
1230
		 *  expanded.
1231
		 */
1231
		 */
Lines 1244-1250 Link Here
1244
		}
1244
		}
1245
		return conns;
1245
		return conns;
1246
	}
1246
	}
1247
	
1247
1248
	/*
1248
	/*
1249
	 * (non-Javadoc)
1249
	 * (non-Javadoc)
1250
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getHostsBySubSystemConfigurationCategory(java.lang.String)
1250
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getHostsBySubSystemConfigurationCategory(java.lang.String)
Lines 1286-1292 Link Here
1286
	 */
1286
	 */
1287
	public IHost[] getHostsBySystemType(IRSESystemType systemType) {
1287
	public IHost[] getHostsBySystemType(IRSESystemType systemType) {
1288
		List connections = new ArrayList();
1288
		List connections = new ArrayList();
1289
		
1289
1290
		if (systemType != null) {
1290
		if (systemType != null) {
1291
			IHost[] candidates = getHosts();
1291
			IHost[] candidates = getHosts();
1292
			for (int i = 0; i < candidates.length; i++) {
1292
			for (int i = 0; i < candidates.length; i++) {
Lines 1297-1306 Link Here
1297
				}
1297
				}
1298
			}
1298
			}
1299
		}
1299
		}
1300
		
1300
1301
		return (IHost[])connections.toArray(new IHost[connections.size()]);
1301
		return (IHost[])connections.toArray(new IHost[connections.size()]);
1302
	}
1302
	}
1303
	
1303
1304
	/*
1304
	/*
1305
	 * (non-Javadoc)
1305
	 * (non-Javadoc)
1306
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getHostsBySystemTypes(org.eclipse.rse.core.IRSESystemType[])
1306
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getHostsBySystemTypes(org.eclipse.rse.core.IRSESystemType[])
Lines 1328-1334 Link Here
1328
	{
1328
	{
1329
		return getHostPool(profile).getHost(connectionName);
1329
		return getHostPool(profile).getHost(connectionName);
1330
	}
1330
	}
1331
	
1331
1332
	/*
1332
	/*
1333
	 * (non-Javadoc)
1333
	 * (non-Javadoc)
1334
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getHostPosition(org.eclipse.rse.core.model.IHost)
1334
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getHostPosition(org.eclipse.rse.core.model.IHost)
Lines 1338-1344 Link Here
1338
		ISystemHostPool pool = conn.getHostPool();
1338
		ISystemHostPool pool = conn.getHostPool();
1339
		return pool.getHostPosition(conn);
1339
		return pool.getHostPosition(conn);
1340
	}
1340
	}
1341
	
1341
1342
	/**
1342
	/**
1343
	 * Return the zero-based position of a SystemConnection object within all active profiles.
1343
	 * Return the zero-based position of a SystemConnection object within all active profiles.
1344
	 */
1344
	 */
Lines 1362-1368 Link Here
1362
	{
1362
	{
1363
		return getHostPool(profile).getHostCount();
1363
		return getHostPool(profile).getHostCount();
1364
	}
1364
	}
1365
	
1365
1366
	/*
1366
	/*
1367
	 * (non-Javadoc)
1367
	 * (non-Javadoc)
1368
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getHostCountWithinProfile(org.eclipse.rse.core.model.IHost)
1368
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getHostCountWithinProfile(org.eclipse.rse.core.model.IHost)
Lines 1402-1408 Link Here
1402
		}
1402
		}
1403
		return names;
1403
		return names;
1404
	}
1404
	}
1405
	
1405
1406
	/*
1406
	/*
1407
	 * (non-Javadoc)
1407
	 * (non-Javadoc)
1408
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getHostAliasNamesForAllActiveProfiles()
1408
	 * @see org.eclipse.rse.core.model.ISystemRegistry#getHostAliasNamesForAllActiveProfiles()
Lines 1445-1451 Link Here
1445
			}
1445
			}
1446
		}
1446
		}
1447
		if ((systemType != null) && (systemType.isLocal() && (v.size() == 0)))
1447
		if ((systemType != null) && (systemType.isLocal() && (v.size() == 0)))
1448
			v.addElement("localhost"); //$NON-NLS-1$
1448
			v.addElement("localhost");
1449
		return (String[])v.toArray(new String[v.size()]);
1449
		return (String[])v.toArray(new String[v.size()]);
1450
	}
1450
	}
1451
1451
Lines 1460-1466 Link Here
1460
			profile = getSystemProfileManager().getDefaultPrivateSystemProfile();
1460
			profile = getSystemProfileManager().getDefaultPrivateSystemProfile();
1461
		if (profile == null)
1461
		if (profile == null)
1462
			profile = getSystemProfileManager().getActiveSystemProfiles()[0];
1462
			profile = getSystemProfileManager().getActiveSystemProfiles()[0];
1463
		 
1463
1464
		try
1464
		try
1465
		{
1465
		{
1466
			IRSESystemType localType = RSECorePlugin.getTheCoreRegistry().getSystemTypeById(IRSESystemType.SYSTEMTYPE_LOCAL_ID);
1466
			IRSESystemType localType = RSECorePlugin.getTheCoreRegistry().getSystemTypeById(IRSESystemType.SYSTEMTYPE_LOCAL_ID);
Lines 1468-1474 Link Here
1468
		  			profile.getName(), localType,
1468
		  			profile.getName(), localType,
1469
		  			name, // connection name
1469
		  			name, // connection name
1470
		  			"localhost", // hostname //$NON-NLS-1$
1470
		  			"localhost", // hostname //$NON-NLS-1$
1471
		  			"", // description //$NON-NLS-1$
1471
		  			"", // description
1472
		  			// DY:  defect 42101, description cannot be null
1472
		  			// DY:  defect 42101, description cannot be null
1473
		  			// null, // description
1473
		  			// null, // description
1474
		  			userId, // default user Id
1474
		  			userId, // default user Id
Lines 1477-1487 Link Here
1477
		}
1477
		}
1478
		catch (Exception exc)
1478
		catch (Exception exc)
1479
		{
1479
		{
1480
			RSECorePlugin.getDefault().getLogger().logError("Error creating local connection", exc); //$NON-NLS-1$
1480
			RSECorePlugin.getDefault().getLogger().logError("Error creating local connection", exc);
1481
		}
1481
		}
1482
		return localConn;
1482
		return localConn;
1483
	}
1483
	}
1484
	
1484
1485
	/* (non-Javadoc)
1485
	/* (non-Javadoc)
1486
	 * @see org.eclipse.rse.core.model.ISystemRegistry#createHost(java.lang.String, org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int, org.eclipse.rse.core.model.ISubSystemConfigurator[])
1486
	 * @see org.eclipse.rse.core.model.ISystemRegistry#createHost(java.lang.String, org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int, org.eclipse.rse.core.model.ISubSystemConfigurator[])
1487
	 */
1487
	 */
Lines 1498-1504 Link Here
1498
	{
1498
	{
1499
		return createHost(profileName, systemType, connectionName, hostName, description, defaultUserId, defaultUserIdLocation, true, configurators);
1499
		return createHost(profileName, systemType, connectionName, hostName, description, defaultUserId, defaultUserIdLocation, true, configurators);
1500
	}
1500
	}
1501
	
1501
1502
	/**
1502
	/**
1503
	 * Create a host object, given its host pool and its attributes.
1503
	 * Create a host object, given its host pool and its attributes.
1504
	 * <p>
1504
	 * <p>
Lines 1522-1530 Link Here
1522
	 * @return SystemConnection object, or null if it failed to create. This is typically
1522
	 * @return SystemConnection object, or null if it failed to create. This is typically
1523
	 * because the connectionName is not unique. Call getLastException() if necessary.
1523
	 * because the connectionName is not unique. Call getLastException() if necessary.
1524
	 */
1524
	 */
1525
	public IHost createHost(final String profileName, final IRSESystemType systemType, final String hostName, 
1525
	public IHost createHost(final String profileName, final IRSESystemType systemType, final String hostName,
1526
			final String hostAddress, final String description, final String defaultUserId, 
1526
			final String hostAddress, final String description, final String defaultUserId,
1527
			final int defaultUserIdLocation, final boolean createSubSystems, 
1527
			final int defaultUserIdLocation, final boolean createSubSystems,
1528
			final ISubSystemConfigurator[] configurators) throws Exception {
1528
			final ISubSystemConfigurator[] configurators) throws Exception {
1529
		final ISystemRegistry sr = this;
1529
		final ISystemRegistry sr = this;
1530
		class CreateHostOperation implements ISystemProfileOperation {
1530
		class CreateHostOperation implements ISystemProfileOperation {
Lines 1607-1636 Link Here
1607
		FireNewHostEvents fire = new FireNewHostEvents(host, subsystems, sr);
1607
		FireNewHostEvents fire = new FireNewHostEvents(host, subsystems, sr);
1608
		Display.getDefault().asyncExec(fire);
1608
		Display.getDefault().asyncExec(fire);
1609
		////Listening to FireNewHostEvents now
1609
		////Listening to FireNewHostEvents now
1610
		//SystemPreferencesManager.setConnectionNamesOrder(); // update preferences order list                
1610
		//SystemPreferencesManager.setConnectionNamesOrder(); // update preferences order list
1611
		return host;
1611
		return host;
1612
	}
1612
	}
1613
	
1613
1614
	/*
1614
	/*
1615
	 * (non-Javadoc)
1615
	 * (non-Javadoc)
1616
	 * @see org.eclipse.rse.core.model.ISystemRegistry#createSubSystems(org.eclipse.rse.core.model.IHost, org.eclipse.rse.core.subsystems.ISubSystemConfiguration[])
1616
	 * @see org.eclipse.rse.core.model.ISystemRegistry#createSubSystems(org.eclipse.rse.core.model.IHost, org.eclipse.rse.core.subsystems.ISubSystemConfiguration[])
1617
	 */
1617
	 */
1618
	public ISubSystem[] createSubSystems(IHost host, ISubSystemConfiguration[] configurations) {
1618
	public ISubSystem[] createSubSystems(IHost host, ISubSystemConfiguration[] configurations) {
1619
		
1619
1620
		ISubSystem[] subsystems = new ISubSystem[configurations.length];
1620
		ISubSystem[] subsystems = new ISubSystem[configurations.length];
1621
		
1621
1622
		for (int i = 0; i < configurations.length; i++) {
1622
		for (int i = 0; i < configurations.length; i++) {
1623
			subsystems[i] = configurations[i].createSubSystem(host, true, null);
1623
			subsystems[i] = configurations[i].createSubSystem(host, true, null);
1624
		}
1624
		}
1625
		
1625
1626
		for (int j = 0; j < subsystems.length; j++) {
1626
		for (int j = 0; j < subsystems.length; j++) {
1627
			fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_ADDED, ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_SUBSYSTEM, subsystems[j], null);
1627
			fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_ADDED, ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_SUBSYSTEM, subsystems[j], null);
1628
		}
1628
		}
1629
		
1629
1630
		host.commit();
1630
		host.commit();
1631
		return subsystems;
1631
		return subsystems;
1632
	}
1632
	}
1633
	
1633
1634
	class NotifyModelChangedRunnable implements Runnable
1634
	class NotifyModelChangedRunnable implements Runnable
1635
	{
1635
	{
1636
		private ISystemModelChangeEvent _event;
1636
		private ISystemModelChangeEvent _event;
Lines 1638-1650 Link Here
1638
		{
1638
		{
1639
			_event = event;
1639
			_event = event;
1640
		}
1640
		}
1641
		
1641
1642
		public void run()
1642
		public void run()
1643
		{
1643
		{
1644
			modelListenerManager.notify(_event);
1644
			modelListenerManager.notify(_event);
1645
		}
1645
		}
1646
	}
1646
	}
1647
	
1647
1648
	class NotifyResourceChangedRunnable implements Runnable
1648
	class NotifyResourceChangedRunnable implements Runnable
1649
	{
1649
	{
1650
		private ISystemResourceChangeEvent _event;
1650
		private ISystemResourceChangeEvent _event;
Lines 1652-1664 Link Here
1652
		{
1652
		{
1653
			_event = event;
1653
			_event = event;
1654
		}
1654
		}
1655
		
1655
1656
		public void run()
1656
		public void run()
1657
		{
1657
		{
1658
			listenerManager.notify(_event);
1658
			listenerManager.notify(_event);
1659
		}
1659
		}
1660
	}
1660
	}
1661
	
1661
1662
	class NotifyPreferenceChangedRunnable implements Runnable
1662
	class NotifyPreferenceChangedRunnable implements Runnable
1663
	{
1663
	{
1664
		private ISystemPreferenceChangeEvent _event;
1664
		private ISystemPreferenceChangeEvent _event;
Lines 1666-1695 Link Here
1666
		{
1666
		{
1667
			_event = event;
1667
			_event = event;
1668
		}
1668
		}
1669
		
1669
1670
		public void run()
1670
		public void run()
1671
		{
1671
		{
1672
			preferenceListManager.notify(_event);
1672
			preferenceListManager.notify(_event);
1673
		}
1673
		}
1674
	}
1674
	}
1675
	
1675
1676
	class PreferenceChangedRunnable implements Runnable
1676
	class PreferenceChangedRunnable implements Runnable
1677
	{
1677
	{
1678
		private ISystemPreferenceChangeEvent _event;
1678
		private ISystemPreferenceChangeEvent _event;
1679
		private ISystemPreferenceChangeListener _listener;
1679
		private ISystemPreferenceChangeListener _listener;
1680
		
1680
1681
		public PreferenceChangedRunnable(ISystemPreferenceChangeEvent event, ISystemPreferenceChangeListener listener)
1681
		public PreferenceChangedRunnable(ISystemPreferenceChangeEvent event, ISystemPreferenceChangeListener listener)
1682
		{
1682
		{
1683
			_event = event;
1683
			_event = event;
1684
			_listener = listener;
1684
			_listener = listener;
1685
		}
1685
		}
1686
		
1686
1687
		public void run()
1687
		public void run()
1688
		{
1688
		{
1689
			_listener.systemPreferenceChanged(_event);
1689
			_listener.systemPreferenceChanged(_event);
1690
		}
1690
		}
1691
	}
1691
	}
1692
	
1692
1693
	class ModelResourceChangedRunnable implements Runnable
1693
	class ModelResourceChangedRunnable implements Runnable
1694
	{
1694
	{
1695
		private ISystemModelChangeListener _listener;
1695
		private ISystemModelChangeListener _listener;
Lines 1699-1711 Link Here
1699
			_event = event;
1699
			_event = event;
1700
			_listener = listener;
1700
			_listener = listener;
1701
		}
1701
		}
1702
		
1702
1703
		public void run()
1703
		public void run()
1704
		{
1704
		{
1705
			_listener.systemModelResourceChanged(_event);
1705
			_listener.systemModelResourceChanged(_event);
1706
		}
1706
		}
1707
	}
1707
	}
1708
	
1708
1709
	class ResourceChangedRunnable implements Runnable
1709
	class ResourceChangedRunnable implements Runnable
1710
	{
1710
	{
1711
		private ISystemResourceChangeListener _listener;
1711
		private ISystemResourceChangeListener _listener;
Lines 1715-1727 Link Here
1715
			_event = event;
1715
			_event = event;
1716
			_listener = listener;
1716
			_listener = listener;
1717
		}
1717
		}
1718
		
1718
1719
		public void run()
1719
		public void run()
1720
		{
1720
		{
1721
			_listener.systemResourceChanged(_event);
1721
			_listener.systemResourceChanged(_event);
1722
		}
1722
		}
1723
	}
1723
	}
1724
	
1724
1725
	class RemoteResourceChangedRunnable implements Runnable
1725
	class RemoteResourceChangedRunnable implements Runnable
1726
	{
1726
	{
1727
		private ISystemRemoteChangeListener _listener;
1727
		private ISystemRemoteChangeListener _listener;
Lines 1731-1743 Link Here
1731
			_event = event;
1731
			_event = event;
1732
			_listener = listener;
1732
			_listener = listener;
1733
		}
1733
		}
1734
		
1734
1735
		public void run()
1735
		public void run()
1736
		{
1736
		{
1737
			_listener.systemRemoteResourceChanged(_event);
1737
			_listener.systemRemoteResourceChanged(_event);
1738
		}
1738
		}
1739
	}
1739
	}
1740
	
1740
1741
	class RemoteChangedRunnable implements Runnable
1741
	class RemoteChangedRunnable implements Runnable
1742
	{
1742
	{
1743
		private ISystemRemoteChangeEvent _event;
1743
		private ISystemRemoteChangeEvent _event;
Lines 1745-1772 Link Here
1745
		{
1745
		{
1746
			_event = event;
1746
			_event = event;
1747
		}
1747
		}
1748
		
1748
1749
		public void run()
1749
		public void run()
1750
		{
1750
		{
1751
			remoteListManager.notify(_event);
1751
			remoteListManager.notify(_event);
1752
		}
1752
		}
1753
	}
1753
	}
1754
	
1754
1755
	
1755
1756
	class FireNewHostEvents implements Runnable
1756
	class FireNewHostEvents implements Runnable
1757
	{
1757
	{
1758
		private ISubSystem[] subSystems;
1758
		private ISubSystem[] subSystems;
1759
		private IHost conn;
1759
		private IHost conn;
1760
		private ISystemRegistry reg;
1760
		private ISystemRegistry reg;
1761
						
1761
1762
		
1762
1763
		public FireNewHostEvents(IHost host, ISubSystem[] subSystems, ISystemRegistry registry)
1763
		public FireNewHostEvents(IHost host, ISubSystem[] subSystems, ISystemRegistry registry)
1764
		{
1764
		{
1765
			this.subSystems= subSystems; 
1765
			this.subSystems= subSystems;
1766
			this.conn = host;
1766
			this.conn = host;
1767
			this.reg = registry;
1767
			this.reg = registry;
1768
		}
1768
		}
1769
		
1769
1770
		public void run()
1770
		public void run()
1771
		{
1771
		{
1772
			int eventType = ISystemResourceChangeEvents.EVENT_ADD_RELATIVE;
1772
			int eventType = ISystemResourceChangeEvents.EVENT_ADD_RELATIVE;
Lines 1787-1801 Link Here
1787
					ISystemModelChangeEvents.SYSTEM_RESOURCE_ADDED,
1787
					ISystemModelChangeEvents.SYSTEM_RESOURCE_ADDED,
1788
					ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_CONNECTION,
1788
					ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_CONNECTION,
1789
					conn, null);
1789
					conn, null);
1790
		
1790
1791
			for (int s = 0; s < subSystems.length; s++)
1791
			for (int s = 0; s < subSystems.length; s++)
1792
			{
1792
			{
1793
				ISubSystem ss = subSystems[s];
1793
				ISubSystem ss = subSystems[s];
1794
				fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_ADDED, ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_SUBSYSTEM, ss, null);						
1794
				fireModelChangeEvent(ISystemModelChangeEvents.SYSTEM_RESOURCE_ADDED, ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_SUBSYSTEM, ss, null);
1795
			}
1795
			}
1796
		}
1796
		}
1797
	}
1797
	}
1798
	
1798
1799
	private ISubSystemConfigurator[] getApplicableConfigurators(ISubSystemConfiguration ssf, ISubSystemConfigurator[] allPages)
1799
	private ISubSystemConfigurator[] getApplicableConfigurators(ISubSystemConfiguration ssf, ISubSystemConfigurator[] allPages)
1800
	{
1800
	{
1801
		if ((allPages == null) || (allPages.length == 0))
1801
		if ((allPages == null) || (allPages.length == 0))
Lines 1813-1819 Link Here
1813
				subPages[count++] = allPages[idx];
1813
				subPages[count++] = allPages[idx];
1814
		return subPages;
1814
		return subPages;
1815
	}
1815
	}
1816
	
1816
1817
	/*
1817
	/*
1818
	 * (non-Javadoc)
1818
	 * (non-Javadoc)
1819
	 * @see org.eclipse.rse.core.model.ISystemRegistry#createHost(java.lang.String, org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String, java.lang.String)
1819
	 * @see org.eclipse.rse.core.model.ISystemRegistry#createHost(java.lang.String, org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String, java.lang.String)
Lines 1821-1837 Link Here
1821
	public IHost createHost(String profileName, IRSESystemType systemType, String connectionName, String hostName, String description)
1821
	public IHost createHost(String profileName, IRSESystemType systemType, String connectionName, String hostName, String description)
1822
		throws Exception
1822
		throws Exception
1823
	{
1823
	{
1824
		return createHost(profileName, systemType, connectionName, hostName, description, true);  
1824
		return createHost(profileName, systemType, connectionName, hostName, description, true);
1825
	}
1825
	}
1826
	
1826
1827
	/* (non-Javadoc)
1827
	/* (non-Javadoc)
1828
	 * @see org.eclipse.rse.core.model.ISystemRegistry#createHost(java.lang.String, org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String, java.lang.String, boolean)
1828
	 * @see org.eclipse.rse.core.model.ISystemRegistry#createHost(java.lang.String, org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String, java.lang.String, boolean)
1829
	 */
1829
	 */
1830
	public IHost createHost(String profileName, IRSESystemType systemType, String connectionName, String hostName, String description, boolean createSubSystems) throws Exception
1830
	public IHost createHost(String profileName, IRSESystemType systemType, String connectionName, String hostName, String description, boolean createSubSystems) throws Exception
1831
	{
1831
	{
1832
		return createHost(profileName, systemType, connectionName, hostName, description, null, IRSEUserIdConstants.USERID_LOCATION_HOST, createSubSystems, null);  
1832
		return createHost(profileName, systemType, connectionName, hostName, description, null, IRSEUserIdConstants.USERID_LOCATION_HOST, createSubSystems, null);
1833
	}
1833
	}
1834
	
1834
1835
	/*
1835
	/*
1836
	 * (non-Javadoc)
1836
	 * (non-Javadoc)
1837
	 * @see org.eclipse.rse.core.model.ISystemRegistry#createHost(org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String, java.lang.String)
1837
	 * @see org.eclipse.rse.core.model.ISystemRegistry#createHost(org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String, java.lang.String)
Lines 1842-1850 Link Here
1842
		ISystemProfile profile = getSystemProfileManager().getDefaultPrivateSystemProfile();
1842
		ISystemProfile profile = getSystemProfileManager().getDefaultPrivateSystemProfile();
1843
		if (profile == null)
1843
		if (profile == null)
1844
			profile = getSystemProfileManager().getActiveSystemProfiles()[0];
1844
			profile = getSystemProfileManager().getActiveSystemProfiles()[0];
1845
		return createHost(profile.getName(), systemType, connectionName, hostName, description);  
1845
		return createHost(profile.getName(), systemType, connectionName, hostName, description);
1846
	}
1846
	}
1847
	
1847
1848
	/**
1848
	/**
1849
	 * Return the previous connection as would be shown in the view
1849
	 * Return the previous connection as would be shown in the view
1850
	 */
1850
	 */
Lines 1867-1873 Link Here
1867
		}
1867
		}
1868
		return prevConn;
1868
		return prevConn;
1869
	}
1869
	}
1870
	
1870
1871
	/*
1871
	/*
1872
	 * (non-Javadoc)
1872
	 * (non-Javadoc)
1873
	 * @see org.eclipse.rse.core.model.ISystemRegistry#updateHost(org.eclipse.rse.core.model.IHost, org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int)
1873
	 * @see org.eclipse.rse.core.model.ISystemRegistry#updateHost(org.eclipse.rse.core.model.IHost, org.eclipse.rse.core.IRSESystemType, java.lang.String, java.lang.String, java.lang.String, java.lang.String, int)
Lines 1886-1892 Link Here
1886
		}
1886
		}
1887
		else
1887
		else
1888
			defaultUserIdChanged = !conn.compareUserIds(defaultUserId, orgDefaultUserId); // d43219
1888
			defaultUserIdChanged = !conn.compareUserIds(defaultUserId, orgDefaultUserId); // d43219
1889
		//!defaultUserId.equalsIgnoreCase(orgDefaultUserId);    	
1889
		//!defaultUserId.equalsIgnoreCase(orgDefaultUserId);
1890
1890
1891
		try
1891
		try
1892
		{
1892
		{
Lines 1896-1908 Link Here
1896
		}
1896
		}
1897
		catch (SystemMessageException exc)
1897
		catch (SystemMessageException exc)
1898
		{
1898
		{
1899
			RSECorePlugin.getDefault().getLogger().logError("Exception in updateConnection for " + connectionName, exc); //$NON-NLS-1$
1899
			RSECorePlugin.getDefault().getLogger().logError("Exception in updateConnection for " + connectionName, exc);
1900
			lastException = exc;
1900
			lastException = exc;
1901
			return;
1901
			return;
1902
		}
1902
		}
1903
		catch (Exception exc)
1903
		catch (Exception exc)
1904
		{
1904
		{
1905
			RSECorePlugin.getDefault().getLogger().logError("Exception in updateConnection for " + connectionName, exc); //$NON-NLS-1$
1905
			RSECorePlugin.getDefault().getLogger().logError("Exception in updateConnection for " + connectionName, exc);
1906
			lastException = exc;
1906
			lastException = exc;
1907
			return;
1907
			return;
1908
		}
1908
		}
Lines 1933-1939 Link Here
1933
					}
1933
					}
1934
					catch (Exception exc)
1934
					catch (Exception exc)
1935
					{
1935
					{
1936
					} // msg already shown    	  	   
1936
					} // msg already shown
1937
				}
1937
				}
1938
			}
1938
			}
1939
		}
1939
		}
Lines 1963-1970 Link Here
1963
		for (int idx = 0; idx < affectedSubSystemFactories.size(); idx++)
1963
		for (int idx = 0; idx < affectedSubSystemFactories.size(); idx++)
1964
		{
1964
		{
1965
			 ((ISubSystemConfiguration) affectedSubSystemFactories.elementAt(idx)).deleteSubSystemsByConnection(conn);
1965
			 ((ISubSystemConfiguration) affectedSubSystemFactories.elementAt(idx)).deleteSubSystemsByConnection(conn);
1966
		} 
1966
		}
1967
		conn.getHostPool().deleteHost(conn); // delete from memory and from disk.       
1967
		conn.getHostPool().deleteHost(conn); // delete from memory and from disk.
1968
		fireModelChangeEvent(
1968
		fireModelChangeEvent(
1969
				ISystemModelChangeEvents.SYSTEM_RESOURCE_REMOVED,
1969
				ISystemModelChangeEvents.SYSTEM_RESOURCE_REMOVED,
1970
				ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_CONNECTION,
1970
				ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_CONNECTION,
Lines 1981-1988 Link Here
1981
1981
1982
		// it looks good, so proceed...
1982
		// it looks good, so proceed...
1983
		String oldName = conn.getAliasName();
1983
		String oldName = conn.getAliasName();
1984
		
1984
1985
		
1985
1986
		// DKM - changing how this is done since there are services with different configurations now
1986
		// DKM - changing how this is done since there are services with different configurations now
1987
		ISubSystem[] subsystems = conn.getSubSystems();
1987
		ISubSystem[] subsystems = conn.getSubSystems();
1988
		for (int i = 0; i < subsystems.length; i++)
1988
		for (int i = 0; i < subsystems.length; i++)
Lines 1990-1996 Link Here
1990
			ISubSystem ss = subsystems[i];
1990
			ISubSystem ss = subsystems[i];
1991
			ss.getSubSystemConfiguration().renameSubSystemsByConnection(conn, newName);
1991
			ss.getSubSystemConfiguration().renameSubSystemsByConnection(conn, newName);
1992
		}
1992
		}
1993
		
1993
1994
		/*
1994
		/*
1995
		Vector affectedSubSystemFactories = getSubSystemFactories(conn);
1995
		Vector affectedSubSystemFactories = getSubSystemFactories(conn);
1996
		for (int idx = 0; idx < affectedSubSystemFactories.size(); idx++)
1996
		for (int idx = 0; idx < affectedSubSystemFactories.size(); idx++)
Lines 1998-2004 Link Here
1998
		*/
1998
		*/
1999
		conn.getHostPool().renameHost(conn, newName); // rename in memory and disk
1999
		conn.getHostPool().renameHost(conn, newName); // rename in memory and disk
2000
		////Listening to events now
2000
		////Listening to events now
2001
		//SystemPreferencesManager.setConnectionNamesOrder(); // update preferences order list        
2001
		//SystemPreferencesManager.setConnectionNamesOrder(); // update preferences order list
2002
		fireModelChangeEvent(
2002
		fireModelChangeEvent(
2003
				ISystemModelChangeEvents.SYSTEM_RESOURCE_RENAMED,
2003
				ISystemModelChangeEvents.SYSTEM_RESOURCE_RENAMED,
2004
				ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_CONNECTION,
2004
				ISystemModelChangeEvents.SYSTEM_RESOURCETYPE_CONNECTION,
Lines 2042-2048 Link Here
2042
		ISystemHostPool targetPool = getHostPool(targetProfile);
2042
		ISystemHostPool targetPool = getHostPool(targetProfile);
2043
		IHost newConn = null;
2043
		IHost newConn = null;
2044
2044
2045
		RSECorePlugin.getDefault().getLogger().logDebugMessage(this.getClass().getName(), "Start of system connection copy. From: " + oldName + " to: " + newName); //$NON-NLS-1$ //$NON-NLS-2$
2045
		RSECorePlugin.getDefault().getLogger().logDebugMessage(this.getClass().getName(), "Start of system connection copy. From: " + oldName + " to: " + newName);
2046
2046
2047
		// STEP 0: BRING ALL IMPACTED SUBSYSTEM FACTORIES TO LIFE NOW, BEFORE DOING THE CLONE.
2047
		// STEP 0: BRING ALL IMPACTED SUBSYSTEM FACTORIES TO LIFE NOW, BEFORE DOING THE CLONE.
2048
		getSubSystemFactories(conn);
2048
		getSubSystemFactories(conn);
Lines 2061-2067 Link Here
2061
2061
2062
			ISubSystem[] subsystems = null;
2062
			ISubSystem[] subsystems = null;
2063
			ISubSystemConfiguration factory = null;
2063
			ISubSystemConfiguration factory = null;
2064
			msg = "Copying subsystems for connection " + conn.getAliasName(); //$NON-NLS-1$
2064
			msg = "Copying subsystems for connection " + conn.getAliasName();
2065
			//monitor.subTask(msg);
2065
			//monitor.subTask(msg);
2066
			RSECorePlugin.getDefault().getLogger().logDebugMessage(this.getClass().getName(), msg);
2066
			RSECorePlugin.getDefault().getLogger().logDebugMessage(this.getClass().getName(), msg);
2067
			subsystems = getSubSystems(conn); // get old subsystems for this connection
2067
			subsystems = getSubSystems(conn); // get old subsystems for this connection
Lines 2069-2075 Link Here
2069
			{
2069
			{
2070
				for (int jdx = 0; jdx < subsystems.length; jdx++)
2070
				for (int jdx = 0; jdx < subsystems.length; jdx++)
2071
				{
2071
				{
2072
					msg += ": subsystem " + subsystems[jdx].getName(); //$NON-NLS-1$
2072
					msg += ": subsystem " + subsystems[jdx].getName();
2073
					//monitor.subTask(msg);
2073
					//monitor.subTask(msg);
2074
					RSECorePlugin.getDefault().getLogger().logDebugMessage(this.getClass().getName(), msg);
2074
					RSECorePlugin.getDefault().getLogger().logDebugMessage(this.getClass().getName(), msg);
2075
					factory = subsystems[jdx].getSubSystemConfiguration();
2075
					factory = subsystems[jdx].getSubSystemConfiguration();
Lines 2077-2083 Link Here
2077
					//try { java.lang.Thread.sleep(3000l); } catch (InterruptedException e) {}
2077
					//try { java.lang.Thread.sleep(3000l); } catch (InterruptedException e) {}
2078
				}
2078
				}
2079
			}
2079
			}
2080
			//monitor.worked(1);                
2080
			//monitor.worked(1);
2081
		}
2081
		}
2082
		catch (Exception exc)
2082
		catch (Exception exc)
2083
		{
2083
		{
Lines 2094-2104 Link Here
2094
			}
2094
			}
2095
			catch (Exception exc)
2095
			catch (Exception exc)
2096
			{
2096
			{
2097
				RSECorePlugin.getDefault().getLogger().logError("Exception (ignored) cleaning up from copy-connection exception.", exc); //$NON-NLS-1$
2097
				RSECorePlugin.getDefault().getLogger().logError("Exception (ignored) cleaning up from copy-connection exception.", exc);
2098
			}
2098
			}
2099
			throw (lastExc);
2099
			throw (lastExc);
2100
		}
2100
		}
2101
		RSECorePlugin.getDefault().getLogger().logDebugMessage(this.getClass().getName(), "Copy of system connection " + oldName + " to " + newName + " successful"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
2101
		RSECorePlugin.getDefault().getLogger().logDebugMessage(this.getClass().getName(), "Copy of system connection " + oldName + " to " + newName + " successful");
2102
		if (getSystemProfileManager().isSystemProfileActive(targetProfile.getName()))
2102
		if (getSystemProfileManager().isSystemProfileActive(targetProfile.getName()))
2103
		{
2103
		{
2104
			int eventType = ISystemResourceChangeEvents.EVENT_ADD_RELATIVE;
2104
			int eventType = ISystemResourceChangeEvents.EVENT_ADD_RELATIVE;
Lines 2128-2134 Link Here
2128
			if (newConn != null)
2128
			if (newConn != null)
2129
			{
2129
			{
2130
				deleteHost(conn); // delete old connection now that new one created successfully
2130
				deleteHost(conn); // delete old connection now that new one created successfully
2131
				RSECorePlugin.getDefault().getLogger().logDebugMessage(this.getClass().getName(), "Move of system connection " + conn.getAliasName() + " to profile " + targetProfile.getName() + " successful"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
2131
				RSECorePlugin.getDefault().getLogger().logDebugMessage(this.getClass().getName(), "Move of system connection " + conn.getAliasName() + " to profile " + targetProfile.getName() + " successful");
2132
				fireEvent(new SystemResourceChangeEvent(conn, ISystemResourceChangeEvents.EVENT_DELETE, this));
2132
				fireEvent(new SystemResourceChangeEvent(conn, ISystemResourceChangeEvents.EVENT_DELETE, this));
2133
			}
2133
			}
2134
		}
2134
		}
Lines 2146-2171 Link Here
2146
	 */
2146
	 */
2147
	public boolean isAnySubSystemSupportsConnect(IHost conn) {
2147
	public boolean isAnySubSystemSupportsConnect(IHost conn) {
2148
		Vector v = getSubSystemFactories(conn);
2148
		Vector v = getSubSystemFactories(conn);
2149
		
2149
2150
		if (v != null) {
2150
		if (v != null) {
2151
			Iterator iter = v.iterator();
2151
			Iterator iter = v.iterator();
2152
			
2152
2153
			while (iter.hasNext()) {
2153
			while (iter.hasNext()) {
2154
				Object obj = iter.next();
2154
				Object obj = iter.next();
2155
				
2155
2156
				if (obj instanceof ISubSystemConfiguration) {
2156
				if (obj instanceof ISubSystemConfiguration) {
2157
					ISubSystemConfiguration config = (ISubSystemConfiguration)obj;
2157
					ISubSystemConfiguration config = (ISubSystemConfiguration)obj;
2158
					
2158
2159
					if (config.supportsSubSystemConnect()) {
2159
					if (config.supportsSubSystemConnect()) {
2160
						return true;
2160
						return true;
2161
					}
2161
					}
2162
				}
2162
				}
2163
			}
2163
			}
2164
		}
2164
		}
2165
		
2165
2166
		return false;
2166
		return false;
2167
	}
2167
	}
2168
	
2168
2169
	/*
2169
	/*
2170
	 * (non-Javadoc)
2170
	 * (non-Javadoc)
2171
	 * @see org.eclipse.rse.core.model.ISystemRegistry#isAnySubSystemConnected(org.eclipse.rse.core.model.IHost)
2171
	 * @see org.eclipse.rse.core.model.ISystemRegistry#isAnySubSystemConnected(org.eclipse.rse.core.model.IHost)
Lines 2187-2193 Link Here
2187
2187
2188
	/**
2188
	/**
2189
	 * Check if there are any subsystem configurations that have not yet been instantiated
2189
	 * Check if there are any subsystem configurations that have not yet been instantiated
2190
	 * and apply to the given system type. 
2190
	 * and apply to the given system type.
2191
	 * @param systemType the system type to check
2191
	 * @param systemType the system type to check
2192
	 * @return <code>true</code> if there are any matching subsystem configurations not yet instantiated.
2192
	 * @return <code>true</code> if there are any matching subsystem configurations not yet instantiated.
2193
	 */
2193
	 */
Lines 2205-2211 Link Here
2205
			}
2205
			}
2206
		}
2206
		}
2207
		return false;
2207
		return false;
2208
		
2208
2209
	}
2209
	}
2210
2210
2211
	/*
2211
	/*
Lines 2229-2235 Link Here
2229
			//If there are no subsystems, they are all connected.
2229
			//If there are no subsystems, they are all connected.
2230
			return true;
2230
			return true;
2231
		}
2231
		}
2232
		
2232
2233
		for (int idx = 0; all && (idx < subsystems.length); idx++)
2233
		for (int idx = 0; all && (idx < subsystems.length); idx++)
2234
		{
2234
		{
2235
			ISubSystem ss = subsystems[idx];
2235
			ISubSystem ss = subsystems[idx];
Lines 2241-2247 Link Here
2241
		}
2241
		}
2242
		return all;
2242
		return all;
2243
	}
2243
	}
2244
	
2244
2245
	/*
2245
	/*
2246
	 * (non-Javadoc)
2246
	 * (non-Javadoc)
2247
	 * @see org.eclipse.rse.core.model.ISystemRegistry#disconnectAllSubSystems(org.eclipse.rse.core.model.IHost)
2247
	 * @see org.eclipse.rse.core.model.ISystemRegistry#disconnectAllSubSystems(org.eclipse.rse.core.model.IHost)
Lines 2254-2260 Link Here
2254
			return;
2254
			return;
2255
2255
2256
		// dy:  defect 47281, user repeatedly prompted to disconnect if there is an open file
2256
		// dy:  defect 47281, user repeatedly prompted to disconnect if there is an open file
2257
		// and they keep hitting cancel. 
2257
		// and they keep hitting cancel.
2258
		boolean cancelled = false;
2258
		boolean cancelled = false;
2259
		for (int idx = 0; idx < subsystems.length && !cancelled; idx++)
2259
		for (int idx = 0; idx < subsystems.length && !cancelled; idx++)
2260
		{
2260
		{
Lines 2263-2274 Link Here
2263
			{
2263
			{
2264
				try
2264
				try
2265
				{
2265
				{
2266
					//ss.getConnectorService().disconnect(); defect 40675         	 
2266
					//ss.getConnectorService().disconnect(); defect 40675
2267
					ss.disconnect();
2267
					ss.disconnect();
2268
				}
2268
				}
2269
				catch (InterruptedException exc)
2269
				catch (InterruptedException exc)
2270
				{
2270
				{
2271
					System.out.println("Cancelled"); //$NON-NLS-1$
2271
					System.out.println("Cancelled");
2272
					cancelled = true;
2272
					cancelled = true;
2273
				}
2273
				}
2274
				catch (Exception exc)
2274
				catch (Exception exc)
Lines 2301-2310 Link Here
2301
		{
2301
		{
2302
			int eventId = ISystemResourceChangeEvents.EVENT_ICON_CHANGE;
2302
			int eventId = ISystemResourceChangeEvents.EVENT_ICON_CHANGE;
2303
			fireEvent(new SystemResourceChangeEvent(conn, eventId, this));
2303
			fireEvent(new SystemResourceChangeEvent(conn, eventId, this));
2304
			
2304
2305
			SystemResourceChangeEvent event = new SystemResourceChangeEvent(subsystem, eventId, conn);
2305
			SystemResourceChangeEvent event = new SystemResourceChangeEvent(subsystem, eventId, conn);
2306
			fireEvent(event);
2306
			fireEvent(event);
2307
			
2307
2308
			// DKM
2308
			// DKM
2309
			// fire for each subsystem
2309
			// fire for each subsystem
2310
			ISubSystem[] sses = getSubSystems(conn);
2310
			ISubSystem[] sses = getSubSystems(conn);
Lines 2315-2330 Link Here
2315
			    {
2315
			    {
2316
			        SystemResourceChangeEvent sevent = new SystemResourceChangeEvent(ss, eventId, conn);
2316
			        SystemResourceChangeEvent sevent = new SystemResourceChangeEvent(ss, eventId, conn);
2317
					fireEvent(sevent);
2317
					fireEvent(sevent);
2318
					
2318
2319
					sevent.setType(ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE); // update vrm
2319
					sevent.setType(ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE); // update vrm
2320
					fireEvent(sevent);
2320
					fireEvent(sevent);
2321
			    }
2321
			    }
2322
			}
2322
			}
2323
			
2323
2324
			
2324
2325
			// DY:  Conditioning of property change event type has been removed so
2325
			// DY:  Conditioning of property change event type has been removed so
2326
			// that the connected property is updated on a disconnect.
2326
			// that the connected property is updated on a disconnect.
2327
			//if (connected)        
2327
			//if (connected)
2328
			event.setType(ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE); // update vrm
2328
			event.setType(ISystemResourceChangeEvents.EVENT_PROPERTY_CHANGE); // update vrm
2329
2329
2330
			fireEvent(event);
2330
			fireEvent(event);
Lines 2333-2339 Link Here
2333
		{
2333
		{
2334
			invalidateFiltersFor(subsystem);
2334
			invalidateFiltersFor(subsystem);
2335
			fireEvent(new SystemResourceChangeEvent(subsystem, ISystemResourceChangeEvents.EVENT_MUST_COLLAPSE, this));
2335
			fireEvent(new SystemResourceChangeEvent(subsystem, ISystemResourceChangeEvents.EVENT_MUST_COLLAPSE, this));
2336
			
2336
2337
			ISubSystem[] sses = getSubSystems(conn);
2337
			ISubSystem[] sses = getSubSystems(conn);
2338
			for (int i = 0; i < sses.length; i++)
2338
			for (int i = 0; i < sses.length; i++)
2339
			{
2339
			{
Lines 2350-2356 Link Here
2350
2350
2351
	// ----------------------------
2351
	// ----------------------------
2352
	// RESOURCE EVENT METHODS...
2352
	// RESOURCE EVENT METHODS...
2353
	// ----------------------------            
2353
	// ----------------------------
2354
2354
2355
	/**
2355
	/**
2356
	 * Register your interest in being told when a system resource such as a connection is changed.
2356
	 * Register your interest in being told when a system resource such as a connection is changed.
Lines 2392-2407 Link Here
2392
	            {
2392
	            {
2393
	                ((ISystemContainer)ref).markStale(true);
2393
	                ((ISystemContainer)ref).markStale(true);
2394
	            }
2394
	            }
2395
	        }	        
2395
	        }
2396
	    }
2396
	    }
2397
	    
2397
2398
	    if (onMainThread()) {
2398
	    if (onMainThread()) {
2399
	    	listenerManager.notify(event);
2399
	    	listenerManager.notify(event);
2400
	    }
2400
	    }
2401
	    else {
2401
	    else {
2402
	    	runOnMainThread(new NotifyResourceChangedRunnable(event));
2402
	    	runOnMainThread(new NotifyResourceChangedRunnable(event));
2403
	    }
2403
	    }
2404
	    	
2404
2405
	}
2405
	}
2406
	/**
2406
	/**
2407
	 * Notify a specific listener of a change to a system resource such as a connection.
2407
	 * Notify a specific listener of a change to a system resource such as a connection.
Lines 2415-2421 Link Here
2415
			runOnMainThread(new ResourceChangedRunnable(event, l));
2415
			runOnMainThread(new ResourceChangedRunnable(event, l));
2416
		}
2416
		}
2417
	}
2417
	}
2418
	
2418
2419
	/**
2419
	/**
2420
	 * Return the listener manager such that the SystemRegistryUI
2420
	 * Return the listener manager such that the SystemRegistryUI
2421
	 * can re-use it for posting events that can only be posted
2421
	 * can re-use it for posting events that can only be posted
Lines 2429-2435 Link Here
2429
2429
2430
	// ----------------------------
2430
	// ----------------------------
2431
	// MODEL RESOURCE EVENT METHODS...
2431
	// MODEL RESOURCE EVENT METHODS...
2432
	// ----------------------------            
2432
	// ----------------------------
2433
2433
2434
	/**
2434
	/**
2435
	 * Register your interest in being told when an RSE model resource is changed.
2435
	 * Register your interest in being told when an RSE model resource is changed.
Lines 2448-2470 Link Here
2448
		modelListenerManager.removeSystemModelChangeListener(l);
2448
		modelListenerManager.removeSystemModelChangeListener(l);
2449
		modelListenerCount--;
2449
		modelListenerCount--;
2450
	}
2450
	}
2451
	
2451
2452
	private boolean onMainThread()
2452
	private boolean onMainThread()
2453
	{
2453
	{
2454
		return Display.getCurrent() != null;
2454
		return Display.getCurrent() != null;
2455
	}
2455
	}
2456
	
2456
2457
	private void runOnMainThread(Runnable runnable)
2457
	private void runOnMainThread(Runnable runnable)
2458
	{
2458
	{
2459
		Display.getDefault().asyncExec(runnable);
2459
		Display.getDefault().asyncExec(runnable);
2460
	}
2460
	}
2461
	
2461
2462
	/**
2462
	/**
2463
	 * Notify all listeners of a change to a system model resource such as a connection.
2463
	 * Notify all listeners of a change to a system model resource such as a connection.
2464
	 * You would not normally call this as the methods in this class call it when appropriate.
2464
	 * You would not normally call this as the methods in this class call it when appropriate.
2465
	 */
2465
	 */
2466
	public void fireEvent(ISystemModelChangeEvent event)
2466
	public void fireEvent(ISystemModelChangeEvent event)
2467
	{		
2467
	{
2468
		if (onMainThread()) {
2468
		if (onMainThread()) {
2469
			modelListenerManager.notify(event);
2469
			modelListenerManager.notify(event);
2470
		}
2470
		}
Lines 2485-2492 Link Here
2485
		modelEvent.setResourceType(resourceType);
2485
		modelEvent.setResourceType(resourceType);
2486
		modelEvent.setResource(resource);
2486
		modelEvent.setResource(resource);
2487
		modelEvent.setOldName(oldName);
2487
		modelEvent.setOldName(oldName);
2488
		
2488
2489
		if (onMainThread()) {	
2489
		if (onMainThread()) {
2490
			modelListenerManager.notify(modelEvent);
2490
			modelListenerManager.notify(modelEvent);
2491
		}
2491
		}
2492
		else {
2492
		else {
Lines 2494-2502 Link Here
2494
			runOnMainThread(new NotifyModelChangedRunnable(modelEvent));
2494
			runOnMainThread(new NotifyModelChangedRunnable(modelEvent));
2495
		}
2495
		}
2496
	}
2496
	}
2497
	
2498
2497
2499
	
2498
2499
2500
	/**
2500
	/**
2501
	 * Notify a specific listener of a change to a system model resource such as a connection.
2501
	 * Notify a specific listener of a change to a system model resource such as a connection.
2502
	 */
2502
	 */
Lines 2512-2518 Link Here
2512
2512
2513
	// --------------------------------
2513
	// --------------------------------
2514
	// REMOTE RESOURCE EVENT METHODS...
2514
	// REMOTE RESOURCE EVENT METHODS...
2515
	// --------------------------------            
2515
	// --------------------------------
2516
2516
2517
	/**
2517
	/**
2518
	 * Register your interest in being told when a remote resource is changed.
2518
	 * Register your interest in being told when a remote resource is changed.
Lines 2531-2537 Link Here
2531
		remoteListManager.removeSystemRemoteChangeListener(l);
2531
		remoteListManager.removeSystemRemoteChangeListener(l);
2532
		remoteListCount--;
2532
		remoteListCount--;
2533
	}
2533
	}
2534
	
2534
2535
	/**
2535
	/**
2536
	 * Query if the ISystemRemoteChangeListener is already listening for SystemRemoteChange events
2536
	 * Query if the ISystemRemoteChangeListener is already listening for SystemRemoteChange events
2537
	 */
2537
	 */
Lines 2539-2545 Link Here
2539
	{
2539
	{
2540
		return remoteListManager.isRegisteredSystemRemoteChangeListener(l);
2540
		return remoteListManager.isRegisteredSystemRemoteChangeListener(l);
2541
	}
2541
	}
2542
	
2542
2543
	/**
2543
	/**
2544
	 * Notify all listeners of a change to a remote resource such as a file.
2544
	 * Notify all listeners of a change to a remote resource such as a file.
2545
	 * You would not normally call this as the methods in this class call it when appropriate.
2545
	 * You would not normally call this as the methods in this class call it when appropriate.
Lines 2553-2566 Link Here
2553
			runOnMainThread(new RemoteChangedRunnable(event));
2553
			runOnMainThread(new RemoteChangedRunnable(event));
2554
		}
2554
		}
2555
	}
2555
	}
2556
	
2556
2557
	/**
2557
	/**
2558
	 * Notify all listeners of a change to a remote resource such as a file.
2558
	 * Notify all listeners of a change to a remote resource such as a file.
2559
	 * This one takes the information needed and creates the event for you.
2559
	 * This one takes the information needed and creates the event for you.
2560
	 * @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents}
2560
	 * @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents}
2561
	 * @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
2561
	 * @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
2562
	 * @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
2562
	 * @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
2563
	 * @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be 
2563
	 * @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be
2564
	 *   limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.
2564
	 *   limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.
2565
	 * @param oldNames - on a rename, copy or move operation, these are the absolute names of the resources prior to the operation
2565
	 * @param oldNames - on a rename, copy or move operation, these are the absolute names of the resources prior to the operation
2566
	 */
2566
	 */
Lines 2572-2578 Link Here
2572
		}
2572
		}
2573
		// mark stale any filters that reference this object
2573
		// mark stale any filters that reference this object
2574
		invalidateFiltersFor(resourceParent, subsystem);
2574
		invalidateFiltersFor(resourceParent, subsystem);
2575
		
2575
2576
		if (remoteEvent == null)
2576
		if (remoteEvent == null)
2577
			remoteEvent = new SystemRemoteChangeEvent();
2577
			remoteEvent = new SystemRemoteChangeEvent();
2578
		remoteEvent.setEventType(eventType);
2578
		remoteEvent.setEventType(eventType);
Lines 2580-2586 Link Here
2580
		remoteEvent.setResourceParent(resourceParent);
2580
		remoteEvent.setResourceParent(resourceParent);
2581
		remoteEvent.setOldNames(oldNames);
2581
		remoteEvent.setOldNames(oldNames);
2582
		remoteEvent.setSubSystem(subsystem);
2582
		remoteEvent.setSubSystem(subsystem);
2583
		
2583
2584
		if (onMainThread())
2584
		if (onMainThread())
2585
		{
2585
		{
2586
			remoteListManager.notify(remoteEvent);
2586
			remoteListManager.notify(remoteEvent);
Lines 2597-2606 Link Here
2597
	 * @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents}
2597
	 * @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents}
2598
	 * @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
2598
	 * @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
2599
	 * @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
2599
	 * @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
2600
	 * @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be 
2600
	 * @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be
2601
	 *   limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.
2601
	 *   limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.
2602
	 * @param oldNames - on a rename, copy or move operation, these are the absolute names of the resources prior to the operation
2602
	 * @param oldNames - on a rename, copy or move operation, these are the absolute names of the resources prior to the operation
2603
	 * @param originatingViewer - optional. If set, this gives the viewer a clue that it should select the affected resource after refreshing its parent. 
2603
	 * @param originatingViewer - optional. If set, this gives the viewer a clue that it should select the affected resource after refreshing its parent.
2604
	 *    This saves sending a separate event to reveal and select the new created resource on a create event, for example.
2604
	 *    This saves sending a separate event to reveal and select the new created resource on a create event, for example.
2605
	 */
2605
	 */
2606
	public void fireRemoteResourceChangeEvent(int eventType, Object resource, Object resourceParent, ISubSystem subsystem, String[] oldNames, Object originatingViewer)
2606
	public void fireRemoteResourceChangeEvent(int eventType, Object resource, Object resourceParent, ISubSystem subsystem, String[] oldNames, Object originatingViewer)
Lines 2611-2617 Link Here
2611
		}
2611
		}
2612
		// mark stale any filters that reference this object
2612
		// mark stale any filters that reference this object
2613
		invalidateFiltersFor(resourceParent, subsystem);
2613
		invalidateFiltersFor(resourceParent, subsystem);
2614
		
2614
2615
		//if (remoteEvent == null)
2615
		//if (remoteEvent == null)
2616
			remoteEvent = new SystemRemoteChangeEvent();
2616
			remoteEvent = new SystemRemoteChangeEvent();
2617
		remoteEvent.setEventType(eventType);
2617
		remoteEvent.setEventType(eventType);
Lines 2620-2626 Link Here
2620
		remoteEvent.setOldNames(oldNames);
2620
		remoteEvent.setOldNames(oldNames);
2621
		remoteEvent.setSubSystem(subsystem);
2621
		remoteEvent.setSubSystem(subsystem);
2622
		remoteEvent.setOriginatingViewer(originatingViewer);
2622
		remoteEvent.setOriginatingViewer(originatingViewer);
2623
		
2623
2624
		if (onMainThread())
2624
		if (onMainThread())
2625
		{
2625
		{
2626
			remoteListManager.notify(remoteEvent);
2626
			remoteListManager.notify(remoteEvent);
Lines 2638-2644 Link Here
2638
	 * @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents}
2638
	 * @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents}
2639
	 * @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
2639
	 * @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
2640
	 * @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
2640
	 * @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
2641
	 * @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be 
2641
	 * @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be
2642
	 *   limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.
2642
	 *   limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.
2643
     * @param oldNames - on a rename, copy or move operation, these are the absolute names of the resources prior to the operation
2643
     * @param oldNames - on a rename, copy or move operation, these are the absolute names of the resources prior to the operation
2644
	 */
2644
	 */
Lines 2650-2656 Link Here
2650
		}
2650
		}
2651
		// mark stale any filters that reference this object
2651
		// mark stale any filters that reference this object
2652
		invalidateFiltersFor(resourceParent, subsystem);
2652
		invalidateFiltersFor(resourceParent, subsystem);
2653
		
2653
2654
		if (remoteEvent == null)
2654
		if (remoteEvent == null)
2655
			remoteEvent = new SystemRemoteChangeEvent();
2655
			remoteEvent = new SystemRemoteChangeEvent();
2656
		remoteEvent.setOperation(operation);
2656
		remoteEvent.setOperation(operation);
Lines 2659-2665 Link Here
2659
		remoteEvent.setResourceParent(resourceParent);
2659
		remoteEvent.setResourceParent(resourceParent);
2660
		remoteEvent.setOldNames(oldNames);
2660
		remoteEvent.setOldNames(oldNames);
2661
		remoteEvent.setSubSystem(subsystem);
2661
		remoteEvent.setSubSystem(subsystem);
2662
		
2662
2663
		if (onMainThread())
2663
		if (onMainThread())
2664
		{
2664
		{
2665
			remoteListManager.notify(remoteEvent);
2665
			remoteListManager.notify(remoteEvent);
Lines 2677-2686 Link Here
2677
	 * @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents}
2677
	 * @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents}
2678
	 * @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
2678
	 * @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
2679
	 * @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
2679
	 * @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
2680
	 * @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be 
2680
	 * @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be
2681
	 *   limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.
2681
	 *   limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.
2682
	 * @param oldNames - on a rename, copy or move operation, these are the absolute names of the resources prior to the operation
2682
	 * @param oldNames - on a rename, copy or move operation, these are the absolute names of the resources prior to the operation
2683
	 * @param originatingViewer - optional. If set, this gives the viewer a clue that it should select the affected resource after refreshing its parent. 
2683
	 * @param originatingViewer - optional. If set, this gives the viewer a clue that it should select the affected resource after refreshing its parent.
2684
	 *    This saves sending a separate event to reveal and select the new created resource on a create event, for example.
2684
	 *    This saves sending a separate event to reveal and select the new created resource on a create event, for example.
2685
	 */
2685
	 */
2686
	public void fireRemoteResourceChangeEvent(String operation, int eventType, Object resource, Object resourceParent, ISubSystem subsystem, String[] oldNames, Object originatingViewer)
2686
	public void fireRemoteResourceChangeEvent(String operation, int eventType, Object resource, Object resourceParent, ISubSystem subsystem, String[] oldNames, Object originatingViewer)
Lines 2691-2707 Link Here
2691
		}
2691
		}
2692
		// mark stale any filters that reference this object
2692
		// mark stale any filters that reference this object
2693
		invalidateFiltersFor(resourceParent, subsystem);
2693
		invalidateFiltersFor(resourceParent, subsystem);
2694
		
2694
2695
		if (remoteEvent == null)
2695
		if (remoteEvent == null)
2696
			remoteEvent = new SystemRemoteChangeEvent();
2696
			remoteEvent = new SystemRemoteChangeEvent();
2697
		remoteEvent.setOperation(operation);	
2697
		remoteEvent.setOperation(operation);
2698
		remoteEvent.setEventType(eventType);
2698
		remoteEvent.setEventType(eventType);
2699
		remoteEvent.setResource(resource);
2699
		remoteEvent.setResource(resource);
2700
		remoteEvent.setResourceParent(resourceParent);
2700
		remoteEvent.setResourceParent(resourceParent);
2701
		remoteEvent.setOldNames(oldNames);
2701
		remoteEvent.setOldNames(oldNames);
2702
		remoteEvent.setSubSystem(subsystem);
2702
		remoteEvent.setSubSystem(subsystem);
2703
		remoteEvent.setOriginatingViewer(originatingViewer);
2703
		remoteEvent.setOriginatingViewer(originatingViewer);
2704
		
2704
2705
		if (onMainThread())
2705
		if (onMainThread())
2706
		{
2706
		{
2707
			remoteListManager.notify(remoteEvent);
2707
			remoteListManager.notify(remoteEvent);
Lines 2711-2724 Link Here
2711
			runOnMainThread(new RemoteChangedRunnable(remoteEvent));
2711
			runOnMainThread(new RemoteChangedRunnable(remoteEvent));
2712
		}
2712
		}
2713
	}
2713
	}
2714
	
2714
2715
    /**
2715
    /**
2716
     * Returns the implementation of ISystemRemoteElement for the given
2716
     * Returns the implementation of ISystemRemoteElement for the given
2717
     * object.  Returns null if this object does not adaptable to this.
2717
     * object.  Returns null if this object does not adaptable to this.
2718
     */
2718
     */
2719
    protected IRemoteObjectIdentifier getRemoteObjectIdentifier(Object o) 
2719
    protected IRemoteObjectIdentifier getRemoteObjectIdentifier(Object o)
2720
    {
2720
    {
2721
		//Try 1: element already an instance of IRemoteObjectIdentifier? 
2721
		//Try 1: element already an instance of IRemoteObjectIdentifier?
2722
    	if (o instanceof IRemoteObjectIdentifier) {
2722
    	if (o instanceof IRemoteObjectIdentifier) {
2723
    		return (IRemoteObjectIdentifier)o;
2723
    		return (IRemoteObjectIdentifier)o;
2724
    	}
2724
    	}
Lines 2745-2758 Link Here
2745
    	}
2745
    	}
2746
		return adapter;
2746
		return adapter;
2747
    }
2747
    }
2748
    
2748
2749
	 private String getRemoteResourceAbsoluteName(Object remoteResource)
2749
	 private String getRemoteResourceAbsoluteName(Object remoteResource)
2750
	    {
2750
	    {
2751
	    	if (remoteResource == null)
2751
	    	if (remoteResource == null)
2752
	    	  return null;
2752
	    	  return null;
2753
	    	String remoteResourceName = null;
2753
	    	String remoteResourceName = null;
2754
	        if (remoteResource instanceof String)
2754
	        if (remoteResource instanceof String)
2755
	    	  remoteResourceName = (String)remoteResource;    	  
2755
	    	  remoteResourceName = (String)remoteResource;
2756
	        else if (remoteResource instanceof SystemFilterReference)
2756
	        else if (remoteResource instanceof SystemFilterReference)
2757
	        {
2757
	        {
2758
	        	ISystemFilterReference ref = (ISystemFilterReference)remoteResource;
2758
	        	ISystemFilterReference ref = (ISystemFilterReference)remoteResource;
Lines 2763-2778 Link Here
2763
	    		  return null;
2763
	    		  return null;
2764
	    		remoteResourceName = rid.getAbsoluteName(remoteResource);
2764
	    		remoteResourceName = rid.getAbsoluteName(remoteResource);
2765
	        }
2765
	        }
2766
	        else 
2766
	        else
2767
	    	{
2767
	    	{
2768
	    		IRemoteObjectIdentifier rid = getRemoteObjectIdentifier(remoteResource);
2768
	    		IRemoteObjectIdentifier rid = getRemoteObjectIdentifier(remoteResource);
2769
	    		if (rid == null)
2769
	    		if (rid == null)
2770
	    		  return null;
2770
	    		  return null;
2771
	    		remoteResourceName = rid.getAbsoluteName(remoteResource);
2771
	    		remoteResourceName = rid.getAbsoluteName(remoteResource);
2772
	    	}
2772
	    	}
2773
	    	return remoteResourceName;    	
2773
	    	return remoteResourceName;
2774
	    }
2774
	    }
2775
	 
2775
2776
	 private List findFilterReferencesFor(ISubSystem subsystem)
2776
	 private List findFilterReferencesFor(ISubSystem subsystem)
2777
		{
2777
		{
2778
		   List results = new ArrayList();
2778
		   List results = new ArrayList();
Lines 2785-2808 Link Here
2785
				    for (int i = 0; i < refs.length; i++)
2785
				    for (int i = 0; i < refs.length; i++)
2786
				    {
2786
				    {
2787
				        ISystemFilterReference filterRef = refs[i];
2787
				        ISystemFilterReference filterRef = refs[i];
2788
				   
2788
2789
				        if (!filterRef.isStale() && filterRef.hasContents(SystemChildrenContentsType.getInstance()))
2789
				        if (!filterRef.isStale() && filterRef.hasContents(SystemChildrenContentsType.getInstance()))
2790
				        {
2790
				        {
2791
				        	results.add(filterRef);
2791
				        	results.add(filterRef);
2792
				        }
2792
				        }
2793
				    }
2793
				    }
2794
				    
2794
2795
		    	}
2795
		    	}
2796
		    }
2796
		    }
2797
		    return results;
2797
		    return results;
2798
		
2798
2799
	    }
2799
	    }
2800
	 
2800
2801
	public List findFilterReferencesFor(Object resource, ISubSystem subsystem)
2801
	public List findFilterReferencesFor(Object resource, ISubSystem subsystem)
2802
	{
2802
	{
2803
		return findFilterReferencesFor(resource, subsystem, true);
2803
		return findFilterReferencesFor(resource, subsystem, true);
2804
	}
2804
	}
2805
		
2805
2806
	public List findFilterReferencesFor(Object resource, ISubSystem subsystem, boolean onlyCached)
2806
	public List findFilterReferencesFor(Object resource, ISubSystem subsystem, boolean onlyCached)
2807
	{
2807
	{
2808
	    String elementName = getRemoteResourceAbsoluteName(resource);
2808
	    String elementName = getRemoteResourceAbsoluteName(resource);
Lines 2813-2847 Link Here
2813
		    for (int i = 0; i < refs.length; i++)
2813
		    for (int i = 0; i < refs.length; i++)
2814
		    {
2814
		    {
2815
		        ISystemFilterReference filterRef = refs[i];
2815
		        ISystemFilterReference filterRef = refs[i];
2816
		   
2816
2817
		        if (!onlyCached || (!filterRef.isStale() && filterRef.hasContents(SystemChildrenContentsType.getInstance())))
2817
		        if (!onlyCached || (!filterRef.isStale() && filterRef.hasContents(SystemChildrenContentsType.getInstance())))
2818
		        	
2818
2819
		        {
2819
		        {
2820
		    	    	// #1
2820
		    	    	// #1
2821
		    	    	if (subsystem.doesFilterMatch(filterRef.getReferencedFilter(), elementName))
2821
		    	    	if (subsystem.doesFilterMatch(filterRef.getReferencedFilter(), elementName))
2822
		    	    	{
2822
		    	    	{
2823
		    	  	       results.add(filterRef); // found a match!
2823
		    	  	       results.add(filterRef); // found a match!
2824
	
2824
2825
		    	    	}
2825
		    	    	}
2826
		    	    	// #2
2826
		    	    	// #2
2827
		    	    	else if (subsystem.doesFilterListContentsOf(filterRef.getReferencedFilter(),elementName))
2827
		    	    	else if (subsystem.doesFilterListContentsOf(filterRef.getReferencedFilter(),elementName))
2828
		    	    	{
2828
		    	    	{
2829
		    	    	    results.add(filterRef); // found a match!
2829
		    	    	    results.add(filterRef); // found a match!
2830
		   	    	    } 
2830
		   	    	    }
2831
		        }
2831
		        }
2832
		    }
2832
		    }
2833
		    
2833
2834
		  
2834
2835
	    }
2835
	    }
2836
	    return results;
2836
	    return results;
2837
	
2837
2838
    }
2838
    }
2839
	
2839
2840
	public void invalidateFiltersFor(ISubSystem subsystem)
2840
	public void invalidateFiltersFor(ISubSystem subsystem)
2841
	{	    
2841
	{
2842
	    if (subsystem != null)
2842
	    if (subsystem != null)
2843
	    {
2843
	    {
2844
		    
2844
2845
	        List results = findFilterReferencesFor(subsystem);
2845
	        List results = findFilterReferencesFor(subsystem);
2846
	        for (int i = 0; i < results.size(); i++)
2846
	        for (int i = 0; i < results.size(); i++)
2847
	        {
2847
	        {
Lines 2849-2860 Link Here
2849
	        }
2849
	        }
2850
	    }
2850
	    }
2851
	}
2851
	}
2852
	
2852
2853
	public void invalidateFiltersFor(Object resourceParent, ISubSystem subsystem)
2853
	public void invalidateFiltersFor(Object resourceParent, ISubSystem subsystem)
2854
	{	    
2854
	{
2855
	    if (subsystem != null)
2855
	    if (subsystem != null)
2856
	    {
2856
	    {
2857
		    
2857
2858
	        List results = findFilterReferencesFor(resourceParent, subsystem);
2858
	        List results = findFilterReferencesFor(resourceParent, subsystem);
2859
	        for (int i = 0; i < results.size(); i++)
2859
	        for (int i = 0; i < results.size(); i++)
2860
	        {
2860
	        {
Lines 2862-2868 Link Here
2862
	        }
2862
	        }
2863
	    }
2863
	    }
2864
	}
2864
	}
2865
	
2865
2866
	/**
2866
	/**
2867
	 * Notify a specific listener of a change to a remote resource such as a file.
2867
	 * Notify a specific listener of a change to a remote resource such as a file.
2868
	 */
2868
	 */
Lines 2874-2885 Link Here
2874
		else {
2874
		else {
2875
			runOnMainThread(new RemoteResourceChangedRunnable(event, l));
2875
			runOnMainThread(new RemoteResourceChangedRunnable(event, l));
2876
		}
2876
		}
2877
			
2877
2878
	}
2878
	}
2879
2879
2880
	// ----------------------------
2880
	// ----------------------------
2881
	// PREFERENCE EVENT METHODS...
2881
	// PREFERENCE EVENT METHODS...
2882
	// ----------------------------            
2882
	// ----------------------------
2883
2883
2884
	/**
2884
	/**
2885
	 * Register your interest in being told when a system preference changes
2885
	 * Register your interest in being told when a system preference changes
Lines 2909-2915 Link Here
2909
		}
2909
		}
2910
	}
2910
	}
2911
	/**
2911
	/**
2912
	 * Notify a specific listener of a change to a system preference 
2912
	 * Notify a specific listener of a change to a system preference
2913
	 */
2913
	 */
2914
	public void fireEvent(ISystemPreferenceChangeListener l, ISystemPreferenceChangeEvent event)
2914
	public void fireEvent(ISystemPreferenceChangeListener l, ISystemPreferenceChangeEvent event)
2915
	{
2915
	{
Lines 2957-2966 Link Here
2957
2957
2958
	// ----------------------------
2958
	// ----------------------------
2959
	// SAVE / RESTORE METHODS...
2959
	// SAVE / RESTORE METHODS...
2960
	// ----------------------------            
2960
	// ----------------------------
2961
2961
2962
	/**
2962
	/**
2963
	 * Save everything! 
2963
	 * Save everything!
2964
	 */
2964
	 */
2965
	public boolean save()
2965
	public boolean save()
2966
	{
2966
	{
Lines 3035-3041 Link Here
3035
	// ----------------------------------
3035
	// ----------------------------------
3036
	// SYSTEMVIEWINPUTPROVIDER METHODS...
3036
	// SYSTEMVIEWINPUTPROVIDER METHODS...
3037
	// ----------------------------------
3037
	// ----------------------------------
3038
	
3038
3039
	/**
3039
	/**
3040
	 * Return the child objects to constitute the root elements in the system view tree.
3040
	 * Return the child objects to constitute the root elements in the system view tree.
3041
	 * We return all connections that have an enabled system type.
3041
	 * We return all connections that have an enabled system type.
Lines 3044-3055 Link Here
3044
	{
3044
	{
3045
		//DKM - only return enabled connections now
3045
		//DKM - only return enabled connections now
3046
		IHost[] connections = getHosts();
3046
		IHost[] connections = getHosts();
3047
		List result = new ArrayList(); 
3047
		List result = new ArrayList();
3048
		for (int i = 0; i < connections.length; i++) {
3048
		for (int i = 0; i < connections.length; i++) {
3049
			IHost con = connections[i];
3049
			IHost con = connections[i];
3050
			IRSESystemType sysType = con.getSystemType();
3050
			IRSESystemType sysType = con.getSystemType();
3051
			// sysType can be null if workspace contains a host that is no longer defined by the workbench
3051
			// sysType can be null if workspace contains a host that is no longer defined by the workbench
3052
			if (sysType != null && sysType.isEnabled()) { 
3052
			if (sysType != null && sysType.isEnabled()) {
3053
				// Note: System types without registered subsystems get disabled by the default
3053
				// Note: System types without registered subsystems get disabled by the default
3054
				// AbstractRSESystemType implementation itself! There is no need to re-check this here again.
3054
				// AbstractRSESystemType implementation itself! There is no need to re-check this here again.
3055
				result.add(con);
3055
				result.add(con);
Lines 3057-3063 Link Here
3057
		}
3057
		}
3058
		return result.toArray();
3058
		return result.toArray();
3059
	}
3059
	}
3060
	
3060
3061
	/**
3061
	/**
3062
	 * Return true if {@link #getSystemViewRoots()} will return a non-empty list
3062
	 * Return true if {@link #getSystemViewRoots()} will return a non-empty list
3063
	 * We return true if there are any connections for any active profile.
3063
	 * We return true if there are any connections for any active profile.
Lines 3084-3090 Link Here
3084
	{
3084
	{
3085
		this.viewer = viewer;
3085
		this.viewer = viewer;
3086
	}
3086
	}
3087
	
3087
3088
	/*
3088
	/*
3089
	 * (non-Javadoc)
3089
	 * (non-Javadoc)
3090
	 * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#getViewer()
3090
	 * @see org.eclipse.rse.ui.view.ISystemViewInputProvider#getViewer()

Return to bug 228774