Search in sources :

Example 1 with RecipeEditorView

use of org.eclipse.che.ide.extension.machine.client.perspective.widgets.recipe.editor.RecipeEditorView in project che by eclipse.

the class RecipePartPresenterTest method stubPanelShouldBeShowed.

@Test
public void stubPanelShouldBeShowed() throws Exception {
    RecipeEditorView recipeEditorView = mock(RecipeEditorView.class);
    when(service.getAllRecipes()).thenReturn(recipePromises);
    when(recipesContainerPresenter.getEditorStubPanel()).thenReturn(recipeEditorPanel);
    when(recipeEditorPanel.getView()).thenReturn(recipeEditorView);
    recipePartPresenter.showRecipes();
    verify(service).getAllRecipes();
    verify(recipePromises).then(operationListDescriptorCaptor.capture());
    operationListDescriptorCaptor.getValue().apply(Collections.<RecipeDescriptor>emptyList());
    verify(recipePartView).clear();
    verify(recipesContainerPresenter).getEditorStubPanel();
    verify(recipeEditorPanel).setDelegate(recipePartPresenter);
    verify(recipesContainerPresenter).showEditorStubPanel();
    verify(recipeEditorView).setName("");
}
Also used : RecipeEditorView(org.eclipse.che.ide.extension.machine.client.perspective.widgets.recipe.editor.RecipeEditorView) Test(org.junit.Test)

Example 2 with RecipeEditorView

use of org.eclipse.che.ide.extension.machine.client.perspective.widgets.recipe.editor.RecipeEditorView in project che by eclipse.

the class RecipePartPresenter method showEditorStubPanel.

private void showEditorStubPanel() {
    RecipeEditorPanel editorStubPanel = recipesContainerPresenter.getEditorStubPanel();
    RecipeEditorView stubPanelView = (RecipeEditorView) editorStubPanel.getView();
    stubPanelView.setName("");
    stubPanelView.setTags(Collections.<String>emptyList());
    editorStubPanel.setVisibleSaveCancelCloneDeleteBtns(false);
    editorStubPanel.setDelegate(this);
    recipesContainerPresenter.showEditorStubPanel();
}
Also used : RecipeEditorPanel(org.eclipse.che.ide.extension.machine.client.perspective.widgets.recipe.editor.RecipeEditorPanel) RecipeEditorView(org.eclipse.che.ide.extension.machine.client.perspective.widgets.recipe.editor.RecipeEditorView)

Example 3 with RecipeEditorView

use of org.eclipse.che.ide.extension.machine.client.perspective.widgets.recipe.editor.RecipeEditorView in project che by eclipse.

the class RecipesContainerPresenter method addRecipePanel.

/**
     * Adds new recipe panel to container.
     *
     * @param recipe
     *         current recipe widget
     */
public void addRecipePanel(@NotNull RecipeWidget recipe) {
    if (recipePanels.get(recipe) != null) {
        return;
    }
    RecipeEditorPanel editorPanel = entityFactory.createRecipeEditorPanel(recipe.getDescriptor());
    recipePanels.put(recipe, editorPanel);
    RecipeEditorView editorView = ((RecipeEditorView) editorPanel.getView());
    RecipeDescriptor recipeDescriptor = recipe.getDescriptor();
    editorView.setScriptUrl(recipeDescriptor.getLink("get recipe script").getHref());
    editorView.setTags(recipeDescriptor.getTags());
    editorView.setName(recipeDescriptor.getName());
}
Also used : RecipeEditorPanel(org.eclipse.che.ide.extension.machine.client.perspective.widgets.recipe.editor.RecipeEditorPanel) RecipeDescriptor(org.eclipse.che.api.machine.shared.dto.recipe.RecipeDescriptor) RecipeEditorView(org.eclipse.che.ide.extension.machine.client.perspective.widgets.recipe.editor.RecipeEditorView)

Aggregations

RecipeEditorView (org.eclipse.che.ide.extension.machine.client.perspective.widgets.recipe.editor.RecipeEditorView)3 RecipeEditorPanel (org.eclipse.che.ide.extension.machine.client.perspective.widgets.recipe.editor.RecipeEditorPanel)2 RecipeDescriptor (org.eclipse.che.api.machine.shared.dto.recipe.RecipeDescriptor)1 Test (org.junit.Test)1