Search in sources :

Example 6 with RecipeEditorPanel

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

the class RecipePartPresenter method onNewButtonClicked.

/** {@inheritDoc} */
@Override
public void onNewButtonClicked() {
    RecipeEditorPanel stubPanel = recipesContainerPresenter.getEditorStubPanel();
    String recipeName = NameGenerator.generateCustomRecipeName(recipes.keySet());
    List<String> tags = stubPanel.getTags();
    if (recipes.isEmpty() && !stubPanel.getName().isEmpty()) {
        recipeName = stubPanel.getName();
        stubPanel.setTags(Collections.<String>emptyList());
    }
    NewRecipe newRecipe = dtoFactory.createDto(NewRecipe.class).withType(RECIPE_TYPE).withScript(resources.recipeTemplate().getText()).withName(recipeName).withTags(tags);
    createRecipe(newRecipe);
}
Also used : RecipeEditorPanel(org.eclipse.che.ide.extension.machine.client.perspective.widgets.recipe.editor.RecipeEditorPanel) NewRecipe(org.eclipse.che.api.machine.shared.dto.recipe.NewRecipe)

Example 7 with RecipeEditorPanel

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

the class RecipePartPresenter method onActivePartChanged.

/** {@inheritDoc} */
@Override
public void onActivePartChanged(ActivePartChangedEvent event) {
    if (!(event.getActivePart() instanceof RecipePartPresenter)) {
        return;
    }
    recipesContainerPresenter.showEditorPanel(selectedRecipe);
    RecipeEditorPanel recipePanel = recipesContainerPresenter.getEditorPanel(selectedRecipe);
    recipePanel.setDelegate(this);
}
Also used : RecipeEditorPanel(org.eclipse.che.ide.extension.machine.client.perspective.widgets.recipe.editor.RecipeEditorPanel)

Aggregations

RecipeEditorPanel (org.eclipse.che.ide.extension.machine.client.perspective.widgets.recipe.editor.RecipeEditorPanel)7 RecipeDescriptor (org.eclipse.che.api.machine.shared.dto.recipe.RecipeDescriptor)2 RecipeEditorView (org.eclipse.che.ide.extension.machine.client.perspective.widgets.recipe.editor.RecipeEditorView)2 NewRecipe (org.eclipse.che.api.machine.shared.dto.recipe.NewRecipe)1 RecipeUpdate (org.eclipse.che.api.machine.shared.dto.recipe.RecipeUpdate)1 OperationException (org.eclipse.che.api.promises.client.OperationException)1 PromiseError (org.eclipse.che.api.promises.client.PromiseError)1 RecipeWidget (org.eclipse.che.ide.extension.machine.client.perspective.widgets.recipe.entry.RecipeWidget)1