1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-05 23:35:48 +02:00

[173772] bug fixings and related cleanups

This commit is contained in:
Uwe Stieber 2007-02-20 09:04:47 +00:00
parent ae03da8d1c
commit e6c3895d55
15 changed files with 410 additions and 261 deletions

View file

@ -29,20 +29,26 @@ public interface IRSECoreRegistry {
/** /**
* Returns all defined system types. * Returns all defined system types.
*
* @return an array of all defined system types. * @return an array of all defined system types.
*/ */
public IRSESystemType[] getSystemTypes(); public IRSESystemType[] getSystemTypes();
/**
* Returns the names of all defined system types.
* @return all defined system type names
*/
public String[] getSystemTypeNames();
/** /**
* Returns a system type object given the name. * Returns a system type object given the name.
*
* @param name the name of the system type * @param name the name of the system type
* @return the system type object with the given name, or <code>null</code> if none is found * @return the system type object with the given name, or <code>null</code> if none is found
*
* @deprecated Use {@link #getSystemTypeById(String)}.
*/ */
public IRSESystemType getSystemType(String name); public IRSESystemType getSystemType(String name);
/**
* Returns a system type object given by the id.
*
* @param systemTypeId The system type id.
* @return The system type object with the given id, or <code>null</code> if none is found
*/
public IRSESystemType getSystemTypeById(String systemTypeId);
} }

View file

