diff options
author | spingel | 2010-04-21 22:51:55 +0000 |
---|---|---|
committer | spingel | 2010-04-21 22:51:55 +0000 |
commit | 526aefb4d21f0d62a1bb66f3bf44bec3b9a1ecd9 (patch) | |
tree | f58f4334e00fbea8197d1cf79cf1270a1ac4e366 /bundles/org.eclipse.equinox.p2.ui.discovery | |
parent | 03250cbef00a3bf29730047883dea8930fbfcf92 (diff) | |
download | rt.equinox.p2-526aefb4d21f0d62a1bb66f3bf44bec3b9a1ecd9.tar.gz rt.equinox.p2-526aefb4d21f0d62a1bb66f3bf44bec3b9a1ecd9.tar.xz rt.equinox.p2-526aefb4d21f0d62a1bb66f3bf44bec3b9a1ecd9.zip |
bug 304843 - [discovery] ensure sufficient extensibility for Eclipse marketplace client
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.ui.discovery')
4 files changed, 41 insertions, 27 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/util/ControlListViewer.java b/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/util/ControlListViewer.java index ef3879296..c5f3ae786 100644 --- a/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/util/ControlListViewer.java +++ b/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/util/ControlListViewer.java @@ -52,13 +52,14 @@ public abstract class ControlListViewer extends StructuredViewer { scrolled.getVerticalBar().setIncrement(height * 2); scrolled.setExpandHorizontal(true); scrolled.setExpandVertical(true); + scrolled.setShowFocusedControl(true); control = new Composite(scrolled, SWT.NONE) { - @Override - public boolean setFocus() { - forceFocus(); - return true; - } +// @Override +// public boolean setFocus() { +// forceFocus(); +// return true; +// } @Override public void setVisible(boolean visible) { diff --git a/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/util/FilteredViewer.java b/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/util/FilteredViewer.java index e37239faa..b44c13b6a 100644 --- a/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/util/FilteredViewer.java +++ b/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/util/FilteredViewer.java @@ -94,6 +94,7 @@ public abstract class FilteredViewer { private void doCreateFindControl(Composite parent) { Label label = new Label(parent, SWT.NONE); label.setText(Messages.ConnectorDiscoveryWizardMainPage_filterLabel); + GridDataFactory.swtDefaults().align(SWT.BEGINNING, SWT.CENTER).applyTo(label); filterText = new TextSearchControl(parent, automaticFind); if (automaticFind) { @@ -114,7 +115,7 @@ public abstract class FilteredViewer { } } }); - GridDataFactory.fillDefaults().grab(true, false).applyTo(filterText); + GridDataFactory.fillDefaults().grab(true, false).align(SWT.FILL, SWT.CENTER).applyTo(filterText); } private void doCreateHeader() { @@ -175,7 +176,10 @@ public abstract class FilteredViewer { viewer.refresh(true); } - void filterTextChanged() { + /** + * Invoked whenever the filter text is changed or the user otherwise causes the filter text to change. + */ + protected void filterTextChanged() { if (refreshJob == null) { refreshJob = doCreateRefreshJob(); } else { @@ -184,6 +188,13 @@ public abstract class FilteredViewer { refreshJob.schedule(refreshJobDelay); } + /** + * Provides the text string of the search widget. + */ + protected String getFilterText() { + return filterText == null ? null : filterText.getTextControl().getText(); + } + public Control getControl() { return container; } diff --git a/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/wizards/CatalogViewer.java b/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/wizards/CatalogViewer.java index 6bf54ecf1..fceb2ddb4 100644 --- a/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/wizards/CatalogViewer.java +++ b/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/wizards/CatalogViewer.java @@ -254,7 +254,7 @@ public class CatalogViewer extends FilteredViewer { } } - private IStatus computeStatus(InvocationTargetException e, String message) { + protected IStatus computeStatus(InvocationTargetException e, String message) { Throwable cause = e.getCause(); if (cause.getMessage() != null) { message = NLS.bind(Messages.ConnectorDiscoveryWizardMainPage_message_with_cause, message, cause.getMessage()); @@ -587,28 +587,30 @@ public class CatalogViewer extends FilteredViewer { } if (catalog != null) { catalogUpdated(wasCancelled, wasError); - if (configuration.isVerifyUpdateSiteAvailability() && !catalog.getItems().isEmpty()) { - try { - context.run(true, true, new IRunnableWithProgress() { - public void run(IProgressMonitor monitor) { - SiteVerifier verifier = new SiteVerifier(catalog); - verifier.verifySiteAvailability(monitor); - } - }); - } catch (InvocationTargetException e) { - IStatus status = computeStatus(e, Messages.ConnectorDiscoveryWizardMainPage_unexpectedException); - StatusManager.getManager().handle(status, StatusManager.SHOW | StatusManager.BLOCK | StatusManager.LOG); - wasError = true; - } catch (InterruptedException e) { - // cancelled by user so nothing to do here. - wasCancelled = true; - } - } + verifyUpdateSiteAvailability(); } // help UI tests viewer.setData("discoveryComplete", "true"); //$NON-NLS-1$//$NON-NLS-2$ } + protected void verifyUpdateSiteAvailability() { + if (configuration.isVerifyUpdateSiteAvailability() && !catalog.getItems().isEmpty()) { + try { + context.run(true, true, new IRunnableWithProgress() { + public void run(IProgressMonitor monitor) { + SiteVerifier verifier = new SiteVerifier(catalog); + verifier.verifySiteAvailability(monitor); + } + }); + } catch (InvocationTargetException e) { + IStatus status = computeStatus(e, Messages.ConnectorDiscoveryWizardMainPage_unexpectedException); + StatusManager.getManager().handle(status, StatusManager.SHOW | StatusManager.BLOCK | StatusManager.LOG); + } catch (InterruptedException e) { + // cancelled by user so nothing to do here. + } + } + } + private void updateState() { setComplete(!checkedItems.isEmpty()); selectionProvider.setSelection(new StructuredSelection(getCheckedItems())); diff --git a/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/wizards/messages.properties b/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/wizards/messages.properties index bdcde965d..6eb528502 100644 --- a/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/wizards/messages.properties +++ b/bundles/org.eclipse.equinox.p2.ui.discovery/src/org/eclipse/equinox/internal/p2/ui/discovery/wizards/messages.properties @@ -12,7 +12,7 @@ ConnectorDescriptorToolTip_detailsLink=<a>Learn more</a> ConnectorDescriptorToolTip_detailsLink_tooltip=Open {0} in an external browser ConnectorDiscoveryWizard_installProblems=Problems occurred while performing installation: {0} ConnectorDiscoveryWizardMainPage_connectorDiscovery=Install Extensions -ConnectorDiscoveryWizardMainPage_filterLabel=Find: +ConnectorDiscoveryWizardMainPage_filterLabel=F&ind: ConnectorDiscoveryWizardMainPage_message_with_cause={0}: {1} ConnectorDiscoveryWizardMainPage_noConnectorsFound=No Extensions Found ConnectorDiscoveryWizardMainPage_noConnectorsFound_description=Discovery completed without finding any extensions. Please check your network connection and try again. @@ -28,7 +28,7 @@ DiscoveryItem_Connector_already_installed_Error_Message={0} is already installed DiscoveryItem_Connector_already_installed_Error_Title=Install Extension DiscoveryItem_Extension_installed={0} (installed) DiscoveryViewer_Certification_Label0=by {0}, {1}, <a>Certified</a> -DiscoveryViewer_Show_Installed=Show Installed +DiscoveryViewer_Show_Installed=Show &Installed DiscoveryWizard_Install_Window_Title=Install InstallConnectorsJob_commaSeparator=, InstallConnectorsJob_connectorsNotAvailable=The following extensions are not available: {0} |