Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browser dashboard widget #2918

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -833,6 +833,7 @@ public class Messages extends NLS
public static String MenuChartXZoomOut;
public static String MenuChartYZoomIn;
public static String MenuChartYZoomOut;
public static String MenuChangeUrl;
public static String MenuChooseClientFilter;
public static String MenuConfigureChart;
public static String MenuConfigureCurrentDashboard;
Expand Down Expand Up @@ -1189,11 +1190,13 @@ public class Messages extends NLS
public static String TooltipSemiVolatility;
public static String TooltipTurnoverRate;
public static String TooltipVolatility;
public static String Url;
public static String WatchlistDelete;
public static String WatchlistEditDialog;
public static String WatchlistEditDialogMsg;
public static String WatchlistNewLabel;
public static String WatchlistRename;
public static String Website;
public static String BookmarkMenu_EditBookmarks;
public static String FilterNotRetired;
public static String MenuFilterTrades;
Expand Down
Expand Up @@ -1654,6 +1654,8 @@ MenuApplyToAllWidgets = Apply to all

MenuChangeHeight = Change height...

MenuChangeUrl = Change URL...

MenuChartAdjustRange = Adjust Range

MenuChartXScrollDown = Scroll left
Expand Down Expand Up @@ -2400,6 +2402,8 @@ TooltipTurnoverRate = The Portfolio Turnover Rate measures how much of the portf

TooltipVolatility = Volatility (or variance) is a measure for variation of price of a financial instrument over time.\n\nThe volatility is calculated using the "accumulated" data series. Therefore performance-neutral transactions have no impact. Weekends and public holidays are ignored (for example Easter and Christmas days).

Url = URL

WatchlistDelete = Delete Watchlist

WatchlistEditDialog = Edit Watchlist Name
Expand All @@ -2410,4 +2414,6 @@ WatchlistNewLabel = New Watchlist

WatchlistRename = Rename Watchlist

Website = Website

YearlyPerformanceHeatmapToolTip = Yearly rate of return displayed as heatmap\n\nTo calculate the yearly rate of return, the true-time weighted rate of return (TTWROR) is used.\n\nThe rate of return is always calculated for the full year - even if the reporting interval ends or starts in the middle of a year.
Expand Up @@ -1640,6 +1640,8 @@ MenuApplyToAllWidgets = Pou\u017E\u00EDt pro v\u0161echny

MenuChangeHeight = Zm\u011Bnit v\u00FD\u0161ku...

MenuChangeUrl = Zm\u011Bna adresy URL...

MenuChartAdjustRange = Upravit rozsah

MenuChartXScrollDown = Posun doleva
Expand Down Expand Up @@ -2384,6 +2386,8 @@ TooltipTurnoverRate = Obr\u00E1tkovost portfolia se m\u011B\u0159\u00ED, jak vel

TooltipVolatility = Volatilita (neboli rozptyl) je m\u011B\u0159\u00EDtkem kol\u00EDs\u00E1n\u00ED ceny finan\u010Dn\u00EDho n\u00E1stroje v \u010Dase.\n\nVolatilita se po\u010D\u00EDt\u00E1 na z\u00E1klad\u011B "kumulovan\u00FDch" datov\u00FDch \u0159ad. V\u00FDkonnostn\u011B neutr\u00E1ln\u00ED transakce proto nemaj\u00ED \u017E\u00E1dn\u00FD vliv. V\u00EDkendy a st\u00E1tn\u00ED sv\u00E1tky se ignoruj\u00ED (nap\u0159\u00EDklad velikono\u010Dn\u00ED a v\u00E1no\u010Dn\u00ED dny).

Url = URL

WatchlistDelete = Odstranit seznam sledovan\u00FDch polo\u017Eek

WatchlistEditDialog = Upravit n\u00E1zev seznamu sledov\u00E1n\u00ED
Expand All @@ -2394,4 +2398,6 @@ WatchlistNewLabel = Nov\u00FD seznam sledov\u00E1n\u00ED

