Skip to main content

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

> 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:
[...]

I can't think of a better solution with the current API. If you don't want to 
use the deprecated method you can create the repository in 
updateSettingsPage() and pass it to connectorUi.getSettingsPage():

 private void updateSettingsPage() {
	assert connector != null;
	if (!connector.getConnectorKind().equals(lastConnectorKind)) {
		AbstractRepositoryConnectorUi connectorUi = 
TasksUiPlugin.getConnectorUi(connector.getConnectorKind());
		 TaskRepository repository = new 
TaskRepository(connector.getConnectorKind(), mylynRepo);
		settingsPage = connectorUi.getSettingsPage(repository);
		settingsPage.setWizard(this);
		lastConnectorKind = connector.getConnectorKind();
	}
 }

> 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.

The setUrl() method will only work after the controls have been constructed, 
i.e. the page is visible. 

Steffen

-- 
Steffen Pingel - steffenp@xxxxxx - http://steffenpingel.de


Back to the top