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("");
}
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();
}
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());
}
Aggregations