Search in sources :

Example 1 with Entry

use of name.abuchen.portfolio.ui.Sidebar.Entry in project portfolio by buchen.

the class ClientEditorSidebar method addAndOpenTaxonomy.

private void addAndOpenTaxonomy(Taxonomy taxonomy) {
    editor.getClient().addTaxonomy(taxonomy);
    editor.markDirty();
    Entry entry = createTaxonomyEntry(taxonomies, taxonomy);
    sidebar.select(entry);
    sidebar.layout();
    scrolledComposite.setMinSize(sidebar.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
Also used : Entry(name.abuchen.portfolio.ui.Sidebar.Entry)

Example 2 with Entry

use of name.abuchen.portfolio.ui.Sidebar.Entry in project portfolio by buchen.

the class ClientEditorSidebar method createTaxonomyDataSection.

private void createTaxonomyDataSection(final Sidebar sidebar) {
    taxonomies = new Entry(sidebar, Messages.LabelTaxonomies);
    taxonomies.setAction(new Action(Messages.LabelTaxonomies, Images.PLUS.descriptor()) {

        @Override
        public void run() {
            showCreateTaxonomyMenu();
        }
    });
    for (Taxonomy taxonomy : editor.getClient().getTaxonomies()) createTaxonomyEntry(taxonomies, taxonomy);
}
Also used : Entry(name.abuchen.portfolio.ui.Sidebar.Entry) SimpleAction(name.abuchen.portfolio.ui.util.SimpleAction) Action(org.eclipse.jface.action.Action) Taxonomy(name.abuchen.portfolio.model.Taxonomy)

Example 3 with Entry

use of name.abuchen.portfolio.ui.Sidebar.Entry in project portfolio by buchen.

the class ClientEditorSidebar method createTaxonomyEntry.

private Entry createTaxonomyEntry(Entry section, final Taxonomy taxonomy) {
    Entry entry = new Entry(section, taxonomy.getName());
    // $NON-NLS-1$
    entry.setAction(new ActivateViewAction(taxonomy.getName(), "taxonomy.Taxonomy", taxonomy, null));
    entry.setContextMenu((e, m) -> taxonomyContextMenuAboutToShow(taxonomy, e, m));
    return entry;
}
Also used : Entry(name.abuchen.portfolio.ui.Sidebar.Entry)

Example 4 with Entry

use of name.abuchen.portfolio.ui.Sidebar.Entry in project portfolio by buchen.

the class ClientEditorSidebar method createMasterDataSection.

private void createMasterDataSection(Sidebar sidebar) {
    Entry section = new Entry(sidebar, Messages.ClientEditorLabelClientMasterData);
    new Entry(section, new // $NON-NLS-1$
    ActivateViewAction(// $NON-NLS-1$
    Messages.LabelAccounts, // $NON-NLS-1$
    "AccountList", Images.ACCOUNT.descriptor())).setContextMenu(setAsStartPage);
    new Entry(section, new // $NON-NLS-1$
    ActivateViewAction(// $NON-NLS-1$
    Messages.LabelPortfolios, // $NON-NLS-1$
    "PortfolioList", Images.PORTFOLIO.descriptor())).setContextMenu(setAsStartPage);
    new Entry(section, new // $NON-NLS-1$
    ActivateViewAction(// $NON-NLS-1$
    Messages.LabelInvestmentPlans, // $NON-NLS-1$
    "InvestmentPlanList", Images.INVESTMENTPLAN.descriptor())).setContextMenu(setAsStartPage);
}
Also used : Entry(name.abuchen.portfolio.ui.Sidebar.Entry)

Example 5 with Entry

use of name.abuchen.portfolio.ui.Sidebar.Entry in project portfolio by buchen.

the class ClientEditorSidebar method createGeneralDataSection.

private void createGeneralDataSection(final Sidebar sidebar) {
    final Entry section = new Entry(sidebar, Messages.LabelSecurities);
    section.setAction(new Action(Messages.LabelSecurities, Images.PLUS.descriptor()) {

        @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();
            scrolledComposite.setMinSize(sidebar.computeSize(SWT.DEFAULT, SWT.DEFAULT));
        }
    });
    allSecurities = new Entry(section, new // $NON-NLS-1$
    ActivateViewAction(// $NON-NLS-1$
    Messages.LabelAllSecurities, // $NON-NLS-1$
    "SecurityList", Images.SECURITY.descriptor()));
    allSecurities.setContextMenu(setAsStartPage);
    for (Watchlist watchlist : editor.getClient().getWatchlists()) createWatchlistEntry(section, watchlist);
}
Also used : Entry(name.abuchen.portfolio.ui.Sidebar.Entry) SimpleAction(name.abuchen.portfolio.ui.util.SimpleAction) Action(org.eclipse.jface.action.Action) Watchlist(name.abuchen.portfolio.model.Watchlist)

Aggregations

Entry (name.abuchen.portfolio.ui.Sidebar.Entry)9 SimpleAction (name.abuchen.portfolio.ui.util.SimpleAction)3 Action (org.eclipse.jface.action.Action)3 Security (name.abuchen.portfolio.model.Security)1 Taxonomy (name.abuchen.portfolio.model.Taxonomy)1 Watchlist (name.abuchen.portfolio.model.Watchlist)1 IMenuManager (org.eclipse.jface.action.IMenuManager)1 MenuManager (org.eclipse.jface.action.MenuManager)1 DropTargetAdapter (org.eclipse.swt.dnd.DropTargetAdapter)1 DropTargetEvent (org.eclipse.swt.dnd.DropTargetEvent)1