Class ScenarioSimulationEditorPresenter
- java.lang.Object
-
- org.drools.workbench.screens.scenariosimulation.client.editor.ScenarioSimulationEditorPresenter
-
@Dependent public class ScenarioSimulationEditorPresenter extends Object
-
-
Field Summary
Fields Modifier and Type Field Description protected ScenarioSimulationContextcontextprotected DataManagementStrategydataManagementStrategyprotected org.uberfire.workbench.model.menu.MenuItemdownloadMenuItemprotected com.google.gwt.event.shared.EventBuseventBusprotected org.uberfire.workbench.model.menu.MenuItemexportToCSVMenuItemstatic StringIDENTIFIERprotected org.uberfire.workbench.model.menu.MenuItemimportMenuItemprotected org.drools.scenariosimulation.api.model.ScenarioSimulationModelmodelprotected StringpackageNameprotected org.uberfire.backend.vfs.ObservablePathpathprotected org.uberfire.client.mvp.PlaceManagerplaceManagerprotected org.uberfire.workbench.model.menu.MenuItemredoMenuItemprotected org.uberfire.workbench.model.menu.MenuItemrunScenarioMenuItemprotected ScenarioGridWidgetscenarioBackgroundGridWidgetprotected ScenarioGridWidgetscenarioMainGridWidgetprotected longscenarioPresenterIdprotected ScenarioSimulationEditorWrapperscenarioSimulationEditorWrapperprotected org.uberfire.workbench.model.menu.MenuItemundoMenuItem
-
Constructor Summary
Constructors Constructor Description ScenarioSimulationEditorPresenter()ScenarioSimulationEditorPresenter(AbstractScenarioSimulationProducer abstractScenarioSimulationProducer, ScenarioSimulationResourceType type, org.uberfire.client.mvp.PlaceManager placeManager, AbstractScenarioSimulationDocksHandler abstractScenarioSimulationDocksHandler, org.uberfire.ext.editor.commons.client.file.exports.TextFileExport textFileExport, ConfirmPopupPresenter confirmPopupPresenter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCommonActions(org.kie.workbench.common.widgets.client.menu.FileMenuBuilder fileMenuBuilder, org.uberfire.workbench.model.menu.MenuItem versionMenuItem, org.uberfire.workbench.model.menu.MenuItem alertsButtonMenuItem)voidaddDownloadMenuItem(org.kie.workbench.common.widgets.client.menu.FileMenuBuilder fileMenuBuilder, Supplier<org.uberfire.backend.vfs.Path> pathSupplier)protected voidcleanReadOnlyColumn(org.drools.scenariosimulation.api.model.AbstractScesimModel abstractScesimModel)Read only columns should not contains any valuesprotected voidclearTestToolsStatus()voidexpandSettingsDock()voidexpandToolsDock()ScenarioSimulationContextgetContext()DataManagementStrategygetDataManagementStrategy()com.google.gwt.event.shared.EventBusgetEventBus()org.jboss.errai.common.client.api.RemoteCallback<String>getExportCallBack()protected StringgetFileDownloadURL(Supplier<org.uberfire.backend.vfs.Path> pathSupplier)protected org.jboss.errai.common.client.api.RemoteCallback<org.drools.scenariosimulation.api.model.AbstractScesimModel>getImportCallBack()protected org.jboss.errai.common.client.api.ErrorCallback<Object>getImportErrorCallback()StringgetJsonModel(org.drools.scenariosimulation.api.model.ScenarioSimulationModel model)org.drools.scenariosimulation.api.model.ScenarioSimulationModelgetModel()voidgetModelSuccessCallbackMethod(DataManagementStrategy dataManagementStrategy, org.drools.scenariosimulation.api.model.ScenarioSimulationModel model)org.uberfire.backend.vfs.ObservablePathgetPath()org.uberfire.mvp.CommandgetPopulateTestToolsCommand()protected org.jboss.errai.common.client.api.RemoteCallback<org.drools.workbench.screens.scenariosimulation.model.SimulationRunResult>getRefreshModelCallback()ScenarioSimulationResourceTypegetType()org.uberfire.mvp.CommandgetUpdateDMNMetadataCommand()protected org.uberfire.mvp.CommandgetValidateCommand()protected org.jboss.errai.common.client.api.RemoteCallback<List<org.drools.workbench.screens.scenariosimulation.model.FactMappingValidationError>>getValidationCallback()org.jboss.errai.common.client.api.ErrorCallback<Boolean>getValidationFailedCallback()ScenarioSimulationViewgetView()voidhideDocks()booleanisDirty()protected booleanisUberfireDocksInteractionEventToManage(org.uberfire.client.workbench.docks.UberfireDocksInteractionEvent uberfireDocksInteractionEvent)Method to verify if the givenUberfireDocksInteractionEventis to be processed by current instance.voidloadContent()voidmakeMenuBar(org.kie.workbench.common.widgets.client.menu.FileMenuBuilder fileMenuBuilder)If you want to customize the menu override this method.voidonBackgroundTabSelected()voidonClose()protected voidonDownload(Supplier<org.uberfire.backend.vfs.Path> pathSupplier)voidonEditTabSelected()protected voidonExportToCsv()voidonImport(String fileContents, GridWidget gridWidget)voidonImportsTabSelected()voidonOverviewSelected()voidonRedo()voidonRunScenario()voidonRunScenario(List<Integer> indexOfScenarioToRun)voidonUberfireDocksInteractionEvent(org.uberfire.client.workbench.docks.UberfireDocksInteractionEvent uberfireDocksInteractionEvent)voidonUndo()protected voidopen(String downloadURL)voidpopulateRightDocks(String identifier)protected voidrefreshModelContent(org.drools.workbench.screens.scenariosimulation.model.SimulationRunResult newData)protected voidregisterTestToolsCallback()voidreloadSettingsDock()To be called to force settings panel reloadvoidreloadTestTools(boolean disable)To be called to force test tools panel reloadprotected voidresetDocks()It resets the status of all Docks widgets present in ScenarioSimulation.voidselectBackgroundTab()voidselectSimulationTab()voidsendNotification(String text, org.uberfire.workbench.events.NotificationEvent.NotificationType type)voidsendNotification(String text, org.uberfire.workbench.events.NotificationEvent.NotificationType type, boolean autoHide)voidsetCheatSheet(CheatSheetView.Presenter presenter)voidsetItemMenuEnabled(boolean enabled)voidsetPackageName(String packageName)voidsetPath(org.uberfire.backend.vfs.ObservablePath path)voidsetRedoButtonEnabledStatus(boolean enabled)voidsetSettings(SettingsView.Presenter presenter)voidsetTestTools(TestToolsView.Presenter presenter)voidsetUndoButtonEnabledStatus(boolean enabled)voidsetWrapper(ScenarioSimulationEditorWrapper scenarioSimulationEditorWrapper)voidshowDocks(org.uberfire.client.mvp.PlaceStatus status)protected voidshowImportDialog()voidunpublishTestResultsAlerts()protected voidunRegisterTestToolsCallback()protected voidupdateSettings(SettingsView.Presenter presenter)voidvalidateSimulation()
-
-
-
Field Detail
-
IDENTIFIER
public static final String IDENTIFIER
- See Also:
- Constant Field Values
-
packageName
protected String packageName
-
path
protected org.uberfire.backend.vfs.ObservablePath path
-
eventBus
protected com.google.gwt.event.shared.EventBus eventBus
-
scenarioMainGridWidget
protected ScenarioGridWidget scenarioMainGridWidget
-
scenarioBackgroundGridWidget
protected ScenarioGridWidget scenarioBackgroundGridWidget
-
placeManager
protected org.uberfire.client.mvp.PlaceManager placeManager
-
dataManagementStrategy
protected DataManagementStrategy dataManagementStrategy
-
context
protected ScenarioSimulationContext context
-
model
protected org.drools.scenariosimulation.api.model.ScenarioSimulationModel model
-
scenarioPresenterId
protected long scenarioPresenterId
-
undoMenuItem
protected org.uberfire.workbench.model.menu.MenuItem undoMenuItem
-
redoMenuItem
protected org.uberfire.workbench.model.menu.MenuItem redoMenuItem
-
runScenarioMenuItem
protected org.uberfire.workbench.model.menu.MenuItem runScenarioMenuItem
-
exportToCSVMenuItem
protected org.uberfire.workbench.model.menu.MenuItem exportToCSVMenuItem
-
importMenuItem
protected org.uberfire.workbench.model.menu.MenuItem importMenuItem
-
downloadMenuItem
protected org.uberfire.workbench.model.menu.MenuItem downloadMenuItem
-
scenarioSimulationEditorWrapper
protected ScenarioSimulationEditorWrapper scenarioSimulationEditorWrapper
-
-
Constructor Detail
-
ScenarioSimulationEditorPresenter
public ScenarioSimulationEditorPresenter()
-
ScenarioSimulationEditorPresenter
@Inject public ScenarioSimulationEditorPresenter(AbstractScenarioSimulationProducer abstractScenarioSimulationProducer, ScenarioSimulationResourceType type, org.uberfire.client.mvp.PlaceManager placeManager, AbstractScenarioSimulationDocksHandler abstractScenarioSimulationDocksHandler, org.uberfire.ext.editor.commons.client.file.exports.TextFileExport textFileExport, ConfirmPopupPresenter confirmPopupPresenter)
-
-
Method Detail
-
setWrapper
public void setWrapper(ScenarioSimulationEditorWrapper scenarioSimulationEditorWrapper)
-
setPath
public void setPath(org.uberfire.backend.vfs.ObservablePath path)
-
getPath
public org.uberfire.backend.vfs.ObservablePath getPath()
-
setPackageName
public void setPackageName(String packageName)
-
onClose
public void onClose()
-
showDocks
public void showDocks(org.uberfire.client.mvp.PlaceStatus status)
- Parameters:
status-PlaceStatusof TestToolsPresenter
-
hideDocks
public void hideDocks()
-
onUberfireDocksInteractionEvent
public void onUberfireDocksInteractionEvent(@Observes org.uberfire.client.workbench.docks.UberfireDocksInteractionEvent uberfireDocksInteractionEvent)
-
expandToolsDock
public void expandToolsDock()
-
expandSettingsDock
public void expandSettingsDock()
-
getView
public ScenarioSimulationView getView()
-
getModel
public org.drools.scenariosimulation.api.model.ScenarioSimulationModel getModel()
-
getPopulateTestToolsCommand
public org.uberfire.mvp.Command getPopulateTestToolsCommand()
-
reloadTestTools
public void reloadTestTools(boolean disable)
To be called to force test tools panel reload- Parameters:
disable- set this totrueto also disable the panel
-
reloadSettingsDock
public void reloadSettingsDock()
To be called to force settings panel reload
-
onRunScenario
public void onRunScenario()
-
onUndo
public void onUndo()
-
onRedo
public void onRedo()
-
setUndoButtonEnabledStatus
public void setUndoButtonEnabledStatus(boolean enabled)
-
setRedoButtonEnabledStatus
public void setRedoButtonEnabledStatus(boolean enabled)
-
setItemMenuEnabled
public void setItemMenuEnabled(boolean enabled)
-
addDownloadMenuItem
public void addDownloadMenuItem(org.kie.workbench.common.widgets.client.menu.FileMenuBuilder fileMenuBuilder, Supplier<org.uberfire.backend.vfs.Path> pathSupplier)
-
getDataManagementStrategy
public DataManagementStrategy getDataManagementStrategy()
-
onImport
public void onImport(String fileContents, GridWidget gridWidget)
-
getEventBus
public com.google.gwt.event.shared.EventBus getEventBus()
-
getContext
public ScenarioSimulationContext getContext()
-
resetDocks
protected void resetDocks()
It resets the status of all Docks widgets present in ScenarioSimulation. Considering the docks are marked as ApplicationScoped, this method should be call everytime ScenarioSimulationEditor is opened (or closed)
-
isUberfireDocksInteractionEventToManage
protected boolean isUberfireDocksInteractionEventToManage(org.uberfire.client.workbench.docks.UberfireDocksInteractionEvent uberfireDocksInteractionEvent)
Method to verify if the givenUberfireDocksInteractionEventis to be processed by current instance.- Parameters:
uberfireDocksInteractionEvent-- Returns:
trueifUberfireDocksInteractionEvent.getTargetDock() != nulland the scesimpath parameter ofUberfireDocksInteractionEvent.getTargetDock().getPlaceRequest()is equals to the path (toString) of the current instance;falseotherwise
-
getRefreshModelCallback
protected org.jboss.errai.common.client.api.RemoteCallback<org.drools.workbench.screens.scenariosimulation.model.SimulationRunResult> getRefreshModelCallback()
-
refreshModelContent
protected void refreshModelContent(org.drools.workbench.screens.scenariosimulation.model.SimulationRunResult newData)
-
sendNotification
public void sendNotification(String text, org.uberfire.workbench.events.NotificationEvent.NotificationType type)
-
sendNotification
public void sendNotification(String text, org.uberfire.workbench.events.NotificationEvent.NotificationType type, boolean autoHide)
-
registerTestToolsCallback
protected void registerTestToolsCallback()
-
unRegisterTestToolsCallback
protected void unRegisterTestToolsCallback()
-
getImportErrorCallback
protected org.jboss.errai.common.client.api.ErrorCallback<Object> getImportErrorCallback()
-
makeMenuBar
public void makeMenuBar(org.kie.workbench.common.widgets.client.menu.FileMenuBuilder fileMenuBuilder)
If you want to customize the menu override this method.- Parameters:
fileMenuBuilder-
-
addCommonActions
public void addCommonActions(org.kie.workbench.common.widgets.client.menu.FileMenuBuilder fileMenuBuilder, org.uberfire.workbench.model.menu.MenuItem versionMenuItem, org.uberfire.workbench.model.menu.MenuItem alertsButtonMenuItem)
-
loadContent
public void loadContent()
-
isDirty
public boolean isDirty()
-
onEditTabSelected
public void onEditTabSelected()
-
onBackgroundTabSelected
public void onBackgroundTabSelected()
-
onOverviewSelected
public void onOverviewSelected()
-
onImportsTabSelected
public void onImportsTabSelected()
-
validateSimulation
public void validateSimulation()
-
selectSimulationTab
public void selectSimulationTab()
-
selectBackgroundTab
public void selectBackgroundTab()
-
onDownload
protected void onDownload(Supplier<org.uberfire.backend.vfs.Path> pathSupplier)
-
open
protected void open(String downloadURL)
-
showImportDialog
protected void showImportDialog()
-
onExportToCsv
protected void onExportToCsv()
-
getExportCallBack
public org.jboss.errai.common.client.api.RemoteCallback<String> getExportCallBack()
-
getImportCallBack
protected org.jboss.errai.common.client.api.RemoteCallback<org.drools.scenariosimulation.api.model.AbstractScesimModel> getImportCallBack()
-
getValidateCommand
protected org.uberfire.mvp.Command getValidateCommand()
-
getValidationCallback
protected org.jboss.errai.common.client.api.RemoteCallback<List<org.drools.workbench.screens.scenariosimulation.model.FactMappingValidationError>> getValidationCallback()
-
getValidationFailedCallback
public org.jboss.errai.common.client.api.ErrorCallback<Boolean> getValidationFailedCallback()
-
cleanReadOnlyColumn
protected void cleanReadOnlyColumn(org.drools.scenariosimulation.api.model.AbstractScesimModel abstractScesimModel)
Read only columns should not contains any values- Parameters:
abstractScesimModel-
-
populateRightDocks
public void populateRightDocks(String identifier)
-
getModelSuccessCallbackMethod
public void getModelSuccessCallbackMethod(DataManagementStrategy dataManagementStrategy, org.drools.scenariosimulation.api.model.ScenarioSimulationModel model)
-
getType
public ScenarioSimulationResourceType getType()
-
setTestTools
public void setTestTools(TestToolsView.Presenter presenter)
-
clearTestToolsStatus
protected void clearTestToolsStatus()
-
setCheatSheet
public void setCheatSheet(CheatSheetView.Presenter presenter)
-
setSettings
public void setSettings(SettingsView.Presenter presenter)
-
updateSettings
protected void updateSettings(SettingsView.Presenter presenter)
-
getJsonModel
public String getJsonModel(org.drools.scenariosimulation.api.model.ScenarioSimulationModel model)
-
getFileDownloadURL
protected String getFileDownloadURL(Supplier<org.uberfire.backend.vfs.Path> pathSupplier)
-
unpublishTestResultsAlerts
public void unpublishTestResultsAlerts()
-
getUpdateDMNMetadataCommand
public org.uberfire.mvp.Command getUpdateDMNMetadataCommand()
-
-