Java Code Examples for org.eclipse.jface.wizard.IWizardPage#equals()

The following examples show how to use org.eclipse.jface.wizard.IWizardPage#equals() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AltConfigWizard.java    From CogniCrypt with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * This method returns previous page. If currentPage is the first question, the task list page is returned. If it is any other question page or the instance list page, the
 * previous question page is returned.
 *
 * @param currentPage
 *        current page, either instance list page or question page
 * @return either previous question or task selection page
 */
@Override
public IWizardPage getPreviousPage(final IWizardPage currentPage) {
	if (!checkifInUpdateRound()) {
		final IWizardPage[] pages = getPages();
		for (int i = 0; i < pages.length; i++) {
			if (currentPage.equals(pages[i])) {
				if (currentPage instanceof BeginnerTaskQuestionPage) {
					((BeginnerTaskQuestionPage) currentPage).setPageInactive();
				}
				final BeginnerTaskQuestionPage prevPage = (BeginnerTaskQuestionPage) pages[i - 1];
				for (final Entry<Question, Answer> quesAns : prevPage.getSelection().entrySet()) {
					this.constraints.remove(quesAns.getKey());
				}
				return prevPage;
			}
		}
	}
	if (currentPage instanceof LocatorPage && selectedTask.getCodeGen() == CodeGenerators.CrySL) {
		resetAnswers();
	}

	return super.getPreviousPage(currentPage);
}
 
Example 2
Source File: ConditionHelpers.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Is the wizard on the page you want?
 *
 * @param wizard
 *            wizard
 * @param page
 *            the desired page
 * @return ICondition for verification
 */
public static ICondition isWizardOnPage(final Wizard wizard, final IWizardPage page) {
    return new SWTBotTestCondition() {
        @Override
        public boolean test() throws Exception {
            if (wizard == null || page == null) {
                return false;
            }
            final IWizardContainer container = wizard.getContainer();
            if (container == null) {
                return false;
            }
            IWizardPage currentPage = container.getCurrentPage();
            return page.equals(currentPage);
        }
    };
}
 
Example 3
Source File: TestConnectorWizard.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public IWizardPage getNextPage(final IWizardPage page) {
    if (page.equals(selectionPage)) {
        final ConnectorDefinition definition = selectionPage.getSelectedConnectorDefinition();
        if (definition != null) {
            extension = findCustomWizardExtension(definition);
            recreateConnectorConfigurationPages(definition, false);
        }
    }

    final List<IWizardPage> pages = getAllPageList();
    final int index = pages.indexOf(page);
    if (index == pages.size() - 1 || index == -1) {
        // last page or page not found
        return null;
    }
    return pages.get(index + 1);
}
 
Example 4
Source File: AbapGitWizard.java    From ADT_Frontend with MIT License 5 votes vote down vote up
@Override
public IWizardPage getNextPage(IWizardPage page) {
	if (page.equals(this.pageBranchAndPackage) && !this.cloneData.hasDependencies()) {
		// If we don't have APACK dependencies, we can skip the APACK-related page
		return this.transportPage;
	} else {
		return super.getNextPage(page);
	}

}
 
Example 5
Source File: AbapGitWizardPull.java    From ADT_Frontend with MIT License 5 votes vote down vote up
@Override
public IWizardPage getNextPage(IWizardPage page) {
	if (page.equals(this.pageBranchAndPackage) && !this.cloneData.hasDependencies()) {
		// If we don't have APACK dependencies, we can skip the APACK-related page
		return this.transportPage;
	} else {
		return super.getNextPage(page);
	}
}
 
Example 6
Source File: SdkToolsControlAddDialog.java    From xds-ide with Eclipse Public License 1.0 5 votes vote down vote up
private void addPageOnce(IWizardPage p) {
    IWizardPage[] all = getPages();
    for (IWizardPage x : all) {
        if (p.equals(x)) {
            return;
        }
    }
    addPage(p);
}
 
Example 7
Source File: ConnectorWizard.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public IWizardPage getPreviousPage(final IWizardPage page) {
    final IWizardPage previousPage = super.getPreviousPage(page);
    if (previousPage != null && previousPage.equals(selectionPage)) {
        return null;
    }
    return previousPage;
}
 
Example 8
Source File: EditConnectorConfigurationWizard.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public IWizardPage getNextPage(final IWizardPage page) {
    if (page.equals(selectConfigurationPage)) {
        final ConnectorConfiguration conf = selectConfigurationPage.getSelectedConfiguration();
        if (conf != null) {
            final ConnectorDefinition definition = connectorDefStore.getDefinition(conf.getDefinitionId(), conf.getVersion());
            connectorWorkingCopy.setDefinitionId(definition.getId());
            connectorWorkingCopy.setDefinitionVersion(definition.getVersion());
            connectorWorkingCopy.setConfiguration(conf);
            extension = findCustomWizardExtension(definition);
            recreateConnectorConfigurationPages(definition, false);
        }
    }
    return super.getNextPage(page);
}
 
Example 9
Source File: ConfigurationWizardDialog.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void selectionChanged(SelectionChangedEvent event) {
    IWizardPage selectedPage = (IWizardPage) ((IStructuredSelection) event.getSelection()).getFirstElement();
    if (selectedPage != null && !selectedPage.equals(getCurrentPage())) {
        showPage(selectedPage);
    }
    updateButtons();
}