comparison dwtx/jface/text/contentassist/ContentAssistant.d @ 162:1a5b8f8129df

...
author Frank Benoit <benoit@tionex.de>
date Mon, 08 Sep 2008 00:51:37 +0200
parents 25f1f92fa3df
children 862b05e0334a
comparison
equal deleted inserted replaced
161:f8d52b926852 162:1a5b8f8129df
686 else 686 else
687 rect= new Rectangle(caret.x, caretLowerY, preferred.x, spaceBelow); 687 rect= new Rectangle(caret.x, caretLowerY, preferred.x, spaceBelow);
688 688
689 return constrainHorizontally(rect, bounds); 689 return constrainHorizontally(rect, bounds);
690 } 690 }
691 package Rectangle computeBoundsAboveBelow_package(Shell shell, Point preferred, int offset) {
692 return computeBoundsAboveBelow(shell, preferred, offset);
693 }
691 694
692 /** 695 /**
693 * Returns the display bounds for <code>shell</code> such that it appears right below 696 * Returns the display bounds for <code>shell</code> such that it appears right below
694 * <code>offset</code>, or above it if below is not suitable. The returned bounds lie 697 * <code>offset</code>, or above it if below is not suitable. The returned bounds lie
695 * within the monitor at the caret location and never overlap with the caret line. 698 * within the monitor at the caret location and never overlap with the caret line.
733 if (popup !is null) 736 if (popup !is null)
734 popup.switchedPositionToAbove(switched); 737 popup.switchedPositionToAbove(switched);
735 738
736 return constrainHorizontally(rect, bounds); 739 return constrainHorizontally(rect, bounds);
737 } 740 }
741 package Rectangle computeBoundsBelowAbove_package(Shell shell, Point preferred, int offset, CompletionProposalPopup popup) {
742 return computeBoundsBelowAbove(shell, preferred, offset, popup );
743 }
738 744
739 private Rectangle getCaretRectangle(int offset) { 745 private Rectangle getCaretRectangle(int offset) {
740 Point location= fContentAssistSubjectControlAdapter.getLocationAtOffset(offset); 746 Point location= fContentAssistSubjectControlAdapter.getLocationAtOffset(offset);
741 Control subjectControl= fContentAssistSubjectControlAdapter.getControl(); 747 Control subjectControl= fContentAssistSubjectControlAdapter.getControl();
742 Point controlSize= subjectControl.getSize(); 748 Point controlSize= subjectControl.getSize();
922 * Flag which tells whether a verify key listener is hooked. 928 * Flag which tells whether a verify key listener is hooked.
923 * 929 *
924 * @since 3.0 930 * @since 3.0
925 */ 931 */
926 private bool fVerifyKeyListenerHooked= false; 932 private bool fVerifyKeyListenerHooked= false;
927 private IContentAssistListener[] fListeners= new IContentAssistListener[4]; 933 private IContentAssistListener[] fListeners;
928 /** 934 /**
929 * The content assist subject control. 935 * The content assist subject control.
930 * 936 *
931 * @since 3.0 937 * @since 3.0
932 */ 938 */
964 /** 970 /**
965 * The list of completion listeners. 971 * The list of completion listeners.
966 * 972 *
967 * @since 3.2 973 * @since 3.2
968 */ 974 */
969 private ListenerList fCompletionListeners= new ListenerList(ListenerList.IDENTITY); 975 private ListenerList fCompletionListeners;
970 /** 976 /**
971 * The message to display at the bottom of the proposal popup. 977 * The message to display at the bottom of the proposal popup.
972 * 978 *
973 * @since 3.2 979 * @since 3.2
974 */ 980 */
1025 * context information above the location at which it was activated. If auto activation will be 1031 * context information above the location at which it was activated. If auto activation will be
1026 * enabled, without further configuration steps, this content assistant is activated after a 500 1032 * enabled, without further configuration steps, this content assistant is activated after a 500
1027 * milliseconds delay. It uses the default partitioning. 1033 * milliseconds delay. It uses the default partitioning.
1028 */ 1034 */
1029 public this() { 1035 public this() {
1036 fListeners= new IContentAssistListener[4];
1037 fCompletionListeners= new ListenerList(ListenerList.IDENTITY);
1030 fPartitioning= IDocumentExtension3.DEFAULT_PARTITIONING; 1038 fPartitioning= IDocumentExtension3.DEFAULT_PARTITIONING;
1031 } 1039 }
1032 1040
1033 /** 1041 /**
1034 * Sets the document partitioning this content assistant is using. 1042 * Sets the document partitioning this content assistant is using.
1732 */ 1740 */
1733 protected void possibleCompletionsClosed() { 1741 protected void possibleCompletionsClosed() {
1734 fLastAutoActivation= Long.MIN_VALUE; 1742 fLastAutoActivation= Long.MIN_VALUE;
1735 storeCompletionProposalPopupSize(); 1743 storeCompletionProposalPopupSize();
1736 } 1744 }
1745 package void possibleCompletionsClosed_package() {
1746 possibleCompletionsClosed();
1747 }
1737 1748
1738 /* 1749 /*
1739 * @see IContentAssist#showContextInformation 1750 * @see IContentAssist#showContextInformation
1740 */ 1751 */
1741 public String showContextInformation() { 1752 public String showContextInformation() {
1750 * has been stopped. 1761 * has been stopped.
1751 * 1762 *
1752 * @since 2.1 1763 * @since 2.1
1753 */ 1764 */
1754 protected void contextInformationClosed() { 1765 protected void contextInformationClosed() {
1766 }
1767 package void contextInformationClosed_package() {
1768 contextInformationClosed();
1755 } 1769 }
1756 1770
1757 /** 1771 /**
1758 * Requests that the specified context information to be shown. 1772 * Requests that the specified context information to be shown.
1759 * 1773 *
2088 if (fProposalPopup !is null) 2102 if (fProposalPopup !is null)
2089 fProposalPopup.hide(); 2103 fProposalPopup.hide();
2090 2104
2091 if (fContextInfoPopup !is null) 2105 if (fContextInfoPopup !is null)
2092 fContextInfoPopup.hide(); 2106 fContextInfoPopup.hide();
2107 }
2108 package void hide_package() {
2109 hide();
2093 } 2110 }
2094 2111
2095 // ------ control's size handling dialog settings ------ 2112 // ------ control's size handling dialog settings ------
2096 2113
2097 /** 2114 /**
2181 size.y= Math.max(size.y, 30); 2198 size.y= Math.max(size.y, 30);
2182 } 2199 }
2183 2200
2184 return size; 2201 return size;
2185 } 2202 }
2203 package Point restoreCompletionProposalPopupSize_package() {
2204 return restoreCompletionProposalPopupSize();
2205 }
2186 2206
2187 /** 2207 /**
2188 * Sets the prefix completion property. If enabled, content assist delegates completion to 2208 * Sets the prefix completion property. If enabled, content assist delegates completion to
2189 * prefix completion. 2209 * prefix completion.
2190 * 2210 *