Package name.abuchen.portfolio.ui.Sidebar

Examples of name.abuchen.portfolio.ui.Sidebar.Entry


        sidebar.select(statementOfAssets);
    }

    private void createGeneralDataSection(final Sidebar sidebar)
    {
        final Entry section = new Entry(sidebar, Messages.LabelSecurities);
        section.setAction(new Action(Messages.LabelSecurities, PortfolioPlugin.descriptor(PortfolioPlugin.IMG_PLUS))
        {
            @Override
            public void run()
            {
                String name = askWatchlistName(Messages.WatchlistNewLabel);
                if (name == null)
                    return;

                Watchlist watchlist = new Watchlist();
                watchlist.setName(name);
                editor.getClient().getWatchlists().add(watchlist);
                editor.markDirty();

                createWatchlistEntry(section, watchlist);
                sidebar.layout();
            }
        });

        allSecurities = new Entry(section, new ActivateViewAction(Messages.LabelAllSecurities, "SecurityList", //$NON-NLS-1$
                        PortfolioPlugin.descriptor(PortfolioPlugin.IMG_SECURITY)));

        for (Watchlist watchlist : editor.getClient().getWatchlists())
            createWatchlistEntry(section, watchlist);
    }
View Full Code Here


            createWatchlistEntry(section, watchlist);
    }

    private void createWatchlistEntry(Entry section, final Watchlist watchlist)
    {
        final Entry entry = new Entry(section, watchlist.getName());
        entry.setAction(new ActivateViewAction(watchlist.getName(), "SecurityList", watchlist, //$NON-NLS-1$
                        PortfolioPlugin.descriptor(PortfolioPlugin.IMG_WATCHLIST)));

        entry.setContextMenu(new IMenuListener()
        {
            @Override
            public void menuAboutToShow(IMenuManager manager)
            {
                manager.add(new Action(Messages.WatchlistRename)
                {
                    @Override
                    public void run()
                    {
                        String newName = askWatchlistName(watchlist.getName());
                        if (newName != null)
                        {
                            watchlist.setName(newName);
                            editor.markDirty();
                            entry.setLabel(newName);
                        }
                    }
                });

                manager.add(new Action(Messages.WatchlistDelete)
                {
                    @Override
                    public void run()
                    {
                        editor.getClient().getWatchlists().remove(watchlist);
                        editor.markDirty();
                        entry.dispose();
                        allSecurities.select();
                    }
                });
            }
        });

        entry.addDropSupport(DND.DROP_MOVE, new Transfer[] { SecurityTransfer.getTransfer() }, new DropTargetAdapter()
        {
            @Override
            public void drop(DropTargetEvent event)
            {
                if (SecurityTransfer.getTransfer().isSupportedType(event.currentDataType))
View Full Code Here

        return dlg.getValue();
    }

    private void createMasterDataSection(Sidebar sidebar)
    {
        Entry section = new Entry(sidebar, Messages.ClientEditorLabelClientMasterData);
        new Entry(section, new ActivateViewAction(Messages.LabelAccounts, "AccountList", //$NON-NLS-1$
                        PortfolioPlugin.descriptor(PortfolioPlugin.IMG_ACCOUNT)));
        new Entry(section, new ActivateViewAction(Messages.LabelPortfolios, "PortfolioList", //$NON-NLS-1$
                        PortfolioPlugin.descriptor(PortfolioPlugin.IMG_PORTFOLIO)));
        new Entry(section, new ActivateViewAction(Messages.LabelInvestmentPlans, "InvestmentPlanList", //$NON-NLS-1$
                        PortfolioPlugin.descriptor(PortfolioPlugin.IMG_INVESTMENTPLAN)));
    }
View Full Code Here

                        PortfolioPlugin.descriptor(PortfolioPlugin.IMG_INVESTMENTPLAN)));
    }

    private void createPerformanceSection(Sidebar sidebar)
    {
        Entry section = new Entry(sidebar, Messages.ClientEditorLabelReports);

        statementOfAssets = new Entry(section, new ActivateViewAction(Messages.LabelStatementOfAssets,
                        "StatementOfAssets")); //$NON-NLS-1$
        new Entry(statementOfAssets,
                        new ActivateViewAction(Messages.ClientEditorLabelChart, "StatementOfAssetsHistory")); //$NON-NLS-1$
        new Entry(statementOfAssets, new ActivateViewAction(Messages.ClientEditorLabelHoldings, "HoldingsPieChart")); //$NON-NLS-1$

        Entry performance = new Entry(section, new ActivateViewAction(Messages.ClientEditorLabelPerformance,
                        "Performance")); //$NON-NLS-1$
        new Entry(performance, new ActivateViewAction(Messages.ClientEditorLabelChart, "PerformanceChart")); //$NON-NLS-1$
        new Entry(performance, new ActivateViewAction(Messages.LabelSecurities, "DividendsPerformance")); //$NON-NLS-1$
    }
View Full Code Here

        new Entry(performance, new ActivateViewAction(Messages.LabelSecurities, "DividendsPerformance")); //$NON-NLS-1$
    }

    private void createTaxonomyDataSection(final Sidebar sidebar)
    {
        taxonomies = new Entry(sidebar, Messages.LabelTaxonomies);
        taxonomies.setAction(new Action(Messages.LabelTaxonomies, PortfolioPlugin.descriptor(PortfolioPlugin.IMG_PLUS))
        {
            @Override
            public void run()
            {
View Full Code Here

            createTaxonomyEntry(taxonomies, taxonomy);
    }

    private Entry createTaxonomyEntry(Entry section, final Taxonomy taxonomy)
    {
        final Entry entry = new Entry(section, taxonomy.getName());
        entry.setAction(new ActivateViewAction(taxonomy.getName(), "taxonomy.Taxonomy", taxonomy, null)); //$NON-NLS-1$
        entry.setContextMenu(new IMenuListener()
        {
            @Override
            public void menuAboutToShow(IMenuManager manager)
            {
                manager.add(new Action(Messages.MenuTaxonomyRename)
                {
                    @Override
                    public void run()
                    {
                        String newName = askTaxonomyName(taxonomy.getName());
                        if (newName != null)
                        {
                            taxonomy.setName(newName);
                            editor.markDirty();
                            entry.setLabel(newName);
                        }
                    }
                });

                manager.add(new Action(Messages.MenuTaxonomyDelete)
                {
                    @Override
                    public void run()
                    {
                        editor.getClient().removeTaxonomy(taxonomy);
                        editor.markDirty();
                        entry.dispose();
                        statementOfAssets.select();
                    }
                });
            }
        });
View Full Code Here

    private void addAndOpenTaxonomy(Taxonomy taxonomy)
    {
        editor.getClient().addTaxonomy(taxonomy);
        editor.markDirty();
        Entry entry = createTaxonomyEntry(taxonomies, taxonomy);

        sidebar.select(entry);
        sidebar.layout();
    }
View Full Code Here

        return dlg.getValue();
    }

    private void createMiscSection(Sidebar sidebar)
    {
        Entry section = new Entry(sidebar, Messages.ClientEditorLabelGeneralData);
        new Entry(section, new ActivateViewAction(Messages.LabelConsumerPriceIndex, "ConsumerPriceIndexList")); //$NON-NLS-1$
    }
View Full Code Here

TOP

Related Classes of name.abuchen.portfolio.ui.Sidebar.Entry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.