WatchlistRename = P\u0159ejmenovat seznam sledov\u00E1n\u00ED

Website = Website

YearlyPerformanceHeatmapToolTip = Ro\u010Dn\u00ED m\u00EDra n\u00E1vratnosti zobrazen\u00E1 jako tepeln\u00E1 mapa\n\nPro v\u00FDpo\u010Det ro\u010Dn\u00ED m\u00EDry n\u00E1vratnosti se pou\u017E\u00EDv\u00E1 skute\u010Dn\u00E1 \u010Dasov\u011B v\u00E1\u017Een\u00E1 m\u00EDra n\u00E1vratnosti (TTWROR).\n\nM\u00EDra n\u00E1vratnosti se po\u010D\u00EDt\u00E1 v\u017Edy za cel\u00FD rok - i kdy\u017E vykazovan\u00FD interval kon\u010D\u00ED nebo za\u010D\u00EDn\u00E1 uprost\u0159ed roku.
Expand Up @@ -1639,6 +1639,8 @@ MenuApplyToAllWidgets = Auf alle anwenden

MenuChangeHeight = H\u00F6he \u00E4ndern...

MenuChangeUrl = URL \u00E4ndern...

MenuChartAdjustRange = Originalgr\u00F6\u00DFe

MenuChartXScrollDown = Nach links verschieben
Expand Down Expand Up @@ -2383,6 +2385,8 @@ TooltipTurnoverRate = Das Turnover-Verh\u00E4ltnis gibt an, welchen Anteil des P

TooltipVolatility = Die Volatilit\u00E4t gibt an, wie stark ein Kurs schwankt. Je h\u00F6her die Volatilit\u00E4t ist, desto st\u00E4rker weichen die einzelnen Renditen vom erwarteten Mittelwert ab, sowohl nach Oben als auch nach Unten. Die Volatilit\u00E4t ist definiert als die Standardabweichung zwischen der erzielten Rendite und dem arithmetischen Durchschnitt der Renditen.\n\nHier wird die Volatilit\u00E4t mit der "akkumuliert" Datenreihe errechnet. Performanceneutrale Bewegungen haben keinen Einflu\u00DF. Wochenenden und B\u00F6rsenfeiertage (z.B. Ostern oder Weihnachten) werden ignoriert.

Url = URL

WatchlistDelete = Watchliste l\u00F6schen

WatchlistEditDialog = Watchliste editieren
Expand All @@ -2393,4 +2397,6 @@ WatchlistNewLabel = Neue Watchliste

WatchlistRename = Watchliste umbenennen

Website = Website

YearlyPerformanceHeatmapToolTip = Jahresrenditen in einer Heatmap\n\nZur Berechnung der Jahresrendite wird der True-Time Weighted Rate of Return (TTWROR) herangezogen.\n\nDie Rendite bezieht sich immer auf das gesamte Jahr - selbst wenn der Berichtszeitraum in der Mitte des Jahres beginnt bzw. endet.
Expand Up @@ -1631,6 +1631,8 @@ MenuApplyToAllWidgets = Aplicar a todo

MenuChangeHeight = Cambiar altura ...

MenuChangeUrl = Cambiar la URL...

MenuChartAdjustRange = Ajustar Rango

MenuChartXScrollDown = Desplazarse a la izquierda
Expand Down Expand Up @@ -2375,6 +2377,8 @@ TooltipTurnoverRate = La tasa de rotaci\u00F3n de la cartera mide qu\u00E9 parte

TooltipVolatility = La volatilidad es una medida para observar la variaci\u00F3n de precio de un activo en el tiempo.\n\nLa volatilidad se calcula usando los datos "acumulados". Por tanto, las transacciones "nuetrales" (sin ganancias ni perdidas) no tienen impacto. Fines de semana y fiestas p\u00FAblicas se ignoran (como Navidad o Pascua).

Url = URL

WatchlistDelete = Eliminar la lista

WatchlistEditDialog = Renombrar lista
Expand All @@ -2385,4 +2389,6 @@ WatchlistNewLabel = Nueva lista

