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: - *
+ * This method is called after restore and for each restored object in the list must: + *