Author: tfennelly
Date: 2011-05-10 06:39:12 -0400 (Tue, 10 May 2011)
New Revision: 31176
Modified:
branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AddNextTaskNodeAction.java
branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AddTaskNodeAction.java
Log:
https://issues.jboss.org/browse/JBIDE-8885
Cannot add a new Task Node if a Processing Task node is not properly selected
Modified:
branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AddNextTaskNodeAction.java
===================================================================
---
branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AddNextTaskNodeAction.java 2011-05-10
09:40:18 UTC (rev 31175)
+++
branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AddNextTaskNodeAction.java 2011-05-10
10:39:12 UTC (rev 31176)
@@ -57,12 +57,11 @@
super.init();
}
- protected void addFreemarkerTemplateTask(IWizard currentWizard, SmooksResourceListType
resourceList) {
+ protected void addFreemarkerTemplateTask(IWizard currentWizard, SmooksResourceListType
resourceList, List<TaskType> selectedTask) {
if (currentWizard instanceof FreemarkerTemplateParametersProvider) {
- List<TaskType> selectedTask = getCurrentSelectedTask();
-
if(selectedTask == null || selectedTask.isEmpty()) {
// No node properly selected in the Task Detail panel...
+ System.out.println("No task selected. Cannot add templating task.");
return;
}
@@ -141,12 +140,13 @@
SmooksResourceListType resourceList =
SmooksUIUtils.getSmooks11ResourceListType(provider.getSmooksModel());
if (taskID.equals(TaskTypeManager.TASK_ID_FREEMARKER_XML_TEMPLATE) ||
taskID.equals(TaskTypeManager.TASK_ID_FREEMARKER_CSV_TEMPLATE)) {
// open wizard
+ List<TaskType> selectedTask = getCurrentSelectedTask();
TemplateMessageTypeWizard wizard = new TemplateMessageTypeWizard();
WizardDialog dialog = new WizardDialog(editorPart.getSite().getShell(), wizard);
if (dialog.open() == Dialog.OK) {
// init freemarker model
IWizard currentWizard = wizard.getWizard();
- addFreemarkerTemplateTask(currentWizard, resourceList);
+ addFreemarkerTemplateTask(currentWizard, resourceList, selectedTask);
} else {
return;
}
Modified:
branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AddTaskNodeAction.java
===================================================================
---
branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AddTaskNodeAction.java 2011-05-10
09:40:18 UTC (rev 31175)
+++
branches/jbosstools-3.2.x/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AddTaskNodeAction.java 2011-05-10
10:39:12 UTC (rev 31176)
@@ -44,8 +44,9 @@
if(currentTask.getTask().isEmpty()) {
String taskID = currentTask.getId();
if (taskID != null) {
- if (taskID.equals(TaskTypeManager.TASK_ID_INPUT) ||
taskID.equals(TaskTypeManager.TASK_ID_JAVA_MAPPING))
+ if (taskID.equals(TaskTypeManager.TASK_ID_INPUT) ||
taskID.equals(TaskTypeManager.TASK_ID_JAVA_MAPPING)) {
this.setEnabled(true);
+ }
}
}
}