use of org.drools.workbench.screens.guided.dtree.client.widget.factories.ActionInsertFactoryHelper in project drools-wb by kiegroup.
the class GuidedDecisionTreePalette method setDataModelOracle.
public void setDataModelOracle(final AsyncPackageDataModelOracle oracle, final boolean isReadOnly) {
this.oracle = PortablePreconditions.checkNotNull("oracle", oracle);
clear();
// Add types and constraints
for (String className : oracle.getFactTypes()) {
add(makePanelGroup(className, isReadOnly));
}
// Add actions
final GuidedDecisionTreePaletteGroup paletteGroup = new GuidedDecisionTreePaletteGroup();
if (oracle.getFactTypes().length > 0) {
final String className = oracle.getFactTypes()[0];
final ActionInsertNode an1 = new ActionInsertNodeImpl(className);
paletteGroup.addStencil(actionInsertNodeFactory, stencilBuilder, new ActionInsertFactoryHelper(an1, isReadOnly), isReadOnly);
}
final ActionUpdateNode an2 = new ActionUpdateNodeImpl();
paletteGroup.addStencil(actionUpdateNodeFactory, stencilBuilder, new ActionUpdateFactoryHelper(an2, isReadOnly), isReadOnly);
final ActionRetractNode an3 = new ActionRetractNodeImpl();
paletteGroup.addStencil(actionRetractNodeFactory, stencilBuilder, new ActionRetractFactoryHelper(an3, isReadOnly), isReadOnly);
add(new PanelGroup() {
{
final PanelCollapse collapse = new PanelCollapse() {
{
add(new PanelBody() {
{
add(paletteGroup);
}
});
}
};
add(new PanelHeader() {
{
setDataToggle(Toggle.COLLAPSE);
setDataParent(getId());
setDataTargetWidget(collapse);
add(new Heading(HeadingSize.H4) {
{
setText(GuidedDecisionTreeConstants.INSTANCE.actionsPaletteGroup());
}
});
}
});
add(collapse);
}
});
}
Aggregations