Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Weiser2017-01-25 03:57:41 -0500
committerStefan Xenos2017-04-25 12:48:39 -0400
commit687c12340b48cb86c55e47a2391287d2a6a56477 (patch)
tree95866356c8cb540abf09264a33a72e325b403b8a
parent62551d88ae657bbf470ae3dec77563bb322b8f16 (diff)
downloadrt.equinox.p2-687c12340b48cb86c55e47a2391287d2a6a56477.tar.gz
rt.equinox.p2-687c12340b48cb86c55e47a2391287d2a6a56477.tar.xz
rt.equinox.p2-687c12340b48cb86c55e47a2391287d2a6a56477.zip
Bug 510497 - Installation dialog - Move "Find more software..." text toI20170425-2000
button * replaces "Available Software" hyperlink with "Manage"-button * adds Strings for new button * removes obsolete Strings * adds mnemonic Change-Id: I103ba7621e199fd343e064da5a5c70af215bc3f7 Signed-off-by: David Weiser <david.weiser@vogella.com>
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIMessages.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RepositorySelectionGroup.java63
-rw-r--r--bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/messages.properties4
3 files changed, 23 insertions, 48 deletions
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIMessages.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIMessages.java
index 6ab19e280..a3caadf2a 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIMessages.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/ProvUIMessages.java
@@ -149,14 +149,12 @@ public class ProvUIMessages extends NLS {
public static String RepositoryManipulationPage_TestConnectionSuccess;
public static String RepositoryManipulationPage_TestConnectionTitle;
public static String RepositoryManipulationPage_Title;
+ public static String RepositoryManipulationPage_Manage;
public static String RepositoryManipulatorDropTarget_DragAndDropJobLabel;
public static String RepositoryManipulatorDropTarget_DragSourceNotValid;
public static String RepositoryNameAndLocationDialog_Title;
- public static String RepositorySelectionGroup_GenericSiteLinkTitle;
public static String RepositorySelectionGroup_NameAndLocationSeparator;
- public static String RepositorySelectionGroup_PrefPageLink;
- public static String RepositorySelectionGroup_PrefPageName;
public static String ResolutionWizardPage_Canceled;
public static String ResolutionWizardPage_ErrorStatus;
public static String ResolutionWizardPage_NoSelections;
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RepositorySelectionGroup.java b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RepositorySelectionGroup.java
index cef599241..4f44b7aef 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RepositorySelectionGroup.java
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RepositorySelectionGroup.java
@@ -26,7 +26,6 @@ import org.eclipse.equinox.p2.repository.IRepository;
import org.eclipse.equinox.p2.repository.IRepositoryManager;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.equinox.p2.ui.ProvisioningUI;
-import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -106,7 +105,7 @@ public class RepositorySelectionGroup {
GridLayout layout = new GridLayout();
layout.marginTop = 0;
layout.marginBottom = IDialogConstants.VERTICAL_SPACING;
- layout.numColumns = 3;
+ layout.numColumns = 4;
comboComposite.setLayout(layout);
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, false);
comboComposite.setLayoutData(gd);
@@ -214,21 +213,7 @@ public class RepositorySelectionGroup {
setButtonLayoutData(button);
button.setFont(comboComposite.getFont());
- // Link to repository manipulator
- repoManipulatorLink = createLink(comboComposite, new Action() {
- @Override
- public void runWithEvent(Event event) {
- if (repositoryManipulationHook != null)
- repositoryManipulationHook.preManipulateRepositories();
- ui.manipulateRepositories(repoCombo.getShell());
- if (repositoryManipulationHook != null)
- repositoryManipulationHook.postManipulateRepositories();
- }
- }, getLinkLabel());
- gd = new GridData(SWT.END, SWT.FILL, true, false);
- gd.horizontalSpan = 3;
- repoManipulatorLink.setLayoutData(gd);
- repoManipulatorLink.setFont(comboComposite.getFont());
+ createRepoManipulatorButton(comboComposite);
addComboProvisioningListeners();
parent.addDisposeListener(new DisposeListener() {
@@ -240,14 +225,26 @@ public class RepositorySelectionGroup {
});
}
- private String getLinkLabel() {
- if (ui.getPolicy().getRepositoryPreferencePageId() != null) {
- String pageName = ui.getPolicy().getRepositoryPreferencePageName();
- if (pageName == null)
- pageName = ProvUIMessages.RepositorySelectionGroup_PrefPageName;
- return NLS.bind(ProvUIMessages.RepositorySelectionGroup_PrefPageLink, pageName);
+ private void createRepoManipulatorButton(Composite comboComposite) {
+ Button repoManipulatorButton = new Button(comboComposite, SWT.PUSH);
+ repoManipulatorButton.setText(ProvUIMessages.RepositoryManipulationPage_Manage);
+ setButtonLayoutData(repoManipulatorButton);
+ repoManipulatorButton.setFont(comboComposite.getFont());
+
+ repoManipulatorButton.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
+ openRepoManipulatorUi();
+ }));
+ }
+
+ private void openRepoManipulatorUi() {
+ if (repositoryManipulationHook != null) {
+ repositoryManipulationHook.preManipulateRepositories();
+ }
+ ui.manipulateRepositories(repoCombo.getShell());
+
+ if (repositoryManipulationHook != null) {
+ repositoryManipulationHook.postManipulateRepositories();
}
- return ProvUIMessages.RepositorySelectionGroup_GenericSiteLinkTitle;
}
private void setButtonLayoutData(Button button) {
@@ -393,24 +390,6 @@ public class RepositorySelectionGroup {
return URIUtil.toUnencodedString(uri);
}
- private Link createLink(Composite parent, IAction action, String text) {
- Link link = new Link(parent, SWT.PUSH);
- link.setText(text);
-
- link.addListener(SWT.Selection, new Listener() {
- @Override
- public void handleEvent(Event event) {
- IAction linkAction = getLinkAction(event.widget);
- if (linkAction != null) {
- linkAction.runWithEvent(event);
- }
- }
- });
- link.setToolTipText(action.getToolTipText());
- link.setData(LINKACTION, action);
- return link;
- }
-
IAction getLinkAction(Widget widget) {
Object data = widget.getData(LINKACTION);
if (data == null || !(data instanceof IAction)) {
diff --git a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/messages.properties b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/messages.properties
index d6bc99629..7d61f00af 100644
--- a/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/messages.properties
+++ b/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/messages.properties
@@ -97,14 +97,12 @@ RepositoryManipulationPage_RemoveConfirmTitle=Remove Sites
RepositoryManipulationPage_TestConnectionSuccess=Information for "{0}" has been reloaded from the server.
RepositoryManipulationPage_TestConnectionTitle=Reload
RepositoryManipulationPage_Title=Available Software Sites
+RepositoryManipulationPage_Manage=&Manage...
RepositoryManipulatorDropTarget_DragAndDropJobLabel=Drag and Drop Operation
RepositoryManipulatorDropTarget_DragSourceNotValid={0} was not accepted as a valid software site location. Check the details.
RepositoryNameAndLocationDialog_Title=Edit Site
-RepositorySelectionGroup_GenericSiteLinkTitle=<a>Work with the list of software sites</a>
# Separator used between a site's name and URL when they are shown together, such as "http://update.example.com - Example Site"
RepositorySelectionGroup_NameAndLocationSeparator=\ -
-RepositorySelectionGroup_PrefPageLink=Find more software by working with the <a>"{0}"</a> preferences.
-RepositorySelectionGroup_PrefPageName=Software Sites
ResolutionWizardPage_Canceled=The operation was cancelled.
ResolutionWizardPage_ErrorStatus=The operation cannot be completed. See the details.
ResolutionWizardPage_NoSelections=There were no installable units selected when the plan was computed.

Back to the top