@ -77,8 +77,7 @@ public class RSECoreRegistry implements IRSECoreRegistry {
return instance; return instance;
} }
/** /* (non-Javadoc)
* Returns all system types that have been defined.
* @see org.eclipse.rse.core.IRSECoreRegistry#getSystemTypes() * @see org.eclipse.rse.core.IRSECoreRegistry#getSystemTypes()
*/ */
public IRSESystemType[] getSystemTypes() { public IRSESystemType[] getSystemTypes() {
@ -91,12 +90,25 @@ public class RSECoreRegistry implements IRSECoreRegistry {
return systemTypes; return systemTypes;
} }
/** /* (non-Javadoc)
* Returns the system type with the given name. * @see org.eclipse.rse.core.IRSECoreRegistry#getSystemTypeById(java.lang.String)
*/
public IRSESystemType getSystemTypeById(String systemTypeId) {
if (systemTypeId != null) {
IRSESystemType[] types = getSystemTypes();
for (int i = 0; i < types.length; i++) {
if (types[i].getId().equals(systemTypeId)) {
return types[i];
}
}
}
return null;
}
/* (non-Javadoc)
* @see org.eclipse.rse.core.IRSECoreRegistry#getSystemType(java.lang.String) * @see org.eclipse.rse.core.IRSECoreRegistry#getSystemType(java.lang.String)
*/ */
public IRSESystemType getSystemType(String name) { public IRSESystemType getSystemType(String name) {
IRSESystemType[] types = getSystemTypes(); IRSESystemType[] types = getSystemTypes();
for (int i = 0; i < types.length; i++) { for (int i = 0; i < types.length; i++) {
@ -110,21 +122,6 @@ public class RSECoreRegistry implements IRSECoreRegistry {
return null; return null;
} }
/**
* @see org.eclipse.rse.core.IRSECoreRegistry#getSystemTypeNames()
*/
public String[] getSystemTypeNames() {
IRSESystemType[] types = getSystemTypes();
String[] names = new String[types.length];
for (int i = 0; i < types.length; i++) {
IRSESystemType type = types[i];
names[i] = type.getName();
}
return names;
}
/** /**
* Reads system types from the extension point registry and returns the defined system types. * Reads system types from the extension point registry and returns the defined system types.
* @return an array of system types that have been defined * @return an array of system types that have been defined

View file

@ -20,6 +20,7 @@ import java.util.Arrays;
import java.util.Locale; import java.util.Locale;
import org.eclipse.jface.action.IAction; import org.eclipse.jface.action.IAction;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.SystemBasePlugin; import org.eclipse.rse.core.SystemBasePlugin;
import org.eclipse.rse.core.model.IHost; import org.eclipse.rse.core.model.IHost;
@ -772,7 +773,7 @@ public class SystemWidgetHelpers {
List list = createListBox(group, listener, false, null, SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP); List list = createListBox(group, listener, false, null, SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
String[] typeItems = ((systemTypes == null) ? RSECorePlugin.getDefault().getRegistry().getSystemTypeNames() : systemTypes); String[] typeItems = ((systemTypes == null) ? getSystemTypeNames() : systemTypes);
if (systemTypes == null) { if (systemTypes == null) {
for (int i = 0; i < typeItems.length; i++) { for (int i = 0; i < typeItems.length; i++) {
@ -1126,13 +1127,28 @@ public class SystemWidgetHelpers {
return createSystemTypeCombo(parent, listener, null); return createSystemTypeCombo(parent, listener, null);
} }
private static String[] systemTypeNames = null;
/**
* Internal method. Helper to get the list of registered system type names.
*/
private static String[] getSystemTypeNames() {
if (systemTypeNames == null) {
java.util.List names = new ArrayList();
IRSESystemType[] systemTypes = RSECorePlugin.getDefault().getRegistry().getSystemTypes();
for (int i = 0; i < systemTypes.length; i++) names.add(systemTypes[i].getName());
systemTypeNames = (String[])names.toArray(new String[names.size()]);
}
return systemTypeNames;
}
/** /**
* Creates a readonly system type combination box with the given system types. * Creates a readonly system type combination box with the given system types.
* Does NOT create the leading prompt or anything except the combo. * Does NOT create the leading prompt or anything except the combo.
*/ */
public static Combo createSystemTypeCombo(Composite parent, Listener listener, String[] systemTypes) { public static Combo createSystemTypeCombo(Composite parent, Listener listener, String[] systemTypes) {
Combo combo = createReadonlyCombo(parent, listener, SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP); Combo combo = createReadonlyCombo(parent, listener, SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
String[] typeItems = ((systemTypes == null) ? RSECorePlugin.getDefault().getRegistry().getSystemTypeNames() : systemTypes); String[] typeItems = ((systemTypes == null) ? getSystemTypeNames() : systemTypes);
ArrayList list = new ArrayList(); ArrayList list = new ArrayList();

View file

@ -35,6 +35,8 @@ import org.eclipse.rse.ui.ISystemIconConstants;
import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.SystemResources; import org.eclipse.rse.ui.SystemResources;
import org.eclipse.rse.ui.wizards.newconnection.RSEMainNewConnectionWizard; import org.eclipse.rse.ui.wizards.newconnection.RSEMainNewConnectionWizard;
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
@ -132,18 +134,34 @@ public class SystemNewConnectionAction extends SystemBaseWizardAction {
protected WizardDialog doCreateWizardDialog(Shell shell, IWizard wizard) { protected WizardDialog doCreateWizardDialog(Shell shell, IWizard wizard) {
// The new connection action is always using the standard Eclipse WizardDialog!!! // The new connection action is always using the standard Eclipse WizardDialog!!!
WizardDialog dialog = new WizardDialog(getShell(), wizard) { WizardDialog dialog = new WizardDialog(getShell(), wizard) {
// protected Rectangle getConstrainedShellBounds(Rectangle preferredSize) { private boolean computeShellSizeFromScratch = true;
// Rectangle bounds = super.getConstrainedShellBounds(preferredSize);
// // We allow to resize the dialog in height, but not in width /* (non-Javadoc)
// // to more to 500 pixel. * @see org.eclipse.jface.window.Window#getConstrainedShellBounds(org.eclipse.swt.graphics.Rectangle)
// bounds.width = Math.min(bounds.width, 500); */
// return bounds; protected Rectangle getConstrainedShellBounds(Rectangle preferredSize) {
// } // The parent shell might have very large bounds if badly selected. We
// protected Point getInitialSize() { // will recalculate the wizard dialogs shell size the first time we end
// Point size = super.getInitialSize(); // up here. That asures that the dialog does not inherit shell bounds
// size.x = 500; // from a much larger window.
// return size; if (computeShellSizeFromScratch) {
// } Point newSize = getInitialSize();
Point newLoaction = getInitialLocation(newSize);
preferredSize.height = newSize.y;
preferredSize.width = newSize.x;
preferredSize.y = newLoaction.y;
preferredSize.x = newLoaction.x;
computeShellSizeFromScratch = false;
}
Rectangle bounds = super.getConstrainedShellBounds(preferredSize);
// We allow to resize the dialog in height, but not in width
// to more to 500 pixel.
bounds.width = Math.min(bounds.width, 500);
return bounds;
}
}; };
return dialog; return dialog;

View file

@ -18,10 +18,14 @@
package org.eclipse.rse.ui.propertypages; package org.eclipse.rse.ui.propertypages;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.jface.preference.FieldEditorPreferencePage; import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.util.PropertyChangeEvent; import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.rse.core.IRSEPreferenceNames; import org.eclipse.rse.core.IRSEPreferenceNames;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.RSECorePlugin; import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.core.model.ISystemPreferenceChangeEvents; import org.eclipse.rse.core.model.ISystemPreferenceChangeEvents;
import org.eclipse.rse.internal.model.SystemPreferenceChangeEvent; import org.eclipse.rse.internal.model.SystemPreferenceChangeEvent;
@ -91,11 +95,15 @@ public class RemoteSystemsPreferencePage
{ {
IPreferenceStore coreStore = new PreferencesMapper(RSECorePlugin.getDefault().getPluginPreferences()); IPreferenceStore coreStore = new PreferencesMapper(RSECorePlugin.getDefault().getPluginPreferences());
List systemTypeNames = new ArrayList();
IRSESystemType[] systemTypes = RSECorePlugin.getDefault().getRegistry().getSystemTypes();
for (int i = 0; i < systemTypes.length; i++) systemTypeNames.add(systemTypes[i].getName());
// DEFAULT SYSTEM TYPE // DEFAULT SYSTEM TYPE
SystemComboBoxFieldEditor systemTypeEditor = new SystemComboBoxFieldEditor( SystemComboBoxFieldEditor systemTypeEditor = new SystemComboBoxFieldEditor(
IRSEPreferenceNames.SYSTEMTYPE, IRSEPreferenceNames.SYSTEMTYPE,
SystemResources.RESID_PREF_SYSTEMTYPE_PREFIX_LABEL, SystemResources.RESID_PREF_SYSTEMTYPE_PREFIX_LABEL,
RSECorePlugin.getDefault().getRegistry().getSystemTypeNames(), (String[])systemTypeNames.toArray(new String[systemTypeNames.size()]),
true, // readonly true, // readonly
getFieldEditorParent() getFieldEditorParent()
); );

View file

@ -21,6 +21,7 @@ import java.util.Iterator;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.ISelectionProvider;
@ -32,6 +33,7 @@ import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.jface.wizard.IWizardPage; import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard; import org.eclipse.jface.wizard.Wizard;
import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.core.RSECorePlugin;
import org.eclipse.rse.ui.ISystemIconConstants; import org.eclipse.rse.ui.ISystemIconConstants;
import org.eclipse.rse.ui.RSEUIPlugin; import org.eclipse.rse.ui.RSEUIPlugin;
import org.eclipse.rse.ui.SystemResources; import org.eclipse.rse.ui.SystemResources;
@ -43,8 +45,11 @@ import org.eclipse.ui.IWorkbench;
* The New Connection wizard. This wizard allows users to create new RSE connections. * The New Connection wizard. This wizard allows users to create new RSE connections.
*/ */
public class RSEMainNewConnectionWizard extends Wizard implements INewWizard, ISelectionProvider { public class RSEMainNewConnectionWizard extends Wizard implements INewWizard, ISelectionProvider {
protected static final String LAST_SELECTED_SYSTEM_TYPE_ID = "lastSelectedSystemTypeId"; //$NON-NLS-1$
private IWizard selectedWizard; private IWizard selectedWizard;
private IRSESystemType selectedSystemType; private IRSESystemType selectedSystemType;
private boolean selectedWizardCanFinishEarly;
private final RSENewConnectionWizardSelectionPage mainPage; private final RSENewConnectionWizardSelectionPage mainPage;
private final List initializedWizards = new LinkedList(); private final List initializedWizards = new LinkedList();
@ -61,12 +66,21 @@ public class RSEMainNewConnectionWizard extends Wizard implements INewWizard, IS
setWindowTitle(SystemResources.RESID_NEWCONN_TITLE); setWindowTitle(SystemResources.RESID_NEWCONN_TITLE);
setForcePreviousAndNextButtons(true); setForcePreviousAndNextButtons(true);
setNeedsProgressMonitor(true); setNeedsProgressMonitor(true);
// Initialize the dialog settings for this wizard
IDialogSettings settings = RSEUIPlugin.getDefault().getDialogSettings();
String sectionName = this.getClass().getName();
if (settings.getSection(sectionName) == null) settings.addNewSection(sectionName);
setDialogSettings(settings.getSection(sectionName));
mainPage = new RSENewConnectionWizardSelectionPage(); mainPage = new RSENewConnectionWizardSelectionPage();
initializedWizards.clear(); initializedWizards.clear();
selectionChangedListener.clear(); selectionChangedListener.clear();
// and finally restore the wizard state
restoreFromDialogSettings();
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#getDefaultPageImage() * @see org.eclipse.jface.wizard.Wizard#getDefaultPageImage()
*/ */
@ -141,8 +155,10 @@ public class RSEMainNewConnectionWizard extends Wizard implements INewWizard, IS
if (selection instanceof IStructuredSelection if (selection instanceof IStructuredSelection
&& ((IStructuredSelection)selection).getFirstElement() instanceof IRSESystemType) { && ((IStructuredSelection)selection).getFirstElement() instanceof IRSESystemType) {
selectedSystemType = (IRSESystemType)((IStructuredSelection)selection).getFirstElement(); selectedSystemType = (IRSESystemType)((IStructuredSelection)selection).getFirstElement();
onSelectedSystemTypeChanged(); } else {
selectedSystemType = null;
} }
onSelectedSystemTypeChanged();
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -172,7 +188,13 @@ public class RSEMainNewConnectionWizard extends Wizard implements INewWizard, IS
// Check if a wizard is registered for the selected system type // Check if a wizard is registered for the selected system type
IRSENewConnectionWizardDescriptor descriptor = getSelection() != null ? RSENewConnectionWizardRegistry.getInstance().getWizardForSelection((IStructuredSelection)getSelection()) : null; IRSENewConnectionWizardDescriptor descriptor = getSelection() != null ? RSENewConnectionWizardRegistry.getInstance().getWizardForSelection((IStructuredSelection)getSelection()) : null;
selectedWizard = descriptor != null ? descriptor.getWizard() : null; if (descriptor != null) {
selectedWizard = descriptor.getWizard();
selectedWizardCanFinishEarly = descriptor.canFinishEarly();
} else {
selectedWizard = null;
selectedWizardCanFinishEarly = false;
}
// register the newly selected wizard as selection changed listener // register the newly selected wizard as selection changed listener
if (selectedWizard instanceof ISelectionChangedListener) { if (selectedWizard instanceof ISelectionChangedListener) {
@ -229,18 +251,49 @@ public class RSEMainNewConnectionWizard extends Wizard implements INewWizard, IS
return nextPage; return nextPage;
} }
/* (non-Javadoc)
* @see org.eclipse.jface.wizard.Wizard#canFinish()
*/
public boolean canFinish() {
// We can finish from the main new connection wizard only if the selected
// wizard can finish early
return selectedWizardCanFinishEarly;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.rse.ui.wizards.AbstractSystemWizard#performFinish() * @see org.eclipse.rse.ui.wizards.AbstractSystemWizard#performFinish()
*/ */
public boolean performFinish() { public boolean performFinish() {
boolean result = true;
if (mainPage != null) result = mainPage.performFinish();
// Note: Do _NOT_ delegate the performFinish from here to the selected // Note: Do _NOT_ delegate the performFinish from here to the selected
// wizard!! The outer wizard dialog is handling the nested wizards by // wizard!! The outer wizard dialog is handling the nested wizards by
// default already itself!! // default already itself!!
return result; // Save the current selection to the dialog settings
IDialogSettings dialogSettings = getDialogSettings();
if (dialogSettings != null && getSelection() instanceof IStructuredSelection) {
IStructuredSelection selection = (IStructuredSelection)getSelection();
if (selection.getFirstElement() instanceof IRSESystemType) {
dialogSettings.put(LAST_SELECTED_SYSTEM_TYPE_ID, ((IRSESystemType)selection.getFirstElement()).getId());
}
}
return true;
} }
} /**
* Restore the persistent saved wizard state. This method
* is called from the wizards constructor.
*/
protected void restoreFromDialogSettings() {
IDialogSettings dialogSettings = getDialogSettings();
if (dialogSettings != null) {
String systemTypeId = dialogSettings.get(LAST_SELECTED_SYSTEM_TYPE_ID);
if (systemTypeId != null) {
IRSESystemType systemType = RSECorePlugin.getDefault().getRegistry().getSystemTypeById(systemTypeId);
if (systemType != null) {
setSelection(new StructuredSelection(systemType));
}
}
}
}
}

View file

@ -10,7 +10,6 @@
*******************************************************************************/ *******************************************************************************/
package org.eclipse.rse.ui.wizards.newconnection; package org.eclipse.rse.ui.wizards.newconnection;
import java.util.Arrays;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
@ -29,8 +28,8 @@ import org.eclipse.rse.ui.wizards.registries.RSEWizardDescriptor;
public class RSENewConnectionWizardDescriptor extends RSEWizardDescriptor implements IRSENewConnectionWizardDescriptor { public class RSENewConnectionWizardDescriptor extends RSEWizardDescriptor implements IRSENewConnectionWizardDescriptor {
private final SystemTypeMatcher systemTypeMatcher; private final SystemTypeMatcher systemTypeMatcher;
// The list of resolved system types supported by this wizard. // The list of resolved system type ids supported by this wizard.
private List resolvedSystemTypes; private List resolvedSystemTypeIds;
/** /**
* Constructor * Constructor
@ -54,14 +53,14 @@ public class RSENewConnectionWizardDescriptor extends RSEWizardDescriptor implem
* @see org.eclipse.rse.ui.wizards.newconnection.INewConnectionWizardDescriptor#getSystemTypeIds() * @see org.eclipse.rse.ui.wizards.newconnection.INewConnectionWizardDescriptor#getSystemTypeIds()
*/ */
public String[] getSystemTypeIds() { public String[] getSystemTypeIds() {
if (resolvedSystemTypes == null) { if (resolvedSystemTypeIds == null) {
resolvedSystemTypes = new LinkedList(); resolvedSystemTypeIds = new LinkedList();
// If the subsystem configuration supports all system types, just add all // If the subsystem configuration supports all system types, just add all
// currently registered system types to th resolved list // currently registered system types to th resolved list
if (systemTypeMatcher.supportsAllSystemTypes()) { if (systemTypeMatcher.supportsAllSystemTypes()) {
String[] systemTypes = RSECorePlugin.getDefault().getRegistry().getSystemTypeNames(); IRSESystemType[] systemTypes = RSECorePlugin.getDefault().getRegistry().getSystemTypes();
if (systemTypes != null) resolvedSystemTypes.addAll(Arrays.asList(systemTypes)); for (int i = 0; i < systemTypes.length; i++) resolvedSystemTypeIds.add(systemTypes[i].getId());
} else { } else {
// We have to match the given lists of system type ids against // We have to match the given lists of system type ids against
// the list of available system types. As the list of system types cannot // the list of available system types. As the list of system types cannot
@ -74,15 +73,15 @@ public class RSENewConnectionWizardDescriptor extends RSEWizardDescriptor implem
if (systemTypeMatcher.matches(systemType) if (systemTypeMatcher.matches(systemType)
|| (adapter != null || (adapter != null
&& adapter.acceptWizardDescriptor(getConfigurationElement().getName(), this))) { && adapter.acceptWizardDescriptor(getConfigurationElement().getName(), this))) {
if (!resolvedSystemTypes.contains(systemType.getId())) { if (!resolvedSystemTypeIds.contains(systemType.getId())) {
resolvedSystemTypes.add(systemType.getId()); resolvedSystemTypeIds.add(systemType.getId());
} }
} }
} }
} }
} }
return (String[])resolvedSystemTypes.toArray(new String[resolvedSystemTypes.size()]); return (String[])resolvedSystemTypeIds.toArray(new String[resolvedSystemTypeIds.size()]);
} }
} }

View file

@ -14,9 +14,11 @@ package org.eclipse.rse.ui.wizards.newconnection;
import java.util.Arrays; import java.util.Arrays;
import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.AbstractTreeViewer; import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.DecoratingLabelProvider; import org.eclipse.jface.viewers.DecoratingLabelProvider;
import org.eclipse.jface.viewers.DoubleClickEvent; import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IBasicPropertyConstants;
import org.eclipse.jface.viewers.IDoubleClickListener; import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider; import org.eclipse.jface.viewers.ISelectionProvider;
@ -26,8 +28,10 @@ import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer; import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer; import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerComparator;
import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.wizard.IWizard; import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.jface.wizard.WizardPage; import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.rse.core.IRSESystemType; import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.rse.ui.RSESystemTypeAdapter; import org.eclipse.rse.ui.RSESystemTypeAdapter;
@ -58,6 +62,10 @@ public class RSENewConnectionWizardSelectionPage extends WizardPage {
private ViewerFilter filteredTreeWizardStateFilter; private ViewerFilter filteredTreeWizardStateFilter;
private RSENewConnectionWizardSelectionTreeDataManager filteredTreeDataManager; private RSENewConnectionWizardSelectionTreeDataManager filteredTreeDataManager;
/**
* Internal class. The wizard state filter is responsible to filter
* out any not enabled wizard from the tree.
*/
private class NewConnectionWizardStateFilter extends ViewerFilter { private class NewConnectionWizardStateFilter extends ViewerFilter {
/* (non-Javadoc) /* (non-Javadoc)
@ -91,6 +99,22 @@ public class RSENewConnectionWizardSelectionPage extends WizardPage {
} }
/** /**
* Internal class. The wizard viewer comparator is responsible for
* the sorting in the tree. Current implementation is not prioritizing
* categories.
*/
private class NewConnectionWizardViewerComparator extends ViewerComparator {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.ViewerComparator#isSorterProperty(java.lang.Object, java.lang.String)
*/
public boolean isSorterProperty(Object element, String property) {
// The comparator is affected if the label of the elements should change.
return property.equals(IBasicPropertyConstants.P_TEXT);
}
}
/**
* Constructor. * Constructor.
*/ */
public RSENewConnectionWizardSelectionPage() { public RSENewConnectionWizardSelectionPage() {
@ -151,13 +175,15 @@ public class RSENewConnectionWizardSelectionPage extends WizardPage {
filteredTreeFilter = new RSEWizardSelectionTreePatternFilter(); filteredTreeFilter = new RSEWizardSelectionTreePatternFilter();
filteredTree = new FilteredTree(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, filteredTreeFilter); filteredTree = new FilteredTree(composite, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER, filteredTreeFilter);
filteredTree.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); filteredTree.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
GridData layoutData = new GridData(GridData.FILL_BOTH);
layoutData.heightHint = 275; layoutData.widthHint = 450;
filteredTree.setLayoutData(layoutData);
final TreeViewer treeViewer = filteredTree.getViewer(); final TreeViewer treeViewer = filteredTree.getViewer();
treeViewer.setContentProvider(new RSEWizardSelectionTreeContentProvider()); treeViewer.setContentProvider(new RSEWizardSelectionTreeContentProvider());
// Explicitly allow the tree items to get decorated!!! // Explicitly allow the tree items to get decorated!!!
treeViewer.setLabelProvider(new DecoratingLabelProvider(new RSEWizardSelectionTreeLabelProvider(), PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator())); treeViewer.setLabelProvider(new DecoratingLabelProvider(new RSEWizardSelectionTreeLabelProvider(), PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator()));
// treeViewer.setComparator(NewWizardCollectionComparator.INSTANCE); treeViewer.setComparator(new NewConnectionWizardViewerComparator());
// treeViewer.addSelectionChangedListener(this);
treeViewer.setAutoExpandLevel(2); treeViewer.setAutoExpandLevel(2);
filteredTreeWizardStateFilter = new NewConnectionWizardStateFilter(); filteredTreeWizardStateFilter = new NewConnectionWizardStateFilter();
@ -170,7 +196,6 @@ public class RSENewConnectionWizardSelectionPage extends WizardPage {
}); });
treeViewer.addDoubleClickListener(new IDoubleClickListener() { treeViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) { public void doubleClick(DoubleClickEvent event) {
// onSelectionChanged();
if (canFlipToNextPage()) getWizard().getContainer().showPage(getNextPage()); if (canFlipToNextPage()) getWizard().getContainer().showPage(getNextPage());
} }
}); });
@ -182,6 +207,19 @@ public class RSENewConnectionWizardSelectionPage extends WizardPage {
Dialog.applyDialogFont(composite); Dialog.applyDialogFont(composite);
setControl(composite); setControl(composite);
// Initialize the selection in the tree
if (getWizard() instanceof ISelectionProvider) {
ISelectionProvider selectionProvider = (ISelectionProvider)getWizard();
if (selectionProvider.getSelection() instanceof IStructuredSelection) {
IStructuredSelection selection = (IStructuredSelection)selectionProvider.getSelection();
if (selection.getFirstElement() instanceof IRSESystemType) {
IRSESystemType systemType = (IRSESystemType)selection.getFirstElement();
RSENewConnectionWizardSelectionTreeElement treeElement = filteredTreeDataManager.getTreeElementForSystemType(systemType);
if (treeElement != null) treeViewer.setSelection(new StructuredSelection(treeElement), true);
}
}
}
} }
/* (non-Javadoc) /* (non-Javadoc)
@ -192,7 +230,7 @@ public class RSENewConnectionWizardSelectionPage extends WizardPage {
} }
/** /**
* Called from the selection and double-click listener to propage the current * Called from the selection listener to propage the current
* system type selection to the underlaying wizard. * system type selection to the underlaying wizard.
*/ */
protected void onSelectionChanged() { protected void onSelectionChanged() {
@ -208,56 +246,33 @@ public class RSENewConnectionWizardSelectionPage extends WizardPage {
} else { } else {
if (!getDefaultDescription().equals(getDescription())) setDescription(getDefaultDescription()); if (!getDefaultDescription().equals(getDescription())) setDescription(getDefaultDescription());
} }
} else {
selectionProvider.setSelection(null);
} }
} }
// Update the wizard container UI elements
IWizardContainer container = getContainer();
if (container != null && container.getCurrentPage() != null) {
container.updateWindowTitle();
container.updateTitleBar();
container.updateButtons();
}
} }
/**
* @see org.eclipse.rse.ui.wizards.AbstractSystemWizardPage#createContents(org.eclipse.swt.widgets.Composite)
*/
// public Control createContents(Composite parent) {
//
// int nbrColumns = 2;
// Composite composite_prompts = SystemWidgetHelpers.createComposite(parent, nbrColumns);
// SystemWidgetHelpers.setCompositeHelp(composite_prompts, parentHelpId);
//
// String temp = SystemWidgetHelpers.appendColon(SystemResources.RESID_CONNECTION_SYSTEMTYPE_LABEL);
//
// Label labelSystemType = SystemWidgetHelpers.createLabel(composite_prompts, temp);
// labelSystemType.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
//
// if (restrictedSystemTypes == null) {
// textSystemType = SystemWidgetHelpers.createSystemTypeListBox(parent, null);
// }
// else {
// String[] systemTypeNames = new String[restrictedSystemTypes.length];
//
// for (int i = 0; i < restrictedSystemTypes.length; i++) {
// systemTypeNames[i] = restrictedSystemTypes[i].getName();
// }
//
// textSystemType = SystemWidgetHelpers.createSystemTypeListBox(parent, null, systemTypeNames);
// }
//
// textSystemType.setToolTipText(SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
// SystemWidgetHelpers.setHelp(textSystemType, RSEUIPlugin.HELPPREFIX + "ccon0003"); //$NON-NLS-1$
//
// textSystemType.addSelectionListener(this);
//
// descriptionSystemType = SystemWidgetHelpers.createMultiLineTextField(parent,null,30);
// descriptionSystemType.setEditable(false);
//
// widgetSelected(null);
//
// return composite_prompts;
// }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.rse.ui.wizards.AbstractSystemWizardPage#performFinish() * @see org.eclipse.jface.wizard.WizardPage#getDialogSettings()
*/ */
public boolean performFinish() { protected IDialogSettings getDialogSettings() {
return true; // If the wizard is set and returns dialog settings, we re-use them here
IDialogSettings settings = super.getDialogSettings();
// If the dialog settings could not set from the wizard, fallback to the plugins
// dialog settings store.
if (settings == null) settings = RSEUIPlugin.getDefault().getDialogSettings();
String sectionName = this.getClass().getName();
if (settings.getSection(sectionName) == null) settings.addNewSection(sectionName);
settings = settings.getSection(sectionName);
return settings;
} }
} }

