Tue, 12 May 2015 12:02:48 -0700
8065077: MethodTypes are not localized
Reviewed-by: ksrini
1.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java Thu May 14 20:12:16 2015 -0700 1.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java Tue May 12 12:02:48 2015 -0700 1.3 @@ -113,7 +113,7 @@ 1.4 Content captionSpan; 1.5 Content span; 1.6 if (type.isDefaultTab()) { 1.7 - captionSpan = HtmlTree.SPAN(new StringContent(type.text())); 1.8 + captionSpan = HtmlTree.SPAN(configuration.getResource(type.resourceKey())); 1.9 span = HtmlTree.SPAN(type.tabId(), 1.10 HtmlStyle.activeTableTab, captionSpan); 1.11 } else { 1.12 @@ -136,7 +136,7 @@ 1.13 */ 1.14 public Content getMethodTypeLinks(MethodTypes methodType) { 1.15 String jsShow = "javascript:show(" + methodType.value() +");"; 1.16 - HtmlTree link = HtmlTree.A(jsShow, new StringContent(methodType.text())); 1.17 + HtmlTree link = HtmlTree.A(jsShow, configuration.getResource(methodType.resourceKey())); 1.18 return link; 1.19 } 1.20
2.1 --- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java Thu May 14 20:12:16 2015 -0700 2.2 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java Tue May 12 12:02:48 2015 -0700 2.3 @@ -471,10 +471,10 @@ 2.4 for (Map.Entry<String,Integer> entry : typeMap.entrySet()) { 2.5 vars.append(sep); 2.6 sep = ","; 2.7 - vars.append("\""); 2.8 - vars.append(entry.getKey()); 2.9 - vars.append("\":"); 2.10 - vars.append(entry.getValue()); 2.11 + vars.append("\"") 2.12 + .append(entry.getKey()) 2.13 + .append("\":") 2.14 + .append(entry.getValue()); 2.15 } 2.16 vars.append("};").append(DocletConstants.NL); 2.17 sep = ""; 2.18 @@ -482,11 +482,19 @@ 2.19 for (MethodTypes entry : methodTypes) { 2.20 vars.append(sep); 2.21 sep = ","; 2.22 - vars.append(entry.value()).append(":"); 2.23 - vars.append("[").append("\"").append(entry.tabId()); 2.24 - vars.append("\"").append(sep).append("\"").append(entry.text()).append("\"]"); 2.25 + vars.append(entry.value()) 2.26 + .append(":") 2.27 + .append("[") 2.28 + .append("\"") 2.29 + .append(entry.tabId()) 2.30 + .append("\"") 2.31 + .append(sep) 2.32 + .append("\"") 2.33 + .append(configuration.getText(entry.resourceKey())) 2.34 + .append("\"]"); 2.35 } 2.36 - vars.append("};").append(DocletConstants.NL); 2.37 + vars.append("};") 2.38 + .append(DocletConstants.NL); 2.39 addStyles(HtmlStyle.altColor, vars); 2.40 addStyles(HtmlStyle.rowColor, vars); 2.41 addStyles(HtmlStyle.tableTab, vars);
3.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties Thu May 14 20:12:16 2015 -0700 3.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties Tue May 12 12:02:48 2015 -0700 3.3 @@ -150,6 +150,13 @@ 3.4 doclet.Constructors=Constructors 3.5 doclet.methods=methods 3.6 doclet.Methods=Methods 3.7 +doclet.All_Methods=All Methods 3.8 +doclet.Static_Methods=Static Methods 3.9 +doclet.Instance_Methods=Instance Methods 3.10 +doclet.Abstract_Methods=Abstract Methods 3.11 +doclet.Concrete_Methods=Concrete Methods 3.12 +doclet.Default_Methods=Default Methods 3.13 +doclet.Deprecated_Methods=Deprecated Methods 3.14 doclet.annotation_type_optional_members=optional elements 3.15 doclet.Annotation_Type_Optional_Members=Optional Elements 3.16 doclet.annotation_type_required_members=required elements
4.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodTypes.java Thu May 14 20:12:16 2015 -0700 4.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodTypes.java Tue May 12 12:02:48 2015 -0700 4.3 @@ -1,5 +1,5 @@ 4.4 /* 4.5 - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. 4.6 + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. 4.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4.8 * 4.9 * This code is free software; you can redistribute it and/or modify it 4.10 @@ -31,22 +31,22 @@ 4.11 * @author Bhavesh Patel 4.12 */ 4.13 public enum MethodTypes { 4.14 - ALL(0xffff, "All Methods", "t0", true), 4.15 - STATIC(0x1, "Static Methods", "t1", false), 4.16 - INSTANCE(0x2, "Instance Methods", "t2", false), 4.17 - ABSTRACT(0x4, "Abstract Methods", "t3", false), 4.18 - CONCRETE(0x8, "Concrete Methods", "t4", false), 4.19 - DEFAULT(0x10, "Default Methods", "t5", false), 4.20 - DEPRECATED(0x20, "Deprecated Methods", "t6", false); 4.21 + ALL(0xffff, "doclet.All_Methods", "t0", true), 4.22 + STATIC(0x1, "doclet.Static_Methods", "t1", false), 4.23 + INSTANCE(0x2, "doclet.Instance_Methods", "t2", false), 4.24 + ABSTRACT(0x4, "doclet.Abstract_Methods", "t3", false), 4.25 + CONCRETE(0x8, "doclet.Concrete_Methods", "t4", false), 4.26 + DEFAULT(0x10, "doclet.Default_Methods", "t5", false), 4.27 + DEPRECATED(0x20, "doclet.Deprecated_Methods", "t6", false); 4.28 4.29 private final int value; 4.30 - private final String text; 4.31 + private final String resourceKey; 4.32 private final String tabId; 4.33 private final boolean isDefaultTab; 4.34 4.35 - MethodTypes(int v, String t, String id, boolean dt) { 4.36 + MethodTypes(int v, String k, String id, boolean dt) { 4.37 this.value = v; 4.38 - this.text = t; 4.39 + this.resourceKey = k; 4.40 this.tabId = id; 4.41 this.isDefaultTab = dt; 4.42 } 4.43 @@ -55,8 +55,8 @@ 4.44 return value; 4.45 } 4.46 4.47 - public String text() { 4.48 - return text; 4.49 + public String resourceKey() { 4.50 + return resourceKey; 4.51 } 4.52 4.53 public String tabId() {