Package name.abuchen.portfolio.model

Examples of name.abuchen.portfolio.model.InvestmentPlan


    }

    @Override
    public void onModified(Object element, Object newValue, Object oldValue)
    {
        InvestmentPlan plan = (InvestmentPlan) element;
        if (plan.getAccount() != null && plan.getAccount().equals(NewPlanDialog.DELIVERY))
            plan.setAccount(null);

        markDirty();
    }
View Full Code Here


        plans.addSelectionChangedListener(new ISelectionChangedListener()
        {
            public void selectionChanged(SelectionChangedEvent event)
            {
                InvestmentPlan plan = (InvestmentPlan) ((IStructuredSelection) event.getSelection()).getFirstElement();

                if (plan != null)
                    transactions.setInput(plan.getPortfolio(), plan.getTransactions());
                else
                    transactions.setInput(null, null);

                transactions.refresh();
            }
View Full Code Here

        column.setLabelProvider(new ColumnLabelProvider()
        {
            @Override
            public String getText(Object e)
            {
                InvestmentPlan plan = (InvestmentPlan) e;
                return plan.getAccount() != null ? plan.getAccount().getName() : Messages.InvestmentPlanOptionDelivery;
            }

            @Override
            public Image getImage(Object e)
            {
                InvestmentPlan plan = (InvestmentPlan) e;
                return plan.getAccount() != null ? PortfolioPlugin.image(PortfolioPlugin.IMG_ACCOUNT) : null;
            }
        });
        ColumnViewerSorter.create(Account.class, "name").attachTo(column); //$NON-NLS-1$
        List<Account> accounts = new ArrayList<Account>();
        accounts.add(NewPlanDialog.DELIVERY);
View Full Code Here

        support.addColumn(column);
    }

    private void fillPlansContextMenu(IMenuManager manager)
    {
        final InvestmentPlan plan = (InvestmentPlan) ((IStructuredSelection) plans.getSelection()).getFirstElement();
        if (plan == null)
            return;

        manager.add(new Action(Messages.InvestmentPlanMenuGenerateTransactions)
        {
            @Override
            public void run()
            {
                List<PortfolioTransaction> latest = plan.generateTransactions();
                markDirty();

                plans.refresh();
                transactions.markTransactions(latest);
                transactions.setInput(plan.getPortfolio(), plan.getTransactions());
            }
        });

        manager.add(new Action(Messages.InvestmentPlanMenuDelete)
        {
View Full Code Here

            if (security == null)
                throw new UnsupportedOperationException(Messages.MsgMissingSecurity);
            if (portfolio == null)
                throw new UnsupportedOperationException(Messages.MsgMissingPortfolio);

            InvestmentPlan plan = new InvestmentPlan(name);
            plan.setSecurity(security);
            plan.setPortfolio(portfolio);
            plan.setAccount(account.equals(DELIVERY) ? null : account);
            plan.setStart(start);
            plan.setInterval(interval);
            plan.setAmount(amount);
            plan.setFees(fees);
            getClient().addPlan(plan);
        }
View Full Code Here

TOP

Related Classes of name.abuchen.portfolio.model.InvestmentPlan

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.