WatchlistRename = Renombrar lista

Website = Website

YearlyPerformanceHeatmapToolTip = Tasa de rendimiento anual mostrada en forma de mapa de calor\n\nPara calcular la tasa de rendimiento anual, se utiliza la tasa de rendimiento ponderada en tiempo real (TTWROR).\n\nLa tasa de rendimiento se calcula siempre para todo el a\u00F1o, aunque el intervalo del informe termine o comience a mitad de a\u00F1o.
Expand Up @@ -1636,6 +1636,8 @@ MenuApplyToAllWidgets = Appliquer \u00E0 tous

MenuChangeHeight = Changer hauteur...

MenuChangeUrl = Modifier l'URL...

MenuChartAdjustRange = Ajuster intervalle

MenuChartXScrollDown = D\u00E9filer vers la gauche
Expand Down Expand Up @@ -2382,6 +2384,8 @@ TooltipTurnoverRate = Le taux de rotation du portefeuille mesure la part du port

TooltipVolatility = La volatilit\u00E9 (ou variance) est une mesure de la variation du prix d'un instrument financier au fil du temps.\n\nLa volatilit\u00E9 est calcul\u00E9e \u00E0 l'aide de la s\u00E9rie de donn\u00E9es \u00AB accumul\u00E9es \u00BB. Par cons\u00E9quent, les transactions neutres en termes de performance n'ont aucun impact. Les week-ends et jours f\u00E9ri\u00E9s sont ignor\u00E9s (par exemple les jours de P\u00E2ques et de No\u00EBl).

Url = URL

WatchlistDelete = Supprimer liste

WatchlistEditDialog = \u00C9diter nom de liste
Expand All @@ -2392,4 +2396,6 @@ WatchlistNewLabel = Nouvelle liste

WatchlistRename = Renommer liste

Website = Website

YearlyPerformanceHeatmapToolTip = Taux de rendement annuel affich\u00E9 sous forme de heatmat\n\nPour calculer le taux de rendement annuel, le true-time weighted rate of return (TTWROR) est utilis\u00E9.\n\nLe taux de rendement est toujours calcul\u00E9 pour l'ann\u00E9e compl\u00E8te - m\u00EAme si l'intervalle s\u00E9lectionn\u00E9 se termine ou commence au milieu d'une ann\u00E9e.
Expand Up @@ -1641,6 +1641,8 @@ MenuApplyToAllWidgets = Applica a tutti

MenuChangeHeight = Cambia altezza...

MenuChangeUrl = Modifica dell'URL...

MenuChartAdjustRange = Regola intervallo

MenuChartXScrollDown = Scorri a sinistra
Expand Down Expand Up @@ -2387,6 +2389,8 @@ TooltipTurnoverRate = Il Portfolio Turnover Rate misura quanto il portafoglio \u

TooltipVolatility = La volatilit\u00E0 (o varianza) \u00E8 una misura della variazione del prezzo di uno strumento finanziario nel tempo.\n\nLa volatilit\u00E0 viene calcolata utilizzando la serie di dati "accumulati". Pertanto, le operazioni neutre in termini di prestazioni non hanno alcun impatto. I fine settimana e i giorni festivi vengono ignorati (ad esempio Pasqua e Natale).

Url = URL

WatchlistDelete = Elimina Watchlist

WatchlistEditDialog = Modifica nome Watchlist
Expand All @@ -2397,4 +2401,6 @@ WatchlistNewLabel = Nuova Watchlist

WatchlistRename = Rinomina Watchlist

Website = Website

YearlyPerformanceHeatmapToolTip = Tasso di rendimento annuale visualizzato come mappa termica\n\nPer calcolare il tasso di rendimento annuale, viene utilizzato il tasso di rendimento ponderato in tempo reale (TTWROR).\n\nIl tasso di rendimento viene sempre calcolato per l'intero anno, anche se l'intervallo di rendicontazione termina o inizia a met\u00E0 anno.
Expand Up @@ -1631,6 +1631,8 @@ MenuApplyToAllWidgets = Toepassen op alles

