Search:
Login
Preferences
Help/Guide
About Trac
Register
Forgot your password?
Wiki
Timeline
Changelog
Browse Source
View Tickets
New Ticket
Roadmap
Builds
Sonar
Search
Context Navigation
+0
Start Page
Index
History
Editing Ja:DevelopersGuide/StyleGuide
Adjust edit area height:
8
12
16
20
24
28
32
36
40
Edit side-by-side
[[TranslatedPages(revision=21)]] = 開発ガイドライン = == How your code should look like == * make sure the code is Java 1.6 compatible * make sure there is no trailing white space * don't use multiple consecutive empty lines * JOSM uses 4 characters indentation and no tab stops * Document your code '''thoroughly'''. Many people will thank you :) == How your javadoc should look like == * The [http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html#styleguide Oracle Javadoc style guide] is used as the base guide * {{{@since}}} is used for public classes and methods (visible to plugin developers) with the JOSM revision that introduced the element. Example: {{{@since 5408}}} * {{{@since}}} is updated when a public method signature changes or if a class is renamed * {{{@since}}} can be omitted for public methods and fields introduced at the same time as the class, provided they do not have changed and the class is correctly documented. * {{{@throws}}} is preferred to {{{@exception}}} === Eclipseの設定 === [[Image(styleguide_compiler_16.png,700px)]] [[Image(ss1.png,700px)]] [[Image(ss2.png,700px)]] [[Image(ss3.png,700px)]] == 国際化 == * make sure you use {{{tr(...)}}} for all localized strings {{{ import import static org.openstreetmap.josm.tools.I18n.tr; // use tr(...) for exception messages // throw new Exception(tr("error message always in tr()")); // use tr(...) for labels, title, tooltip texts and the like // new JLabel(tr("Label always in tr()")); // etc. }}} * never assemble localized messages with {{{+}}}. Use format placeholders instead. '''DONT''' {{{new JLabel(tr("My Label " + labelId));}}} '''DO''' {{{new JLabel(tr("My Label {0}",labelId));}}} Only exception: {{{+}}} can be used to break long lines of non-variable texts. * When using apostrophe, the following rules apply: For all {{{tr}}} the apostrophe is special. (Like backslash in C)[[BR]] It needs to be escaped by another apostrophe: {{{new JButton(tr("Don''t press me more than {0} times!", n))}}}
Note:
See
WikiFormatting
and
TracWiki
for help on editing wiki content.
Change information
Your email or username:
E-mail address and name can be saved in the
Preferences
Comment about this change (optional):
Note:
See
TracWiki
for help on using the wiki.