Package com.heroku.api

Examples of com.heroku.api.Addon


        return String.class;
    }

    public Addon getAddOn(int row) {
        if (row==-1) return null;
        final Addon addon = addons.get(row);
        if (isInstalled(addon)) return appAddons.get(addon.getName());
        return addon;
    }
View Full Code Here


        return Column.values().length;
    }

    @Override
    public Object getValueAt(int row, int col) {
        Addon addon = getAddOn(row);

        switch (columnFor(col)) {
            case Name:
                return addon.getName();
            case Installed:
                return isInstalled(addon);
            case Description:
                return addon.getDescription();
            /*case configured:
                return addon.getConfigured();
            */
            case State:
                return addon.getState();
            case Price:
                return new Price(addon.getPriceCents(),addon.getPriceUnit());
            case Url:
                return addon.getUrl();
        }
        return null;
    }
View Full Code Here

    @Override
    protected List<AnAction> createActions() {
        return Arrays.<AnAction>asList(
                new AnAction("Add Add-On", "", icon("/general/add.png")) {
                    public void actionPerformed(AnActionEvent anActionEvent) {
                        final Addon addon = tableModel.getAddOn(selectedRow.get());
                        if (addon==null || tableModel.isInstalled(addon)) return;
                        final Price price = new Price(addon.getPriceCents(), addon.getPriceUnit());
                        if (Messages.showYesNoDialog("Add the Add-On: "+addon.getName()+" for "+price,"Add Add-On",Messages.getQuestionIcon())!=Messages.YES) return;
                        // ask confirmation
                        herokuProjectService.addAddon(addon);
                        HerokuAddonsWindow.this.doUpdate();
                    }
                },
                new AnAction("Remove Add-On", "", icon("/general/remove.png")) {
                    public void actionPerformed(AnActionEvent anActionEvent) {
                        final Addon addon = tableModel.getAddOn(selectedRow.get());
                        if (addon==null || !tableModel.isInstalled(addon)) return;
                        // ask confirmation
                        if (Messages.showYesNoDialog("Remove the Add-On:"+addon.getName(),"Remove Add-On",Messages.getQuestionIcon())!=Messages.YES) return;
                        herokuProjectService.removeAddon(addon);
                        HerokuAddonsWindow.this.doUpdate();
                    }
                },
                new AnAction("Show Documentation", "", icon("/xml/web_preview.png","/actions/preview.png")) {
                    public void actionPerformed(AnActionEvent anActionEvent) {
                        final Addon addon = tableModel.getAddOn(selectedRow.get());
                        if (addon==null) return;
                        BrowserUtil.launchBrowser(addonUrl(addon));
                    }
                },
                new AnAction("Update", "", icon("/actions/sync.png")) {
View Full Code Here

TOP

Related Classes of com.heroku.api.Addon

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.