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() |