This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
I am trying to localize the text of Cancel button in property editor to French language. In doing so, I am overriding the bundle through branding => org/netbeans/core/windows/services/Bundle.properties. Following are the property keys representing those texts. [code] CLOSED_OPTION_CAPTION=Fermer CANCEL_OPTION_CAPTION=Annuler HELP_OPTION_CAPTION=Aide OK_OPTION_CAPTION=OK [/code] However, there is no effect on them except for Help button. Help button shows the text correctly as "Aide". Furthermore, I checked the source of org.netbeans.core.windows.services.NbPresenter.java and it should work according to its implementation. [code] private final JButton stdYesButton = new JButton(NbBundle.getBundle(NbPresenter.class).getString("YES_OPTION_CAPTION")); // NOI18N private final JButton stdNoButton = new JButton(NbBundle.getBundle(NbPresenter.class).getString("NO_OPTION_CAPTION")); // NOI18N private final JButton stdOKButton = new JButton(NbBundle.getBundle(NbPresenter.class).getString("OK_OPTION_CAPTION")); // NOI18N private final JButton stdCancelButton = new JButton(NbBundle.getBundle(NbPresenter.class).getString("CANCEL_OPTION_CAPTION")); // NOI18N private final JButton stdClosedButton = new JButton(NbBundle.getBundle(NbPresenter.class).getString("CLOSED_OPTION_CAPTION")); // NOI18N private final JButton stdHelpButton = new JButton(); private final JButton stdDetailButton = new JButton(NbBundle.getBundle(NbPresenter.class).getString("HELP_OPTION_CAPTION")); // NOI18N [/code]
Created attachment 157034 [details] Bundle file for French version
What property editor, can you make a screenshot of the dialog?
This is a custom editor implemented in our application by extending java.beans.PropertyEditorSupport. Following is its implementation. [code] public class MyEditor extends PropertyEditorSupport implements ExPropertyEditor { private PropertyEnv pe; private MyPanel myPanel; public MyEditor() { MyPanel = MyPanel.getInstance(); Locale currentLocale = Locale.getDefault(); HelpCtx.setHelpIDString(myPanel, "some id goes here"); } @Override public void attachEnv(PropertyEnv pe) { this.pe = pe; } @Override public Component getCustomEditor() { if (pe != null) { pe.setState(PropertyEnv.STATE_NEEDS_VALIDATION); pe.addVetoableChangeListener(new VetoableChangeListener() { @Override public void vetoableChange(PropertyChangeEvent evt) throws PropertyVetoException { if (PropertyEnv.PROP_STATE.equals(evt.getPropertyName()) && evt.getNewValue().equals(PropertyEnv.STATE_VALID)) { String ret = myPanel.validateErrorValue(); if (ret == null) { myPanel.saveGUIValues(); pe.removeVetoableChangeListener(this); } else { throw new PropertyVetoException(ret, evt); } } } }); } return myPanel; } @Override public void setValue(Object value) { // some code goes here } @Override public boolean supportsCustomEditor() { return true; } @Override public String getAsText() { return myPanel.toString(); } @Override public void setAsText(String text) throws IllegalArgumentException { // some code goes here } } [/code]
Created attachment 157036 [details] Property window of the implemented editor
Created attachment 157037 [details] Editor window in netbeans
https://netbeans.org/bugzilla/attachment.cgi?id=157037 The buttons I am talking about is as same as the buttons in the attached property window of netbeans app.
You're localizing a wrong Bundle. Property editor manager provides its own Cancel button, change it in: openide.explorer/src/org/openide/explorer/propertysheet/Bundle.properties#CTL_Cancel
Yes. With the given path it works fine.....