View file

@ -26,6 +26,10 @@ import org.eclipse.rse.ui.wizards.registries.RSEWizardSelectionTreeElement;
* New connection wizard selection tree data manager. * New connection wizard selection tree data manager.
*/ */
public class RSENewConnectionWizardSelectionTreeDataManager extends RSEAbstractWizardSelectionTreeDataManager { public class RSENewConnectionWizardSelectionTreeDataManager extends RSEAbstractWizardSelectionTreeDataManager {
// The element map is required to translate from IRSESystemType object instance
// into RSENewConnectionWizardSelectionTreeElement object instances as the tree
// and the wizard using these different object instances in their selections!
private Map elementMap;
/** /**
* Constructor. * Constructor.
@ -34,10 +38,28 @@ public class RSENewConnectionWizardSelectionTreeDataManager extends RSEAbstractW
super(); super();
} }
/**
* Returns the corresponding wizard selection tree element for the specified
* system type.
*
* @param systemType The system type. Must be not <code>null</code>.
* @return The wizard selection tree element or <code>null</code>.
*/
public RSENewConnectionWizardSelectionTreeElement getTreeElementForSystemType(IRSESystemType systemType) {
assert systemType != null;
return (RSENewConnectionWizardSelectionTreeElement)elementMap.get(systemType);
}
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.rse.ui.internal.wizards.newconnection.RSEAbstractWizardSelectionTreeDataManager#initialize(java.util.Set) * @see org.eclipse.rse.ui.internal.wizards.newconnection.RSEAbstractWizardSelectionTreeDataManager#initialize(java.util.Set)
*/ */
protected void initialize(Set rootElement) { protected void initialize(Set rootElement) {
// we must check the elementMap here for null as the static
// constructors may not have called yet as this method is called
// from the base classes constructor!
if (elementMap == null) elementMap = new HashMap();
elementMap.clear();
Map categoryCache = new HashMap(); Map categoryCache = new HashMap();
// The new connection wizard selection is combining system types // The new connection wizard selection is combining system types
@ -59,6 +81,8 @@ public class RSENewConnectionWizardSelectionTreeDataManager extends RSEAbstractW
// and categorise the wizard. // and categorise the wizard.
RSENewConnectionWizardSelectionTreeElement wizardElement = new RSENewConnectionWizardSelectionTreeElement(systemType, descriptor); RSENewConnectionWizardSelectionTreeElement wizardElement = new RSENewConnectionWizardSelectionTreeElement(systemType, descriptor);
wizardElement.setParentElement(null); wizardElement.setParentElement(null);
elementMap.put(systemType, wizardElement);
String categoryId = descriptor.getCategoryId(); String categoryId = descriptor.getCategoryId();
// if the wizard is of type IRSEDynamicNewConnectionWizard, call validateCategoryId! // if the wizard is of type IRSEDynamicNewConnectionWizard, call validateCategoryId!
if (descriptor.getWizard() instanceof IRSEDynamicNewConnectionWizard) { if (descriptor.getWizard() instanceof IRSEDynamicNewConnectionWizard) {

View file

@ -72,7 +72,22 @@ public class RSENewConnectionWizardSelectionTreeElement extends RSEWizardSelecti
return image; return image;
} }
/* (non-Javadoc)
* @see org.eclipse.rse.ui.wizards.registries.RSEWizardSelectionTreeElement#getDescription()
*/
public String getDescription() {
// Check the system type adapter for the description in case the wizard descriptor does
// not come up with a description itself.
String description = super.getDescription();
if (description == null) {
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(getSystemType().getAdapter(IRSESystemType.class));
if (adapter != null) {
description = adapter.getDescription(getSystemType());
}
}
return description;
}
/* (non-Javadoc) /* (non-Javadoc)
* @see java.lang.Object#equals(java.lang.Object) * @see java.lang.Object#equals(java.lang.Object)

View file

@ -34,10 +34,8 @@ public class RSEWizardSelectionTreePatternFilter extends PatternFilter {
protected boolean isLeafMatch(Viewer viewer, Object element) { protected boolean isLeafMatch(Viewer viewer, Object element) {
if (element instanceof RSEWizardSelectionTreeElement) { if (element instanceof RSEWizardSelectionTreeElement) {
RSEWizardSelectionTreeElement treeElement = (RSEWizardSelectionTreeElement)element; RSEWizardSelectionTreeElement treeElement = (RSEWizardSelectionTreeElement)element;
// we filter only the wizard nodes, not the category nodes (yet). // we filter only the wizard nodes
if (treeElement.getWizardRegistryElement() instanceof IRSEWizardCategory) { if (treeElement.getWizardRegistryElement() instanceof IRSEWizardDescriptor) {
return true;
} else {
return wordMatches(treeElement.getLabel()); return wordMatches(treeElement.getLabel());
} }

View file

@ -15,6 +15,9 @@
********************************************************************************/ ********************************************************************************/
package org.eclipse.rse.internal.model; package org.eclipse.rse.internal.model;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageDescriptor;
@ -40,75 +43,86 @@ import org.eclipse.swt.widgets.Shell;
* It shows as "New Connection..." in the tree. When expanded, they get the new connection * It shows as "New Connection..." in the tree. When expanded, they get the new connection
* wizard. * wizard.
*/ */
public class SystemNewConnectionPromptObject public class SystemNewConnectionPromptObject implements ISystemPromptableObject, ISystemViewRunnableObject, IAdaptable {
implements ISystemPromptableObject, ISystemViewRunnableObject, IAdaptable private Object parent;
{ private IRSESystemType[] systemTypes;
private Object parent; private ISystemPromptableObject[] children;
private String[] systemTypes; private SystemNewConnectionAction action = null;
private ISystemPromptableObject[] children; private boolean systemTypesSet = false;
private SystemNewConnectionAction action = null; private String newConnText;
private boolean systemTypesSet = false; private boolean isRootPrompt = false;
private String newConnText;
private boolean isRootPrompt = false; /**
* Constructor
/** */
* Constructor public SystemNewConnectionPromptObject() {
*/ setSystemTypes(RSECorePlugin.getDefault().getRegistry().getSystemTypes());
public SystemNewConnectionPromptObject() isRootPrompt = true;
{ }
setSystemTypes(RSECorePlugin.getDefault().getRegistry().getSystemTypeNames());
isRootPrompt = true; /**
} * Constructor for child instances
/** */
* Constructor for child instances public SystemNewConnectionPromptObject(SystemNewConnectionPromptObject parent, IRSESystemType systemType) {
*/ this.parent = parent;
public SystemNewConnectionPromptObject(SystemNewConnectionPromptObject parent, String systemType) setSystemTypes(new IRSESystemType[] { systemType });
{ }
this.parent = parent;
setSystemTypes(new String[] {systemType}); // ----------------------------------------------------
} // METHODS FOR CONFIGURING THIS OBJECT
// ----------------------------------------------------
// ----------------------------------------------------
// METHODS FOR CONFIGURING THIS OBJECT /**
// ---------------------------------------------------- * Set the system types to restrict the New Connection wizard to
*/
/** public void setSystemTypes(IRSESystemType[] systemTypes) {
* Set the system types to restrict the New Connection wizard to this.systemTypes = systemTypes;
*/ this.systemTypesSet = true;
public void setSystemTypes(String[] systemTypes) }
{
this.systemTypes = systemTypes; /**
this.systemTypesSet = true; * @deprecated Use {@link #setSystemTypes(IRSESystemType[])}.
} */
public void setSystemTypes(String[] systemTypes) {
/* (non-Javadoc) if (systemTypes != null) {
* @see org.eclipse.rse.model.ISystemPromptableObject#getSystemTypes() List types = new ArrayList();
*/ for (int i = 0; i < systemTypes.length; i++) {
public String[] getSystemTypes() { IRSESystemType type = RSECorePlugin.getDefault().getRegistry().getSystemType(systemTypes[i]);
String[] types = systemTypes; if (type != null) types.add(type);
if (types == null || !systemTypesSet) types = new String[0]; }
return types; setSystemTypes((IRSESystemType[])types.toArray(new IRSESystemType[types.size()]));
} else {
setSystemTypes((IRSESystemType[])null);
} }
}
/**
* Set the parent object so that we can respond to getParent requests /* (non-Javadoc)
*/ * @see org.eclipse.rse.model.ISystemPromptableObject#getSystemTypes()
public void setParent(Object parent) */
{ public IRSESystemType[] getSystemTypes() {
this.parent = parent; IRSESystemType[] types = systemTypes;
} if (types == null || !systemTypesSet)
types = new IRSESystemType[0];
// ---------------------------------------------------- return types;
// METHODS CALLED BY THE SYSTEMVIEWPROMPTABLEADAPTER... }
// ----------------------------------------------------
/**
/** * Set the parent object so that we can respond to getParent requests
* Get the parent object (within tree view) */
*/ public void setParent(Object parent) {
public Object getParent() this.parent = parent;
{ }
return parent;
} // ----------------------------------------------------
// METHODS CALLED BY THE SYSTEMVIEWPROMPTABLEADAPTER...
// ----------------------------------------------------
/**
* Get the parent object (within tree view)
*/
public Object getParent() {
return parent;
}
/** /**
* Return the child promptable objects. * Return the child promptable objects.
@ -123,9 +137,7 @@ public class SystemNewConnectionPromptObject
// Basically, once initialized, the list of system types cannot change, but // Basically, once initialized, the list of system types cannot change, but
// it doesn't hurt to check this in case it changes because of future extensions. // it doesn't hurt to check this in case it changes because of future extensions.
if (isRootPrompt) { if (isRootPrompt) {
String[] typeNames = RSECorePlugin.getDefault().getRegistry().getSystemTypeNames(); systemTypes = RSECorePlugin.getDefault().getRegistry().getSystemTypes();
if (systemTypes == null || typeNames.length != systemTypes.length)
systemTypes = typeNames;
} }
if (systemTypes != null) { if (systemTypes != null) {
@ -138,21 +150,20 @@ public class SystemNewConnectionPromptObject
return children; return children;
} }
/** /**
* Return true if we have children, false if run when expanded * Return true if we have children, false if run when expanded
*/ */
public boolean hasChildren() public boolean hasChildren() {
{
// DKM - I think we shouuld indicate children even if there's only one connection type // DKM - I think we shouuld indicate children even if there's only one connection type
//if (systemTypes.length == 1) //if (systemTypes.length == 1)
if (systemTypes == null || (systemTypes.length == 1 && !isRootPrompt)) if (systemTypes == null || (systemTypes.length == 1 && !isRootPrompt))
return false; return false;
else else
return true; return true;
} }
/** /**
* Returns an image descriptor for the image. More efficient than getting the image. * Returns an image descriptor for the image. More efficient than getting the image.
* Calls getImage on the subsystem's owning factory. * Calls getImage on the subsystem's owning factory.
@ -161,12 +172,11 @@ public class SystemNewConnectionPromptObject
if (hasChildren()) if (hasChildren())
return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWCONNECTION_ID); return RSEUIPlugin.getDefault().getImageDescriptor(ISystemIconConstants.ICON_SYSTEM_NEWCONNECTION_ID);
else { else {
IRSESystemType sysType = RSECorePlugin.getDefault().getRegistry().getSystemType(systemTypes[0]); RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemTypes[0].getAdapter(IRSESystemType.class));
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(sysType.getAdapter(IRSESystemType.class)); return adapter.getImageDescriptor(systemTypes[0]);
return adapter.getImageDescriptor(sysType);
} }
} }
/** /**
* Return the label for this object * Return the label for this object
*/ */
@ -184,68 +194,59 @@ public class SystemNewConnectionPromptObject
return newConnText; return newConnText;
} }
/** /**
* Return the type label for this object * Return the type label for this object
*/ */
public String getType() public String getType() {
{
if (hasChildren()) if (hasChildren())
return SystemResources.RESID_NEWCONN_EXPANDABLEPROMPT_VALUE; return SystemResources.RESID_NEWCONN_EXPANDABLEPROMPT_VALUE;
else else
return SystemResources.RESID_NEWCONN_PROMPT_VALUE; return SystemResources.RESID_NEWCONN_PROMPT_VALUE;
} }
/** /**
* Run this prompt. This should return an appropriate ISystemMessageObject to show * Run this prompt. This should return an appropriate ISystemMessageObject to show
* as the child, reflecting if it ran successfully, was cancelled or failed. * as the child, reflecting if it ran successfully, was cancelled or failed.
*/ */
public Object[] run(Shell shell) public Object[] run(Shell shell) {
{ if (action == null) {
if (action == null) action = new SystemNewConnectionAction(shell, false, false, null);
{
action = new SystemNewConnectionAction(shell, false, false, null);
} }
if (systemTypes!=null) if (systemTypes != null) {
action.restrictSystemTypes(systemTypes); List systemTypeNames = new ArrayList();
for (int i = 0; i < systemTypes.length; i++) systemTypeNames.add(systemTypes[i].getName());
try action.restrictSystemTypes((String[])systemTypeNames.toArray(new String[systemTypeNames.size()]));
{
action.run();
} catch (Exception exc)
{
return new Object[] {
new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_FAILED),
ISystemMessageObject.MSGTYPE_ERROR,null)};
} }
try {
action.run();
} catch (Exception exc) {
return new Object[] { new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_FAILED), ISystemMessageObject.MSGTYPE_ERROR, null) };
}
IHost newConnection = (IHost)action.getValue(); IHost newConnection = (IHost)action.getValue();
// create appropriate object to return... // create appropriate object to return...
ISystemMessageObject result = null; ISystemMessageObject result = null;
if (newConnection != null) if (newConnection != null) {
{ result = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_CONNECTIONCREATED), ISystemMessageObject.MSGTYPE_OBJECTCREATED,
result = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_CONNECTIONCREATED), null);
ISystemMessageObject.MSGTYPE_OBJECTCREATED,null); } else
} result = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_CANCELLED), ISystemMessageObject.MSGTYPE_CANCEL, null);
else return new Object[] { result };
result = new SystemMessageObject(RSEUIPlugin.getPluginMessage(ISystemMessages.MSG_EXPAND_CANCELLED),
ISystemMessageObject.MSGTYPE_CANCEL,null);
return new Object[] {result};
} }
// ----------------------------------------------------
// METHODS REQUIRED BY THE IADAPTABLE INTERFACE...
// ----------------------------------------------------
/** // ----------------------------------------------------
// METHODS REQUIRED BY THE IADAPTABLE INTERFACE...
// ----------------------------------------------------
/**
* This is the method required by the IAdaptable interface. * This is the method required by the IAdaptable interface.
* Given an adapter class type, return an object castable to the type, or * Given an adapter class type, return an object castable to the type, or
* null if this is not possible. * null if this is not possible.
*/ */
public Object getAdapter(Class adapterType) public Object getAdapter(Class adapterType) {
{ return Platform.getAdapterManager().getAdapter(this, adapterType);
return Platform.getAdapterManager().getAdapter(this, adapterType); }
} }
}

