Mercurial > projects > dwt-addons
comparison dwtx/jface/viewers/DecoratingLabelProvider.d @ 43:ea8ff534f622
Fix override and super aliases
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Fri, 11 Apr 2008 01:24:25 +0200 |
parents | b6c35faf97c8 |
children | 46a6e0e6ccd4 |
comparison
equal
deleted
inserted
replaced
42:4567a6f54939 | 43:ea8ff534f622 |
---|---|
76 * The <code>DecoratingLabelProvider</code> implementation of this <code>IBaseLabelProvider</code> method | 76 * The <code>DecoratingLabelProvider</code> implementation of this <code>IBaseLabelProvider</code> method |
77 * adds the listener to both the nested label provider and the label decorator. | 77 * adds the listener to both the nested label provider and the label decorator. |
78 * | 78 * |
79 * @param listener a label provider listener | 79 * @param listener a label provider listener |
80 */ | 80 */ |
81 public void addListener(ILabelProviderListener listener) { | 81 public override void addListener(ILabelProviderListener listener) { |
82 super.addListener(listener); | 82 super.addListener(listener); |
83 provider.addListener(listener); | 83 provider.addListener(listener); |
84 if (decorator !is null) { | 84 if (decorator !is null) { |
85 decorator.addListener(listener); | 85 decorator.addListener(listener); |
86 } | 86 } |
89 | 89 |
90 /** | 90 /** |
91 * The <code>DecoratingLabelProvider</code> implementation of this <code>IBaseLabelProvider</code> method | 91 * The <code>DecoratingLabelProvider</code> implementation of this <code>IBaseLabelProvider</code> method |
92 * disposes both the nested label provider and the label decorator. | 92 * disposes both the nested label provider and the label decorator. |
93 */ | 93 */ |
94 public void dispose() { | 94 public override void dispose() { |
95 provider.dispose(); | 95 provider.dispose(); |
96 if (decorator !is null) { | 96 if (decorator !is null) { |
97 decorator.dispose(); | 97 decorator.dispose(); |
98 } | 98 } |
99 } | 99 } |
103 * <code>ILabelProvider</code> method returns the image provided | 103 * <code>ILabelProvider</code> method returns the image provided |
104 * by the nested label provider's <code>getImage</code> method, | 104 * by the nested label provider's <code>getImage</code> method, |
105 * decorated with the decoration provided by the label decorator's | 105 * decorated with the decoration provided by the label decorator's |
106 * <code>decorateImage</code> method. | 106 * <code>decorateImage</code> method. |
107 */ | 107 */ |
108 public Image getImage(Object element) { | 108 public override Image getImage(Object element) { |
109 Image image = provider.getImage(element); | 109 Image image = provider.getImage(element); |
110 if (decorator !is null) { | 110 if (decorator !is null) { |
111 if ( auto ld2 = cast(LabelDecorator)decorator ) { | 111 if ( auto ld2 = cast(LabelDecorator)decorator ) { |
112 Image decorated = ld2.decorateImage(image, element, getDecorationContext()); | 112 Image decorated = ld2.decorateImage(image, element, getDecorationContext()); |
113 if (decorated !is null) { | 113 if (decorated !is null) { |
146 * <code>ILabelProvider</code> method returns the text label provided | 146 * <code>ILabelProvider</code> method returns the text label provided |
147 * by the nested label provider's <code>getText</code> method, | 147 * by the nested label provider's <code>getText</code> method, |
148 * decorated with the decoration provided by the label decorator's | 148 * decorated with the decoration provided by the label decorator's |
149 * <code>decorateText</code> method. | 149 * <code>decorateText</code> method. |
150 */ | 150 */ |
151 public String getText(Object element) { | 151 public override String getText(Object element) { |
152 String text = provider.getText(element); | 152 String text = provider.getText(element); |
153 if (decorator !is null) { | 153 if (decorator !is null) { |
154 if ( auto ld2 = cast(LabelDecorator)decorator ) { | 154 if ( auto ld2 = cast(LabelDecorator)decorator ) { |
155 String decorated = ld2.decorateText(text, element, getDecorationContext()); | 155 String decorated = ld2.decorateText(text, element, getDecorationContext()); |
156 if (decorated !is null) { | 156 if (decorated !is null) { |
170 * The <code>DecoratingLabelProvider</code> implementation of this | 170 * The <code>DecoratingLabelProvider</code> implementation of this |
171 * <code>IBaseLabelProvider</code> method returns <code>true</code> if the corresponding method | 171 * <code>IBaseLabelProvider</code> method returns <code>true</code> if the corresponding method |
172 * on the nested label provider returns <code>true</code> or if the corresponding method on the | 172 * on the nested label provider returns <code>true</code> or if the corresponding method on the |
173 * decorator returns <code>true</code>. | 173 * decorator returns <code>true</code>. |
174 */ | 174 */ |
175 public bool isLabelProperty(Object element, String property) { | 175 public override bool isLabelProperty(Object element, String property) { |
176 if (provider.isLabelProperty(element, property)) { | 176 if (provider.isLabelProperty(element, property)) { |
177 return true; | 177 return true; |
178 } | 178 } |
179 if (decorator !is null && decorator.isLabelProperty(element, property)) { | 179 if (decorator !is null && decorator.isLabelProperty(element, property)) { |
180 return true; | 180 return true; |
186 * The <code>DecoratingLabelProvider</code> implementation of this <code>IBaseLabelProvider</code> method | 186 * The <code>DecoratingLabelProvider</code> implementation of this <code>IBaseLabelProvider</code> method |
187 * removes the listener from both the nested label provider and the label decorator. | 187 * removes the listener from both the nested label provider and the label decorator. |
188 * | 188 * |
189 * @param listener a label provider listener | 189 * @param listener a label provider listener |
190 */ | 190 */ |
191 public void removeListener(ILabelProviderListener listener) { | 191 public override void removeListener(ILabelProviderListener listener) { |
192 super.removeListener(listener); | 192 super.removeListener(listener); |
193 provider.removeListener(listener); | 193 provider.removeListener(listener); |
194 if (decorator !is null) { | 194 if (decorator !is null) { |
195 decorator.removeListener(listener); | 195 decorator.removeListener(listener); |
196 } | 196 } |