From 726c8abe7070b6c595dc806338a25477fef517ed Mon Sep 17 00:00:00 2001 From: David Dykstal Date: Wed, 28 Jun 2006 03:16:48 +0000 Subject: [PATCH] bug 148808 - local subsystems do not work on linux/gtk --- .../dstore/DStoreConnectorService.java | 18 +- .../ssh/SshConnectorService.java | 3 +- .../org/eclipse/rse/core/RSECorePlugin.java | 37 ++ .../UI/org/eclipse/rse/ui/RSEUIPlugin.java | 59 +-- .../RemoteSystemsPreferencePage.java | 3 +- ...mNewConnectionWizardRenameProfilePage.java | 12 +- .../ISystemFilterPoolReferenceManager.java | 391 ++++++++++-------- .../internal/filters/SystemFilterPool.java | 4 - .../filters/SystemFilterPoolReference.java | 39 +- .../SystemFilterPoolReferenceManager.java | 88 ++-- .../rse/internal/model/SystemHostPool.java | 2 +- .../rse/internal/model/SystemProfile.java | 94 ++--- .../internal/model/SystemProfileManager.java | 79 ++-- .../persistence/RSEPersistenceManager.java | 2 +- .../persistence/dom/RSEDOMImporter.java | 48 ++- .../SystemPersistableReferencingObject.java | 144 ++----- .../references/SystemReferencingObject.java | 6 +- .../subsystems/SubSystemConfiguration.java | 2 +- 18 files changed, 491 insertions(+), 540 deletions(-) diff --git a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java index f64f0127eb4..586d8e53c1a 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.dstore/src/org/eclipse/rse/connectorservice/dstore/DStoreConnectorService.java @@ -22,9 +22,8 @@ import java.security.cert.X509Certificate; import java.util.List; import java.util.Vector; +import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.IProgressMonitor; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.PluginVersionIdentifier; import org.eclipse.dstore.core.client.ClientConnection; import org.eclipse.dstore.core.client.ClientSSLProperties; import org.eclipse.dstore.core.client.ConnectionStatus; @@ -36,13 +35,13 @@ import org.eclipse.dstore.core.model.DataStore; import org.eclipse.dstore.core.model.IDataStoreConstants; import org.eclipse.dstore.core.model.IDataStoreProvider; import org.eclipse.dstore.core.model.ISSLProperties; -import org.eclipse.dstore.core.server.ServerLauncher; import org.eclipse.jface.dialogs.IDialogConstants; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.rse.connectorservice.dstore.util.ConnectionStatusListener; import org.eclipse.rse.connectorservice.dstore.util.StatusMonitor; import org.eclipse.rse.connectorservice.dstore.util.StatusMonitorFactory; import org.eclipse.rse.core.IRSESystemType; +import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.SystemBasePlugin; import org.eclipse.rse.core.comm.ISystemKeystoreProvider; import org.eclipse.rse.core.comm.SystemKeystoreProviderManager; @@ -69,6 +68,7 @@ import org.eclipse.rse.ui.messages.SystemMessageDialog; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.osgi.framework.Bundle; +import org.osgi.framework.Version; /** * System class required by the remote systems framework. * This represents the live connection at tool runtime. @@ -271,7 +271,7 @@ public class DStoreConnectorService extends AbstractConnectorService implements // fall back to getting local machine ip address // this may be incorrect for the server in certain cases // like over VPN - return RSEUIPlugin.getLocalMachineIPAddress(); + return RSECorePlugin.getLocalMachineIPAddress(); } /** @@ -355,12 +355,12 @@ public class DStoreConnectorService extends AbstractConnectorService implements try { - String path = Platform.resolve(pluginsURL).getPath(); + String path = FileLocator.resolve(pluginsURL).getPath(); File systemsPluginDir = new File(path); path = systemsPluginDir.getParentFile().getAbsolutePath(); String version = (String)(bundle.getHeaders().get(org.osgi.framework.Constants.BUNDLE_VERSION)); - String versionString = (new PluginVersionIdentifier(version)).toString(); - + Version v = new Version(version); + String versionString = v.toString(); String dstorePath = getDStorePath(path, versionString); System.setProperty("A_PLUGIN_PATH", dstorePath); } @@ -759,7 +759,7 @@ public class DStoreConnectorService extends AbstractConnectorService implements { //dataStore.showTicket(launchStatus.getTicket()); // send security token to server, this must be done first DataElement ticket = dataStore.createTicket(launchStatus.getTicket()); - DataElement ticketStatus = dataStore.queryShowTicket(ticket); + dataStore.queryShowTicket(ticket); //statusMonitor.waitForUpdate(ticketStatus); } else @@ -834,7 +834,7 @@ public class DStoreConnectorService extends AbstractConnectorService implements { if (launchStatus.isSLLProblem()) { - Throwable exception = launchStatus.getException(); + launchStatus.getException(); List certs = launchStatus.getUntrustedCertificates(); if (certs.size() > 0) diff --git a/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/connectorservice/ssh/SshConnectorService.java b/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/connectorservice/ssh/SshConnectorService.java index df56a361ee2..4fe343fc34d 100644 --- a/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/connectorservice/ssh/SshConnectorService.java +++ b/rse/plugins/org.eclipse.rse.connectorservice.ssh/src/org/eclipse/rse/connectorservice/ssh/SshConnectorService.java @@ -27,6 +27,7 @@ import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.operation.IRunnableContext; import org.eclipse.jface.operation.IRunnableWithProgress; import org.eclipse.jface.preference.IPreferenceStore; +import org.eclipse.jface.window.Window; import org.eclipse.rse.core.SystemBasePlugin; import org.eclipse.rse.core.subsystems.AbstractConnectorService; import org.eclipse.rse.core.subsystems.CommunicationsEvent; @@ -579,7 +580,7 @@ public class SshConnectorService extends AbstractConnectorService implements ISs UserValidationDialog uvd = new UserValidationDialog(null, null, fUser, message); uvd.setUsernameMutable(false); - if (uvd.open() == uvd.OK) { + if (uvd.open() == Window.OK) { retval[0] = uvd.getPassword(); } else { retval[0] = null; diff --git a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java index c6691bd5ad8..338670e7d38 100644 --- a/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java +++ b/rse/plugins/org.eclipse.rse.core/src/org/eclipse/rse/core/RSECorePlugin.java @@ -15,7 +15,12 @@ ********************************************************************************/ package org.eclipse.rse.core; +import java.net.InetAddress; +import java.net.UnknownHostException; + +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Plugin; +import org.eclipse.core.runtime.Status; import org.eclipse.rse.core.internal.RSECoreRegistry; import org.osgi.framework.BundleContext; @@ -27,6 +32,32 @@ public class RSECorePlugin extends Plugin { // the shared instance private static RSECorePlugin plugin; + /** + * @return the local machine name + */ + public static String getLocalMachineName() { + String machineName = null; + try { + machineName = InetAddress.getLocalHost().getHostName(); + } catch (UnknownHostException e) { + getDefault().log(e); + } + return machineName; + } + + /** + * @return the local IP address + */ + public static String getLocalMachineIPAddress() { + String machineAddress = null; + try { + machineAddress = InetAddress.getLocalHost().getHostAddress(); + } catch (UnknownHostException e) { + getDefault().log(e); + } + return machineAddress; + } + /** * The constructor. */ @@ -65,4 +96,10 @@ public class RSECorePlugin extends Plugin { public IRSECoreRegistry getRegistry() { return RSECoreRegistry.getDefault(); } + + private void log(Throwable t) { + String pluginId = this.getBundle().getSymbolicName(); + IStatus status = new Status(IStatus.ERROR, pluginId, 0, "Unexpected Exception", t); + getLog().log(status); + } } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java index 83501504a5d..bc74206a2bf 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/RSEUIPlugin.java @@ -29,6 +29,7 @@ import org.eclipse.core.runtime.Platform; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.ISystemViewSupplier; +import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.SystemBasePlugin; import org.eclipse.rse.core.SystemPropertyPageExtension; import org.eclipse.rse.core.SystemResourceManager; @@ -41,6 +42,7 @@ import org.eclipse.rse.core.subsystems.ISubSystemConfigurationProxy; import org.eclipse.rse.internal.model.SystemProfileManager; import org.eclipse.rse.internal.model.SystemRegistry; import org.eclipse.rse.internal.persistence.RSEPersistenceManager; +import org.eclipse.rse.model.ISystemProfile; import org.eclipse.rse.model.ISystemProfileManager; import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.model.ISystemResourceChangeEvents; @@ -89,8 +91,6 @@ public class RSEUIPlugin extends SystemBasePlugin private ISubSystemConfigurationProxy[] subsystemFactories = null; - private static String machineName = null; - private static String machineIP = null; private Vector viewSuppliers = new Vector(); private SystemViewAdapterFactory svaf; // for fastpath access private SystemTeamViewResourceAdapterFactory svraf; // for fastpath @@ -559,12 +559,13 @@ public class RSEUIPlugin extends SystemBasePlugin registerKeystoreProviders(); // if first time creating the remote systems project, add some default connections... - if (SystemResourceManager.isFirstTime() - && !dontShowLocalConnection) // new support to allow products to not pre-create a local connection - { +// if (SystemResourceManager.isFirstTime() +// && !dontShowLocalConnection) // new support to allow products to not pre-create a local connection +// { //try //{ - registry.createLocalHost(null, SystemResources.TERM_LOCAL, getLocalMachineName()); // profile, name, userId + +// registry.createLocalHost(null, SystemResources.TERM_LOCAL, SystemProfileManager.getSystemProfileManager().getDefaultPrivateSystemProfileName()); // profile, name, userId /* replaced with re-usable method by Phil, in v5.1.2 SystemConnection localConn = registry.createConnection( //SystemResourceConstants.RESOURCE_TEAMPROFILE_NAME, IRSESystemType.SYSTEMTYPE_LOCAL, @@ -582,6 +583,13 @@ public class RSEUIPlugin extends SystemBasePlugin //{ //logError("Error creating default Local connection", exc); //} +// } + // new support to allow products to not pre-create a local connection + if (SystemResourceManager.isFirstTime() && !dontShowLocalConnection) { + ISystemProfileManager profileManager = SystemProfileManager.getSystemProfileManager(); + ISystemProfile profile = profileManager.getDefaultPrivateSystemProfile(); + String userName = System.getProperty("user.name"); + registry.createLocalHost(profile, SystemResources.TERM_LOCAL, userName); } } @@ -1429,45 +1437,6 @@ public class RSEUIPlugin extends SystemBasePlugin return msg; } - /** - * Return the local user's machine name - */ - public static String getLocalMachineName() - { - if (machineName == null) - { - try - { - //InetAddress ip = InetAddress.getByName("localhost"); - machineName = InetAddress.getLocalHost().getHostName(); - }catch(Exception exc) - { - machineName = ""; // ? what else ? no point in trying again. - logWarning("Exception getting local hostname: " + exc.getClass().getName() + ": " + exc.getMessage()); - } - } - return machineName; - } - /** - * Return the local user's IP address - */ - public static String getLocalMachineIPAddress() - { - if (machineIP == null) - { - try - { - //InetAddress ip = InetAddress.getByName("localhost"); - machineIP = InetAddress.getLocalHost().getHostAddress(); - }catch(Exception exc) - { - machineIP = ""; // ? what else ? no point in trying again. - logWarning("Exception getting local hostname: " + exc.getClass().getName() + ": " + exc.getMessage()); - } - } - return machineIP; - } - /** * Register a view supplier so we can ask them to participate in team synchs */ diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/RemoteSystemsPreferencePage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/RemoteSystemsPreferencePage.java index b0875865226..b64181f54c1 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/RemoteSystemsPreferencePage.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/propertypages/RemoteSystemsPreferencePage.java @@ -26,6 +26,7 @@ import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.internal.model.SystemPreferenceChangeEvent; +import org.eclipse.rse.internal.model.SystemProfileManager; import org.eclipse.rse.model.ISystemPreferenceChangeEvents; import org.eclipse.rse.ui.ISystemPreferencesConstants; import org.eclipse.rse.ui.Mnemonics; @@ -590,7 +591,7 @@ public class RemoteSystemsPreferencePage store.setDefault(ISystemPreferencesConstants.SHOWFILTERPOOLS, ISystemPreferencesConstants.DEFAULT_SHOWFILTERPOOLS); String defaultProfileNames = ISystemPreferencesConstants.DEFAULT_ACTIVEUSERPROFILES; - String userProfileName = RSEUIPlugin.getLocalMachineName(); + String userProfileName = SystemProfileManager.getDefaultPrivateSystemProfileName(); defaultProfileNames += ";" + userProfileName; diff --git a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewConnectionWizardRenameProfilePage.java b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewConnectionWizardRenameProfilePage.java index db0023aaa49..a9b0741a152 100644 --- a/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewConnectionWizardRenameProfilePage.java +++ b/rse/plugins/org.eclipse.rse.ui/UI/org/eclipse/rse/ui/wizards/SystemNewConnectionWizardRenameProfilePage.java @@ -16,6 +16,8 @@ package org.eclipse.rse.ui.wizards; import org.eclipse.jface.wizard.Wizard; +import org.eclipse.rse.core.RSECorePlugin; +import org.eclipse.rse.internal.model.SystemProfileManager; import org.eclipse.rse.ui.ISystemMessages; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemProfileForm; @@ -82,16 +84,8 @@ public class SystemNewConnectionWizardRenameProfilePage { Control c = form.createContents(parent); form.getInitialFocusControl().setFocus(); - - String initProfileName = RSEUIPlugin.getLocalMachineName(); - int dotIndex = initProfileName.indexOf('.'); - - if (dotIndex != -1) { - initProfileName = initProfileName.substring(0, dotIndex); - } - + String initProfileName = SystemProfileManager.getDefaultPrivateSystemProfileName(); form.setProfileName(initProfileName); - return c; } /** diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolReferenceManager.java b/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolReferenceManager.java index b0e01a8277f..21d8714e75b 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolReferenceManager.java +++ b/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/filters/ISystemFilterPoolReferenceManager.java @@ -15,13 +15,13 @@ ********************************************************************************/ package org.eclipse.rse.filters; + import java.util.Vector; import org.eclipse.core.resources.IFolder; import org.eclipse.rse.core.subsystems.ISubSystem; import org.eclipse.rse.references.ISystemBasePersistableReferenceManager; - /** * This class manages a persistable list of objects each of which reference * a filter pool. This class builds on the parent class SystemPersistableReferenceManager, @@ -31,238 +31,267 @@ import org.eclipse.rse.references.ISystemBasePersistableReferenceManager; /** * @lastgen interface SystemFilterPoolReferenceManager extends SystemPersistableReferenceManager {} */ -public interface ISystemFilterPoolReferenceManager extends ISystemBasePersistableReferenceManager -{ - /** - * Get the object which instantiated this instance of the filter pool reference manager. - * This is also available from any filter reference framework object. - */ - public ISystemFilterPoolReferenceManagerProvider getProvider(); - /** - * Set the object which instantiated this instance of the filter pool reference manager. - * This makes it available to retrieve from any filter reference framework object, - * via the ubiquitous getProvider interface method. - */ - public void setProvider(ISystemFilterPoolReferenceManagerProvider caller); - /** - * Turn off callbacks to the provider until turned on again. - */ - public void setProviderEventNotification(boolean fireEvents); - // ------------------------------------------------------------ - // Methods for setting and querying related filterpool manager - // ------------------------------------------------------------ - /* - * Set the managers of the master list of filter pools, from which - * objects in this list reference. - * NOW DELETED SO THAT WE DYNAMICALLY QUERY THIS LIST FROM THE - * ASSOCIATED SYSTEMFILTERPOOLMANAGER PROVIDER, SO IT IS ALWAYS UP - * TO DATE. psc. - */ - //public void setSystemFilterPoolManagers(SystemFilterPoolManager[] mgrs); - /** - * Set the associated master pool manager provider. Note the provider - * typically manages multiple pool managers and we manage references - * across those. - */ - public void setSystemFilterPoolManagerProvider(ISystemFilterPoolManagerProvider poolMgrProvider); - /** - * Get the associated master pool manager provider. Note the provider - * typically manages multiple pool managers and we manage references - * across those. - */ - public ISystemFilterPoolManagerProvider getSystemFilterPoolManagerProvider(); - /** - * Get the managers of the master list of filter pools, from which - * objects in this list reference. - */ - public ISystemFilterPoolManager[] getSystemFilterPoolManagers(); - /** - * Get the managers of the master list of filter pools, from which - * objects in this list reference, but which are not in the list of - * managers our pool manager supplier gives us. That is, these are - * references to filter pools outside the expected list. - * @return null if no unmatched managers found, else an array of such managers. - */ - public ISystemFilterPoolManager[] getAdditionalSystemFilterPoolManagers(); - /** - * Set the default manager of the master list of filter pools, from which - * objects in this list reference. - */ - public void setDefaultSystemFilterPoolManager(ISystemFilterPoolManager mgr); - /** - * Get the default manager of the master list of filter pools, from which - * objects in this list reference. - */ - public ISystemFilterPoolManager getDefaultSystemFilterPoolManager(); - - // --------------------------------------------------- - // Methods that work on FilterPool referencing objects - // --------------------------------------------------- - /** - * Ask each referenced pool for its name, and update it. - * Called after the name of the pool or its manager changes. - */ - public void regenerateReferencedSystemFilterPoolNames(); - /** +public interface ISystemFilterPoolReferenceManager extends ISystemBasePersistableReferenceManager { + /** + * Get the object which instantiated this instance of the filter pool reference manager. + * This is also available from any filter reference framework object. + */ + public ISystemFilterPoolReferenceManagerProvider getProvider(); + + /** + * Set the object which instantiated this instance of the filter pool reference manager. + * This makes it available to retrieve from any filter reference framework object, + * via the ubiquitous getProvider interface method. + */ + public void setProvider(ISystemFilterPoolReferenceManagerProvider caller); + + /** + * Turn off callbacks to the provider until turned on again. + */ + public void setProviderEventNotification(boolean fireEvents); + + // ------------------------------------------------------------ + // Methods for setting and querying related filterpool manager + // ------------------------------------------------------------ + /* + * Set the managers of the master list of filter pools, from which + * objects in this list reference. + * NOW DELETED SO THAT WE DYNAMICALLY QUERY THIS LIST FROM THE + * ASSOCIATED SYSTEMFILTERPOOLMANAGER PROVIDER, SO IT IS ALWAYS UP + * TO DATE. psc. + */ + //public void setSystemFilterPoolManagers(SystemFilterPoolManager[] mgrs); + /** + * Set the associated master pool manager provider. Note the provider + * typically manages multiple pool managers and we manage references + * across those. + */ + public void setSystemFilterPoolManagerProvider(ISystemFilterPoolManagerProvider poolMgrProvider); + + /** + * Get the associated master pool manager provider. Note the provider + * typically manages multiple pool managers and we manage references + * across those. + */ + public ISystemFilterPoolManagerProvider getSystemFilterPoolManagerProvider(); + + /** + * Get the managers of the master list of filter pools, from which + * objects in this list reference. + */ + public ISystemFilterPoolManager[] getSystemFilterPoolManagers(); + + /** + * Get the managers of the master list of filter pools, from which + * objects in this list reference, but which are not in the list of + * managers our pool manager supplier gives us. That is, these are + * references to filter pools outside the expected list. + * @return null if no unmatched managers found, else an array of such managers. + */ + public ISystemFilterPoolManager[] getAdditionalSystemFilterPoolManagers(); + + /** + * Set the default manager of the master list of filter pools, from which + * objects in this list reference. + */ + public void setDefaultSystemFilterPoolManager(ISystemFilterPoolManager mgr); + + /** + * Get the default manager of the master list of filter pools, from which + * objects in this list reference. + */ + public ISystemFilterPoolManager getDefaultSystemFilterPoolManager(); + + // --------------------------------------------------- + // Methods that work on FilterPool referencing objects + // --------------------------------------------------- + /** + * Ask each referenced pool for its name, and update it. + * Called after the name of the pool or its manager changes. + */ + public void regenerateReferencedSystemFilterPoolNames(); + + /** * Return array of SystemFilterPoolReference objects. * Result will never be null, although it may be an array of length zero. */ public ISystemFilterPoolReference[] getSystemFilterPoolReferences(); + /** * In one shot, set the filter pool references - *

Calls back to inform provider + *

Calls back to inform provider * @param array of filter pool reference objects to set the list to. - * @param deReference true to first de-reference all objects in the existing list. + * @param deReference true to first de-reference all objects in the existing list. */ - public void setSystemFilterPoolReferences(ISystemFilterPoolReference[] filterPoolReferences, - boolean deReference); - /** - * Create a filter pool referencing object, but do NOT add it to the list, do NOT call back. - */ - public ISystemFilterPoolReference createSystemFilterPoolReference(ISystemFilterPool filterPool); + public void setSystemFilterPoolReferences(ISystemFilterPoolReference[] filterPoolReferences, boolean deReference); + /** * Add a filter pool referencing object to the list. * @return the new count of referencing objects */ public int addSystemFilterPoolReference(ISystemFilterPoolReference filterPoolReference); + /** * Reset the filter pool a reference points to. Called on a move-filter-pool operation */ public void resetSystemFilterPoolReference(ISystemFilterPoolReference filterPoolReference, ISystemFilterPool newPool); + /** * Remove a filter pool referencing object from the list. * @param filterPool Reference the reference to remove * @param deReference true if we want to dereference the referenced object (call removeReference on it) * @return the new count of referencing objects */ - public int removeSystemFilterPoolReference(ISystemFilterPoolReference filterPoolReference, - boolean deReference); + public int removeSystemFilterPoolReference(ISystemFilterPoolReference filterPoolReference, boolean deReference); + /** * Return count of referenced filter pools */ public int getSystemFilterPoolReferenceCount(); - /** - * Return the zero-based position of a SystemFilterPoolReference object within this list - */ - public int getSystemFilterPoolReferencePosition(ISystemFilterPoolReference filterPoolRef); - /** - * Move a given filter pool reference to a given zero-based location - *

Calls back to inform provider - */ - public void moveSystemFilterPoolReference(ISystemFilterPoolReference filterPoolRef,int pos); - /** - * Move existing filter pool references a given number of positions. - * If the delta is negative, they are all moved up by the given amount. If - * positive, they are all moved down by the given amount.

- *

Calls back to inform provider - * @param filterPoolRefs Array of SystemFilterPoolReferences to move. - * @param newPosition new zero-based position for the filter pool references. - */ - public void moveSystemFilterPoolReferences(ISystemFilterPoolReference[] filterPoolRefs, int delta); - // ---------------------------------------------- - // Methods that work on FilterPool master objects - // ---------------------------------------------- - /** - * Return array of filter pools currently referenced by this manager + /** + * Return the zero-based position of a SystemFilterPoolReference object within this list + */ + public int getSystemFilterPoolReferencePosition(ISystemFilterPoolReference filterPoolRef); + + /** + * Move a given filter pool reference to a given zero-based location + *

Calls back to inform provider + */ + public void moveSystemFilterPoolReference(ISystemFilterPoolReference filterPoolRef, int pos); + + /** + * Move existing filter pool references a given number of positions. + * If the delta is negative, they are all moved up by the given amount. If + * positive, they are all moved down by the given amount.

+ *

Calls back to inform provider + * @param filterPoolRefs Array of SystemFilterPoolReferences to move. + * @param newPosition new zero-based position for the filter pool references. + */ + public void moveSystemFilterPoolReferences(ISystemFilterPoolReference[] filterPoolRefs, int delta); + + // ---------------------------------------------- + // Methods that work on FilterPool master objects + // ---------------------------------------------- + /** + * Return array of filter pools currently referenced by this manager * Result will never be null, although it may be an array of length zero. - */ - public ISystemFilterPool[] getReferencedSystemFilterPools(); + */ + public ISystemFilterPool[] getReferencedSystemFilterPools(); + /** * Return true if the given filter pool has a referencing object in this list. */ public boolean isSystemFilterPoolReferenced(ISystemFilterPool filterPool); + /** * Given a filter pool, locate the referencing object for it and return it. * @return the referencing object if found, else null */ public ISystemFilterPoolReference getReferenceToSystemFilterPool(ISystemFilterPool filterPool); + /** * Given a filter pool, create a referencing object and add it to the list. - *

Calls back to inform provider + *

Calls back to inform provider * @return new filter pool reference */ public ISystemFilterPoolReference addReferenceToSystemFilterPool(ISystemFilterPool filterPool); + /** + * Given a filter pool name, create a referencing object and add it to the list. + * This creates an unresolved reference to that filter pool. It will be resolved on first use. + *

Calls back to inform provider + * @param filterPoolManager the manager that can be used to resolve the reference. + * @param filterPoolName the name of the filter pool being referenced. + * @return new filter pool reference + */ + public ISystemFilterPoolReference addReferenceToSystemFilterPool(ISystemFilterPoolManager filterPoolManager, String filterPoolName); + /** * Given a filter pool, locate the referencing object for it and remove it from the list. - *

Calls back to inform provider + *

Calls back to inform provider * @return the new count of referencing objects */ public int removeReferenceToSystemFilterPool(ISystemFilterPool filterPool); - /** - * A reference filter pool has been renamed. Update our stored name... - *

Calls back to inform provider - */ - public void renameReferenceToSystemFilterPool(ISystemFilterPool pool); + + /** + * A reference filter pool has been renamed. Update our stored name... + *

Calls back to inform provider + */ + public void renameReferenceToSystemFilterPool(ISystemFilterPool pool); + /** * In one shot, set the filter pool references to new references to supplied filter pools. - *

Calls back to inform provider + *

Calls back to inform provider * @param array of filter pool objects to create references for - * @param deReference true to first de-reference all objects in the existing list. + * @param deReference true to first de-reference all objects in the existing list. */ - public void setSystemFilterPoolReferences(ISystemFilterPool[] filterPools, - boolean deReference); - // ------------------------- - // SPECIAL CASE METHODS - // ------------------------- - /** - * Create a single filter refererence to a given filter. Needed when a filter - * is added to a pool, and the GUI is not showing pools but rather all filters - * in all pool references. - */ - public ISystemFilterReference getSystemFilterReference(ISubSystem subSystem, ISystemFilter filter); - /** - * Concatenate all filter references from all filter pools we reference, into one - * big list. - */ - public ISystemFilterReference[] getSystemFilterReferences(ISubSystem subSystem); - /** - * Given a filter reference, return its position within this reference manager - * when you think of all filter references from all filter pool references as - * being concatenated - */ - public int getSystemFilterReferencePosition(ISystemFilterReference filterRef); - /** - * Given a filter, return its position within this reference manager - * when you think of all filter references from all filter pool references as - * being concatenated - */ - public int getSystemFilterReferencePosition(ISubSystem subSystem, ISystemFilter filter); - // ------------------------- - // SAVE / RESTORE METHODS... - // ------------------------- - /** - * After restoring this from disk, there is only the referenced object name, - * not the referenced object pointer, for each referencing object. - *

- * This method is called after restore and for each restored object in the list must: - *

    - *
  1. Do what is necessary to find the referenced object, and set the internal reference pointer. - *
  2. Call addReference(this) on that object so it can maintain it's in-memory list - * of all referencing objects. - *
  3. Set the important transient variables - *
- * @param relatedManagers the filter pool managers that hold filter pools we reference - * @param provider the host of this reference manager, so you can later call getProvider - * @return A Vector of SystemFilterPoolReferences that were not successfully resolved, or null if all - * were resolved. - */ - public Vector resolveReferencesAfterRestore(ISystemFilterPoolManagerProvider relatedPoolMgrProvider, - ISystemFilterPoolReferenceManagerProvider provider); - /** - * Save all the filter pool references to disk. - * Use only if not doing your own saving, else override or set save policy to none. - */ - public void save() - throws Exception; + public void setSystemFilterPoolReferences(ISystemFilterPool[] filterPools, boolean deReference); - /** - * Return the folder that this manager is contained in. - */ - public IFolder getFolder(); - /** - * Reset the folder that this manager is contained in. - */ - public void resetManagerFolder(IFolder newFolder); + // ------------------------- + // SPECIAL CASE METHODS + // ------------------------- + /** + * Create a single filter refererence to a given filter. Needed when a filter + * is added to a pool, and the GUI is not showing pools but rather all filters + * in all pool references. + */ + public ISystemFilterReference getSystemFilterReference(ISubSystem subSystem, ISystemFilter filter); + + /** + * Concatenate all filter references from all filter pools we reference, into one + * big list. + */ + public ISystemFilterReference[] getSystemFilterReferences(ISubSystem subSystem); + + /** + * Given a filter reference, return its position within this reference manager + * when you think of all filter references from all filter pool references as + * being concatenated + */ + public int getSystemFilterReferencePosition(ISystemFilterReference filterRef); + + /** + * Given a filter, return its position within this reference manager + * when you think of all filter references from all filter pool references as + * being concatenated + */ + public int getSystemFilterReferencePosition(ISubSystem subSystem, ISystemFilter filter); + + // ------------------------- + // SAVE / RESTORE METHODS... + // ------------------------- + /** + * After restoring this from disk, there is only the referenced object name, + * not the referenced object pointer, for each referencing object. + *

+ * This method is called after restore and for each restored object in the list must: + *

    + *
  1. Do what is necessary to find the referenced object, and set the internal reference pointer. + *
  2. Call addReference(this) on that object so it can maintain it's in-memory list + * of all referencing objects. + *
  3. Set the important transient variables + *
+ * @param relatedManagers the filter pool managers that hold filter pools we reference + * @param provider the host of this reference manager, so you can later call getProvider + * @return A Vector of SystemFilterPoolReferences that were not successfully resolved, or null if all + * were resolved. + */ + public Vector resolveReferencesAfterRestore(ISystemFilterPoolManagerProvider relatedPoolMgrProvider, ISystemFilterPoolReferenceManagerProvider provider); + + /** + * Save all the filter pool references to disk. + * Use only if not doing your own saving, else override or set save policy to none. + */ + public void save() throws Exception; + + /** + * Return the folder that this manager is contained in. + */ + public IFolder getFolder(); + + /** + * Reset the folder that this manager is contained in. + */ + public void resetManagerFolder(IFolder newFolder); } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/internal/filters/SystemFilterPool.java b/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/internal/filters/SystemFilterPool.java index 25d32ae8a96..7a32f52e02c 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/internal/filters/SystemFilterPool.java +++ b/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/internal/filters/SystemFilterPool.java @@ -608,10 +608,6 @@ public class SystemFilterPool extends SystemPersistableReferencedObject */ public boolean isDefault() { - if (!default_) - { - default_ = (getType().equals(DEFAULT_TYPE)); - } return default_; } diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/internal/filters/SystemFilterPoolReference.java b/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/internal/filters/SystemFilterPoolReference.java index 7f3b9334f65..119d12c82be 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/internal/filters/SystemFilterPoolReference.java +++ b/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/internal/filters/SystemFilterPoolReference.java @@ -23,6 +23,7 @@ import org.eclipse.rse.filters.ISystemFilter; import org.eclipse.rse.filters.ISystemFilterContainer; import org.eclipse.rse.filters.ISystemFilterContainerReference; import org.eclipse.rse.filters.ISystemFilterPool; +import org.eclipse.rse.filters.ISystemFilterPoolManager; import org.eclipse.rse.filters.ISystemFilterPoolReference; import org.eclipse.rse.filters.ISystemFilterPoolReferenceManager; import org.eclipse.rse.filters.ISystemFilterPoolReferenceManagerProvider; @@ -31,23 +32,43 @@ import org.eclipse.rse.internal.references.SystemPersistableReferencingObject; import org.eclipse.rse.references.ISystemPersistableReferencedObject; /** - * A shadow object of a master filter pool - */ -/** - * @lastgen class SystemFilterPoolReferenceImpl extends SystemPersistableReferencingObjectImpl implements SystemFilterPoolReference, SystemFilterContainerReference, IAdaptable {} + * A reference to a filter pool. A reference may be "resolved" or "unresolved". */ public class SystemFilterPoolReference extends SystemPersistableReferencingObject implements ISystemFilterPoolReference, ISystemFilterContainerReference, IAdaptable { + private SystemFilterContainerReferenceCommonMethods containerHelper = null; + private ISystemFilterPoolManager filterPoolManager = null; protected static final String DELIMITER = "___"; protected static final int DELIMITER_LENGTH = 3; /** - * Default constructor. Typically called by MOF factory method. + * Default constructor. */ - protected SystemFilterPoolReference() { + private SystemFilterPoolReference() { super(); containerHelper = new SystemFilterContainerReferenceCommonMethods(this); } + + /** + * Constructs a new resolved filter pool reference. + * @param filterPool The filter pool that this filter will refer to. + */ + public SystemFilterPoolReference(ISystemFilterPool filterPool) { + this(); + setReferenceToFilterPool(filterPool); + } + + /** + * Constructs a new filter pool reference. This is an unresolved reference. + * It is resolved on first use by using the supplied filterPoolManager. + * @param filterPoolManager the manager used to resolve the reference. + * @param filterPoolName the name of the filter pool. + */ + public SystemFilterPoolReference(ISystemFilterPoolManager filterPoolManager, String filterPoolName) { + this(); + this.filterPoolManager = filterPoolManager; + setReferencedObjectName(filterPoolName); + } /** * Return the reference manager which is managing this filter reference @@ -82,7 +103,7 @@ public class SystemFilterPoolReference extends SystemPersistableReferencingObjec /** * Return name of the filter pool we reference * The name is stored qualified by the manager name, - * so we first have to strip that off. + * so we first have to strip that off. */ public String getReferencedFilterPoolName() { String savedName = super.getReferencedObjectName(); @@ -134,7 +155,9 @@ public class SystemFilterPoolReference extends SystemPersistableReferencingObjec public ISystemFilterPool getReferencedFilterPool() { ISystemFilterPool filterPool = (ISystemFilterPool) getReferencedObject(); if (filterPool == null) { - + String filterPoolName = getReferencedFilterPoolName(); + filterPool = filterPoolManager.getSystemFilterPool(filterPoolName); + setReferenceToFilterPool(filterPool); } return filterPool; } diff --git a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/internal/filters/SystemFilterPoolReferenceManager.java b/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/internal/filters/SystemFilterPoolReferenceManager.java index 1905200ed8e..95f92abbddd 100644 --- a/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/internal/filters/SystemFilterPoolReferenceManager.java +++ b/rse/plugins/org.eclipse.rse.ui/filters/org/eclipse/rse/internal/filters/SystemFilterPoolReferenceManager.java @@ -49,19 +49,19 @@ import org.eclipse.rse.references.ISystemPersistableReferencedObject; public class SystemFilterPoolReferenceManager extends SystemPersistableReferenceManager implements ISystemFilterPoolReferenceManager { //private SystemFilterPoolManager[] poolMgrs = null; - private ISystemFilterPoolManagerProvider poolMgrProvider = null; - private ISystemFilterPoolManager defaultPoolMgr = null; + private ISystemFilterPoolManagerProvider poolMgrProvider = null; + private ISystemFilterPoolManager defaultPoolMgr = null; private ISystemFilterPoolReferenceManagerProvider caller = null; - private ISystemFilterNamingPolicy namingPolicy = null; - private int savePolicy = ISystemFilterSavePolicies.SAVE_POLICY_NONE; - private Object mgrData = null; - private IFolder mgrFolder = null; - private boolean initialized = false; - private boolean noSave; - private boolean noEvents; - private boolean fireEvents = true; - private ISystemFilterPoolReference[] fpRefsArray = null; - private static final ISystemFilterPoolReference[] emptyFilterPoolRefArray = new ISystemFilterPoolReference[0]; + private ISystemFilterNamingPolicy namingPolicy = null; + private int savePolicy = ISystemFilterSavePolicies.SAVE_POLICY_NONE; + private Object mgrData = null; + private IFolder mgrFolder = null; + private boolean initialized = false; + private boolean noSave; + private boolean noEvents; + private boolean fireEvents = true; + private ISystemFilterPoolReference[] fpRefsArray = null; + private static final ISystemFilterPoolReference[] emptyFilterPoolRefArray = new ISystemFilterPoolReference[0]; /** * Default constructor. Typically called by MOF factory methods. @@ -422,17 +422,28 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference } /** - * Create a filter pool referencing object, but do NOT add it to the list, do NOT call back. - */ - public ISystemFilterPoolReference createSystemFilterPoolReference(ISystemFilterPool filterPool) - { - ISystemFilterPoolReference filterPoolReference = new SystemFilterPoolReference(); - // FIXME SystemFilterImpl.initMOF().createSystemFilterPoolReference(); - invalidateFilterPoolReferencesCache(); - filterPoolReference.setReferencedObject((ISystemPersistableReferencedObject)filterPool); + * Create a filter pool reference. This creates a raw reference that must be added to the managed + * lists by the caller. + */ + private ISystemFilterPoolReference createSystemFilterPoolReference(ISystemFilterPool filterPool) { + ISystemFilterPoolReference filterPoolReference = new SystemFilterPoolReference(filterPool); + invalidateFilterPoolReferencesCache(); return filterPoolReference; - } - /** + } + + /** + * Create a filter pool reference. This creates an unresolved raw reference that + * must be added to the managed lists by the caller. + * That will be attempted to be resolved on first use. + */ + // DWD working + private ISystemFilterPoolReference createSystemFilterPoolReference(ISystemFilterPoolManager filterPoolManager, String filterPoolName) { + ISystemFilterPoolReference filterPoolReference = new SystemFilterPoolReference(filterPoolManager, filterPoolName); + invalidateFilterPoolReferencesCache(); + return filterPoolReference; + } + + /** * Add a filter pool referencing object to the list. * @return the new count of referencing objects */ @@ -444,6 +455,7 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference quietSave(); return count; } + /** * Reset the filter pool a reference points to. Called on a move-filter-pool operation */ @@ -575,22 +587,32 @@ public class SystemFilterPoolReferenceManager extends SystemPersistableReference return (ISystemFilterPoolReference)super.getReferencedObject(filterPool); } - /** - * Given a filter pool, create a referencing object and add it to the list. - * Also add that reference to the filterPool itself, and calls back to provider when done. - * @param filterPool what to reference - * @return the new reference object + /* (non-Javadoc) + * @see org.eclipse.rse.filters.ISystemFilterPoolReferenceManager#addReferenceToSystemFilterPool(org.eclipse.rse.filters.ISystemFilterPool) */ - public ISystemFilterPoolReference addReferenceToSystemFilterPool(ISystemFilterPool filterPool) - { + public ISystemFilterPoolReference addReferenceToSystemFilterPool(ISystemFilterPool filterPool) { ISystemFilterPoolReference filterPoolReference = createSystemFilterPoolReference(filterPool); - addReferencingObject(filterPoolReference); // DWD - should be done in addReferencingObject + addReferencingObject(filterPoolReference); // DWD - should be done in addReferencingObject? filterPoolReference.setParentReferenceManager(this); - invalidateFilterPoolReferencesCache(); + invalidateFilterPoolReferencesCache(); quietSave(); // callback to provider so they can fire events in their GUI - if (fireEvents && (caller != null)) - caller.filterEventFilterPoolReferenceCreated(filterPoolReference); + if (fireEvents && (caller != null)) caller.filterEventFilterPoolReferenceCreated(filterPoolReference); + return filterPoolReference; + } + + // DWD Working + /* (non-Javadoc) + * @see org.eclipse.rse.filters.ISystemFilterPoolReferenceManager#addReferenceToSystemFilterPool(org.eclipse.rse.filters.ISystemFilterPoolManager, java.lang.String) + */ + public ISystemFilterPoolReference addReferenceToSystemFilterPool(ISystemFilterPoolManager filterPoolManager, String filterPoolName) { + ISystemFilterPoolReference filterPoolReference = createSystemFilterPoolReference(filterPoolManager, filterPoolName); + addReferencingObject(filterPoolReference); // DWD - should be done in addReferencingObject? + filterPoolReference.setParentReferenceManager(this); + invalidateFilterPoolReferencesCache(); + quietSave(); + // callback to provider so they can fire events in their GUI + if (fireEvents && (caller != null)) caller.filterEventFilterPoolReferenceCreated(filterPoolReference); return filterPoolReference; } diff --git a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/internal/model/SystemHostPool.java b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/internal/model/SystemHostPool.java index 58380f1bd73..132093d9b42 100644 --- a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/internal/model/SystemHostPool.java +++ b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/internal/model/SystemHostPool.java @@ -208,7 +208,7 @@ public class SystemHostPool extends RSEModelObject implements ISystemHostPool addHost(conn); // only record internally if saved successfully conn.setHostPool(this); conn.setAliasName(aliasName); - // DWD if default userID is null, and location is in the connection we should retrieve it and use it as the initial value. + // if default userID is null, and location is in the connection we should retrieve it and use it as the initial value. if (defaultUserId == null && defaultUserIdLocation == ISystemUserIdConstants.USERID_LOCATION_CONNECTION) { defaultUserId = conn.getDefaultUserId(); } diff --git a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/internal/model/SystemProfile.java b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/internal/model/SystemProfile.java index cc59f92f3b2..e8ec01f9010 100644 --- a/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/internal/model/SystemProfile.java +++ b/rse/plugins/org.eclipse.rse.ui/model/org/eclipse/rse/internal/model/SystemProfile.java @@ -29,61 +29,26 @@ import org.eclipse.rse.model.ISystemRegistry; import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.SystemResources; - -//import java.lang.ClassCastException; - /** - * A profile represents a user or name which is used to key filter pools and - * connections by. + * A profile contains hosts and filter pools. It is the unit of save/restore for RSE model + * objects. All model objects are contained within a profile. */ - - public class SystemProfile extends RSEModelObject implements ISystemProfile, IAdaptable { - /** - * The default value of the '{@link #getName() Name}' attribute. - * - * - * @see #getName() - * @generated - * @ordered - */ - protected static final String NAME_EDEFAULT = null; - - private ISystemProfileManager mgr; private boolean active; - - - /** - * @generated This field/method will be replaced during code generation. - */ - /** - * @generated This field/method will be replaced during code generation. - */ - protected String name = NAME_EDEFAULT; - /** - * The default value of the '{@link #isDefaultPrivate() Default Private}' attribute. - * - * - * @see #isDefaultPrivate() - * @generated - * @ordered - */ - protected static final boolean DEFAULT_PRIVATE_EDEFAULT = false; + private String name = null; + private boolean defaultPrivate = false; /** - * @generated This field/method will be replaced during code generation. - */ - protected boolean defaultPrivate = DEFAULT_PRIVATE_EDEFAULT; - /** * Default constructor */ protected SystemProfile() { super(); } + /** * Set the in-memory pointer back to the parent system profile manager */ @@ -91,6 +56,7 @@ public class SystemProfile extends RSEModelObject implements ISystemProfile, IAd { this.mgr = mgr; } + /** * Get the in-memory pointer back to the parent system profile manager */ @@ -115,6 +81,7 @@ public class SystemProfile extends RSEModelObject implements ISystemProfile, IAd { return RSEUIPlugin.getTheSystemRegistry().getHostsByProfile(this); } + /** * Return all filter pools for this profile */ @@ -129,7 +96,6 @@ public class SystemProfile extends RSEModelObject implements ISystemProfile, IAd for (int ydx=0; ydx 0) { + name = name.substring(0, i); + } + } + if (name == null) { + name = System.getProperty("user.name"); + } + return name; } /** @@ -77,7 +85,7 @@ public class SystemProfileManager implements ISystemProfileManager */ public static void clearDefault() { - defaultInst = null; + singleton = null; } /** @@ -96,8 +104,7 @@ public class SystemProfileManager implements ISystemProfileManager ISystemProfile existingProfile = getSystemProfile(name); if (existingProfile != null) { - // replace the existing one with a new profile - deleteSystemProfile(existingProfile); + deleteSystemProfile(existingProfile); // replace the existing one with a new profile } ISystemProfile newProfile = internalCreateSystemProfileAndFolder(name); @@ -132,7 +139,7 @@ public class SystemProfileManager implements ISystemProfileManager // FIXME initMOF().createSystemProfile(); initialize(profile, name); - profile.setDefaultPrivate(name.equalsIgnoreCase("Private")); + profile.setDefaultPrivate(name.equalsIgnoreCase(getDefaultPrivateSystemProfileName())); //System.out.println("initializing new profile " + name + ", is default private? " + profile.isDefaultPrivate()); return profile; } @@ -143,7 +150,7 @@ public class SystemProfileManager implements ISystemProfileManager private ISystemProfile internalCreateSystemProfileAndFolder(String name) { ISystemProfile profile = internalCreateSystemProfile(name); - SystemResourceManager.getProfileFolder(profile); // creates proj/profileName folder +// SystemResourceManager.getProfileFolder(profile); // creates proj/profileName folder DWD This is where those pesky folders get created return profile; } @@ -183,14 +190,7 @@ public class SystemProfileManager implements ISystemProfileManager for (int idx=0; (!defaultProfileExist) && (idx + * @see org.eclipse.rse.references.ISystemPersistableReferencingObject */ -public abstract class SystemPersistableReferencingObject extends SystemReferencingObject implements ISystemPersistableReferencingObject -{ - /** - * The default value of the '{@link #getReferencedObjectName() Referenced Object Name}' attribute. - * - * - * @see #getReferencedObjectName() - * @generated - * @ordered - */ - protected static final String REFERENCED_OBJECT_NAME_EDEFAULT = null; +// DWD Change this name to SystemPersistableReference? Ditto for the interface. +public abstract class SystemPersistableReferencingObject extends SystemReferencingObject implements ISystemPersistableReferencingObject { + + protected String referencedObjectName = null; + protected ISystemBasePersistableReferenceManager _referenceManager; /** - * @generated This field/method will be replaced during code generation. + * Create a new referencing object. */ - protected String referencedObjectName = REFERENCED_OBJECT_NAME_EDEFAULT; - - // FIXME - protected ISystemBasePersistableReferenceManager _referenceManager; - - /** - * Constructor. Typically called by MOF framework via factory create method. - */ - protected SystemPersistableReferencingObject() - { + protected SystemPersistableReferencingObject() { super(); - helper = new SystemReferencingObjectHelper(this); } + /** - * Set the persistable referenced object name - * @generated This field/method will be replaced during code generation. - */ - public void setReferencedObjectName(String newReferencedObjectName) - { + * Set the persistable referenced object name + */ + public void setReferencedObjectName(String newReferencedObjectName) { referencedObjectName = newReferencedObjectName; } - // ---------------------------------------------- - // ISystemPersistableReferencingObject methods... - // ---------------------------------------------- /** - * Set the in-memory reference to the master object. - * This implementation also extracts that master object's name and calls - * setReferencedObjectName as part of this method call. + * Set the in-memory reference to the master object. + * This implementation also extracts that master object's name and calls + * setReferencedObjectName as part of this method call. * @see org.eclipse.rse.references.ISystemBasePersistableReferencingObject#setReferencedObject(ISystemBasePersistableReferencedObject) */ - public void setReferencedObject(ISystemBasePersistableReferencedObject obj) - { - helper.setReferencedObject((ISystemBaseReferencedObject)obj); - setReferencedObjectName(obj.getReferenceName()); + public void setReferencedObject(ISystemBasePersistableReferencedObject obj) { + getHelper().setReferencedObject((ISystemBaseReferencedObject) obj); + setReferencedObjectName(obj.getReferenceName()); } /** - * Get the persistable referenced object name. Handled by MOF generated code. - * @generated This field/method will be replaced during code generation + * Get the persistable referenced object name. */ - public String getReferencedObjectName() - { + public String getReferencedObjectName() { return referencedObjectName; } - // ---------------------------------------------- - // ISystemReferencingObject methods... - // ---------------------------------------------- - /** - * @see org.eclipse.rse.references.ISystemBaseReferencingObject#setReferencedObject(ISystemBaseReferencedObject) + * @return The reference manager for this reference. */ - public void setReferencedObject(ISystemBaseReferencedObject obj) - { - helper.setReferencedObject(obj); - } - - /** - * @see org.eclipse.rse.references.ISystemBaseReferencingObject#getReferencedObject() - */ - public ISystemBaseReferencedObject getReferencedObject() - { - return helper.getReferencedObject(); - } - - /** - * @see org.eclipse.rse.references.ISystemBaseReferencingObject#removeReference() - */ - public int removeReference() - { - return helper.removeReference(); - } - - /** - * @generated This field/method will be replaced during code generation - */ - public ISystemBasePersistableReferenceManager getParentReferenceManager() - { - /*FIXME - if (eContainerFeatureID != ReferencesPackage.SYSTEM_PERSISTABLE_REFERENCING_OBJECT__PARENT_REFERENCE_MANAGER) return null; - return (SystemPersistableReferenceManager)eContainer; - */ - if (_referenceManager == null) - { - //SystemFilterPoolReferenceManagerImpl.createSystemFilterPoolReferenceManager(caller, relatedPoolManagerProvider, mgrFolder, name, savePolicy, namingPolicy) - _referenceManager = new SystemFilterPoolReferenceManager(); - } + public ISystemBasePersistableReferenceManager getParentReferenceManager() { return _referenceManager; } /** - * @generated This field/method will be replaced during code generation. + * Sets the reference manager for this reference. Must be done when this reference is created. */ - public void setParentReferenceManager(ISystemBasePersistableReferenceManager newParentReferenceManager) - { - /*FIXME - if (newParentReferenceManager != eContainer || (eContainerFeatureID != ReferencesPackage.SYSTEM_PERSISTABLE_REFERENCING_OBJECT__PARENT_REFERENCE_MANAGER && newParentReferenceManager != null)) - { - if (EcoreUtil.isAncestor(this, newParentReferenceManager)) - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - NotificationChain msgs = null; - if (eContainer != null) - msgs = eBasicRemoveFromContainer(msgs); - if (newParentReferenceManager != null) - msgs = ((InternalEObject)newParentReferenceManager).eInverseAdd(this, ReferencesPackage.SYSTEM_PERSISTABLE_REFERENCE_MANAGER__REFERENCING_OBJECT_LIST, SystemPersistableReferenceManager.class, msgs); - msgs = eBasicSetContainer((InternalEObject)newParentReferenceManager, ReferencesPackage.SYSTEM_PERSISTABLE_REFERENCING_OBJECT__PARENT_REFERENCE_MANAGER, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, ReferencesPackage.SYSTEM_PERSISTABLE_REFERENCING_OBJECT__PARENT_REFERENCE_MANAGER, newParentReferenceManager, newParentReferenceManager)); - */ + public void setParentReferenceManager(ISystemBasePersistableReferenceManager newParentReferenceManager) { _referenceManager = newParentReferenceManager; - return; } - /** - * @generated This field/method will be replaced during code generation. + /* (non-Javadoc) + * @see java.lang.Object#toString() */ - public String toString() - { - - + public String toString() { StringBuffer result = new StringBuffer(super.toString()); result.append(" (referencedObjectName: "); result.append(referencedObjectName); diff --git a/rse/plugins/org.eclipse.rse.ui/references/org/eclipse/rse/internal/references/SystemReferencingObject.java b/rse/plugins/org.eclipse.rse.ui/references/org/eclipse/rse/internal/references/SystemReferencingObject.java index 4f026227106..15e60e7c853 100644 --- a/rse/plugins/org.eclipse.rse.ui/references/org/eclipse/rse/internal/references/SystemReferencingObject.java +++ b/rse/plugins/org.eclipse.rse.ui/references/org/eclipse/rse/internal/references/SystemReferencingObject.java @@ -37,7 +37,7 @@ import org.eclipse.rse.ui.SystemResources; */ public abstract class SystemReferencingObject extends RSEModelObject implements ISystemReferencingObject { - protected SystemReferencingObjectHelper helper = null; + private SystemReferencingObjectHelper helper = null; protected boolean referenceBroken = false; /** @@ -91,4 +91,8 @@ public abstract class SystemReferencingObject extends RSEModelObject implements { return SystemResources.RESID_MODELOBJECTS_REFERENCINGOBJECT_DESCRIPTION; } + + protected final SystemReferencingObjectHelper getHelper() { + return helper; + } } \ No newline at end of file diff --git a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java index 386ffb7dc5d..1ca92681da1 100644 --- a/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java +++ b/rse/plugins/org.eclipse.rse.ui/subsystems/org/eclipse/rse/core/subsystems/SubSystemConfiguration.java @@ -1891,7 +1891,7 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration getFilterPoolManagerName(profile), // the filter pool manager name supportsNestedFilters(), // whether or not nested filters are allowed ISystemFilterSavePolicies.SAVE_POLICY_ONE_FILE_PER_FILTER, filterNamingPolicy); - mgr.setSingleFilterStringOnly(!supportsMultipleFilterStrings()); + mgr.setSingleFilterStringOnly(!supportsMultipleFilterStrings()); // DWD was restored flag? } catch (Exception exc) {