| Code Conventions for the Platform UI Team | |
|
|
The main Eclipse coding conventions can be found here. The Platform UI team separates the issue of coding conventions into two components: formatting, and compiler warnings and errors. For formatting, all of our code is formatted using the built-in "Java Conventions" formatter provided by JDT. All of imports should be organized using the default settings. We discourage the use of the "Sort Memebers" functionality; however, if you are creating new files, feel free to use it if you wish. Do not use "Sort Members" on existing code. For compiler settings, we recommend changing the following items from "Ignore" to "Warning". As a note, it is required that all Platform UI code (excluding code in "org.eclipse.ui.tests") does not contain non-externalized strings.
These settings can be imported from this file. |
|
|
Platform UI covers several components: JFace, the Generic Workbench, and the IDE.
Code in these components should respect the API boundaries of these other components
(i.e. treat other components as if they were owned by another team).
In particular, code in the
Code in these components should respect the API boundaries of these other components
(i.e. treat other components as if they were owned by another team).
In particular, code in the |
|
|
In the IDE, we occasionally need to map between workspace resources and workbench objects. For example, when closing a project, we need to determine the affected editors by checking whether their input corresponds to a file in the project. Although the IDE provides IFileEditorInput and FileEditorInput, we must not assume that this is the only kind of editor input that can represent an workspace file. When mapping from an editor input, use the adaptable mechanism rather than instanceof checks for [I]FileEditorInput. See ResourceUtil.getFile(IEditorInput) for a convenience method that will do this properly. |