当前位置: 首页>>代码示例>>Java>>正文


Java Command类代码示例

本文整理汇总了Java中org.uberfire.mvp.Command的典型用法代码示例。如果您正苦于以下问题:Java Command类的具体用法?Java Command怎么用?Java Command使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Command类属于org.uberfire.mvp包,在下文中一共展示了Command类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testHide

import org.uberfire.mvp.Command; //导入依赖的package包/类
@Test
public void testHide() {
    tested.hide();
    verify(view,
           times(1)).hide();
    verify(view,
           times(0)).init(any(UserAssignedGroupsEditor.class));
    verify(view,
           times(0)).configure(any(EntitiesExplorerView.class));
    verify(view,
           times(0)).show(anyString());
    verify(view,
           times(0)).configureClose(anyString(),
                                    any(Command.class));
    verify(view,
           times(0)).configureSave(anyString(),
                                   any(Command.class));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:19,代码来源:UserAssignedGroupsEditorTest.java

示例2: testOnDeleteUserEvent

import org.uberfire.mvp.Command; //导入依赖的package包/类
@Test
public void testOnDeleteUserEvent() {
    final OnDeleteEvent onDeleteEvent = mock(OnDeleteEvent.class);
    when(onDeleteEvent.getContext()).thenReturn(userEditor);
    tested.user = user;
    doAnswer(new Answer<Void>() {
        @Override
        public Void answer(InvocationOnMock invocationOnMock) throws Throwable {
            final Command callback = (Command) invocationOnMock.getArguments()[2];
            callback.execute();
            return null;
        }
    }).when(confirmBox).show(anyString(),
                             anyString(),
                             any(Command.class),
                             any(Command.class));
    tested.onDeleteUserEvent(onDeleteEvent);
    verify(confirmBox,
           times(1)).show(anyString(),
                          anyString(),
                          any(Command.class),
                          any(Command.class));
    verify(userManagerService,
           times(1)).delete(anyString());
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:26,代码来源:UserCreationWorkflowTest.java

示例3: addCommand

import org.uberfire.mvp.Command; //导入依赖的package包/类
@Override
public void addCommand(String name, Command command) {
    AnchorElement anchor = Document.get().createAnchorElement();
    anchor.setInnerText(name);

    LIElement li = Document.get().createLIElement();
    li.getStyle().setCursor(Style.Cursor.POINTER);
    li.appendChild(anchor);
    commandMenu.appendChild((Node) li);

    Event.sinkEvents(anchor, Event.ONCLICK);
    Event.setEventListener(anchor, event -> {
        if(Event.ONCLICK == event.getTypeInt()) {
            command.execute();
        }
    });
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:NavItemDefaultEditorView.java

示例4: generateBreadCrumbSelectCommand

import org.uberfire.mvp.Command; //导入依赖的package包/类
Command generateBreadCrumbSelectCommand(final String perspective,
                                        final BreadcrumbsPresenter breadCrumb,
                                        final PlaceRequest placeRequest,
                                        final HasWidgets addTo,
                                        final Command command) {
    return () -> {
        removeDeepLevelBreadcrumbs(perspective,
                                   breadCrumb);
        breadCrumb.activate();
        if (placeRequest != null) {
            goToBreadCrumb(placeRequest,
                           addTo);
        }
        updateView();
        if (command != null) {
            command.execute();
        }
    };
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:UberfireBreadcrumbs.java

示例5: AbstractConcurrentChangePopup

import org.uberfire.mvp.Command; //导入依赖的package包/类
protected AbstractConcurrentChangePopup(final String content,
                                        final Command onIgnore,
                                        final Command onAction,
                                        final String buttonText) {
    setTitle(CommonConstants.INSTANCE.Error());

    add(new ModalBody() {{
        add(uiBinder.createAndBindUi(AbstractConcurrentChangePopup.this));
    }});
    add(new ModalFooterReOpenIgnoreButtons(this,
                                           onAction,
                                           onIgnore,
                                           buttonText));

    message.setHTML(SafeHtmlUtils.fromTrustedString(content));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:AbstractConcurrentChangePopup.java

示例6: testNoCommands

import org.uberfire.mvp.Command; //导入依赖的package包/类
@Test
public void testNoCommands() throws Exception {
    final String title = "title";
    final String message = "message";
    final Command yesCommand = mock(Command.class);
    final Command noCommand = mock(Command.class);
    presenter.show(title,
                   message,
                   yesCommand,
                   noCommand);
    verify(view,
           times(1)).show(title,
                          message,
                          yesCommand,
                          noCommand);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:ConfirmBoxTest.java

示例7: addPartTwiceShouldCloseOtherPartTest

import org.uberfire.mvp.Command; //导入依赖的package包/类
@Test
public void addPartTwiceShouldCloseOtherPartTest() {

    SinglePartPanelHelper singlePartPanelHelper = mock(SinglePartPanelHelper.class);

    SimpleWorkbenchPanelPresenter presenter = new SimpleWorkbenchPanelPresenter(view,
                                                                                mock(PerspectiveManager.class),
                                                                                placeManager) {
        SinglePartPanelHelper createSinglePartPanelHelper() {
            return singlePartPanelHelper;
        }
    };

    presenter.init();
    presenter.setDefinition(panelPresenterPanelDefinition);

    //there is already a part
    when(singlePartPanelHelper.hasNoParts()).thenReturn(false);

    WorkbenchPartPresenter part2 = mock(WorkbenchPartPresenter.class);
    when(part2.getDefinition()).thenReturn(mock(PartDefinition.class));

    presenter.addPart(part2);

    verify(singlePartPanelHelper).closeFirstPartAndAddNewOne(any(Command.class));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:27,代码来源:SimpleWorkbenchPanelPresenterTest.java

示例8: DefaultToolBarItem

import org.uberfire.mvp.Command; //导入依赖的package包/类
public DefaultToolBarItem(final String url,
                          final String tooltip,
                          final Command command) {
    this.tooltip = checkNotNull("tooltip",
                                tooltip);
    this.command = checkNotNull("command",
                                command);
    checkNotNull("url",
                 url);
    this.icon = new ToolBarUrlIcon() {
        @Override
        public String getUrl() {
            return url;
        }
    };
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:17,代码来源:DefaultToolBarItem.java

示例9: configureSave

import org.uberfire.mvp.Command; //导入依赖的package包/类
@Override
public AssignedEntitiesEditor<T> configureSave(final String saveText,
                                               final Command saveCallback) {
    saveButton.setText(saveText);
    saveButton.setTitle(saveText);
    saveButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(final ClickEvent clickEvent) {
            if (saveCallback != null) {
                saveCallback.execute();
                ;
            } else {
                entitiesModal.hide();
            }
        }
    });
    return this;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:19,代码来源:AssignedEntitiesModalEditorView.java

示例10: testAddMenuWithPermission

import org.uberfire.mvp.Command; //导入依赖的package包/类
@Test
public void testAddMenuWithPermission() {
    final String perspectiveId = "perspectiveId";
    final String label = "perspectiveLabel";
    final Menus menus = MenuFactory.newSimpleItem(label).perspective(perspectiveId).endMenu().build();
    when(authzManager.authorize(menus.getItems().get(0),
                                identity)).thenReturn(true);

    presenter.addMenus(menus);

    verify(authzManager).authorize(menus.getItems().get(0),
                                   identity);
    verify(view).addMenuItem(eq(perspectiveId),
                             eq(label),
                             isNull(String.class),
                             any(Command.class),
                             any(MenuPosition.class));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:19,代码来源:WorkbenchMenuBarPresenterTest.java

示例11: createBreadCrumb

import org.uberfire.mvp.Command; //导入依赖的package包/类
private BreadcrumbsPresenter createBreadCrumb(final String perspective,
                                              final String label,
                                              final PlaceRequest placeRequest,
                                              final HasWidgets addTo,
                                              final Command command) {

    BreadcrumbsPresenter breadCrumb = breadcrumbsPresenters.get();
    breadCrumb.setup(label,
                     placeRequest,
                     generateBreadCrumbSelectCommand(perspective,
                                                     breadCrumb,
                                                     placeRequest,
                                                     addTo,
                                                     command));
    breadCrumb.activate();
    return breadCrumb;
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:18,代码来源:UberfireBreadcrumbs.java

示例12: testUpdatePassword

import org.uberfire.mvp.Command; //导入依赖的package包/类
@Test
public void testUpdatePassword() throws Exception {
    final String newPassw = "new-password";
    Command callback = mock(Command.class);
    ChangePassword.ChangePasswordCallback changePasswordCallback = mock(ChangePassword.ChangePasswordCallback.class);
    presenter.username = "user";
    presenter.callback = changePasswordCallback;
    presenter.onUpdatePassword(newPassw,
                               callback);
    verify(userManagerService,
           times(1)).changePassword(presenter.username,
                                    newPassw);
    verify(changePasswordEvent,
           times(1)).fire(any(ChangePasswordEvent.class));
    verify(workbenchNotification,
           times(1)).fire(any(NotificationEvent.class));
    verify(callback,
           times(1)).execute();
    verify(changePasswordCallback,
           times(1)).onPasswordUpdated();
    verify(view,
           times(1)).hide();
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:24,代码来源:ChangePasswordTest.java

示例13: testAllCommands

import org.uberfire.mvp.Command; //导入依赖的package包/类
@Test
public void testAllCommands() throws Exception {
    final String title = "title";
    final String message = "message";
    final Command yesCommand = mock(Command.class);
    final Command noCommand = mock(Command.class);
    final Command cancelCommand = mock(Command.class);
    presenter.show(title,
                   message,
                   yesCommand,
                   noCommand,
                   cancelCommand);
    verify(view,
           times(1)).show(title,
                          message,
                          yesCommand,
                          noCommand,
                          cancelCommand);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:20,代码来源:ConfirmBoxTest.java

示例14: ModalFooterYesNoCancelButtons

import org.uberfire.mvp.Command; //导入依赖的package包/类
public ModalFooterYesNoCancelButtons(final Modal panel,
                                     final Command yesCommand,
                                     final ButtonType yesButtonType,
                                     final Command noCommand,
                                     final ButtonType noButtonType,
                                     final Command cancelCommand,
                                     final ButtonType cancelButtonType) {
    this(panel,
         yesCommand,
         null,
         yesButtonType,
         null,
         noCommand,
         null,
         noButtonType,
         null,
         cancelCommand,
         null,
         cancelButtonType,
         null);
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:22,代码来源:ModalFooterYesNoCancelButtons.java

示例15: testEdit

import org.uberfire.mvp.Command; //导入依赖的package包/类
@Test
public void testEdit() {
    tested.edit(user);
    assertTrue(tested.isEditMode);
    assertTrue(tested.entities.size() == 1);
    verify(rolesExplorer,
           times(1)).show(any(ExplorerViewContext.class));
    verify(view,
           times(1)).show(anyString());
    verify(view,
           times(0)).init(any(UserAssignedRolesEditor.class));
    verify(view,
           times(0)).configure(any(EntitiesExplorerView.class));
    verify(view,
           times(0)).hide();
    verify(view,
           times(0)).configureClose(anyString(),
                                    any(Command.class));
    verify(view,
           times(0)).configureSave(anyString(),
                                   any(Command.class));
}
 
开发者ID:kiegroup,项目名称:appformer,代码行数:23,代码来源:UserAssignedRolesEditorTest.java


注:本文中的org.uberfire.mvp.Command类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。