368 |
public void setDisplayedMnemonic(int mnemonic) |
public void setDisplayedMnemonic(int mnemonic) |
369 |
{ |
{ |
370 |
if (displayedMnemonic != mnemonic) |
if (displayedMnemonic != mnemonic) |
371 |
{ |
{ |
372 |
firePropertyChange(DISPLAYED_MNEMONIC_CHANGED_PROPERTY, |
firePropertyChange(DISPLAYED_MNEMONIC_CHANGED_PROPERTY, |
373 |
displayedMnemonic, mnemonic); |
displayedMnemonic, mnemonic); |
374 |
displayedMnemonic = mnemonic; |
displayedMnemonic = mnemonic; |
386 |
* @param mnemonic The character to use for the mnemonic. |
* @param mnemonic The character to use for the mnemonic. |
387 |
*/ |
*/ |
388 |
public void setDisplayedMnemonic(char mnemonic) |
public void setDisplayedMnemonic(char mnemonic) |
389 |
{ |
{ |
390 |
setDisplayedMnemonic((int) mnemonic); |
setDisplayedMnemonic((int) mnemonic); |
391 |
} |
} |
392 |
|
|
416 |
{ |
{ |
417 |
if (newIndex < -1 || (text != null && newIndex >= text.length())) |
if (newIndex < -1 || (text != null && newIndex >= text.length())) |
418 |
throw new IllegalArgumentException(); |
throw new IllegalArgumentException(); |
419 |
|
|
420 |
if (text == null || text.charAt(newIndex) != displayedMnemonic) |
if (text == null || text.charAt(newIndex) != displayedMnemonic) |
421 |
newIndex = -1; |
newIndex = -1; |
422 |
|
|
423 |
if (newIndex != displayedMnemonicIndex) |
if (newIndex != displayedMnemonicIndex) |
424 |
{ |
{ |
425 |
firePropertyChange(DISPLAYED_MNEMONIC_INDEX_CHANGED_PROPERTY, |
firePropertyChange(DISPLAYED_MNEMONIC_INDEX_CHANGED_PROPERTY, |
426 |
displayedMnemonicIndex, newIndex); |
displayedMnemonicIndex, newIndex); |
427 |
displayedMnemonicIndex = newIndex; |
displayedMnemonicIndex = newIndex; |
428 |
} |
} |
429 |
} |
} |
430 |
|
|
431 |
/** |
/** |