Mercurial > projects > dwt-addons
annotate dwtx/jface/text/ITextViewerExtension8.d @ 160:3678e4f1a766
toHash, toString
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 27 Aug 2008 02:07:22 +0200 |
parents | 7926b636c282 |
children |
rev | line source |
---|---|
129 | 1 /******************************************************************************* |
2 * Copyright (c) 2007, 2008 IBM Corporation and others. | |
3 * All rights reserved. This program and the accompanying materials | |
4 * are made available under the terms of the Eclipse Public License v1.0 | |
5 * which accompanies this distribution, and is available at | |
6 * http://www.eclipse.org/legal/epl-v10.html | |
7 * | |
8 * Contributors: | |
9 * IBM Corporation - initial API and implementation | |
10 * Port to the D programming language: | |
11 * Frank Benoit <benoit@tionex.de> | |
12 *******************************************************************************/ | |
13 module dwtx.jface.text.ITextViewerExtension8; | |
14 | |
15 import dwt.dwthelper.utils; | |
16 | |
17 import dwt.custom.StyledTextPrintOptions; | |
18 | |
19 | |
20 /** | |
21 * Extension interface for {@link dwtx.jface.text.ITextViewer}. Adds the | |
22 * ability to print and set how hovers should be enriched when the mouse is moved into them. | |
156 | 23 * |
129 | 24 * @since 3.4 |
25 */ | |
26 public interface ITextViewerExtension8 { | |
156 | 27 |
129 | 28 /** |
29 * Print the text viewer contents using the given options. | |
156 | 30 * |
129 | 31 * @param options the print options |
32 */ | |
33 void print(StyledTextPrintOptions options); | |
34 | |
35 /** | |
36 * Sets the hover enrich mode. | |
37 * A non-<code>null</code> <code>mode</code> defines when hovers | |
38 * should be enriched once the mouse is moved into them. | |
39 * If <code>mode</code> is <code>null</code>, hovers are automatically closed | |
40 * when the mouse is moved out of the {@link ITextHover#getHoverRegion(ITextViewer, int) hover region}. | |
41 * <p> | |
42 * Note that a hover can only be enriched if its {@link IInformationControlExtension5#getInformationPresenterControlCreator()} | |
43 * is not <code>null</code>. | |
44 * </p> | |
156 | 45 * |
129 | 46 * @param mode the enrich mode, or <code>null</code> |
47 */ | |
48 void setHoverEnrichMode(EnrichMode mode); | |
156 | 49 |
50 | |
51 | |
52 } | |
159 | 53 |
129 | 54 /** |
55 * Type-safe enum of the available enrich modes. | |
56 */ | |
159 | 57 public final class EnrichMode { |
129 | 58 |
59 /** | |
60 * Enrich the hover shortly after the mouse has been moved into it and | |
61 * stopped moving. | |
156 | 62 * |
129 | 63 * @see ITextViewerExtension8#setHoverEnrichMode(dwtx.jface.text.ITextViewerExtension8.EnrichMode) |
64 */ | |
156 | 65 public static const EnrichMode AFTER_DELAY; |
129 | 66 |
67 /** | |
68 * Enrich the hover immediately when the mouse is moved into it. | |
156 | 69 * |
129 | 70 * @see ITextViewerExtension8#setHoverEnrichMode(dwtx.jface.text.ITextViewerExtension8.EnrichMode) |
71 */ | |
156 | 72 public static const EnrichMode IMMEDIATELY; |
129 | 73 |
74 /** | |
75 * Enrich the hover on explicit mouse click. | |
156 | 76 * |
129 | 77 * @see ITextViewerExtension8#setHoverEnrichMode(dwtx.jface.text.ITextViewerExtension8.EnrichMode) |
78 */ | |
156 | 79 public static const EnrichMode ON_CLICK; |
80 | |
129 | 81 |
156 | 82 static this(){ |
83 AFTER_DELAY= new EnrichMode("after delay"); //$NON-NLS-1$ | |
84 IMMEDIATELY= new EnrichMode("immediately"); //$NON-NLS-1$ | |
85 ON_CLICK= new EnrichMode("on click"); //$NON-NLS-1$; | |
86 } | |
87 | |
129 | 88 private String fName; |
89 | |
133
7d818bd32d63
Fix ctors to this with gvim regexp
Frank Benoit <benoit@tionex.de>
parents:
131
diff
changeset
|
90 private this(String name) { |
129 | 91 fName= name; |
92 } | |
93 | |
94 /* | |
95 * @see java.lang.Object#toString() | |
96 */ | |
160 | 97 public override String toString() { |
129 | 98 return fName; |
99 } | |
100 } | |
159 | 101 alias EnrichMode ITextViewerExtension8_EnrichMode; |