|
Re: Comment message for CDO [message #1841429 is a reply to message #1841315] |
Sun, 16 May 2021 10:50  |
|
I've implemented a CDOCommitCommentPrompter now, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=573563 and https://bugs.eclipse.org/bugs/show_bug.cgi?id=573562
To automatically create and use an instance during CDOUtil.configureView() you need to implement a custom CDOViewConfigurator:
public class CheckoutViewConfigurator implements CDOViewConfigurator
{
@Override
public void configureView(CDOView view)
{
view.options().setLockNotificationEnabled(true);
if (view instanceof CDOTransaction)
{
new CDOCommitCommentPrompter((CDOTransaction)view);
}
}
public static final class Factory extends CDOViewConfigurator.Factory
{
public Factory()
{
super("checkout");
}
@Override
public CDOViewConfigurator create(String description) throws ProductCreationException
{
return new CheckoutViewConfigurator();
}
}
}
The factory must be contributed via your plugin.xml:
<extension point="org.eclipse.net4j.util.factories">
<factory
productGroup="org.eclipse.emf.cdo.viewConfigurators"
type="checkout"
class="x.y.z.CheckoutViewConfigurator$Factory"/>
</extension>
Alternatively register it programmatically soon after startup:
static
{
IPluginContainer.INSTANCE.registerFactory(new CheckoutViewConfigurator.Factory());
}
The build I20210516-0645 with this new feature should be available soon on the download page: https://www.eclipse.org/cdo/downloads/index.php#integration_weekly
In the future we might provide some UI (a checkbox) in the CDO Explorer to do that automatically...
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Powered by
FUDForum. Page generated in 0.01218 seconds