It's all about the answers!

Ask a question

Build property editors extension point


kathleen sharp (2821112) | asked Apr 05 '12, 8:57 a.m.
I have been looking at the build ui extension points, and I believe I might be able to use com.ibm.team.build.ui.buildPropertyEditors to achieve what I want.

Basically, I want to provide a richer editing experience for build properties, I want to:

Display a list/combo of all of our available properties so that you can pick one.

Based on what you've picked display some relevant ui to allow you to select a value. So, for example, a project navigator/picker for one of our properties that requires the name of a project.

Unfortunately, from poking around with a basic implementation, this extension point doesn't quite seem to give me enough capability to achieve this.

The com.ibm.team.build.ui.buildPropertyEditors extension point seems to let me contribute a new type of property, which is displayed in the "Add Build Property - select property type" dialog. When that is selected the "edit" button on the next dialog then launches my contributed class/ui.

I would prefer to be able to contribute an entirely new edit dialog, after the user has selected my contributed property type, is this possible?

If not, I was hoping I could work around it. When the edit button is clicked my class gets a call back and I can launch my own dialog. If I do not have the ability to control the previous dialog, then I would like to let the user have the ability to change the name/description/value of the property from my dialog.

All my contribution has access to is an IBuildPropertyEditorContext, which then gives an IBuildProperty. When I set the name/description/value on the IBuildProperty and close my dialog only the changes to property value are reflected in the edit dialog.

Is there any way to force all the changes to the property object to be honoured?

Comments
1
kathleen sharp commented Aug 22 '12, 10:47 a.m.

Hi, I didn't like the way this extension point worked - it seemed like a pretty bad user experience. I ended up using the build section extension point instead, and added a new section for my rich properties, with some richer UI. com.ibm.team.build.ui.requestBuildDialogSections


Liora Milbaum commented Aug 26 '12, 5:04 a.m.

Thanks. I'll look into it. Did you find info regarding how to start developing an extension for RTC?


Nick Edgar commented Aug 31 '12, 3:53 p.m.
JAZZ DEVELOPER

2 answers



permanent link
sam detweiler (12.5k6189201) | answered Aug 26 '12, 8:09 a.m.
edited Jul 18 '13, 3:50 p.m.
you create an Aspect Editor (for eclipse) this is the UI part

https://jazz.net/wiki/bin/view/Main/ProcessAspectEditorCreation#How_to_Create_a_Process_Aspect_E

permanent link
Nick Edgar (6.5k711) | answered Jul 18 '13, 2:00 p.m.
JAZZ DEVELOPER
edited Jul 18 '13, 2:01 p.m.
Further to Kathleen's mention of the requestBuildDialogSections extension point, I thought I'd post some more info on how it works. 

Here are some snippets for how the built-in SCM page gets contributed.


in com.ibm.team.build.ui's plugin.xml:


   <extension

         point="com.ibm.team.build.ui.requestBuildDialogSections">

      <requestBuildDialogSection

            class="com.ibm.team.build.internal.ui.dialogs.ScmOptionsSection$Factory"

            order="100"/>

...

   </extension>


----


import com.ibm.team.build.ui.dialogs.requestbuild.IRequestBuildSectionFactory;

import com.ibm.team.build.ui.dialogs.requestbuild.RequestBuildSection;

import com.ibm.team.build.ui.dialogs.requestbuild.RequestBuildSectionSite;


public class ScmOptionsSection extends RequestBuildSection {


    /**

     * Factory interface for creating the section.

     */

    public static class Factory implements IRequestBuildSectionFactory {

        public RequestBuildSection createRequestBuildSection(RequestBuildSectionSite site) {

            return new ScmOptionsSection(site);

        }

    }


The site object gives access to the containing context of the request dialog:


    public ScmOptionsSection(RequestBuildSectionSite site) {

        super(site);

    }


You can create your own SWT controls under the given section control:

 

    @Override

    protected void createSectionContent(Section section) {

...

    }


The initialize method is called in the background and lets you fetch info from the repository, based on request/definition info from the section's site:

    @Override

    public void initialize(IProgressMonitor monitor) {

        if (getSite().isRebuild()) {

            setPersonalBuildWorkspace(getWorkspace(getSite().getBuildRequest(), monitor));

            setComponentLoadRules(getComponentLoadRules(getSite().getBuildRequest(), monitor));

        } else {

            setPersonalBuildWorkspace(getPersistedWorkspace(getSite().getBuildDefinition(), monitor));

            setComponentLoadRules(getComponentLoadRules(getSite().getBuildDefinition(), monitor));

        }

    }


You can validate fields and add error/warning messages via site API:

    @Override

    public boolean validate2() {

...

        if (isBuildWorkspacePrivate) {

            getSite().addWarningMessage(

                    BuildUIDialogMessages.ScmOptionsSection_WARNING_MESSAGE_PRIVATE_BUILD_WORKSPACE,

                    BuildUIDialogMessages.ScmOptionsSection_WARNING_MESSAGE_PRIVATE_BUILD_WORKSPACE);

        } else {

            getSite().removeWarningMessage(

                    BuildUIDialogMessages.ScmOptionsSection_WARNING_MESSAGE_PRIVATE_BUILD_WORKSPACE);

        }

...

    }


I hope this gives a general idea of how one can add a section to the build request dialog in the Eclipse UI.  The web UI has a similar extension point.




Your answer


Register or to post your answer.