Search in sources :

Example 21 with AcceptsOneWidget

use of com.google.gwt.user.client.ui.AcceptsOneWidget in project che by eclipse.

the class GitImporterPagePresenterTest method testGo.

@Test
public void testGo() {
    AcceptsOneWidget container = mock(AcceptsOneWidget.class);
    presenter.go(container);
    verify(container).setWidget(eq(view));
    verify(view).setProjectName(anyString());
    verify(view).setProjectDescription(anyString());
    verify(view).setProjectUrl(anyString());
    verify(view).setInputsEnableState(eq(true));
    verify(view).focusInUrlInput();
}
Also used : AcceptsOneWidget(com.google.gwt.user.client.ui.AcceptsOneWidget) Test(org.junit.Test)

Example 22 with AcceptsOneWidget

use of com.google.gwt.user.client.ui.AcceptsOneWidget in project che by eclipse.

the class GithubImporterPagePresenterTest method testGo.

@Test
public void testGo() throws Exception {
    String importerDescription = "description";
    AcceptsOneWidget container = mock(AcceptsOneWidget.class);
    ProjectImporterDescriptor projectImporter = mock(ProjectImporterDescriptor.class);
    //when(wizardContext.getData(ImportProjectWizard.PROJECT_IMPORTER)).thenReturn(projectImporter);
    when(projectImporter.getDescription()).thenReturn(importerDescription);
    presenter.go(container);
    verify(view).setInputsEnableState(eq(true));
    verify(container).setWidget(eq(view));
    verify(view).focusInUrlInput();
}
Also used : Matchers.anyString(org.mockito.Matchers.anyString) AcceptsOneWidget(com.google.gwt.user.client.ui.AcceptsOneWidget) ProjectImporterDescriptor(org.eclipse.che.api.project.shared.dto.ProjectImporterDescriptor) Test(org.junit.Test)

Example 23 with AcceptsOneWidget

use of com.google.gwt.user.client.ui.AcceptsOneWidget in project che by eclipse.

the class TargetsPresenter method onTargetSelected.

@Override
public void onTargetSelected(final Target target) {
    selectedTarget = target;
    if (target == null) {
        view.showHintPanel();
        return;
    }
    final CategoryPage page = categoryPageRegistry.getCategoryPage(target.getCategory());
    if (page == null) {
        view.showHintPanel();
        return;
    }
    page.go(new AcceptsOneWidget() {

        @Override
        public void setWidget(IsWidget widget) {
            view.setPropertiesPanel(widget.asWidget());
            page.setCurrentSelection(target);
        }
    });
}
Also used : IsWidget(com.google.gwt.user.client.ui.IsWidget) AcceptsOneWidget(com.google.gwt.user.client.ui.AcceptsOneWidget)

Example 24 with AcceptsOneWidget

use of com.google.gwt.user.client.ui.AcceptsOneWidget in project che by eclipse.

the class ProcessesPanelPresenter method addOutputConsole.

private void addOutputConsole(final String id, final ProcessTreeNode processNode, final OutputConsole outputConsole, final boolean machineConsole) {
    consoles.put(id, outputConsole);
    consoleCommands.put(outputConsole, id);
    outputConsole.go(new AcceptsOneWidget() {

        @Override
        public void setWidget(final IsWidget widget) {
            view.addProcessNode(processNode);
            view.addWidget(id, outputConsole.getTitle(), outputConsole.getTitleIcon(), widget, machineConsole);
            if (!MACHINE_NODE.equals(processNode.getType())) {
                ProcessTreeNode node = view.getNodeById(id);
                view.selectNode(node);
                notifyTreeNodeSelected(node);
            }
        }
    });
    outputConsole.addActionDelegate(this);
}
Also used : IsWidget(com.google.gwt.user.client.ui.IsWidget) ProcessTreeNode(org.eclipse.che.ide.extension.machine.client.processes.ProcessTreeNode) AcceptsOneWidget(com.google.gwt.user.client.ui.AcceptsOneWidget)

Example 25 with AcceptsOneWidget

use of com.google.gwt.user.client.ui.AcceptsOneWidget in project che by eclipse.

the class DevelopmentCategoryPresenterTest method testGo.

@Test
public void testGo() throws Exception {
    AcceptsOneWidget container = Mockito.mock(AcceptsOneWidget.class);
    arbitraryCategoryPresenter.go(container);
    verify(container).setWidget(eq(developmentView));
}
Also used : AcceptsOneWidget(com.google.gwt.user.client.ui.AcceptsOneWidget) Test(org.junit.Test)

Aggregations

AcceptsOneWidget (com.google.gwt.user.client.ui.AcceptsOneWidget)27 Test (org.junit.Test)23 IsWidget (com.google.gwt.user.client.ui.IsWidget)3 ProjectImporterDescriptor (org.eclipse.che.api.project.shared.dto.ProjectImporterDescriptor)2 ActivePartChangedEvent (org.eclipse.che.ide.api.event.ActivePartChangedEvent)2 SelectionChangedHandler (org.eclipse.che.ide.api.event.SelectionChangedHandler)2 AbstractPartPresenter (org.eclipse.che.ide.api.parts.AbstractPartPresenter)2 Selection (org.eclipse.che.ide.api.selection.Selection)2 ArrayList (java.util.ArrayList)1 Breakpoint (org.eclipse.che.ide.api.debug.Breakpoint)1 ProcessTreeNode (org.eclipse.che.ide.extension.machine.client.processes.ProcessTreeNode)1 BaseTest (org.eclipse.che.plugin.debugger.ide.BaseTest)1 Matchers.anyString (org.mockito.Matchers.anyString)1 Mockito.anyString (org.mockito.Mockito.anyString)1 Test (org.testng.annotations.Test)1