Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[mylyn-integrators] Injecting URL into RepositorySettingsPage

Hi,

I have an Eclipse Plugin that has the URL to an issuetracker. I have
made that plugin start an extension of Mylyn's NewRepositoryWizard.
Since I don't know the kind of issuetracker (only the URL) the plugin
has to wait for the user to choose the correct connectorkind.

In order to get this to work I had to implement every method of the
NewRepositoryWizard (which is some kind of restricted, so that is
probably not the best idea) in my own Wizard. Furthermore I have
overwritten the following method as this:

	@SuppressWarnings("deprecation")
	@Override
	public IWizardPage getNextPage(IWizardPage page) {

		if (page == selectConnectorPage) {

			System.out.println("selectconnector");

			connector = selectConnectorPage.getConnector();
			updateSettingsPage();

			AbstractRepositorySettingsPage abstractSettingsPage =
(AbstractRepositorySettingsPage) settingsPage;

			TaskRepository repository = new
TaskRepository(connector.getConnectorKind(), mylynRepo);

			abstractSettingsPage.setRepository(repository);

			return settingsPage;
		}
		
		return super.getNextPage(page);
	}

Another problem her is that the
abstractSettingsPage.setRepository(repository); is deprecated, and I
am not sure which other method I could use (from the
AbstractRepositorySettingsPage) in order to overwrite the URL. The
setUrl method gave med a NullPointer and seems to be only for testing.

If anyone has any ideas to how I could make my code a bit less
"hackish" I would be very grateful!

Thanks,
- Erling


Back to the top