Mercurial > hg > openjdk > aarch64-port > langtools
changeset 2820:f6923d26b0fb
8065077: MethodTypes are not localized
Reviewed-by: ksrini
author | bpatel |
---|---|
date | Tue, 12 May 2015 12:02:48 -0700 |
parents | ecb7e46b820f |
children | 31ceef045272 |
files | src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodTypes.java |
diffstat | 4 files changed, 38 insertions(+), 23 deletions(-) [+] |
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java Thu May 14 20:12:16 2015 -0700 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java Tue May 12 12:02:48 2015 -0700 @@ -113,7 +113,7 @@ Content captionSpan; Content span; if (type.isDefaultTab()) { - captionSpan = HtmlTree.SPAN(new StringContent(type.text())); + captionSpan = HtmlTree.SPAN(configuration.getResource(type.resourceKey())); span = HtmlTree.SPAN(type.tabId(), HtmlStyle.activeTableTab, captionSpan); } else { @@ -136,7 +136,7 @@ */ public Content getMethodTypeLinks(MethodTypes methodType) { String jsShow = "javascript:show(" + methodType.value() +");"; - HtmlTree link = HtmlTree.A(jsShow, new StringContent(methodType.text())); + HtmlTree link = HtmlTree.A(jsShow, configuration.getResource(methodType.resourceKey())); return link; }
--- a/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java Thu May 14 20:12:16 2015 -0700 +++ b/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java Tue May 12 12:02:48 2015 -0700 @@ -471,10 +471,10 @@ for (Map.Entry<String,Integer> entry : typeMap.entrySet()) { vars.append(sep); sep = ","; - vars.append("\""); - vars.append(entry.getKey()); - vars.append("\":"); - vars.append(entry.getValue()); + vars.append("\"") + .append(entry.getKey()) + .append("\":") + .append(entry.getValue()); } vars.append("};").append(DocletConstants.NL); sep = ""; @@ -482,11 +482,19 @@ for (MethodTypes entry : methodTypes) { vars.append(sep); sep = ","; - vars.append(entry.value()).append(":"); - vars.append("[").append("\"").append(entry.tabId()); - vars.append("\"").append(sep).append("\"").append(entry.text()).append("\"]"); + vars.append(entry.value()) + .append(":") + .append("[") + .append("\"") + .append(entry.tabId()) + .append("\"") + .append(sep) + .append("\"") + .append(configuration.getText(entry.resourceKey())) + .append("\"]"); } - vars.append("};").append(DocletConstants.NL); + vars.append("};") + .append(DocletConstants.NL); addStyles(HtmlStyle.altColor, vars); addStyles(HtmlStyle.rowColor, vars); addStyles(HtmlStyle.tableTab, vars);
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties Thu May 14 20:12:16 2015 -0700 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties Tue May 12 12:02:48 2015 -0700 @@ -150,6 +150,13 @@ doclet.Constructors=Constructors doclet.methods=methods doclet.Methods=Methods +doclet.All_Methods=All Methods +doclet.Static_Methods=Static Methods +doclet.Instance_Methods=Instance Methods +doclet.Abstract_Methods=Abstract Methods +doclet.Concrete_Methods=Concrete Methods +doclet.Default_Methods=Default Methods +doclet.Deprecated_Methods=Deprecated Methods doclet.annotation_type_optional_members=optional elements doclet.Annotation_Type_Optional_Members=Optional Elements doclet.annotation_type_required_members=required elements
--- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodTypes.java Thu May 14 20:12:16 2015 -0700 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodTypes.java Tue May 12 12:02:48 2015 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,22 +31,22 @@ * @author Bhavesh Patel */ public enum MethodTypes { - ALL(0xffff, "All Methods", "t0", true), - STATIC(0x1, "Static Methods", "t1", false), - INSTANCE(0x2, "Instance Methods", "t2", false), - ABSTRACT(0x4, "Abstract Methods", "t3", false), - CONCRETE(0x8, "Concrete Methods", "t4", false), - DEFAULT(0x10, "Default Methods", "t5", false), - DEPRECATED(0x20, "Deprecated Methods", "t6", false); + ALL(0xffff, "doclet.All_Methods", "t0", true), + STATIC(0x1, "doclet.Static_Methods", "t1", false), + INSTANCE(0x2, "doclet.Instance_Methods", "t2", false), + ABSTRACT(0x4, "doclet.Abstract_Methods", "t3", false), + CONCRETE(0x8, "doclet.Concrete_Methods", "t4", false), + DEFAULT(0x10, "doclet.Default_Methods", "t5", false), + DEPRECATED(0x20, "doclet.Deprecated_Methods", "t6", false); private final int value; - private final String text; + private final String resourceKey; private final String tabId; private final boolean isDefaultTab; - MethodTypes(int v, String t, String id, boolean dt) { + MethodTypes(int v, String k, String id, boolean dt) { this.value = v; - this.text = t; + this.resourceKey = k; this.tabId = id; this.isDefaultTab = dt; } @@ -55,8 +55,8 @@ return value; } - public String text() { - return text; + public String resourceKey() { + return resourceKey; } public String tabId() {