use of org.eclipse.egit.ui.internal.preferences.ConfigurationEditorComponent in project egit by eclipse.
the class RepositoryPropertyPage method createContents.
@Override
protected Control createContents(Composite parent) {
Composite displayArea = new Composite(parent, SWT.NONE);
GridLayoutFactory.fillDefaults().applyTo(displayArea);
GridDataFactory.fillDefaults().applyTo(displayArea);
final Repository repo = AdapterUtils.adapt(getElement(), Repository.class);
if (repo == null)
return displayArea;
StoredConfig config = repo.getConfig();
if (config instanceof FileBasedConfig) {
File configFile = ((FileBasedConfig) config).getFile();
config = new FileBasedConfig(configFile, repo.getFS());
config.addChangeListener(new ConfigChangedListener() {
@Override
public void onConfigChanged(ConfigChangedEvent event) {
repo.fireEvent(new ConfigChangedEvent());
}
});
}
editor = new ConfigurationEditorComponent(displayArea, config, true) {
@Override
protected void setErrorMessage(String message) {
RepositoryPropertyPage.this.setErrorMessage(message);
}
};
editor.createContents();
return displayArea;
}
Aggregations