MenuChangeHeight = Hoogte wijzigen ...

MenuChangeUrl = URL wijzigen...

MenuChartAdjustRange = Stel bereik in

MenuChartXScrollDown = Blader naar links
Expand Down Expand Up @@ -2377,6 +2379,8 @@ TooltipTurnoverRate = De omloopsnelheid van de portefeuille meet hoeveel van de

TooltipVolatility = Volatiliteit is een maat voor de prijsvariatie van een financieel instrument in de tijd.\n\nDe volatiliteit wordt berekend met behulp van de "geaccumuleerde" gegevensreeks. Daarom hebben resultaatafhankelijke transacties geen impact. Weekends en feestdagen worden genegeerd (bijvoorbeeld paas- en kerstdagen).

Url = URL

WatchlistDelete = Watchlist verwijderen

WatchlistEditDialog = Bewerk volglijstnaam
Expand All @@ -2387,4 +2391,6 @@ WatchlistNewLabel = Nieuwe watchlist

WatchlistRename = Watchlijst wijzigen

Website = Website

YearlyPerformanceHeatmapToolTip = Jaarlijkse rendementspercentage weergegeven als heatmap \n\nOm het jaarlijkse rendement te berekenen, wordt het gewogen rendement in realtime (TTWROR) gebruikt.\n\nHet rendement wordt altijd berekend voor het volledige jaar - zelfs als het rapportage-interval eindigt of begint in het midden van een jaar.
Expand Up @@ -1639,6 +1639,8 @@ MenuApplyToAllWidgets = Aplicar a todos

MenuChangeHeight = Alterar altura...

MenuChangeUrl = Mudar URL...

MenuChartAdjustRange = Ajustar intervalo

MenuChartXScrollDown = Rolar para a esquerda
Expand Down Expand Up @@ -2383,6 +2385,8 @@ TooltipTurnoverRate = A Taxa de Rota\u00E7\u00E3o do Portf\u00F3lio mede quanto

TooltipVolatility = Volatilidade \u00E9 uma medida de varia\u00E7\u00E3o de pre\u00E7o de um instrumento financeiro ao longo do tempo.\n\nA volatilidade \u00E9 calculada usando a s\u00E9rie de dados "acumulados". Portanto, transa\u00E7\u00F5es com desempenho neutro n\u00E3o t\u00EAm impacto. Fins de semana e feriados s\u00E3o ignorados (por exemplo, dias de P\u00E1scoa e Natal).

Url = URL

WatchlistDelete = Excluir lista de observa\u00E7\u00E3o

WatchlistEditDialog = Editar nome da lista de observa\u00E7\u00E3o
Expand All @@ -2393,4 +2397,6 @@ WatchlistNewLabel = Nova lista de observa\u00E7\u00E3o

WatchlistRename = Renomear lista de observa\u00E7\u00E3o

Website = Website

YearlyPerformanceHeatmapToolTip = Taxa de retorno anual exibida como mapa de calor\n\nPara calcular a taxa de retorno anual, \u00E9 usada a taxa de retorno ponderada em tempo real (TTWROR).\n\nA taxa de retorno \u00E9 sempre calculada para o ano inteiro, mesmo que o intervalo do relat\u00F3rio termine ou comece no meio de um ano.
Expand Up @@ -1641,6 +1641,8 @@ MenuApplyToAllWidgets = \u041F\u0440\u0438\u043C\u0435\u043D\u0438\u0442\u044C \

MenuChangeHeight = \u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u0432\u044B\u0441\u043E\u0442\u0443...

MenuChangeUrl = \u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C URL...

MenuChartAdjustRange = \u041E\u0442\u0440\u0435\u0433\u0443\u043B\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D

MenuChartXScrollDown = \u0421\u043A\u0440\u043E\u043B\u043B \u0432\u043B\u0435\u0432\u043E
Expand Down Expand Up @@ -2385,6 +2387,8 @@ TooltipTurnoverRate = Portfolio Turnover Rate \u043E\u0437\u043D\u0430\u0447\u04

