use of org.eclipse.egit.ui.IBranchNameProvider in project egit by eclipse.
the class CreateBranchPage method getBranchNameProvider.
private IBranchNameProvider getBranchNameProvider() {
IExtensionRegistry registry = Platform.getExtensionRegistry();
IConfigurationElement[] config = registry.getConfigurationElementsFor(BRANCH_NAME_PROVIDER_ID);
if (config.length > 0) {
Object provider;
try {
// $NON-NLS-1$
provider = config[0].createExecutableExtension("class");
if (provider instanceof IBranchNameProvider)
return (IBranchNameProvider) provider;
} catch (Throwable e) {
Activator.logError(UIText.CreateBranchPage_CreateBranchNameProviderFailed, e);
}
}
return null;
}
use of org.eclipse.egit.ui.IBranchNameProvider in project egit by eclipse.
the class CreateBranchPage method getBranchNameSuggestionFromProvider.
private String getBranchNameSuggestionFromProvider() {
final AtomicReference<String> ref = new AtomicReference<>();
final IBranchNameProvider branchNameProvider = getBranchNameProvider();
if (branchNameProvider != null)
SafeRunner.run(new SafeRunnable() {
@Override
public void run() throws Exception {
ref.set(branchNameProvider.getBranchNameSuggestion());
}
});
return ref.get();
}
Aggregations