use of com.haulmont.cuba.gui.sys.TestIdManager in project cuba by cuba-platform.
the class WebPickerField method setDebugId.
@Override
public void setDebugId(String id) {
super.setDebugId(id);
if (id != null) {
String debugId = getDebugId();
TestIdManager testIdManager = AppUI.getCurrent().getTestIdManager();
for (Action action : actions) {
CubaButton button = actionButtons.get(action);
if (button != null && Strings.isNullOrEmpty(button.getId())) {
button.setId(testIdManager.getTestId(debugId + "_" + action.getId()));
}
}
}
}
use of com.haulmont.cuba.gui.sys.TestIdManager in project cuba by cuba-platform.
the class WebPickerField method addAction.
@Override
public void addAction(Action action, int index) {
checkNotNullArgument(action, "action must be non null");
int oldIndex = findActionById(actions, action.getId());
if (oldIndex >= 0) {
removeAction(actions.get(oldIndex));
if (index > oldIndex) {
index--;
}
}
actions.add(index, action);
actionHandler.addAction(action, index);
CubaButton vButton = new CubaButton();
setPickerButtonAction(vButton, action);
component.addButton(vButton, index);
actionButtons.put(action, vButton);
if (StringUtils.isNotEmpty(getDebugId())) {
TestIdManager testIdManager = AppUI.getCurrent().getTestIdManager();
// Set debug id
vButton.setId(testIdManager.getTestId(getDebugId() + "_" + action.getId()));
}
if (action instanceof PickerFieldAction) {
PickerFieldAction pickerFieldAction = (PickerFieldAction) action;
pickerFieldAction.setPickerField(this);
if (!isEditable()) {
pickerFieldAction.editableChanged(this, isEditable());
}
}
actionsPermissions.apply(action);
refreshActionsState();
}
use of com.haulmont.cuba.gui.sys.TestIdManager in project cuba by cuba-platform.
the class WebPopupButton method setDebugId.
@Override
public void setDebugId(String id) {
super.setDebugId(id);
AppUI ui = AppUI.getCurrent();
if (id != null && ui != null && ui.isPerformanceTestMode()) {
TestIdManager testIdManager = ui.getTestIdManager();
for (Map.Entry<Action, Button> entry : actionButtons.entrySet()) {
Button button = entry.getValue();
Action action = entry.getKey();
button.setId(testIdManager.getTestId(id + "_" + action.getId()));
}
}
}
Aggregations