1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 07:05:24 +02:00

[190231][api] Move ISubSystemPropertiesWizardPage from UI to Core

This commit is contained in:
Martin Oberhuber 2007-05-31 15:27:11 +00:00
parent 60fd92fdb1
commit 9af20ac231
4 changed files with 8 additions and 79 deletions

View file

@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2006 IBM Corporation. All rights reserved.
* Copyright (c) 2006, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
@ -11,12 +11,11 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* Martin Oberhuber (Wind River) - [190231] Moved from rse.ui.wizards to core.subsystems
********************************************************************************/
package org.eclipse.rse.ui.wizards;
package org.eclipse.rse.core.subsystems;
import org.eclipse.rse.core.subsystems.ISubSystem;
public interface ISubSystemPropertiesWizardPage
{

View file

@ -16,6 +16,7 @@
* Martin Oberhuber (Wind River) - [184095] Replace systemTypeName by IRSESystemType
* Martin Oberhuber (Wind River) - [186773] split ISystemRegistryUI from ISystemRegistry
* Javier Montalvo Orus (Symbian) - [188146] Incorrect "FTP Settings" node in Property Sheet for Linux connection
* Martin Oberhuber (Wind River) - [190231] Move ISubSystemPropertiesWizardPage from UI to Core
********************************************************************************/
package org.eclipse.rse.ui.wizards;
@ -37,6 +38,7 @@ import org.eclipse.rse.core.subsystems.IServiceSubSystem;
import org.eclipse.rse.core.subsystems.IServiceSubSystemConfiguration;
import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.core.subsystems.ISubSystemPropertiesWizardPage;
import org.eclipse.rse.ui.widgets.services.ConnectorServiceElement;
import org.eclipse.rse.ui.widgets.services.FactoryServiceElement;
import org.eclipse.rse.ui.widgets.services.PropertySetServiceElement;

View file

@ -1,5 +1,5 @@
/********************************************************************************
* Copyright (c) 2002, 2006 IBM Corporation. All rights reserved.
* Copyright (c) 2002, 2007 IBM Corporation and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License v1.0 which accompanies this distribution, and is
* available at http://www.eclipse.org/legal/epl-v10.html
@ -11,7 +11,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* Martin Oberhuber (Wind River) - [190231] Move ISubSystemPropertiesWizardPage from UI to Core
********************************************************************************/
package org.eclipse.rse.ui.wizards;
@ -21,6 +21,7 @@ import java.util.List;
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.core.subsystems.ISubSystemConfiguration;
import org.eclipse.rse.core.subsystems.ISubSystemPropertiesWizardPage;
import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.internal.ui.view.monitor.TabFolderLayout;
import org.eclipse.rse.ui.ISystemVerifyListener;

View file

@ -69,9 +69,7 @@ import org.eclipse.rse.ui.ISystemMessages;
import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.SystemBasePlugin;
import org.eclipse.rse.ui.SystemPreferencesManager;
import org.eclipse.rse.ui.filters.actions.SystemNewFilterAction;
import org.eclipse.rse.ui.messages.SystemMessageDialog;
import org.eclipse.rse.ui.wizards.ISubSystemPropertiesWizardPage;
/**
@ -1419,77 +1417,6 @@ public abstract class SubSystemConfiguration implements ISubSystemConfiguration
}
}
/**
* There is a reasonable amount of processing needed to configure filter wizards. To aid
* in performance and memory usage, we extract that processing into this method, and then
* use a callback contract with the filter wizard to call us back to do this processing
* only at the time the action is actually selected to be run.
* <p>
* The processing we do here is to specify the filter pools to prompt the user for, in the
* second page of the New Filter wizards.
* <p>
* This method is from the ISystemNewFilterActionConfigurator interface
*/
public void configureNewFilterAction(SystemNewFilterAction newFilterAction, Object callerData)
{
//System.out.println("Inside configureNewFilterAction! It worked!");
newFilterAction.setFromRSE(true);
boolean showFilterPools = showFilterPools();
// It does not make sense, when invoked from a filterPool, to ask the user
// for the parent filter pool, or to ask the user whether the filter is connection
// specific, as they user has explicitly chosen their pool...
//if (!showFilterPools || (callerData instanceof SubSystem))
if (!showFilterPools)
{
ISubSystem selectedSubSystem = (ISubSystem) callerData;
// When not showing filter pools, we need to distinquish between an advanced user and a new user.
// For a new user we simply want to ask them whether this filter is to be team sharable or private,
// and based on that, we will place the filter in the default filter pool for the appropriate profile.
// For an advanced user who has simply turned show filter pools back off, we want to let them choose
// explicitly which filter pool they want to place the filter in.
// To approximate the decision, we will define an advanced user as someone who already has a reference
// to a filter pool other than the default pools in the active profiles.
boolean advancedUser = false;
ISystemFilterPoolReferenceManager refMgr = selectedSubSystem.getSystemFilterPoolReferenceManager();
ISystemFilterPool[] refdPools = refMgr.getReferencedSystemFilterPools();
if (refdPools.length == 0)
SystemBasePlugin.logInfo("SubSystemConfigurationImpl::getSubSystemActions - getReferencedSystemFilterPools returned array of length zero."); //$NON-NLS-1$
// so there already exists references to more than one filter pool, but it might simply be a reference
// to the default filter pool in the user's profile and another to reference to the default filter pool in
// the team profile... let's see...
else if (refdPools.length > 1)
{
for (int idx = 0; !advancedUser && (idx < refdPools.length); idx++)
{
if (!refdPools[idx].isDefault() && (refdPools[idx].getOwningParentName()==null))
advancedUser = true;
}
}
if (advancedUser)
{
newFilterAction.setAllowFilterPoolSelection(refdPools); // show all pools referenced in this subsystem, and let them choose one
}
else
{
boolean anyAdded = false;
SystemFilterPoolWrapperInformation poolWrapperInfo = getNewFilterWizardPoolWrapperInformation();
ISystemProfile[] activeProfiles = RSECorePlugin.getTheSystemRegistry().getActiveSystemProfiles();
ISystemProfile activeProfile = selectedSubSystem.getHost().getSystemProfile();
for (int idx = 0; idx < activeProfiles.length; idx++)
{
ISystemFilterPool defaultPool = getDefaultSystemFilterPool(activeProfiles[idx]);
if (defaultPool != null)
{
poolWrapperInfo.addWrapper(activeProfiles[idx].getName(), defaultPool, (activeProfiles[idx] == activeProfile)); // display name, pool to wrap, whether to preselect
anyAdded = true;
}
}
if (anyAdded)
newFilterAction.setAllowFilterPoolSelection(poolWrapperInfo);
}
}
}
/**
* Overridable entry for child classes to supply their own flavour of ISystemFilterPoolWrapperInformation for
* the new filter wizards.