package name.abuchen.portfolio.ui.preferences;

import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Link;

import name.abuchen.portfolio.ui.UIConstants;
import name.abuchen.portfolio.ui.util.DesktopAPI;

public class PortfolioReportPreferencePage extends FieldEditorPreferencePage
{

    public PortfolioReportPreferencePage()
    {
        super(GRID);

        setTitle("Portfolio Report");
        setDescription("Sync data with server portfolio");
    }

    @Override
    public void createFieldEditors()
    {
        Link link = new Link(getFieldEditorParent(), SWT.NONE);
        link.setText("<a>https://api.portfolio-report.net/doc/</a>"); //$NON-NLS-1$
        link.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 3, 1));
        link.addSelectionListener(new SelectionAdapter()
        {
            @Override
            public void widgetSelected(final SelectionEvent event)
            {
                DesktopAPI.browse("https://app.portfolio-report.net/"); //$NON-NLS-1$
            }
        });

        addField(new StringFieldEditor(UIConstants.Preferences.PORTFOLIO_REPORT_API_KEY, //
                        "Portfolio Report Session Key", getFieldEditorParent()));
    }
}

@@ -359,16 +359,59 @@
 .Link;%0A%0A
+import name.abuchen.portfolio.ui.Messages;%0A
 import n
@@ -448,16 +448,16 @@
 stants;%0A
-
 import n
@@ -910,17 +910,17 @@
 tps://ap
-i
+p
 .portfol
@@ -937,12 +937,8 @@
 net/
-doc/
 %3C/a%3E
@@ -1411,16 +1411,16 @@
 KEY, //%0A
-
         
@@ -1489,20 +1489,192 @@
 Parent()));%0A
+%0A        createNoteComposite(getFieldEditorParent().getFont(), getFieldEditorParent(), //%0A                        Messages.PrefLabelNote, %22Keep the session key secret!%22);%0A%0A
     %7D%0A%7D%0A

Add warning to PortfolioReportPreferencePage