Mercurial > projects > dwt-addons
comparison dwtx/jface/text/AbstractInformationControlManager.d @ 139:93a6ec48fd28
Regexp throws removal in interfaces
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sun, 24 Aug 2008 02:31:41 +0200 |
parents | b6bad70d540a |
children | 75302ef3f92f |
comparison
equal
deleted
inserted
replaced
138:b6bad70d540a | 139:93a6ec48fd28 |
---|---|
198 */ | 198 */ |
199 abstract public class AbstractInformationControlManager { | 199 abstract public class AbstractInformationControlManager { |
200 | 200 |
201 /** | 201 /** |
202 * An internal class that gives access to internal methods. | 202 * An internal class that gives access to internal methods. |
203 * | 203 * |
204 * @since 3.4 | 204 * @since 3.4 |
205 */ | 205 */ |
206 class MyInternalAccessor : InternalAccessor { | 206 class MyInternalAccessor : InternalAccessor { |
207 public IInformationControl getCurrentInformationControl() { | 207 public IInformationControl getCurrentInformationControl() { |
208 return this.outer.getCurrentInformationControl(); | 208 return this.outer.getCurrentInformationControl(); |
209 } | 209 } |
210 | 210 |
211 public void setInformationControlReplacer(InformationControlReplacer replacer) { | 211 public void setInformationControlReplacer(InformationControlReplacer replacer) { |
212 this.outer.setInformationControlReplacer(replacer); | 212 this.outer.setInformationControlReplacer(replacer); |
213 } | 213 } |
214 | 214 |
215 public InformationControlReplacer getInformationControlReplacer() { | 215 public InformationControlReplacer getInformationControlReplacer() { |
216 return this.outer.getInformationControlReplacer(); | 216 return this.outer.getInformationControlReplacer(); |
217 } | 217 } |
218 | 218 |
219 public bool canReplace(IInformationControl control) { | 219 public bool canReplace(IInformationControl control) { |
220 return this.outer.canReplace(control); | 220 return this.outer.canReplace(control); |
221 } | 221 } |
222 | 222 |
223 public bool isReplaceInProgress() { | 223 public bool isReplaceInProgress() { |
224 return this.outer.isReplaceInProgress(); | 224 return this.outer.isReplaceInProgress(); |
225 } | 225 } |
226 | 226 |
227 public void replaceInformationControl(bool takeFocus) { | 227 public void replaceInformationControl(bool takeFocus) { |
228 this.outer.replaceInformationControl(takeFocus); | 228 this.outer.replaceInformationControl(takeFocus); |
229 } | 229 } |
230 | 230 |
231 public void cropToClosestMonitor(Rectangle bounds) { | 231 public void cropToClosestMonitor(Rectangle bounds) { |
232 this.outer.cropToClosestMonitor(bounds); | 232 this.outer.cropToClosestMonitor(bounds); |
233 } | 233 } |
234 | 234 |
235 public void setHoverEnrichMode(EnrichMode mode) { | 235 public void setHoverEnrichMode(EnrichMode mode) { |
236 throw new UnsupportedOperationException("only implemented in AbstractHoverInformationControlManager"); //$NON-NLS-1$ | 236 throw new UnsupportedOperationException("only implemented in AbstractHoverInformationControlManager"); //$NON-NLS-1$ |
237 } | 237 } |
238 | 238 |
239 public bool getAllowMouseExit() { | 239 public bool getAllowMouseExit() { |
240 throw new UnsupportedOperationException("only implemented in AnnotationBarHoverManager"); //$NON-NLS-1$ | 240 throw new UnsupportedOperationException("only implemented in AnnotationBarHoverManager"); //$NON-NLS-1$ |
241 } | 241 } |
242 } | 242 } |
243 | 243 |
297 fFlag= flag; | 297 fFlag= flag; |
298 } | 298 } |
299 /** | 299 /** |
300 * Returns the DWT direction flag. One of {@link DWT#BOTTOM}, {@link DWT#TOP}, | 300 * Returns the DWT direction flag. One of {@link DWT#BOTTOM}, {@link DWT#TOP}, |
301 * {@link DWT#LEFT}, {@link DWT#RIGHT}, {@link DWT#CENTER}, | 301 * {@link DWT#LEFT}, {@link DWT#RIGHT}, {@link DWT#CENTER}, |
302 * | 302 * |
303 * @return the DWT direction flag | 303 * @return the DWT direction flag |
304 * @since 3.3 | 304 * @since 3.3 |
305 */ | 305 */ |
306 int getSWTFlag() { | 306 int getSWTFlag() { |
307 return fFlag; | 307 return fFlag; |
308 } | 308 } |
309 | 309 |
310 public String toString() { | 310 public String toString() { |
311 switch (fFlag) { | 311 switch (fFlag) { |
312 case DWT.BOTTOM: return "BOTTOM"; //$NON-NLS-1$ | 312 case DWT.BOTTOM: return "BOTTOM"; //$NON-NLS-1$ |
313 case DWT.TOP: return "TOP"; //$NON-NLS-1$ | 313 case DWT.TOP: return "TOP"; //$NON-NLS-1$ |
314 case DWT.LEFT: return "LEFT"; //$NON-NLS-1$ | 314 case DWT.LEFT: return "LEFT"; //$NON-NLS-1$ |
354 /** | 354 /** |
355 * Dialog store constant for the size's height. | 355 * Dialog store constant for the size's height. |
356 * @since 3.0 | 356 * @since 3.0 |
357 */ | 357 */ |
358 public static final String STORE_SIZE_HEIGHT= "size.height"; //$NON-NLS-1$ | 358 public static final String STORE_SIZE_HEIGHT= "size.height"; //$NON-NLS-1$ |
359 | 359 |
360 /** | 360 /** |
361 * Tells whether this class and its subclasses are in debug mode. | 361 * Tells whether this class and its subclasses are in debug mode. |
362 * <p> | 362 * <p> |
363 * Subclasses may use this. | 363 * Subclasses may use this. |
364 * </p> | 364 * </p> |
379 /** Indicates whether the information control takes focus when visible */ | 379 /** Indicates whether the information control takes focus when visible */ |
380 private bool fTakesFocusWhenVisible= false; | 380 private bool fTakesFocusWhenVisible= false; |
381 | 381 |
382 /** | 382 /** |
383 * The information control. | 383 * The information control. |
384 * | 384 * |
385 * <p>This field should not be referenced by subclasses. It is <code>protected</code> for API | 385 * <p>This field should not be referenced by subclasses. It is <code>protected</code> for API |
386 * compatibility reasons. | 386 * compatibility reasons. |
387 */ | 387 */ |
388 protected IInformationControl fInformationControl; | 388 protected IInformationControl fInformationControl; |
389 | 389 |
390 /** | 390 /** |
391 * The information control creator. | 391 * The information control creator. |
392 * | 392 * |
393 * <p>This field should not be referenced by subclasses. It is <code>protected</code> for API | 393 * <p>This field should not be referenced by subclasses. It is <code>protected</code> for API |
394 * compatibility reasons. | 394 * compatibility reasons. |
395 */ | 395 */ |
396 protected IInformationControlCreator fInformationControlCreator; | 396 protected IInformationControlCreator fInformationControlCreator; |
397 | 397 |
398 /** | 398 /** |
399 * The information control closer. | 399 * The information control closer. |
400 * | 400 * |
401 * <p>This field should not be referenced by subclasses. It is <code>protected</code> for API | 401 * <p>This field should not be referenced by subclasses. It is <code>protected</code> for API |
402 * compatibility reasons. | 402 * compatibility reasons. |
403 */ | 403 */ |
404 protected IInformationControlCloser fInformationControlCloser; | 404 protected IInformationControlCloser fInformationControlCloser; |
405 | 405 |
406 /** | 406 /** |
407 * Indicates that the information control has been disposed. | 407 * Indicates that the information control has been disposed. |
408 * | 408 * |
409 * <p>This field should not be referenced by subclasses. It is <code>protected</code> for API | 409 * <p>This field should not be referenced by subclasses. It is <code>protected</code> for API |
410 * compatibility reasons. | 410 * compatibility reasons. |
411 */ | 411 */ |
412 protected bool fDisposed= false; | 412 protected bool fDisposed= false; |
413 | 413 |
414 /** | 414 /** |
415 * The information control replacer to be used when this information control | 415 * The information control replacer to be used when this information control |
416 * needs to be replaced with another information control. | 416 * needs to be replaced with another information control. |
417 * | 417 * |
418 * @since 3.4 | 418 * @since 3.4 |
419 */ | 419 */ |
420 private InformationControlReplacer fInformationControlReplacer; | 420 private InformationControlReplacer fInformationControlReplacer; |
421 | 421 |
422 /** Indicates the enable state of this manager */ | 422 /** Indicates the enable state of this manager */ |
497 */ | 497 */ |
498 private bool fIsRestoringSize; | 498 private bool fIsRestoringSize; |
499 | 499 |
500 /** | 500 /** |
501 * The dispose listener on the subject control. | 501 * The dispose listener on the subject control. |
502 * | 502 * |
503 * @since 3.1 | 503 * @since 3.1 |
504 */ | 504 */ |
505 private DisposeListener fSubjectControlDisposeListener; | 505 private DisposeListener fSubjectControlDisposeListener; |
506 | 506 |
507 | 507 |
570 * @param closer the information control closer for this manager | 570 * @param closer the information control closer for this manager |
571 */ | 571 */ |
572 protected void setCloser(IInformationControlCloser closer) { | 572 protected void setCloser(IInformationControlCloser closer) { |
573 fInformationControlCloser= closer; | 573 fInformationControlCloser= closer; |
574 } | 574 } |
575 | 575 |
576 /** | 576 /** |
577 * Sets the information control replacer for this manager and disposes the | 577 * Sets the information control replacer for this manager and disposes the |
578 * old one if set. | 578 * old one if set. |
579 * | 579 * |
580 * @param replacer the information control replacer for this manager, or | 580 * @param replacer the information control replacer for this manager, or |
581 * <code>null</code> if no information control replacing should | 581 * <code>null</code> if no information control replacing should |
582 * take place | 582 * take place |
583 * @since 3.4 | 583 * @since 3.4 |
584 */ | 584 */ |
588 fInformationControlReplacer= replacer; | 588 fInformationControlReplacer= replacer; |
589 } | 589 } |
590 | 590 |
591 /** | 591 /** |
592 * Returns the current information control replacer or <code>null</code> if none has been installed. | 592 * Returns the current information control replacer or <code>null</code> if none has been installed. |
593 * | 593 * |
594 * @return the current information control replacer or <code>null</code> if none has been installed | 594 * @return the current information control replacer or <code>null</code> if none has been installed |
595 * @since 3.4 | 595 * @since 3.4 |
596 */ | 596 */ |
597 InformationControlReplacer getInformationControlReplacer() { | 597 InformationControlReplacer getInformationControlReplacer() { |
598 return fInformationControlReplacer; | 598 return fInformationControlReplacer; |
599 } | 599 } |
600 | 600 |
601 /** | 601 /** |
602 * Returns whether an information control replacer has been installed. | 602 * Returns whether an information control replacer has been installed. |
603 * | 603 * |
604 * @return whether an information control replacer has been installed | 604 * @return whether an information control replacer has been installed |
605 * @since 3.4 | 605 * @since 3.4 |
606 */ | 606 */ |
607 bool hasInformationControlReplacer() { | 607 bool hasInformationControlReplacer() { |
608 return fInformationControlReplacer !is null; | 608 return fInformationControlReplacer !is null; |
609 } | 609 } |
610 | 610 |
611 /** | 611 /** |
612 * Tests whether the given information control is replaceable. | 612 * Tests whether the given information control is replaceable. |
613 * | 613 * |
614 * @param iControl information control or <code>null</code> if none | 614 * @param iControl information control or <code>null</code> if none |
615 * @return <code>true</code> if information control is replaceable, <code>false</code> otherwise | 615 * @return <code>true</code> if information control is replaceable, <code>false</code> otherwise |
616 * @since 3.4 | 616 * @since 3.4 |
617 */ | 617 */ |
618 bool canReplace(IInformationControl iControl) { | 618 bool canReplace(IInformationControl iControl) { |
619 return iControl instanceof IInformationControlExtension3 | 619 return cast(IInformationControlExtension3)iControl |
620 && iControl instanceof IInformationControlExtension5 | 620 && cast(IInformationControlExtension5)iControl |
621 && (cast(IInformationControlExtension5) iControl).getInformationPresenterControlCreator() !is null; | 621 && (cast(IInformationControlExtension5) iControl).getInformationPresenterControlCreator() !is null; |
622 } | 622 } |
623 | 623 |
624 /** | 624 /** |
625 * Returns the current information control, or <code>null</code> if none. | 625 * Returns the current information control, or <code>null</code> if none. |
626 * | 626 * |
627 * @return the current information control, or <code>null</code> if none | 627 * @return the current information control, or <code>null</code> if none |
628 * @since 3.4 | 628 * @since 3.4 |
629 */ | 629 */ |
630 IInformationControl getCurrentInformationControl() { | 630 IInformationControl getCurrentInformationControl() { |
631 return fInformationControl; | 631 return fInformationControl; |
632 } | 632 } |
633 | 633 |
634 /** | 634 /** |
635 * Tells whether this manager's information control is currently being replaced. | 635 * Tells whether this manager's information control is currently being replaced. |
636 * | 636 * |
637 * @return <code>true</code> if a replace is in progress | 637 * @return <code>true</code> if a replace is in progress |
638 * @since 3.4 | 638 * @since 3.4 |
639 */ | 639 */ |
640 bool isReplaceInProgress() { | 640 bool isReplaceInProgress() { |
641 return fInformationControlReplacer !is null && fInformationControlReplacer.isReplacing(); | 641 return fInformationControlReplacer !is null && fInformationControlReplacer.isReplacing(); |
642 } | 642 } |
643 | 643 |
644 /** | 644 /** |
645 * Sets the horizontal and vertical margin to be used when laying out the | 645 * Sets the horizontal and vertical margin to be used when laying out the |
646 * information control relative to the subject control. | 646 * information control relative to the subject control. |
647 * | 647 * |
648 * @param xMargin the x-margin | 648 * @param xMargin the x-margin |
649 * @param yMargin the y-Margin | 649 * @param yMargin the y-Margin |
650 */ | 650 */ |
651 public void setMargins(int xMargin, int yMargin) { | 651 public void setMargins(int xMargin, int yMargin) { |
652 fMarginX= xMargin; | 652 fMarginX= xMargin; |
742 * | 742 * |
743 * @param informationControlCreator the creator, possibly <code>null</code> | 743 * @param informationControlCreator the creator, possibly <code>null</code> |
744 * @since 3.0 | 744 * @since 3.0 |
745 */ | 745 */ |
746 protected void setCustomInformationControlCreator(IInformationControlCreator informationControlCreator) { | 746 protected void setCustomInformationControlCreator(IInformationControlCreator informationControlCreator) { |
747 if (informationControlCreator !is null && fCustomInformationControlCreator instanceof IInformationControlCreatorExtension) { | 747 if (informationControlCreator !is null && cast(IInformationControlCreatorExtension)fCustomInformationControlCreator) { |
748 IInformationControlCreatorExtension extension= cast(IInformationControlCreatorExtension) fCustomInformationControlCreator; | 748 IInformationControlCreatorExtension extension= cast(IInformationControlCreatorExtension) fCustomInformationControlCreator; |
749 if (extension.canReplace(informationControlCreator)) | 749 if (extension.canReplace(informationControlCreator)) |
750 return; | 750 return; |
751 } | 751 } |
752 fCustomInformationControlCreator= informationControlCreator; | 752 fCustomInformationControlCreator= informationControlCreator; |
790 fInformationControlCloser.setSubjectControl(subjectControl); | 790 fInformationControlCloser.setSubjectControl(subjectControl); |
791 | 791 |
792 setEnabled(true); | 792 setEnabled(true); |
793 fDisposed= false; | 793 fDisposed= false; |
794 } | 794 } |
795 | 795 |
796 /** | 796 /** |
797 * Returns the dispose listener which gets added | 797 * Returns the dispose listener which gets added |
798 * to the subject control. | 798 * to the subject control. |
799 * | 799 * |
800 * @return the dispose listener | 800 * @return the dispose listener |
801 * @since 3.1 | 801 * @since 3.1 |
802 */ | 802 */ |
803 private DisposeListener getSubjectControlDisposeListener() { | 803 private DisposeListener getSubjectControlDisposeListener() { |
804 if (fSubjectControlDisposeListener is null) { | 804 if (fSubjectControlDisposeListener is null) { |
1006 if (isRTL) | 1006 if (isRTL) |
1007 xShift += controlSize.x; | 1007 xShift += controlSize.x; |
1008 | 1008 |
1009 return fSubjectControl.toDisplay(new Point(subjectArea.x + xShift, subjectArea.y + yShift)); | 1009 return fSubjectControl.toDisplay(new Point(subjectArea.x + xShift, subjectArea.y + yShift)); |
1010 } | 1010 } |
1011 | 1011 |
1012 /** | 1012 /** |
1013 * Computes the area available for an information control given an anchor and the subject area | 1013 * Computes the area available for an information control given an anchor and the subject area |
1014 * within <code>bounds</code>. | 1014 * within <code>bounds</code>. |
1015 * | 1015 * |
1016 * @param subjectArea the subject area | 1016 * @param subjectArea the subject area |
1017 * @param bounds the bounds | 1017 * @param bounds the bounds |
1018 * @param anchor the anchor at the subject area | 1018 * @param anchor the anchor at the subject area |
1019 * @return the area available at the given anchor relative to the subject area, confined to the | 1019 * @return the area available at the given anchor relative to the subject area, confined to the |
1020 * monitor's client area | 1020 * monitor's client area |
1047 | 1047 |
1048 // Don't return negative areas if the subjectArea overlaps with the monitor bounds. | 1048 // Don't return negative areas if the subjectArea overlaps with the monitor bounds. |
1049 area.intersect(bounds); | 1049 area.intersect(bounds); |
1050 return area; | 1050 return area; |
1051 } | 1051 } |
1052 | 1052 |
1053 /** | 1053 /** |
1054 * Checks whether a control of the given size at the given location would be completely visible | 1054 * Checks whether a control of the given size at the given location would be completely visible |
1055 * in the given display area when laid out by using the given anchor. If not, this method tries | 1055 * in the given display area when laid out by using the given anchor. If not, this method tries |
1056 * to shift the control orthogonal to the direction given by the anchor to make it visible. If possible | 1056 * to shift the control orthogonal to the direction given by the anchor to make it visible. If possible |
1057 * it updates the location.<p> | 1057 * it updates the location.<p> |
1169 | 1169 |
1170 upperLeft= computeLocation(subjectArea, controlSize, testAnchor); | 1170 upperLeft= computeLocation(subjectArea, controlSize, testAnchor); |
1171 Monitor monitor= getClosestMonitor(subjectAreaDisplayRelative, testAnchor); | 1171 Monitor monitor= getClosestMonitor(subjectAreaDisplayRelative, testAnchor); |
1172 if (updateLocation(upperLeft, controlSize, monitor.getClientArea(), testAnchor)) | 1172 if (updateLocation(upperLeft, controlSize, monitor.getClientArea(), testAnchor)) |
1173 return upperLeft; | 1173 return upperLeft; |
1174 | 1174 |
1175 // compute available area for this anchor and update if better than best | 1175 // compute available area for this anchor and update if better than best |
1176 Rectangle available= computeAvailableArea(subjectAreaDisplayRelative, monitor.getClientArea(), testAnchor); | 1176 Rectangle available= computeAvailableArea(subjectAreaDisplayRelative, monitor.getClientArea(), testAnchor); |
1177 Rectangle proposed= new Rectangle(upperLeft.x, upperLeft.y, controlSize.x, controlSize.y); | 1177 Rectangle proposed= new Rectangle(upperLeft.x, upperLeft.y, controlSize.x, controlSize.y); |
1178 available.intersect(proposed); | 1178 available.intersect(proposed); |
1179 int area= available.width * available.height; | 1179 int area= available.width * available.height; |
1180 if (area > bestArea) { | 1180 if (area > bestArea) { |
1181 bestArea= area; | 1181 bestArea= area; |
1182 bestBounds= available; | 1182 bestBounds= available; |
1183 bestAnchor= testAnchor; | 1183 bestAnchor= testAnchor; |
1184 } | 1184 } |
1185 | 1185 |
1186 testAnchor= getNextFallbackAnchor(testAnchor); | 1186 testAnchor= getNextFallbackAnchor(testAnchor); |
1187 | 1187 |
1188 } while (testAnchor !is fAnchor && testAnchor !is null); | 1188 } while (testAnchor !is fAnchor && testAnchor !is null); |
1189 | 1189 |
1190 // no anchor is perfect - select the one with larges area and set the size to not overlap with the subjectArea | 1190 // no anchor is perfect - select the one with larges area and set the size to not overlap with the subjectArea |
1191 if (bestAnchor !is ANCHOR_GLOBAL) | 1191 if (bestAnchor !is ANCHOR_GLOBAL) |
1192 Geometry.set(controlSize, Geometry.getSize(bestBounds)); | 1192 Geometry.set(controlSize, Geometry.getSize(bestBounds)); |
1193 return Geometry.getLocation(bestBounds); | 1193 return Geometry.getLocation(bestBounds); |
1194 } | 1194 } |
1195 | 1195 |
1196 /** | 1196 /** |
1197 * Gets the closest monitor given an anchor and the subject area. | 1197 * Gets the closest monitor given an anchor and the subject area. |
1198 * | 1198 * |
1199 * @param area the subject area | 1199 * @param area the subject area |
1200 * @param anchor the anchor | 1200 * @param anchor the anchor |
1201 * @return the monitor closest to the edge of <code>area</code> defined by | 1201 * @return the monitor closest to the edge of <code>area</code> defined by |
1202 * <code>anchor</code> | 1202 * <code>anchor</code> |
1203 * @since 3.3 | 1203 * @since 3.3 |
1213 | 1213 |
1214 /** | 1214 /** |
1215 * Copied from dwtx.jface.window.Window. Returns the monitor whose client area contains | 1215 * Copied from dwtx.jface.window.Window. Returns the monitor whose client area contains |
1216 * the given point. If no monitor contains the point, returns the monitor that is closest to the | 1216 * the given point. If no monitor contains the point, returns the monitor that is closest to the |
1217 * point. If this is ever made public, it should be moved into a separate utility class. | 1217 * point. If this is ever made public, it should be moved into a separate utility class. |
1218 * | 1218 * |
1219 * @param display the display to search for monitors | 1219 * @param display the display to search for monitors |
1220 * @param rectangle the rectangle to find the closest monitor for (display coordinates) | 1220 * @param rectangle the rectangle to find the closest monitor for (display coordinates) |
1221 * @return the monitor closest to the given point | 1221 * @return the monitor closest to the given point |
1222 * @since 3.3 | 1222 * @since 3.3 |
1223 */ | 1223 */ |
1295 private void internalShowInformationControl(Rectangle subjectArea, Object information) { | 1295 private void internalShowInformationControl(Rectangle subjectArea, Object information) { |
1296 if ( cast(InformationControlReplacer)this ) { | 1296 if ( cast(InformationControlReplacer)this ) { |
1297 (cast(InformationControlReplacer) this).showInformationControl(subjectArea, information); | 1297 (cast(InformationControlReplacer) this).showInformationControl(subjectArea, information); |
1298 return; | 1298 return; |
1299 } | 1299 } |
1300 | 1300 |
1301 IInformationControl informationControl= getInformationControl(); | 1301 IInformationControl informationControl= getInformationControl(); |
1302 if (informationControl !is null) { | 1302 if (informationControl !is null) { |
1303 | 1303 |
1304 Point sizeConstraints= computeSizeConstraints(fSubjectControl, fSubjectArea, informationControl); | 1304 Point sizeConstraints= computeSizeConstraints(fSubjectControl, fSubjectArea, informationControl); |
1305 if ( cast(IInformationControlExtension3)informationControl ) { | 1305 if ( cast(IInformationControlExtension3)informationControl ) { |
1348 cropToClosestMonitor(controlBounds); | 1348 cropToClosestMonitor(controlBounds); |
1349 location= Geometry.getLocation(controlBounds); | 1349 location= Geometry.getLocation(controlBounds); |
1350 size= Geometry.getSize(controlBounds); | 1350 size= Geometry.getSize(controlBounds); |
1351 informationControl.setLocation(location); | 1351 informationControl.setLocation(location); |
1352 informationControl.setSize(size.x, size.y); | 1352 informationControl.setSize(size.x, size.y); |
1353 | 1353 |
1354 showInformationControl(subjectArea); | 1354 showInformationControl(subjectArea); |
1355 } | 1355 } |
1356 } | 1356 } |
1357 | 1357 |
1358 /** | 1358 /** |
1359 * Crops the given bounds such that they lie completely on the closest monitor. | 1359 * Crops the given bounds such that they lie completely on the closest monitor. |
1360 * | 1360 * |
1361 * @param bounds shell bounds to crop | 1361 * @param bounds shell bounds to crop |
1362 * @since 3.4 | 1362 * @since 3.4 |
1363 */ | 1363 */ |
1364 void cropToClosestMonitor(Rectangle bounds) { | 1364 void cropToClosestMonitor(Rectangle bounds) { |
1365 Rectangle monitorBounds= getClosestMonitor(fSubjectControl.getDisplay(), bounds).getClientArea(); | 1365 Rectangle monitorBounds= getClosestMonitor(fSubjectControl.getDisplay(), bounds).getClientArea(); |
1396 | 1396 |
1397 /** | 1397 /** |
1398 * Replaces this manager's information control as defined by | 1398 * Replaces this manager's information control as defined by |
1399 * the information control replacer. | 1399 * the information control replacer. |
1400 * <strong>Must only be called when {@link #fInformationControl} instanceof {@link IInformationControlExtension3}!</strong> | 1400 * <strong>Must only be called when {@link #fInformationControl} instanceof {@link IInformationControlExtension3}!</strong> |
1401 * | 1401 * |
1402 * @param takeFocus <code>true</code> iff the replacing information control should take focus | 1402 * @param takeFocus <code>true</code> iff the replacing information control should take focus |
1403 * | 1403 * |
1404 * @since 3.4 | 1404 * @since 3.4 |
1405 */ | 1405 */ |
1406 void replaceInformationControl(bool takeFocus) { | 1406 void replaceInformationControl(bool takeFocus) { |
1412 IInformationControlCreator informationPresenterControlCreator= (cast(IInformationControlExtension5) fInformationControl).getInformationPresenterControlCreator(); | 1412 IInformationControlCreator informationPresenterControlCreator= (cast(IInformationControlExtension5) fInformationControl).getInformationPresenterControlCreator(); |
1413 fInformationControlReplacer.replaceInformationControl(informationPresenterControlCreator, contentBounds, fInformation, fSubjectArea, takeFocus); | 1413 fInformationControlReplacer.replaceInformationControl(informationPresenterControlCreator, contentBounds, fInformation, fSubjectArea, takeFocus); |
1414 } | 1414 } |
1415 hideInformationControl(); | 1415 hideInformationControl(); |
1416 } | 1416 } |
1417 | 1417 |
1418 /** | 1418 /** |
1419 * Disposes this manager's information control. | 1419 * Disposes this manager's information control. |
1420 */ | 1420 */ |
1421 public void disposeInformationControl() { | 1421 public void disposeInformationControl() { |
1422 if (fInformationControl !is null) { | 1422 if (fInformationControl !is null) { |
1434 | 1434 |
1435 fDisposed= true; | 1435 fDisposed= true; |
1436 | 1436 |
1437 setEnabled(false); | 1437 setEnabled(false); |
1438 disposeInformationControl(); | 1438 disposeInformationControl(); |
1439 | 1439 |
1440 if (fInformationControlReplacer !is null) { | 1440 if (fInformationControlReplacer !is null) { |
1441 fInformationControlReplacer.dispose(); | 1441 fInformationControlReplacer.dispose(); |
1442 fInformationControlReplacer= null; | 1442 fInformationControlReplacer= null; |
1443 } | 1443 } |
1444 | 1444 |
1445 if (fSubjectControl !is null && !fSubjectControl.isDisposed() && fSubjectControlDisposeListener !is null) | 1445 if (fSubjectControl !is null && !fSubjectControl.isDisposed() && fSubjectControlDisposeListener !is null) |
1446 fSubjectControl.removeDisposeListener(fSubjectControlDisposeListener); | 1446 fSubjectControl.removeDisposeListener(fSubjectControlDisposeListener); |
1447 fSubjectControl= null; | 1447 fSubjectControl= null; |
1448 fSubjectControlDisposeListener= null; | 1448 fSubjectControlDisposeListener= null; |
1449 | 1449 |
1565 | 1565 |
1566 /** | 1566 /** |
1567 * Returns an adapter that gives access to internal methods. | 1567 * Returns an adapter that gives access to internal methods. |
1568 * <p> | 1568 * <p> |
1569 * <strong>Note:</strong> This method is not intended to be referenced or overridden by clients.</p> | 1569 * <strong>Note:</strong> This method is not intended to be referenced or overridden by clients.</p> |
1570 * | 1570 * |
1571 * @return the replaceable information control accessor | 1571 * @return the replaceable information control accessor |
1572 * @since 3.4 | 1572 * @since 3.4 |
1573 * @noreference This method is not intended to be referenced by clients. | 1573 * @noreference This method is not intended to be referenced by clients. |
1574 * @nooverride This method is not intended to be re-implemented or extended by clients. | 1574 * @nooverride This method is not intended to be re-implemented or extended by clients. |
1575 */ | 1575 */ |