use of org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView in project drools-wb by kiegroup.
the class EnumLoaderUtilities method getEnumsFromServer.
private void getEnumsFromServer(final DropDownData enumDefinition, final Callback<Map<String, String>> callback, final GuidedDecisionTablePresenter presenter, final Command onFetchCommand, final Command onFetchCompleteCommand) {
final String key = buildKey(enumDefinition);
if (enumCache.containsKey(key)) {
callback.callback(enumCache.get(key));
return;
}
// Cache empty value to prevent recurrent calls to the server for the same data.
// The View will be redrawn once by the batch() command in the success callback.
enumCache.put(key, Collections.emptyMap());
final GuidedDecisionTableView view = presenter.getView();
final ObservablePath currentPath = presenter.getCurrentPath();
onFetchCommand.execute();
enumDropdownService.call(new RemoteCallback<String[]>() {
@Override
public void callback(final String[] items) {
onFetchCompleteCommand.execute();
final Map<String, String> convertedDropDownData = convertDropDownData(items);
enumCache.put(key, convertedDropDownData);
callback.callback(convertedDropDownData);
view.batch();
}
}, new HasBusyIndicatorDefaultErrorCallback(view)).loadDropDownExpression(currentPath, enumDefinition.getValuePairs(), enumDefinition.getQueryExpression());
}
use of org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView in project drools-wb by kiegroup.
the class DeleteAndEditCell method perform.
@Override
public boolean perform(final GridWidget gridWidget, final boolean isShiftKeyDown, final boolean isControlKeyDown) {
final GridData gridModel = gridWidget.getModel();
final GridData.SelectedCell origin = gridModel.getSelectedCellsOrigin();
if (origin == null) {
return false;
}
if (!(gridWidget instanceof GuidedDecisionTableView)) {
return false;
}
final GuidedDecisionTableView view = (GuidedDecisionTableView) gridWidget;
final GuidedDecisionTableView.Presenter dtPresenter = view.getPresenter();
dtPresenter.onDeleteSelectedCells();
return super.perform(gridWidget, isShiftKeyDown, isControlKeyDown);
}
use of org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView in project drools-wb by kiegroup.
the class SelectionCut method perform.
@Override
public boolean perform(final GridWidget gridWidget, final boolean isShiftKeyDown, final boolean isControlKeyDown) {
final GridData gridModel = gridWidget.getModel();
final GridData.SelectedCell origin = gridModel.getSelectedCellsOrigin();
if (origin == null) {
return false;
}
if (!(gridWidget instanceof GuidedDecisionTableView)) {
return false;
}
final GuidedDecisionTableView view = (GuidedDecisionTableView) gridWidget;
final GuidedDecisionTableView.Presenter dtPresenter = view.getPresenter();
dtPresenter.onCut();
return false;
}
use of org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView in project drools-wb by kiegroup.
the class SelectionPaste method perform.
@Override
public boolean perform(final GridWidget gridWidget, final boolean isShiftKeyDown, final boolean isControlKeyDown) {
final GridData gridModel = gridWidget.getModel();
final GridData.SelectedCell origin = gridModel.getSelectedCellsOrigin();
if (origin == null) {
return false;
}
if (!(gridWidget instanceof GuidedDecisionTableView)) {
return false;
}
final GuidedDecisionTableView view = (GuidedDecisionTableView) gridWidget;
final GuidedDecisionTableView.Presenter dtPresenter = view.getPresenter();
dtPresenter.onPaste();
return false;
}
use of org.drools.workbench.screens.guided.dtable.client.widget.table.GuidedDecisionTableView in project drools-wb by kiegroup.
the class RadarMenuViewImpl method setAvailableDecisionTables.
@Override
public void setAvailableDecisionTables(final Set<GuidedDecisionTableView.Presenter> dtPresenters) {
for (GuidedDecisionTableView.Presenter dtPresenter : dtPresenters) {
final GuidedDecisionTableView view = dtPresenter.getView();
radarLayer.add(makeDecisionTableGlyph(view));
}
radarLayer.batch();
}
Aggregations