public void createContents()

in org.apache.easyant4e/src/org/apache/easyant4e/ivyde/extension/page/PhaseDetailsPage.java [94:152]


    public void createContents(Composite parent) {
        TableWrapLayout layout = new TableWrapLayout();
        layout.topMargin = 5;
        layout.leftMargin = 5;
        layout.rightMargin = 2;
        layout.bottomMargin = 2;
        parent.setLayout(layout);

        FormToolkit toolkit = mform.getToolkit();
        Section section1 = toolkit.createSection(parent, Section.DESCRIPTION | Section.TITLE_BAR);
        section1.marginWidth = 10;
        section1.setText("Phase Details");
        section1
                .setDescription("Phases define an ordered set of build phases. Build phases are responsible for the build choreography at macro level.");
        TableWrapData td = new TableWrapData(TableWrapData.FILL, TableWrapData.TOP);
        td.grabHorizontal = true;
        section1.setLayoutData(td);
        Composite client = toolkit.createComposite(section1);
        GridLayout glayout = new GridLayout();
        glayout.marginWidth = glayout.marginHeight = 0;
        client.setLayout(glayout);

        createSpacer(toolkit, client, 2);

        toolkit.createLabel(client, "Description:");
        description = toolkit.createText(client, "", SWT.MULTI | SWT.WRAP);
        GridData gdDescription = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
        gdDescription.widthHint = 10;
        description.setLayoutData(gdDescription);

        createSpacer(toolkit, client, 2);

        toolkit.createLabel(client, "Depends:");
        depends = toolkit.createText(client, "", SWT.MULTI | SWT.WRAP);
        GridData gdDepends = new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING);
        gdDepends.widthHint = 10;
        depends.setLayoutData(gdDepends);

        createSpacer(toolkit, client, 2);

        ImageHyperlink buildLink = toolkit.createImageHyperlink(client, SWT.NULL);
        buildLink.setText("Run this phase...");
        buildLink.setForeground(PlatformUI.getWorkbench().getDisplay().getSystemColor(SWT.COLOR_BLUE));
        buildLink.setImage(imageProvider.getBuildImage());
        buildLink.addHyperlinkListener(new HyperlinkAdapter() {
            public void linkActivated(HyperlinkEvent e) {
                Job job = new WorkspaceJob("Easyant running phase " + phase.getName() + "...") {
                    @Override
                    public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
                        easyantProjectService.runBuild(project, phase.getName(), logLevel, monitor);
                        return Status.OK_STATUS;
                    }
                };
                job.schedule();
            }
        });

        section1.setClient(client);
    }