Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Update doc links for registries and remote connections (#496)
Browse files Browse the repository at this point in the history
Signed-off-by: John Pitman <[email protected]>
  • Loading branch information
jopit authored Dec 13, 2019
1 parent 03bce75 commit ccaeb27
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ private UIConstants() {}
DOC_BASE_URL = "https://www.eclipse.org/codewind",
CWSETTINGS_INFO_URL = DOC_BASE_URL + "/mdteclipsemanagingprojects.html",
TEMPLATES_INFO_URL = DOC_BASE_URL + "/mdteclipseworkingwithtemplates.html",
REGISTRY_INFO_URL = DOC_BASE_URL + "/dockerregistry.html";
REGISTRY_INFO_URL = DOC_BASE_URL + "/image-registry-credentials.html",
REMOTE_SETUP_URL = DOC_BASE_URL +"/remoteconfiguring.html";
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;

import org.eclipse.codewind.core.internal.CodewindObjectFactory;
import org.eclipse.codewind.core.internal.Logger;
Expand All @@ -22,6 +23,7 @@
import org.eclipse.codewind.core.internal.connection.CodewindConnection;
import org.eclipse.codewind.core.internal.connection.CodewindConnectionManager;
import org.eclipse.codewind.ui.CodewindUIPlugin;
import org.eclipse.codewind.ui.internal.UIConstants;
import org.eclipse.codewind.ui.internal.messages.Messages;
import org.eclipse.codewind.ui.internal.views.ViewHelper;
import org.eclipse.core.runtime.IProgressMonitor;
Expand All @@ -33,11 +35,17 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.browser.IWebBrowser;
import org.eclipse.ui.browser.IWorkbenchBrowserSupport;

public class CodewindConnectionComposite extends Composite {

Expand Down Expand Up @@ -84,6 +92,24 @@ protected void createControl() {

createLabel(Messages.CodewindConnectionComposite_PasswordLabel, this, 1);
connPassText = createConnText(this, SWT.PASSWORD, 1);

Link learnMoreLink = new Link(this, SWT.NONE);
learnMoreLink.setText("<a>" + Messages.RegMgmtLearnMoreLink + "</a>"); //$NON-NLS-1$ //$NON-NLS-2$
learnMoreLink.setLayoutData(new GridData(GridData.BEGINNING, GridData.END, false, false, 1, 1));

learnMoreLink.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
try {
IWorkbenchBrowserSupport browserSupport = PlatformUI.getWorkbench().getBrowserSupport();
IWebBrowser browser = browserSupport.getExternalBrowser();
URL url = new URL(UIConstants.REMOTE_SETUP_URL);
browser.openURL(url);
} catch (Exception e) {
Logger.logError("An error occurred trying to open an external browser at: " + UIConstants.TEMPLATES_INFO_URL, e); //$NON-NLS-1$
}
}
});

initialize();
connNameText.setFocus();
Expand Down

0 comments on commit ccaeb27

Please sign in to comment.