View file

@ -17,6 +17,7 @@
package org.eclipse.rse.model; package org.eclipse.rse.model;
import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.rse.core.IRSESystemType;
import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Shell;
/** /**
@ -29,9 +30,7 @@ import org.eclipse.swt.widgets.Shell;
* <p> * <p>
* Related adapter is org.eclipse.rse.ui.view.SystemViewPromptableAdapter * Related adapter is org.eclipse.rse.ui.view.SystemViewPromptableAdapter
*/ */
public interface ISystemPromptableObject extends IAdaptable public interface ISystemPromptableObject extends IAdaptable {
{
/** /**
* Returns the list of system types this promptable object * Returns the list of system types this promptable object
* is associated with. This is important to implement label * is associated with. This is important to implement label
@ -39,9 +38,9 @@ public interface ISystemPromptableObject extends IAdaptable
* *
* @return The list of associated system types or an empty list. * @return The list of associated system types or an empty list.
*/ */
public String[] getSystemTypes(); public IRSESystemType[] getSystemTypes();
/** /**
* Get the parent object (within tree view) * Get the parent object (within tree view)
*/ */
public Object getParent(); public Object getParent();

View file

@ -103,8 +103,9 @@ New connection wizard may have the need of contributing different attribute valu
<attribute name="categoryId" type="string"> <attribute name="categoryId" type="string">
<annotation> <annotation>
<documentation> <documentation>
A fully qualified valid category id previously defined by this or some other plug-in. If omitted or if the specified category id is invalid, the wizard will be added as non-categorized root element. A fully qualified valid category id previously defined by this or some other plug-in. If omitted or if the specified category id is invalid, the wizard will be added as non-categorized root element.
&lt;p&gt;
The default RSE wizard category id is &quot;org.eclipse.rse.ui.wizards.newconnection.default.category&quot;.
</documentation> </documentation>
</annotation> </annotation>
</attribute> </attribute>
@ -148,7 +149,6 @@ New connection wizard may have the need of contributing different attribute valu
<annotation> <annotation>
<documentation> <documentation>
The fully qualified id of the parent category or empty if it is a root category. The fully qualified id of the parent category or empty if it is a root category.
</documentation> </documentation>
</annotation> </annotation>
</attribute> </attribute>
@ -166,16 +166,16 @@ New connection wizard may have the need of contributing different attribute valu
&lt;pre&gt; &lt;pre&gt;
&lt;extension &lt;extension
point=&quot;org.eclipse.rse.ui.newConnectionWizard&quot;&gt; point=&quot;org.eclipse.rse.ui.newConnectionWizard&quot;&gt;
&lt;category id=&quot;org.eclipse.rse.ui.wizards.newconnection.default.category&quot; &lt;category id=&quot;org.eclipse.rse.ui.wizards.newconnection.default.category&quot;
name=&quot;%Creation.category.name&quot;/&gt; name=&quot;%Creation.category.name&quot;/&gt;
&lt;newConnectionWizard &lt;newConnectionWizard
id=&quot;org.eclipse.rse.ui.wizards.newconnection.RSEDefaultnNewConnectionWizard&quot; id=&quot;org.eclipse.rse.ui.wizards.newconnection.RSEDefaultnNewConnectionWizard&quot;
class=&quot;org.eclipse.rse.ui.wizards.newconnection.RSEDefaultNewConnectionWizard&quot; class=&quot;org.eclipse.rse.ui.wizards.newconnection.RSEDefaultNewConnectionWizard&quot;
name=&quot;%DefaultRSENewConnectionWizard.name&quot; name=&quot;%DefaultRSENewConnectionWizard.name&quot;
canFinishEarly=&quot;false&quot; canFinishEarly=&quot;false&quot;
categoryId=&quot;org.eclipse.rse.ui.wizards.newconnection.default.category&quot; categoryId=&quot;org.eclipse.rse.ui.wizards.newconnection.default.category&quot;
hasPages=&quot;true&quot;&gt; hasPages=&quot;true&quot;&gt;
&lt;/newConnectionWizard&gt; &lt;/newConnectionWizard&gt;
&lt;/extension&gt; &lt;/extension&gt;
&lt;/pre&gt; &lt;/pre&gt;
&lt;/p&gt; &lt;/p&gt;

View file

@ -164,8 +164,8 @@ public class SubSystemConfigurationProxy implements ISubSystemConfigurationProxy
// If the subsystem configuration supports all system types, just add all // If the subsystem configuration supports all system types, just add all
// currently registered system types to th resolved list // currently registered system types to th resolved list
if (supportsAllSystemTypes()) { if (supportsAllSystemTypes()) {
String[] systemTypes = RSECorePlugin.getDefault().getRegistry().getSystemTypeNames(); IRSESystemType[] systemTypes = RSECorePlugin.getDefault().getRegistry().getSystemTypes();
if (systemTypes != null) resolvedSystemTypes.addAll(Arrays.asList(systemTypes)); for (int i = 0; i < systemTypes.length; i++) resolvedSystemTypes.add(systemTypes[i].getName());
} else { } else {
// We have to match the given lists of system type ids against // We have to match the given lists of system type ids against
// the list of available system types. As the list of system types cannot // the list of available system types. As the list of system types cannot