mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-21 07:05:58 +02:00
[cleanup] Class documentation for changed system type enablement check order
This commit is contained in:
parent
7402ada104
commit
3474b27f34
1 changed files with 10 additions and 9 deletions
|
@ -60,8 +60,8 @@ import org.eclipse.ui.dialogs.PatternFilter;
|
||||||
* <b>Note:</b> The page allows filtering of the presented wizard list by adapting
|
* <b>Note:</b> The page allows filtering of the presented wizard list by adapting
|
||||||
* the associated system type to<br>
|
* the associated system type to<br>
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li><code>org.eclipse.rse.ui.RSESystemTypeAdapter</code>: calling <code>RSESystemTypeAdapter.isEnabled(...)</code> and</li>
|
* <li><code>org.eclipse.jface.viewers.ViewerFilter</code>: calling <code>ViewerFilter.select(...)</code> and double-check via.</li>
|
||||||
* <li><code>org.eclipse.jface.viewers.ViewerFilter</code>: calling <code>ViewerFilter.select(...)</code>.
|
* <li><code>org.eclipse.rse.ui.RSESystemTypeAdapter</code>: calling <code>RSESystemTypeAdapter.isEnabled(...)</code>.</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
public class RSENewConnectionWizardSelectionPage extends WizardPage {
|
public class RSENewConnectionWizardSelectionPage extends WizardPage {
|
||||||
|
@ -103,18 +103,19 @@ public class RSENewConnectionWizardSelectionPage extends WizardPage {
|
||||||
if (!Arrays.asList(restricted).contains(systemType)) return false;
|
if (!Arrays.asList(restricted).contains(systemType)) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// first check if the system type is enabled at all.
|
// First, adapt the system type to a viewer filter and pass on the select request
|
||||||
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemType.getAdapter(IRSESystemType.class));
|
|
||||||
if (adapter != null && !adapter.isEnabled(systemType)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// second, adapt the system type to a viewer filter and pass on the select request
|
|
||||||
// to the viewer filter adapter if available
|
// to the viewer filter adapter if available
|
||||||
ViewerFilter filter = (ViewerFilter)(systemType.getAdapter(ViewerFilter.class));
|
ViewerFilter filter = (ViewerFilter)(systemType.getAdapter(ViewerFilter.class));
|
||||||
if (filter != null && !filter.select(viewer, parentElement, element)) {
|
if (filter != null && !filter.select(viewer, parentElement, element)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Second, double check if the system type passed the viewer filter but is disabled.
|
||||||
|
RSESystemTypeAdapter adapter = (RSESystemTypeAdapter)(systemType.getAdapter(IRSESystemType.class));
|
||||||
|
if (adapter != null && !adapter.isEnabled(systemType)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// In all other cases, the element passes the filter
|
// In all other cases, the element passes the filter
|
||||||
|
|
Loading…
Add table
Reference in a new issue