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