use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class DefaultAdminPageHelper method addSecurityPerspective.
private void addSecurityPerspective() {
if (hasAccessToPerspective(PerspectiveIds.SECURITY_MANAGEMENT)) {
adminPage.addTool("root", constants.Roles(), "fa-unlock-alt", "security", () -> {
final Command accessRoles = () -> {
Map<String, String> params = new HashMap<>();
params.put("activeTab", "RolesTab");
placeManager.goTo(new DefaultPlaceRequest(SECURITY_MANAGEMENT, params));
};
accessRoles.execute();
addAdminBreadcrumbs(SECURITY_MANAGEMENT, constants.SecurityManagement(), accessRoles);
}, command -> userSystemManager.roles((AbstractEntityManager.SearchResponse<Role> response) -> {
if (response != null) {
command.execute(response.getTotal());
}
}, (o, throwable) -> false).search(new SearchRequestImpl("", 1, 1, null)));
adminPage.addTool("root", constants.Groups(), "fa-users", "security", () -> {
final Command accessGroups = () -> {
Map<String, String> params = new HashMap<>();
params.put("activeTab", "GroupsTab");
placeManager.goTo(new DefaultPlaceRequest(SECURITY_MANAGEMENT, params));
};
accessGroups.execute();
addAdminBreadcrumbs(SECURITY_MANAGEMENT, constants.SecurityManagement(), accessGroups);
}, command -> userSystemManager.groups((AbstractEntityManager.SearchResponse<Group> response) -> {
if (response != null) {
command.execute(response.getTotal());
}
}, (o, throwable) -> false).search(new SearchRequestImpl("", 1, 1, null)));
adminPage.addTool("root", constants.Users(), "fa-user", "security", () -> {
final Command accessUsers = () -> {
Map<String, String> params = new HashMap<>();
params.put("activeTab", "UsersTab");
placeManager.goTo(new DefaultPlaceRequest(SECURITY_MANAGEMENT, params));
};
accessUsers.execute();
addAdminBreadcrumbs(SECURITY_MANAGEMENT, constants.SecurityManagement(), accessUsers);
}, command -> userSystemManager.users((AbstractEntityManager.SearchResponse<User> response) -> {
if (response != null) {
command.execute(response.getTotal());
}
}, (o, throwable) -> false).search(new SearchRequestImpl("", 1, 1, null)));
}
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class ActiveOptionsInitTest method testParametersInPlaceRequest_business_tree.
@Test
public void testParametersInPlaceRequest_business_tree() throws Exception {
Command completeCommand = mock(Command.class);
PlaceRequest placeRequest = mock(PlaceRequest.class);
when(placeRequest.getParameter("mode", "")).thenReturn("business_tree");
options.init(placeRequest, completeCommand);
assertFalse(options.getOptions().isEmpty());
assertTrue(options.isBusinessViewActive());
assertTrue(options.isTreeNavigatorVisible());
assertFalse(options.areHiddenFilesVisible());
verify(completeCommand).execute();
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class ContainerView method confirmRemove.
@Override
public void confirmRemove(final Command command) {
final YesNoCancelPopup result = YesNoCancelPopup.newYesNoCancelPopup(getConfirmRemovePopupTitle(), getConfirmRemovePopupMessage(), command, new Command() {
@Override
public void execute() {
}
}, null);
result.clearScrollHeight();
result.show();
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class ContainerCardPresenter method updateContent.
public void updateContent(final ServerInstanceKey serverInstanceKey, final Container container) {
linkTitlePresenter.setup(serverInstanceKey.getServerName(), new Command() {
@Override
public void execute() {
remoteServerSelectedEvent.fire(new ServerInstanceSelected(serverInstanceKey));
}
});
bodyPresenter.setup(container.getMessages());
footerPresenter.setup(container.getUrl(), container.getResolvedReleasedId().getVersion());
}
use of org.uberfire.mvp.Command in project kie-wb-common by kiegroup.
the class ServerNavigationView method addTemplate.
@Override
public void addTemplate(final String id, final String name) {
final CustomGroupItem template = new CustomGroupItem(name, IconType.FOLDER_O, new Command() {
@Override
public void execute() {
presenter.select(id);
}
});
idItem.put(id, template);
serverTemplates.add(template);
}
Aggregations