*/
package eu.etaxonomy.taxeditor.ui.element;
-import java.io.IOException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import eu.etaxonomy.cdm.common.DOI;
import eu.etaxonomy.taxeditor.l10n.Messages;
-import eu.etaxonomy.taxeditor.model.ImageResources;
-import eu.etaxonomy.taxeditor.model.MessagingUtils;
-import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
-import eu.etaxonomy.taxeditor.workbench.WorkbenchUtility;
/**
* @author k.luther
//uri text
initText(formFactory, null, textHeight, null, false, style, getLayoutComposite());
- Composite textAndButton = formFactory.createComposite(getLayoutComposite(), style);
- addControl(textAndButton);
- textAndButton.setLayout(LayoutConstants.LAYOUT(2, false));
- textAndButton.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
- //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;
-
- DOI doi= parseText();
- if(doi!=null){
- try {
- WorkbenchUtility.openWebpage(new URL(doi.asURI()));
- } catch (IOException pie) {
- MessagingUtils.informationDialog(errorTitle, new Status(IStatus.WARNING, TaxeditorStorePlugin.PLUGIN_ID, errorText, pie));
- } 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());
+// Composite textAndButton = formFactory.createComposite(getLayoutComposite(), style);
+// addControl(textAndButton);
+// textAndButton.setLayout(LayoutConstants.LAYOUT(2, false));
+// textAndButton.setLayoutData(LayoutConstants.FILL_HORIZONTALLY());
+// //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;
+//
+// DOI doi= parseText();
+// if(doi!=null){
+// try {
+// WorkbenchUtility.openWebpage(new URL(doi.asURI()));
+// } catch (IOException pie) {
+// MessagingUtils.informationDialog(errorTitle, new Status(IStatus.WARNING, TaxeditorStorePlugin.PLUGIN_ID, errorText, pie));
+// } 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());
initExceptionLabel(getLayoutComposite(), formFactory, initialObject);
}