Mercurial > projects > dwt-addons
comparison dwtx/jface/text/link/LinkedModeModel.d @ 136:6dcb0baaa031
Regex removal of throws decls, some instanceof
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 02:20:40 +0200 |
parents | 51e6e63f930e |
children | 25170b5a8951 |
comparison
equal
deleted
inserted
replaced
135:65801ad2b265 | 136:6dcb0baaa031 |
---|---|
311 * | 311 * |
312 * @param group the group being checked | 312 * @param group the group being checked |
313 * @throws BadLocationException if <code>group</code> conflicts with this | 313 * @throws BadLocationException if <code>group</code> conflicts with this |
314 * model's groups | 314 * model's groups |
315 */ | 315 */ |
316 private void enforceDisjoint(LinkedPositionGroup group) throws BadLocationException { | 316 private void enforceDisjoint(LinkedPositionGroup group) { |
317 for (Iterator it= fGroups.iterator(); it.hasNext(); ) { | 317 for (Iterator it= fGroups.iterator(); it.hasNext(); ) { |
318 LinkedPositionGroup g= cast(LinkedPositionGroup) it.next(); | 318 LinkedPositionGroup g= cast(LinkedPositionGroup) it.next(); |
319 g.enforceDisjoint(group); | 319 g.enforceDisjoint(group); |
320 } | 320 } |
321 } | 321 } |
417 * @throws BadLocationException if the group conflicts with the other groups | 417 * @throws BadLocationException if the group conflicts with the other groups |
418 * in this model or violates the nesting requirements. | 418 * in this model or violates the nesting requirements. |
419 * @throws IllegalStateException if the method is called when the | 419 * @throws IllegalStateException if the method is called when the |
420 * model is already sealed | 420 * model is already sealed |
421 */ | 421 */ |
422 public void addGroup(LinkedPositionGroup group) throws BadLocationException { | 422 public void addGroup(LinkedPositionGroup group) { |
423 if (group is null) | 423 if (group is null) |
424 throw new IllegalArgumentException("group may not be null"); //$NON-NLS-1$ | 424 throw new IllegalArgumentException("group may not be null"); //$NON-NLS-1$ |
425 if (fIsSealed) | 425 if (fIsSealed) |
426 throw new IllegalStateException("model is already installed"); //$NON-NLS-1$ | 426 throw new IllegalStateException("model is already installed"); //$NON-NLS-1$ |
427 if (fGroups.contains(group)) | 427 if (fGroups.contains(group)) |
451 * </p> | 451 * </p> |
452 * | 452 * |
453 * @throws BadLocationException if some of the positions of this model | 453 * @throws BadLocationException if some of the positions of this model |
454 * were not valid positions on their respective documents | 454 * were not valid positions on their respective documents |
455 */ | 455 */ |
456 public void forceInstall() throws BadLocationException { | 456 public void forceInstall() { |
457 if (!install(true)) | 457 if (!install(true)) |
458 Assert.isTrue(false); | 458 Assert.isTrue(false); |
459 } | 459 } |
460 | 460 |
461 /** | 461 /** |
472 * @return <code>true</code> if installation was successful, | 472 * @return <code>true</code> if installation was successful, |
473 * <code>false</code> otherwise | 473 * <code>false</code> otherwise |
474 * @throws BadLocationException if some of the positions of this model | 474 * @throws BadLocationException if some of the positions of this model |
475 * were not valid positions on their respective documents | 475 * were not valid positions on their respective documents |
476 */ | 476 */ |
477 public bool tryInstall() throws BadLocationException { | 477 public bool tryInstall() { |
478 return install(false); | 478 return install(false); |
479 } | 479 } |
480 | 480 |
481 /** | 481 /** |
482 * Installs this model, which includes registering as document | 482 * Installs this model, which includes registering as document |
492 * @return <code>true</code> if installation was successful, | 492 * @return <code>true</code> if installation was successful, |
493 * <code>false</code> otherwise | 493 * <code>false</code> otherwise |
494 * @throws BadLocationException if some of the positions of this model | 494 * @throws BadLocationException if some of the positions of this model |
495 * were not valid positions on their respective documents | 495 * were not valid positions on their respective documents |
496 */ | 496 */ |
497 private bool install(bool force) throws BadLocationException { | 497 private bool install(bool force) { |
498 if (fIsSealed) | 498 if (fIsSealed) |
499 throw new IllegalStateException("model is already installed"); //$NON-NLS-1$ | 499 throw new IllegalStateException("model is already installed"); //$NON-NLS-1$ |
500 enforceNotEmpty(); | 500 enforceNotEmpty(); |
501 | 501 |
502 IDocument[] documents= getDocuments(); | 502 IDocument[] documents= getDocuments(); |
698 * | 698 * |
699 * @param position the position to register | 699 * @param position the position to register |
700 * @throws BadLocationException if the position cannot be added to its | 700 * @throws BadLocationException if the position cannot be added to its |
701 * document | 701 * document |
702 */ | 702 */ |
703 void register(LinkedPosition position) throws BadLocationException { | 703 void register(LinkedPosition position) { |
704 Assert.isNotNull(position); | 704 Assert.isNotNull(position); |
705 | 705 |
706 IDocument document= position.getDocument(); | 706 IDocument document= position.getDocument(); |
707 manageDocument(document); | 707 manageDocument(document); |
708 try { | 708 try { |