TooltipVolatility = \u0412\u043E\u043B\u0430\u0442\u0438\u043B\u044C\u043D\u043E\u0441\u0442\u044C (\u0438\u043B\u0438 \u0434\u0438\u0441\u043F\u0435\u0440\u0441\u0438\u044F) - \u044D\u0442\u043E \u043C\u0435\u0440\u0430 \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u0446\u0435\u043D\u044B \u0444\u0438\u043D\u0430\u043D\u0441\u043E\u0432\u043E\u0433\u043E \u0438\u043D\u0441\u0442\u0440\u0443\u043C\u0435\u043D\u0442\u0430 \u0432\u043E \u0432\u0440\u0435\u043C\u0435\u043D\u0438.\n\n\u0412\u043E\u043B\u0430\u0442\u0438\u043B\u044C\u043D\u043E\u0441\u0442\u044C \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u0441 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0438\u0435\u043C "\u043D\u0430\u043A\u043E\u043F\u043B\u0435\u043D\u043D\u044B\u0445" \u043D\u0430\u0431\u043E\u0440\u043E\u0432 \u0434\u0430\u043D\u043D\u044B\u0445. \u041F\u043E\u044D\u0442\u043E\u043C\u0443 \u0442\u0440\u0430\u043D\u0437\u0430\u043A\u0446\u0438\u0438, \u043D\u0435\u0439\u0442\u0440\u0430\u043B\u044C\u043D\u044B\u0435 \u043A \u044D\u0444\u0444\u0435\u043A\u0442\u0438\u0432\u043D\u043E\u0441\u0442\u0438, \u043D\u0435 \u043E\u043A\u0430\u0437\u044B\u0432\u0430\u044E\u0442 \u043D\u0438\u043A\u0430\u043A\u043E\u0433\u043E \u0432\u043B\u0438\u044F\u043D\u0438\u044F. \u0412\u044B\u0445\u043E\u0434\u043D\u044B\u0435 \u0438 \u043F\u0440\u0430\u0437\u0434\u043D\u0438\u0447\u043D\u044B\u0435 \u0434\u043D\u0438 \u0438\u0433\u043D\u043E\u0440\u0438\u0440\u0443\u044E\u0442\u0441\u044F (\u043D\u0430\u043F\u0440\u0438\u043C\u0435\u0440, \u041F\u0430\u0441\u0445\u0430 \u0438 \u0420\u043E\u0436\u0434\u0435\u0441\u0442\u0432\u043E).

Url = URL

WatchlistDelete = \u0423\u0434\u0430\u043B\u0438\u0442\u044C \u0421\u043F\u0438\u0441\u043E\u043A \u043D\u0430\u0431\u043B\u044E\u0434\u0435\u043D\u0438\u044F

WatchlistEditDialog = \u0418\u0437\u043C\u0435\u043D\u0438\u0442\u044C \u041D\u0430\u0437\u0432\u0430\u043D\u0438\u0435 \u0421\u043F\u0438\u0441\u043A\u0430 \u043D\u0430\u0431\u043B\u044E\u0434\u0435\u043D\u0438\u044F
Expand All @@ -2395,4 +2399,6 @@ WatchlistNewLabel = \u041D\u043E\u0432\u044B\u0439 \u0421\u043F\u0438\u0441\u043

WatchlistRename = \u041F\u0435\u0440\u0435\u0438\u043C\u0435\u043D\u043E\u0432\u0430\u0442\u044C \u0421\u043F\u0438\u0441\u043E\u043A \u043D\u0430\u0431\u043B\u044E\u0434\u0435\u043D\u0438\u044F

Website = Website

