문제

I created a JFace wizard showing a single list where the user is supposed to make a selection. Since the page just contains a list, I would like to enable the double click selection. If the user performs a double click on a single event, the wizard should jump to the next page.

I got the following code so far:

 viewer.addDoubleClickListener(new IDoubleClickListener() {
        @Override
        public void doubleClick(DoubleClickEvent event) {
            IStructuredSelection selection = (IStructuredSelection) event.getSelection();
            if (selection.getFirstElement() instanceof File) {
                if(canFlipToNextPage()) {
                   //perform jump to next page here.
                }
            }
        }
    });

Apparently there is no method for the programmatic execution of the next button. Thank you.

도움이 되었습니까?

해결책

You first need a reference to the wizard page where you want to go. If you don't have it already through other means, you can find all wizard pages via this API:

getWizard().getPages()

Next, you make the following call:

getContainer().showPage( desiredPage )

다른 팁

You can also access the next page, so a more generic solution would be:

if (canFlipToNextPage()) {
    IWizardPage page = getNextPage();
    if (page != null) {
        getContainer().showPage(page);
    }
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top