Bug 300472 [Dialogs] [JFace] Provide accessor for dialog messages
It would be nice to have access to the Dialog messages (eg. IDialogConstants.OK_LABEL) trough API instead of a field access. This would allow the RAP team to provide a session-based translation for the labels and furthermore improves the usability for our current users. Developers who want to single-source their applications for RCP and RAP cannot use the existing API of JFace as the labels are hardcoded as static fields and RAP has no chance to intervene this behavior without breaking API. I suggest to provide an accessor like SWT.getMessage() to get the translated string as this would allow developers to use the same API in RCP and JFace. I'd be happy to provide a patch once we decided on a possible approach. As suggested above, I'd introduce an accessor on Dialog itself and introduce message keys in IDialogConstants.
bundles/org.eclipse.jface/src/org/eclipse/jface/dialogs/IDialogConstants.java
public int NO_TO_ALL_ID = 21;
    /**
     * Starting button id reserved for internal use by JFace (value 256). JFace
     * classes make ids by adding to this number.
     */
    public int INTERNAL_ID = 256;
    /**
     * Starting button id reserved for use by clients of JFace (value 1024).
     * Clients of JFace should make ids by adding to this number.
     */
    public int CLIENT_ID = 1024;
    
    /**
     * The label for OK buttons.
     */
    public String OK_LABEL = JFaceResources.getString("ok"); 
    /**
     * The label for cancel buttons.
     */
    public String CANCEL_LABEL = JFaceResources.getString("cancel"); 
    /**
     * The label for yes buttons.
     */
    public String YES_LABEL = JFaceResources.getString("yes"); 
    /**
     * The label for no buttons.
     */
    public String NO_LABEL = JFaceResources.getString("no"); 
    /**
     * The label for not to all buttons.