YearlyPerformanceHeatmapToolTip = \u0413\u043E\u0434\u043E\u0432\u0430\u044F \u0434\u043E\u0445\u043E\u0434\u043D\u043E\u0441\u0442\u044C \u043E\u0442\u043E\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044F \u0432 \u0432\u0438\u0434\u0435 \u0442\u0435\u043F\u043B\u043E\u0432\u043E\u0439 \u043A\u0430\u0440\u0442\u044B\n\n\u0414\u043B\u044F \u0440\u0430\u0441\u0447\u0435\u0442\u0430 \u0433\u043E\u0434\u043E\u0432\u043E\u0439 \u043D\u043E\u0440\u043C\u044B \u043F\u0440\u0438\u0431\u044B\u043B\u0438 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0435\u0442\u0441\u044F \u0432\u0437\u0432\u0435\u0448\u0435\u043D\u043D\u0430\u044F \u0432 \u0440\u0435\u0430\u043B\u044C\u043D\u043E\u043C \u0432\u0440\u0435\u043C\u0435\u043D\u0438 \u0441\u0442\u0430\u0432\u043A\u0430 \u0434\u043E\u0445\u043E\u0434\u043D\u043E\u0441\u0442\u0438 (TTWROR).\n\n\u041D\u043E\u0440\u043C\u0430 \u043F\u0440\u0438\u0431\u044B\u043B\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044B\u0432\u0430\u0435\u0442\u0441\u044F \u0437\u0430 \u043F\u043E\u043B\u043D\u044B\u0439 \u0433\u043E\u0434 - \u0434\u0430\u0436\u0435 \u0435\u0441\u043B\u0438 \u043E\u0442\u0447\u0435\u0442\u043D\u044B\u0439 \u0438\u043D\u0442\u0435\u0440\u0432\u0430\u043B \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044F \u0438\u043B\u0438 \u043D\u0430\u0447\u0438\u043D\u0430\u0435\u0442\u0441\u044F \u0432 \u0441\u0435\u0440\u0435\u0434\u0438\u043D\u0435 \u0433\u043E\u0434\u0430.
@@ -0,0 +1,85 @@
package name.abuchen.portfolio.ui.views.dashboard;

import java.util.function.Supplier;

import org.eclipse.jface.layout.GridDataFactory;
import org.eclipse.jface.layout.GridLayoutFactory;
import org.eclipse.swt.SWT;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;

import name.abuchen.portfolio.model.Dashboard;
import name.abuchen.portfolio.model.Dashboard.Widget;
import name.abuchen.portfolio.util.TextUtil;

public class BrowserWidget extends WidgetDelegate<Object>
{
private Label title;
private Browser browser;
private Composite container;

public BrowserWidget(Widget widget, DashboardData data)
{
super(widget, data);

addConfig(new UrlConfig(this));
addConfig(new ChartHeightConfig(this));
}

@Override
public Composite createControl(Composite parent, DashboardResources resources)
{
container = new Composite(parent, SWT.NONE);
GridLayoutFactory.fillDefaults().numColumns(1).margins(5, 5).spacing(3, 8).applyTo(container);

title = new Label(container, SWT.NONE);
title.setBackground(container.getBackground());
title.setText(TextUtil.tooltip(getWidget().getLabel()));
GridDataFactory.fillDefaults().grab(true, false).applyTo(title);

browser = new Browser(container, SWT.NONE);
browser.setJavascriptEnabled(false);
GridDataFactory.fillDefaults().grab(true, true).applyTo(browser);

return container;
}

@Override
public Control getTitleControl()
{
return title;
}

@Override
public Supplier<Object> getUpdateTask()
{
return () -> null;
}

@Override
public void update(Object object)
{
title.setText(TextUtil.tooltip(getWidget().getLabel()));

String url = getWidget().getConfiguration().get(Dashboard.Config.URL.name());
if (url != null)
{
browser.setUrl(url);
}

GridData data = (GridData) container.getLayoutData();

int oldHeight = data.heightHint;
int newHeight = get(ChartHeightConfig.class).getPixel();

if (oldHeight != newHeight)
{
data.heightHint = newHeight;
browser.getParent().layout(true);
browser.getParent().getParent().layout(true);
}
}
}