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


Java ClickHandler.onClick方法代码示例

本文整理汇总了Java中com.google.gwt.event.dom.client.ClickHandler.onClick方法的典型用法代码示例。如果您正苦于以下问题:Java ClickHandler.onClick方法的具体用法?Java ClickHandler.onClick怎么用?Java ClickHandler.onClick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.event.dom.client.ClickHandler的用法示例。


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

示例1: shouldCallPlayOrStopDescriptionOnPlayButtonClick

import com.google.gwt.event.dom.client.ClickHandler; //导入方法依赖的package包/类
@Test
public void shouldCallPlayOrStopDescriptionOnPlayButtonClick() {
    // given
    String file = "test.mp3";
    Entry entry = mock(Entry.class);
    when(entry.getEntryExampleSound()).thenReturn(file);

    doAnswer(new Answer<Void>() {
        @Override
        public Void answer(InvocationOnMock invocation) {
            clickHandler = (ClickHandler) invocation.getArguments()[0];
            return null;
        }
    }).when(explanationView).addPlayButtonHandler(any(ClickHandler.class));

    // when
    testObj.init();
    testObj.processEntry(entry);
    clickHandler.onClick(null);

    // then
    verify(explanationDescriptionSoundController).playOrStopExplanationSound(entry.getEntryExampleSound());
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:24,代码来源:ExplanationControllerTest.java

示例2: shouldCallPlayOrStopEntryOnPlayButtonClick

import com.google.gwt.event.dom.client.ClickHandler; //导入方法依赖的package包/类
@Test
public void shouldCallPlayOrStopEntryOnPlayButtonClick() {
    // given
    String file = "test.mp3";
    Entry entry = mock(Entry.class);
    when(entry.getEntrySound()).thenReturn(file);

    doAnswer(new Answer<Void>() {
        @Override
        public Void answer(InvocationOnMock invocation) {
            clickHandler = (ClickHandler) invocation.getArguments()[0];
            return null;
        }
    }).when(explanationView).addEntryPlayButtonHandler(any(ClickHandler.class));

    // when
    testObj.init();
    testObj.processEntry(entry);
    clickHandler.onClick(null);

    // then
    verify(entryDescriptionSoundController).playOrStopEntrySound(entry.getEntrySound());
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:24,代码来源:ExplanationControllerTest.java

示例3: shouldHideFeedback

import com.google.gwt.event.dom.client.ClickHandler; //导入方法依赖的package包/类
@Test
public void shouldHideFeedback() {
    //given
    Element element = mock(Element.class);
    testObj.initModule(element);
    verify(feedbackPresenter).addCloseButtonClickHandler(clickHandlerCaptor.capture());
    ClickHandler clickHandler = clickHandlerCaptor.getValue();
    ClickEvent clickEvent = mock(ClickEvent.class);

    //when
    clickHandler.onClick(clickEvent);

    //then
    verify(feedbackPresenter, times(2)).hideFeedback();
    verify(feedbackBlend, times(2)).hide();
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:17,代码来源:TextActionProcessorTest.java

示例4: shouldOpenURl

import com.google.gwt.event.dom.client.ClickHandler; //导入方法依赖的package包/类
@Test
public void shouldOpenURl() {
    // given
    doAnswer(new Answer<Void>() {
        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            clickHandler = (ClickHandler) invocation.getArguments()[0];
            return null;
        }
    }).when(view).addAnchorClickHandler(any(ClickHandler.class));

    instance.setBean(bean);
    instance.init();

    ClickEvent clickEvent = mock(ClickEvent.class);

    // when
    clickHandler.onClick(clickEvent);

    // then
    verify(assetOpenDelegatorService).open(URL);
    verify(clickEvent).preventDefault();
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:24,代码来源:ButtonModulePresenterTest.java

示例5: shouldShowFeedback

import com.google.gwt.event.dom.client.ClickHandler; //导入方法依赖的package包/类
@Test
public void shouldShowFeedback() {
    //given
    Element element = mock(Element.class);
    testObj.initModule(element);
    verify(feedbackPresenter).addShowButtonClickHandler(clickHandlerCaptor.capture());
    ClickHandler clickHandler = clickHandlerCaptor.getValue();
    ClickEvent clickEvent = mock(ClickEvent.class);
    //when
    clickHandler.onClick(clickEvent);
    //then
    verify(feedbackPresenter).showFeedback();
    verify(feedbackBlend).show(feedbackPresenter);
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:15,代码来源:TextActionProcessorTest.java

示例6: shouldShowMenu_onFirstClick

import com.google.gwt.event.dom.client.ClickHandler; //导入方法依赖的package包/类
@Test
public void shouldShowMenu_onFirstClick() {
    // given
    ClickHandler clickHandler = commandCaptor.getValue();

    // when
    clickHandler.onClick(clickEvent);

    // then
    verify(view).removeStyleName(qpMenuHidden);
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:12,代码来源:MenuPresenterTest.java

示例7: shouldHideMenu_onSecondClick

import com.google.gwt.event.dom.client.ClickHandler; //导入方法依赖的package包/类
@Test
public void shouldHideMenu_onSecondClick() {
    // given
    ClickHandler clickHandler = commandCaptor.getValue();

    // when
    clickHandler.onClick(clickEvent);
    clickHandler.onClick(clickEvent);

    // then
    verify(view).addStyleName(qpMenuHidden);
}
 
开发者ID:YoungDigitalPlanet,项目名称:empiria.player,代码行数:13,代码来源:MenuPresenterTest.java


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