- initText(formFactory, null, textHeight, null, false, style, getLayoutComposite());
+ initText(formFactory, null, textHeight, null, false, style, textAndButton);
+ //button
+ btnOpenBrowser = formFactory.createButton(textAndButton, "", SWT.NONE); //$NON-NLS-1$
+ btnOpenBrowser.setImage(ImageResources.getImage(ImageResources.WEB));
+ btnOpenBrowser.setToolTipText(Messages.UriWithLabelElement_OPEN_EXTERNAL_BROWSER);
+ btnOpenBrowser.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ String errorTitle = Messages.UriWithLabelElement_INVALID_URL;
+ String errorText = Messages.UriWithLabelElement_COULD_NOT_OPEN_BROWSER;
+
+ ORCID orcid = parseText();
+ if(orcid!=null){
+ try {
+ WorkbenchUtility.openWebpage(orcid.asURI());
+ } catch (IllegalArgumentException iae) {
+ MessagingUtils.informationDialog(errorTitle, new Status(IStatus.WARNING, TaxeditorStorePlugin.PLUGIN_ID, errorText, iae));
+ }
+ }
+ else{
+ MessagingUtils.informationDialog(errorTitle, new Status(IStatus.WARNING, TaxeditorStorePlugin.PLUGIN_ID, errorText, null));
+ }
+ }
+ });
+ btnOpenBrowser.setLayoutData(LayoutConstants.RIGHT());