Community
Participate
Working Groups
If you call restrictToSystemType on a org.eclipse.rse.ui.wizards.newconnection.RSEMainNewConnectionWizard, the wizard will not be able to get past the first page. The next button remains grayed out.
Works perfect for me. See attached screenshot. However, you should not use RSEMainNewConnectionWizard directly. Much better is to open the new connection wizard, with or without restrictions, via the SystemNewConnectionAction. This action asures that the RSEMainNewConnectionWizard is handled correctly
Created attachment 105476 [details] New Connection Wizard with restricted system types
I agree with Uwe and think this request is invalid. Reopen if you disagree.
The problem seems to occur when you have an RseMainNewConnectionWizard that you want to restrict to a single system type.
To help define my situation better, I have an IWizardNode, and I want one of the wizards to create a connection, but be limited to a single connection type, which makes using the SystemNewConnectionAction problematic.
(In reply to comment #5) As Uwe has shown, restricting to system type works fine in the wizard. Considering your IWizardNode situation, could it be that your problem really is that you're trying to triple-nest wizards here? RSEMainNewConnectionWizard is a wizard delegating to other wizards. Embedding that one as a delegate might be problematic. Jacob, given that we can prove that restricting to System types works fine in "naked" standard RSE, I'm afraid we'll be only able to help you if you come up with some sample code that we can execute to reproduce your problem, or you debug it and attach a patch that fixes your problem. For the sample code, you can do the simplest thing you can think of and attach a patch (e.g. create an additional toolbar button in rse.ui/plugin.xml that runs your code) - or, write a unit test.
I'm still not fully understanding the use-case here. Asuming you have your own wizard creating or doing whatever. This wizard should create an RSE connection as one of it's steps? If yes, why are you trying to embed the whole wizard UI including the system type selection page into your wizard? You can either provide a button to create a new connection and the button is doing nothing else than opening a subwizard dialog via the SystemNewConnectionAction or as you know the specific system type you should do what the SystemNewConnectionAction does ... RSEMainNewConnectionWizard newConnWizard = new RSEMainNewConnectionWizard(); ... newConnWizard.restrictToSystemTypes(...); ... if (newConnWizard.isRestrictedToSingleSystemType()) { IWizard wizard = newConnWizard.getSelectedWizard(); if (wizard instanceof ISelectionChangedListener) { ((ISelectionChangedListener)wizard).selectionChanged(new SelectionChangedEvent(newConnWizard, newConnWizard.getSelection())); } return wizard; } and use the system type specific wizard directly. It doesn't make sense to use the system type selection page if there is only one system type to select.
Uwe, I agree with your second suggestion, since I do not need the selection page. However, there can still be a situation where someone does not know they will only have one connection type at compile time, and will want to use a wizard instead of an action, so I believe the bug is still valid. I sadly do not have time at the moment to create a simple case in base RSE, but I will do so at a future time if needed.
Uwe has shown that "restrict to system type" works properly, at least when the Sample Code is used that we use in the SystemNewConnectionAction, and that Uwe also posted. It might be necessary to manually update the selection or something like that. Uwe, can you think of anything that we still have to do or is this request in fact INVALID?
Martin, let's give Jacob a chance to make his case. He decreased the severity to minor already and I've set priority to P4 now. Leave it assigned to me and I'll try to solve it with him. I haven't much time either, but I can give it a try to construct a case based on Jacobs information. I remember that handling a single wizard within the selection page had been difficult, mainly because the user do no require to click on the system type as, if I'm not mistaken, the system type is preselected. I try to reserve some time for it as soon as I can. Deal?
Thanks Uwe. Though I still think that Jacob is the next actor, so I don't see any urgency for this before we get more information. Deal!
Created attachment 106663 [details] Adds an interactive test case for reproducing the issue The patch adds a new interactive test suite which is opening a wizard having a page allowing for very simple system type selection. Once a system type is selected, the user can advance to the next page, which is the standard RSE new connection system type selection page backed up by a standard RSEMainNewConnectionWizard instance. If the user switches to the second page, the next and the finish buttons will not be activated. Jacob: Can you please confirm that this is exactly what you see and the test case is matching your approach?
Created attachment 106664 [details] mylyn/context/zip
Hi Jacob, you can very easely workaround the issue on your end. After the line where you restrict the system type to the main wizard add the initialization of the wizard pages. ... fMainWizard.restrictToSystemType(<the single system type instance>); // Initialize the pages of the selected wizard if (fMainWizard.getSelectedWizard() != null && fMainWizard.getSelectedWizard().getStartingPage() == null) { fMainWizard.getSelectedWizard().addPages(); } ... I even tend to believe that this is the correct usage anyway. Having the standard RSE new connection selection wizard page and the RSE main new connection wizard embedded within another wizard is a kind of special case. The requirement which causes the issue is that if the RSE new connection wizard is restricted to a single type, the main selection page shall _not_ be shown as this page will add nothing useful to the user. If restricted to a single system type, we open the new connection wizard directly with the first page of the system type specific new connection wizard. For fixing the issue to make it work without above workaround, we will have to detect that the main RSE new connection system type selection page isn't the first page shown by the enclosing wizard dialog. Not yet checked on this if we can get this information.
Created attachment 106702 [details] Patch to allow usage of new connection wizard embedded within another wizard - Fixed the issue within RSEMainNewConnectionWizard and call selectedWizard.addPages() if the system type selection page isn't the first page. - Fixed an issue within the system type selection page which failed to refresh the tree content if the restricted system type changed - Fixed an issue within the system type selection page which failed to update the initial selection if the restricted system type changed. This fix introduce a new API method, therefor the patch can be applied to the 3.1 branch only.
Applied and retested applied patches.
Fix involved an API addition: RSENewConnectionWizardSelectionPage#initializeSelection(TreeViewer)