1 package org.tigris.scarab.screens; 2 3 48 49 import org.apache.turbine.RunData; 51 import org.apache.turbine.TemplateContext; 52 53 import org.tigris.scarab.tools.ScarabRequestTool; 55 import org.tigris.scarab.tools.ScarabLocalizationTool; 56 import org.tigris.scarab.util.Log; 57 58 64 public class SaveTemplate extends Default 65 { 66 protected String getTitle(ScarabRequestTool scarabR, 67 ScarabLocalizationTool l10n, 68 RunData data, TemplateContext context) 69 throws Exception 70 { 71 String title = null; 72 try 73 { 74 if (scarabR.getIssueTemplate().getIssueId() == null) 75 { 76 title = l10n.get("SaveTemplate"); 77 } 78 else 79 { 80 String name = scarabR.getIssueTemplateInfo().getName(); 81 String editTemplate = l10n.get("EditTemplate"); 82 StringBuffer sb = new StringBuffer (name.length() + 83 editTemplate.length() + 4); 84 sb.append(editTemplate).append(" '").append(name).append('\''); 85 title = sb.toString(); 86 } 87 } 88 catch (Exception e) 89 { 90 title = l10n.get("SaveTemplate"); 91 Log.get().debug("no current issue type, cannot retrieve SaveTemplate title", e); 92 } 93 return title; 94 } 95 } 96 | Popular Tags |