Package org.codinjutsu.tools.jenkins.view

Examples of org.codinjutsu.tools.jenkins.view.BrowserPanel$LoadSelectedViewJob


    @Override
    public void actionPerformed(AnActionEvent event) {
        Project project = ActionUtil.getProject(event);

        final BrowserPanel browserPanel = BrowserPanel.getInstance(project);
        try {
            Job job = browserPanel.getSelectedJob();

            RequestManager requestManager = browserPanel.getJenkinsManager();
            if (job.hasParameters()) {
                BuildParamDialog.showDialog(job, JenkinsAppSettings.getSafeInstance(project), requestManager, new BuildParamDialog.RunBuildCallback() {

                    public void notifyOnOk(Job job) {
                        notifyOnGoingMessage(job);
                    }

                    public void notifyOnError(Job job, Exception ex) {
                        browserPanel.notifyErrorJenkinsToolWindow("Build '" + job.getName() + "' cannot be run: " + ex.getMessage());
                    }
                });
            } else {
                requestManager.runBuild(job, JenkinsAppSettings.getSafeInstance(project));
                notifyOnGoingMessage(job);
                browserPanel.loadSelectedJob();
            }

        } catch (Exception ex) {
            LOG.error(ex.getMessage(), ex);
            browserPanel.notifyErrorJenkinsToolWindow("Build cannot be run: " + ex.getMessage());
        }
    }
View Full Code Here


    private void showDialog() {
        SwingUtilities.invokeLater(new Runnable() {
            public void run() {

                final BrowserPanel browserPanel = BrowserPanel.getInstance(project);

                SelectJobDialog dialog = new SelectJobDialog(selectedChangeLists, browserPanel.getJobs(), project);
                dialog.setLocationRelativeTo(null);
                dialog.setMaximumSize(new Dimension(300, 200));
                dialog.pack();
                dialog.setVisible(true);
            }
View Full Code Here

    @Override
    public void actionPerformed(AnActionEvent event) {
        Project project = ActionUtil.getProject(event);

        String message = "";
        final BrowserPanel browserPanel = BrowserPanel.getInstance(project);

        try {
            Job job = browserPanel.getSelectedJob();

            RequestManager requestManager = browserPanel.getJenkinsManager();

            if (job.hasParameters()) {
                if (job.hasParameter(PARAMETER_NAME)) {

                    JenkinsAppSettings settings = JenkinsAppSettings.getSafeInstance(project);

                    final VirtualFile virtualFile =
                        prepareFile(browserPanel, FileChooser.chooseFile(
                                browserPanel,
                                new FileChooserDescriptor(true, false, false, false, false, false))
                        , settings, job);

                    if ((null != virtualFile)) {
                        if (virtualFile.exists()) {
                            Map<String, VirtualFile> files = new HashMap<String, VirtualFile>();
                            files.put(PARAMETER_NAME, virtualFile);
                            requestManager.runBuild(job, settings, files);
                            notifyOnGoingMessage(job);
                            browserPanel.loadSelectedJob();
                        } else {
                            message = String.format("File \"%s\" not exists", virtualFile.getPath());
                        }
                    }
                } else {
                    message = String.format("Job \"%s\" should has parameter with name \"%s\"", job.getName(), PARAMETER_NAME);

                }
            } else {
                message = String.format("Job \"%s\" has no parameters", job.getName());
            }

        } catch (Exception e) {
            message = String.format("Build cannot be run: " + e.getMessage());
            e.printStackTrace();
        }

        if (!message.isEmpty()) {
            LOG.info(message);
            browserPanel.notifyErrorJenkinsToolWindow(message);
        }

    }
View Full Code Here

        // called when project is being closed
    }

    @Override
    public void decorateChangeList(LocalChangeList localChangeList, ColoredTreeCellRenderer coloredTreeCellRenderer, boolean b, boolean b2, boolean b3) {
        BrowserPanel browserPanel = BrowserPanel.getInstance(project);
        //browserPanel.watch();
        Map<String, Job> jobs = browserPanel.getWatched();
        if (jobs.containsKey(localChangeList.getName())) {
            Build build = jobs.get(localChangeList.getName()).getLastBuild();
            String status = build.getStatus().getStatus();
            if (build.isBuilding()) {
                status = "Running";
View Full Code Here

    }

    public JenkinsWindowManager(Project project) {
        this.project = project;

        final BrowserPanel browserPanel = BrowserPanel.getInstance(project);

        Content content = ContentFactory.SERVICE.getInstance().createContent(browserPanel, null, false);
        ToolWindowManager toolWindowManager = ToolWindowManager.getInstance(project);
        ToolWindow toolWindow = toolWindowManager.registerToolWindow(JENKINS_BROWSER, false, ToolWindowAnchor.RIGHT);
        toolWindow.setIcon(JENKINS_ICON);
        ContentManager contentManager = toolWindow.getContentManager();
        contentManager.addContent(content);

        final StatusBar statusBar = WindowManager.getInstance().getStatusBar(project);
        JenkinsWidget jenkinsWidget = JenkinsWidget.getInstance(project);
        statusBar.addWidget(jenkinsWidget);
        jenkinsWidget.install(statusBar);

        final RssLogic rssLogic = RssLogic.getInstance(project);

        StartupManager.getInstance(project).registerPostStartupActivity(new DumbAwareRunnable() {
            @Override
            public void run() {

                browserPanel.init();
                browserPanel.initScheduledJobs(scheduledThreadPoolExecutor);
                rssLogic.init();
                rssLogic.initScheduledJobs(scheduledThreadPoolExecutor);
            }
        });
    }
View Full Code Here

        scheduledThreadPoolExecutor.shutdown();
    }

    public void reloadConfiguration() {
        BrowserPanel browserPanel = BrowserPanel.getInstance(project);
        browserPanel.reloadConfiguration();
        browserPanel.initScheduledJobs(scheduledThreadPoolExecutor);

        RssLogic.getInstance(project).initScheduledJobs(scheduledThreadPoolExecutor);
    }
View Full Code Here

TOP

Related Classes of org.codinjutsu.tools.jenkins.view.BrowserPanel$LoadSelectedViewJob

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.