# HG changeset patch
# User Frank Benoit true
iff the replacing information control should take focus
*/
public void replaceInformationControl(IInformationControlCreator informationPresenterControlCreator, Rectangle contentBounds, Object information, final Rectangle subjectArea, bool takeFocus) {
-
+
try {
fIsReplacing= true;
if (! fDelayedInformationSet)
@@ -99,11 +99,11 @@
takeFocus= true; // delayed input has been set, so the original info control must have been focused
fContentBounds= contentBounds;
fReplaceableArea= subjectArea;
-
+
setCustomInformationControlCreator(informationPresenterControlCreator);
-
+
takesFocusWhenVisible(takeFocus);
-
+
showInformation();
} finally {
fIsReplacing= false;
@@ -113,7 +113,7 @@
setCustomInformationControlCreator(null);
}
}
-
+
/*
* @see dwtx.jface.text.AbstractInformationControlManager#computeInformation()
*/
@@ -122,8 +122,8 @@
setInformation(fReplacableInformation, fReplaceableArea);
return;
}
-
- if cast(DEBUG)
+
+ if (DEBUG)
System.out_.println("InformationControlReplacer: no active replaceable"); //$NON-NLS-1$
}
@@ -136,40 +136,40 @@
*/
public void showInformationControl(Rectangle subjectArea, Object information) {
IInformationControl informationControl= getInformationControl();
-
+
Rectangle controlBounds= fContentBounds;
if ( cast(IInformationControlExtension3)informationControl ) {
IInformationControlExtension3 iControl3= cast(IInformationControlExtension3) informationControl;
Rectangle trim= iControl3.computeTrim();
controlBounds= Geometry.add(controlBounds, trim);
-
+
/*
* Ensure minimal size. Interacting with a tiny information control
* (resizing, selecting text) would be a pain.
*/
controlBounds.width= Math.max(controlBounds.width, MIN_WIDTH);
controlBounds.height= Math.max(controlBounds.height, MIN_HEIGHT);
-
+
getInternalAccessor().cropToClosestMonitor(controlBounds);
}
-
+
Point location= Geometry.getLocation(controlBounds);
Point size= Geometry.getSize(controlBounds);
-
+
// Caveat: some IInformationControls fail unless setSizeConstraints(..) is called with concrete values
informationControl.setSizeConstraints(size.x, size.y);
-
+
if ( cast(IInformationControlExtension2)informationControl )
(cast(IInformationControlExtension2) informationControl).setInput(information);
else
informationControl.setInformation(information.toString());
-
+
informationControl.setLocation(location);
informationControl.setSize(size.x, size.y);
-
+
showInformationControl(subjectArea);
}
-
+
/*
* @see dwtx.jface.text.AbstractInformationControlManager#hideInformationControl()
*/
@@ -184,7 +184,7 @@
fReplacableInformation= input;
if (! isReplacing()) {
fDelayedInformationSet= true;
- } else if (getCurrentInformationControl2() instanceof IInformationControlExtension2) {
+ } else if (cast(IInformationControlExtension2)getCurrentInformationControl2() ) {
(cast(IInformationControlExtension2) getCurrentInformationControl2()).setInput(input);
} else if (getCurrentInformationControl2() !is null) {
getCurrentInformationControl2().setInformation(input.toString());
@@ -193,23 +193,23 @@
/**
* Tells whether the replacer is currently replacing another information control.
- *
+ *
* @return true
while code from {@link #replaceInformationControl(IInformationControlCreator, Rectangle, Object, Rectangle, bool)} is run
*/
public bool isReplacing() {
return fIsReplacing;
}
-
+
/**
* @return the current information control, or null
if none available
*/
public IInformationControl getCurrentInformationControl2() {
return getInternalAccessor().getCurrentInformationControl();
}
-
+
/**
* The number of pixels to blow up the keep-up zone.
- *
+ *
* @return the margin in pixels
*/
public int getKeepUpMargin() {
diff -r b411f1c62131 -r 5cf141e43417 dwtx/jface/internal/text/StickyHoverManager.d
--- a/dwtx/jface/internal/text/StickyHoverManager.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/jface/internal/text/StickyHoverManager.d Sun Aug 24 23:05:26 2008 +0200
@@ -84,7 +84,7 @@
class Closer : IInformationControlCloser, ControlListener, MouseListener, IViewportListener, KeyListener, FocusListener, Listener {
//TODO: Catch 'Esc' key in fInformationControlToClose: Don't dispose, just hideInformationControl().
// This would allow to reuse the information control also when the user explicitly closes it.
-
+
//TODO: if subject control is a Scrollable, should add selection listeners to both scroll bars
// (and remove the ViewPortListener, which only listens to vertical scrolling)
@@ -125,7 +125,7 @@
}
fTextViewer.addViewportListener(this);
-
+
IInformationControl fInformationControlToClose= getCurrentInformationControl2();
if (fInformationControlToClose !is null)
fInformationControlToClose.addFocusListener(this);
@@ -153,11 +153,11 @@
fSubjectControl.removeMouseListener(this);
fSubjectControl.removeKeyListener(this);
}
-
+
IInformationControl fInformationControlToClose= getCurrentInformationControl2();
if (fInformationControlToClose !is null)
fInformationControlToClose.removeFocusListener(this);
-
+
if (fDisplay !is null && !fDisplay.isDisposed()) {
fDisplay.removeFilter(DWT.MouseMove, this);
fDisplay.removeFilter(DWT.FocusOut, this);
@@ -219,18 +219,18 @@
*/
public void keyReleased(KeyEvent e) {
}
-
+
/*
* @see dwt.events.FocusListener#focusGained(dwt.events.FocusEvent)
*/
public void focusGained(FocusEvent e) {
}
-
+
/*
* @see dwt.events.FocusListener#focusLost(dwt.events.FocusEvent)
*/
public void focusLost(FocusEvent e) {
- if cast(DEBUG) System.out_.println("StickyHoverManager.Closer.focusLost(): " + e); //$NON-NLS-1$
+ if (DEBUG) System.out_.println("StickyHoverManager.Closer.focusLost(): " + e); //$NON-NLS-1$
Display d= fSubjectControl.getDisplay();
d.asyncExec(new class() Runnable {
// Without the asyncExec, mouse clicks to the workbench window are swallowed.
@@ -239,7 +239,7 @@
}
});
}
-
+
/*
* @see dwt.widgets.Listener#handleEvent(dwt.widgets.Event)
*/
@@ -247,10 +247,10 @@
if (event.type is DWT.MouseMove) {
if (!( cast(Control)event.widget ) || event.widget.isDisposed())
return;
-
+
IInformationControl infoControl= getCurrentInformationControl2();
if (infoControl !is null && !infoControl.isFocusControl() && cast(IInformationControlExtension3)infoControl ) {
-// if cast(DEBUG) System.out_.println("StickyHoverManager.Closer.handleEvent(): activeShell= " + fDisplay.getActiveShell()); //$NON-NLS-1$
+// if (DEBUG) System.out_.println("StickyHoverManager.Closer.handleEvent(): activeShell= " + fDisplay.getActiveShell()); //$NON-NLS-1$
IInformationControlExtension3 iControl3= cast(IInformationControlExtension3) infoControl;
Rectangle controlBounds= iControl3.getBounds();
if (controlBounds !is null) {
@@ -261,7 +261,7 @@
hideInformationControl();
}
}
-
+
} else {
/*
* TODO: need better understanding of why/if this is needed.
@@ -270,9 +270,9 @@
if (fDisplay !is null && !fDisplay.isDisposed())
fDisplay.removeFilter(DWT.MouseMove, this);
}
-
+
} else if (event.type is DWT.FocusOut) {
- if cast(DEBUG) System.out_.println("StickyHoverManager.Closer.handleEvent(): focusOut: " + event); //$NON-NLS-1$
+ if (DEBUG) System.out_.println("StickyHoverManager.Closer.handleEvent(): focusOut: " + event); //$NON-NLS-1$
IInformationControl iControl= getCurrentInformationControl2();
if (iControl !is null && ! iControl.isFocusControl())
hideInformationControl();
@@ -280,21 +280,21 @@
}
}
-
+
private const TextViewer fTextViewer;
-
+
/**
* Creates a new sticky hover manager.
- *
+ *
* @param textViewer the text viewer
*/
public this(TextViewer textViewer) {
super(new DefaultInformationControlCreator());
-
+
fTextViewer= textViewer;
setCloser(new Closer());
-
+
install(fTextViewer.getTextWidget());
}
@@ -305,7 +305,7 @@
if (fTextViewer !is null && fTextViewer.requestWidgetToken(this, WIDGET_PRIORITY))
super.showInformationControl(subjectArea);
else
- if cast(DEBUG)
+ if (DEBUG)
System.out_.println("cancelled StickyHoverManager.showInformationControl(..): did not get widget token (with prio)"); //$NON-NLS-1$
}
@@ -338,7 +338,7 @@
*/
public bool requestWidgetToken(IWidgetTokenOwner owner) {
hideInformationControl();
- if cast(DEBUG)
+ if (DEBUG)
System.out_.println("StickyHoverManager gave up widget token (no prio)"); //$NON-NLS-1$
return true;
}
@@ -349,21 +349,21 @@
public bool requestWidgetToken(IWidgetTokenOwner owner, int priority) {
if (getCurrentInformationControl2() !is null) {
if (getCurrentInformationControl2().isFocusControl()) {
- if cast(DEBUG)
+ if (DEBUG)
System.out_.println("StickyHoverManager kept widget token (focused)"); //$NON-NLS-1$
return false;
} else if (priority > WIDGET_PRIORITY) {
hideInformationControl();
- if cast(DEBUG)
+ if (DEBUG)
System.out_.println("StickyHoverManager gave up widget token (prio)"); //$NON-NLS-1$
return true;
} else {
- if cast(DEBUG)
+ if (DEBUG)
System.out_.println("StickyHoverManager kept widget token (prio)"); //$NON-NLS-1$
return false;
}
}
- if cast(DEBUG)
+ if (DEBUG)
System.out_.println("StickyHoverManager gave up widget token (no iControl)"); //$NON-NLS-1$
return true;
}
@@ -384,5 +384,5 @@
iControl.setFocus();
return iControl.isFocusControl();
}
-
+
}
diff -r b411f1c62131 -r 5cf141e43417 dwtx/jface/internal/text/html/BrowserInformationControl.d
--- a/dwtx/jface/internal/text/html/BrowserInformationControl.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/jface/internal/text/html/BrowserInformationControl.d Sun Aug 24 23:05:26 2008 +0200
@@ -78,7 +78,7 @@
*
true
if the control should be resizable
@@ -186,10 +186,10 @@
fSymbolicFontName= symbolicFontName;
create();
}
-
+
/**
* Creates a browser information control with the given shell as parent.
- *
+ *
* @param parent the parent shell
* @param symbolicFontName the symbolic name of the font used for size computations
* @param statusFieldText the text to be used in the optional status field
@@ -201,10 +201,10 @@
fSymbolicFontName= symbolicFontName;
create();
}
-
+
/**
* Creates a browser information control with the given shell as parent.
- *
+ *
* @param parent the parent shell
* @param symbolicFontName the symbolic name of the font used for size computations
* @param toolBarManager the manager or null
if toolbar is not desired
@@ -215,13 +215,13 @@
fSymbolicFontName= symbolicFontName;
create();
}
-
+
/*
* @see dwtx.jface.text.AbstractInformationControl#createContent(dwt.widgets.Composite)
*/
protected void createContent(Composite parent) {
fBrowser= new Browser(parent, DWT.NONE);
-
+
Display display= getShell().getDisplay();
fBrowser.setForeground(display.getSystemColor(DWT.COLOR_INFO_FOREGROUND));
fBrowser.setBackground(display.getSystemColor(DWT.COLOR_INFO_BACKGROUND));
@@ -240,10 +240,10 @@
fCompleted= true;
}
});
-
+
// Replace browser's built-in context menu with none
fBrowser.setMenu(new Menu(getShell(), DWT.NONE));
-
+
createTextLayout();
}
@@ -266,13 +266,13 @@
}
});
}
-
+
/**
* {@inheritDoc} This control can handle {@link String} and
* {@link BrowserInformationControlInput}.
*/
public void setInput(Object input) {
- Assert.isLegal(input is null || cast(String)input || input instanceof BrowserInformationControlInput);
+ Assert.isLegal(input is null || cast(String)input || cast(BrowserInformationControlInput)input );
if ( cast(String)input ) {
setInformation(cast(String)input);
@@ -280,11 +280,11 @@
}
fInput= cast(BrowserInformationControlInput)input;
-
+
String content= null;
if (fInput !is null)
content= fInput.getHtml();
-
+
fBrowserHasContent= content !is null && content.length() > 0;
if (!fBrowserHasContent)
@@ -297,29 +297,29 @@
// and the re-wrapping would cause visual noise
String[] styles= null;
if (RTL && resizable)
- styles= new String[] { "direction:rtl;", "overflow:scroll;", "word-wrap:break-word;" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ styles= [ "direction:rtl;", "overflow:scroll;", "word-wrap:break-word;" ]; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
else if (RTL && !resizable)
- styles= new String[] { "direction:rtl;", "overflow:hidden;", "word-wrap:break-word;" }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ styles= [ "direction:rtl;", "overflow:hidden;", "word-wrap:break-word;" ]; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
else if (!resizable)
//XXX: In IE, "word-wrap: break-word;" causes bogus wrapping even in non-broken words :-(see e.g. Javadoc of String).
// Re-check whether we really still need this now that the Javadoc Hover header already sets this style.
- styles= new String[] { "overflow:hidden;"/*, "word-wrap: break-word;"*/ }; //$NON-NLS-1$
+ styles= [ "overflow:hidden;"/*, "word-wrap: break-word;"*/ ]; //$NON-NLS-1$
else
- styles= new String[] { "overflow:scroll;" }; //$NON-NLS-1$
-
+ styles= [ "overflow:scroll;" ]; //$NON-NLS-1$
+
StringBuffer buffer= new StringBuffer(content);
HTMLPrinter.insertStyles(buffer, styles);
content= buffer.toString();
-
+
/*
* XXX: Should add some JavaScript here that shows something like
* "(continued...)" or "..." at the end of the visible area when the page overflowed
* with "overflow:hidden;".
*/
-
+
fCompleted= false;
fBrowser.setText(content);
-
+
Object[] listeners= fInputChangeListeners.getListeners();
for (int i= 0; i < listeners.length; i++)
(cast(IInputChangedListener)listeners[i]).inputChanged(fInput);
@@ -332,45 +332,45 @@
Shell shell= getShell();
if (shell.isVisible() is visible)
return;
-
+
if (!visible) {
super.setVisible(false);
setInput(null);
return;
}
-
+
/*
* The Browser widget flickers when made visible while it is not completely loaded.
* The fix is to delay the call to setVisible until either loading is completed
* (see ProgressListener in constructor), or a timeout has been reached.
*/
final Display display= shell.getDisplay();
-
+
// Make sure the display wakes from sleep after timeout:
display.timerExec(100, new class() Runnable {
public void run() {
fCompleted= true;
}
});
-
+
while (!fCompleted) {
// Drive the event loop to process the events required to load the browser widget's contents:
if (!display.readAndDispatch()) {
display.sleep();
}
}
-
+
shell= getShell();
if (shell is null || shell.isDisposed())
return;
-
+
/*
* Avoids flickering when replacing hovers, especially on Vista in ON_CLICK mode.
* Causes flickering on GTK. Carbon does not care.
*/
if ("win32".equals(DWT.getPlatform())) //$NON-NLS-1$
shell.moveAbove(null);
-
+
super.setVisible(true);
}
@@ -389,12 +389,12 @@
/**
* Creates and initializes the text layout used
* to compute the size hint.
- *
+ *
* @since 3.2
*/
private void createTextLayout() {
fTextLayout= new TextLayout(fBrowser.getDisplay());
-
+
// Initialize fonts
Font font= fSymbolicFontName is null ? JFaceResources.getDialogFont() : JFaceResources.getFont(fSymbolicFontName);
fTextLayout.setFont(font);
@@ -404,11 +404,11 @@
fontData[i].setStyle(DWT.BOLD);
font= new Font(getShell().getDisplay(), fontData);
fBoldStyle= new TextStyle(font, null, null);
-
+
// Compute and set tab width
fTextLayout.setText(" "); //$NON-NLS-1$
int tabWidth = fTextLayout.getBounds().width;
- fTextLayout.setTabs(new int[] {tabWidth});
+ fTextLayout.setTabs([tabWidth]);
fTextLayout.setText(""); //$NON-NLS-1$
}
@@ -426,7 +426,7 @@
fBoldStyle= null;
}
fBrowser= null;
-
+
super.dispose();
}
@@ -437,7 +437,7 @@
Point sizeConstraints= getSizeConstraints();
Rectangle trim= computeTrim();
int height= trim.height;
-
+
//FIXME: The HTML2TextReader does not render like a browser. // Instead of inserting an empty line, it just adds a single line break. // Furthermore, the indentation of
true
iff a delayed input change
* listener is currently registered
* @since 3.4
@@ -586,10 +586,10 @@
public bool hasDelayedInputChangeListener() {
return fDelayedInputChangeListener !is null;
}
-
+
/**
* Notifies listeners of a delayed input change.
- *
+ *
* @param newInput the new input, or null
to request cancellation
* @since 3.4
*/
@@ -597,7 +597,7 @@
if (fDelayedInputChangeListener !is null)
fDelayedInputChangeListener.inputChanged(newInput);
}
-
+
/*
* @see java.lang.Object#toString()
* @since 3.4
@@ -613,21 +613,21 @@
public BrowserInformationControlInput getInput() {
return fInput;
}
-
+
/*
* @see dwtx.jface.text.IInformationControlExtension5#computeSizeConstraints(int, int)
*/
public Point computeSizeConstraints(int widthInChars, int heightInChars) {
if (fSymbolicFontName is null)
return null;
-
+
GC gc= new GC(fBrowser);
Font font= fSymbolicFontName is null ? JFaceResources.getDialogFont() : JFaceResources.getFont(fSymbolicFontName);
gc.setFont(font);
int width= gc.getFontMetrics().getAverageCharWidth();
int height= gc.getFontMetrics().getHeight();
gc.dispose();
-
+
return new Point(widthInChars * width, heightInChars * height);
}
diff -r b411f1c62131 -r 5cf141e43417 dwtx/jface/internal/text/html/HTML2TextReader.d
--- a/dwtx/jface/internal/text/html/HTML2TextReader.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/jface/internal/text/html/HTML2TextReader.d Sun Aug 24 23:05:26 2008 +0200
@@ -49,7 +49,7 @@
private static const Map fgEntityLookup;
private static const Set fgTags;
- static {
+ static this() {
fgTags= new HashSet();
fgTags.add("b"); //$NON-NLS-1$
@@ -157,7 +157,7 @@
return EMPTY_STRING;
html= html.toLowerCase();
-
+
String tag= html;
if ('/' is tag.charAt(0))
tag= tag.substring(1);
@@ -225,13 +225,13 @@
if ("/dd".equals(html)) //$NON-NLS-1$
return LINE_DELIM;
-
+
if ("head".equals(html) && !fHeaderDetected) { //$NON-NLS-1$
fHeaderDetected= true;
fIgnore= true;
return EMPTY_STRING;
}
-
+
if ("/head".equals(html) && fHeaderDetected && fIgnore) { //$NON-NLS-1$
fIgnore= false;
return EMPTY_STRING;
@@ -280,11 +280,11 @@
return html2Text(buf.toString());
}
-
+
private static bool isInComment(StringBuffer buf) {
return buf.length() >= 3 && "!--".equals(buf.substring(0, 3)); //$NON-NLS-1$
}
-
+
private static bool isCommentEnd(StringBuffer buf) {
int tagLen= buf.length();
return tagLen >= 5 && "--".equals(buf.substring(tagLen - 2)); //$NON-NLS-1$
diff -r b411f1c62131 -r 5cf141e43417 dwtx/jface/internal/text/html/HTMLMessages.d
--- a/dwtx/jface/internal/text/html/HTMLMessages.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/jface/internal/text/html/HTMLMessages.d Sun Aug 24 23:05:26 2008 +0200
@@ -37,9 +37,14 @@
*/
class HTMLMessages {
- private static const String RESOURCE_BUNDLE= HTMLMessages.class.getName();
+// private static const String RESOURCE_BUNDLE= HTMLMessages.class.getName();
+
+ private static ResourceBundle fgResourceBundle;//= ResourceBundle.getBundle(RESOURCE_BUNDLE);
- private static ResourceBundle fgResourceBundle= ResourceBundle.getBundle(RESOURCE_BUNDLE);
+ static this() {
+ fgResourceBundle = ResourceBundle.getBundle(
+ getImportData!("dwtx.jface.internal.text.html.HTMLMessages.properties"));
+ }
private this() {
}
@@ -54,7 +59,7 @@
try {
return fgResourceBundle.getString(key);
} catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
+ return "!" ~ key ~ "!";//$NON-NLS-2$ //$NON-NLS-1$
}
}
@@ -65,32 +70,14 @@
* @param args the arguments used to format the string
* @return the formatted string
*/
- public static String getFormattedString(String key, Object[] args) {
+ public static String getFormattedString(String key, Object[] args...) {
String format= null;
try {
format= fgResourceBundle.getString(key);
} catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
+ return "!" ~ key ~ "!";//$NON-NLS-2$ //$NON-NLS-1$
}
return MessageFormat.format(format, args);
}
- /**
- * Gets a string from the resource bundle and formats it with the given argument.
- *
- * @param key the string used to get the bundle value, must not be null
- * @param arg the argument used to format the string
- * @return the formatted string
- */
- public static String getFormattedString(String key, Object arg) {
- String format= null;
- try {
- format= fgResourceBundle.getString(key);
- } catch (MissingResourceException e) {
- return "!" + key + "!";//$NON-NLS-2$ //$NON-NLS-1$
- }
- if (arg is null)
- arg= ""; //$NON-NLS-1$
- return MessageFormat.format(format, new Object[] { arg });
- }
}
diff -r b411f1c62131 -r 5cf141e43417 dwtx/jface/internal/text/html/HTMLPrinter.d
--- a/dwtx/jface/internal/text/html/HTMLPrinter.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/jface/internal/text/html/HTMLPrinter.d Sun Aug 24 23:05:26 2008 +0200
@@ -46,7 +46,8 @@
private static RGB FG_COLOR_RGB= new RGB(0, 0, 0); // RGB value of info fg color on WindowsXP
- static {
+ static this() {
+ implMissing( __FILE__, __LINE__ ); // lazy init needed for Display
final Display display= Display.getDefault();
if (display !is null && !display.isDisposed()) {
try {
@@ -185,12 +186,12 @@
private static void appendStyleSheetURL(StringBuffer buffer, String styleSheet) {
if (styleSheet is null)
return;
-
+
buffer.append(""); //$NON-NLS-1$
}
-
+
private static void appendStyleSheetURL(StringBuffer buffer, URL styleSheetURL) {
if (styleSheetURL is null)
return;
@@ -218,7 +219,7 @@
appendColors(pageProlog, FG_COLOR_RGB, BG_COLOR_RGB);
buffer.insert(position, pageProlog.toString());
}
-
+
public static void insertPageProlog(StringBuffer buffer, int position, String styleSheet) {
insertPageProlog(buffer, position, null, null, styleSheet);
}
@@ -266,7 +267,7 @@
if (paragraphReader !is null)
addParagraph(buffer, read(paragraphReader));
}
-
+
/**
* Replaces the following style attributes of the font definition of the html
* element:
@@ -281,7 +282,7 @@
* * If the listed font attributes are not contained in the passed style list, nothing happens. *
- * + * * @param styles CSS style definitions * @param fontData the font information to use * @return the modified style definitions @@ -290,10 +291,10 @@ public static String convertTopLevelFont(String styles, FontData fontData) { bool bold= (fontData.getStyle() & DWT.BOLD) !is 0; bool italic= (fontData.getStyle() & DWT.ITALIC) !is 0; - + // See: https://bugs.eclipse.org/bugs/show_bug.cgi?id=155993 String size= Integer.toString(fontData.getHeight()) + ("carbon".equals(DWT.getPlatform()) ? "px" : "pt"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - + String family= "'" + fontData.getName() + "',sans-serif"; //$NON-NLS-1$ //$NON-NLS-2$ styles= styles.replaceFirst("(html\\s*\\{.*(?:\\s|;)font-size:\\s*)\\d+pt(\\;?.*\\})", "$1" + size + "$2"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ styles= styles.replaceFirst("(html\\s*\\{.*(?:\\s|;)font-weight:\\s*)\\w+(\\;?.*\\})", "$1" + (bold ? "bold" : "normal") + "$2"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ diff -r b411f1c62131 -r 5cf141e43417 dwtx/jface/internal/text/link/contentassist/CompletionProposalPopup2.d --- a/dwtx/jface/internal/text/link/contentassist/CompletionProposalPopup2.d Sun Aug 24 22:41:48 2008 +0200 +++ b/dwtx/jface/internal/text/link/contentassist/CompletionProposalPopup2.d Sun Aug 24 23:05:26 2008 +0200 @@ -120,11 +120,11 @@ /** * Tells whether colored labels support is enabled. * Only valid while the popup is active. - * + * * @since 3.4 */ private bool fIsColoredLabelsSupportEnabled= false; - + private final IEditingSupport fFocusEditingSupport= new class() IEditingSupport { public bool isOriginator(DocumentEvent event, IRegion focus) { @@ -278,7 +278,7 @@ // fProposalShell= new Shell(control.getShell(), DWT.ON_TOP | DWT.RESIZE ); fProposalTable= new Table(fProposalShell, DWT.H_SCROLL | DWT.V_SCROLL); // fProposalTable= new Table(fProposalShell, DWT.H_SCROLL | DWT.V_SCROLL); - + fIsColoredLabelsSupportEnabled= fContentAssistant.isColoredLabelsSupportEnabled(); if (fIsColoredLabelsSupportEnabled) @@ -556,7 +556,7 @@ item= new TableItem(fProposalTable, DWT.NULL); if (p.getImage() !is null) item.setImage(p.getImage()); - + String displayString; StyleRange[] styleRanges= null; if (fIsColoredLabelsSupportEnabled && cast(ICompletionProposalExtension6)p ) { @@ -569,7 +569,7 @@ item.setText(displayString); if (fIsColoredLabelsSupportEnabled) TableOwnerDrawSupport.storeStyleRanges(item, 0, styleRanges); - + item.setData(p); if (validate && validateProposal(document, p, endOffset, null)) { @@ -924,13 +924,13 @@ List filtered= new ArrayList(length); for (int i= 0; i < length; i++) { - if (proposals[i] instanceof ICompletionProposalExtension2) { + if (cast(ICompletionProposalExtension2)proposals[i] ) { ICompletionProposalExtension2 p= cast(ICompletionProposalExtension2) proposals[i]; if (p.validate(document, offset, event)) filtered.add(p); - } else if (proposals[i] instanceof ICompletionProposalExtension) { + } else if (cast(ICompletionProposalExtension)proposals[i] ) { ICompletionProposalExtension p= cast(ICompletionProposalExtension) proposals[i]; if (p.isValidFor(document, offset)) diff -r b411f1c62131 -r 5cf141e43417 dwtx/jface/internal/text/link/contentassist/ContentAssistMessages.d --- a/dwtx/jface/internal/text/link/contentassist/ContentAssistMessages.d Sun Aug 24 22:41:48 2008 +0200 +++ b/dwtx/jface/internal/text/link/contentassist/ContentAssistMessages.d Sun Aug 24 23:05:26 2008 +0200 @@ -10,6 +10,7 @@ * Port to the D programming language: * Frank Benoitcolor
@@ -74,7 +74,7 @@
/**
* Converts an {@link RGB} to an HSI
* triplet.
- *
+ *
* @param color the color to convert
* @return the HSI float array of length 3
*/
@@ -95,7 +95,7 @@
hue = (g - b) / delta;
} else {
if (g is max) {
- hue = 2 + (b - r) / delta;
+ hue = 2 + (b - r) / delta;
} else {
hue = 4 + (r - g) / delta;
}
@@ -103,12 +103,12 @@
hue *= 60;
if (hue < 0) hue += 360;
}
- return new float[] {hue, saturation, intensity};
+ return [hue, saturation, intensity];
}
/**
* Converts a HSI triplet to an RGB.
- *
+ *
* @param hsi the HSI values
* @return the RGB corresponding to the HSI spec
*/
@@ -118,7 +118,7 @@
float saturation= hsi[1];
float intensity= hsi[2];
if (saturation is 0) {
- r = g = b = intensity;
+ r = g = b = intensity;
} else {
float temp2= intensity < 0.5f ? intensity * (1.0f + saturation) : (intensity + saturation) - (intensity * saturation);
float temp1= 2f * intensity - temp2;
@@ -132,7 +132,7 @@
int red = cast(int)(r * 255 + 0.5);
int green = cast(int)(g * 255 + 0.5);
- int blue = cast(int)(b * 255 + 0.5);
+ int blue = cast(int)(b * 255 + 0.5);
return new RGB(red, green, blue);
}
@@ -158,7 +158,7 @@
* @param bg the background color
* @param fg the foreground color
* @param factor the mixing factor, must be in [0, 1]
- *
+ *
* @return the interpolated color
*/
public static RGB blend(RGB bg, RGB fg, float factor) {
@@ -179,7 +179,7 @@
*
* The returned array has size steps
, and the color at index 0 is start
, the color
* at index steps - 1
is end
.
- *
+ *
* @param start the start color of the palette
* @param end the end color of the palette
* @param steps the requested size, must be > 0
@@ -189,14 +189,14 @@
Assert.isLegal(start !is null);
Assert.isLegal(end !is null);
Assert.isLegal(steps > 0);
-
+
if (steps is 1)
- return new RGB[] { start };
+ return [ start ];
float step= 1.0f / (steps - 1);
RGB[] gradient= new RGB[steps];
for (int i= 0; i < steps; i++)
- gradient[i]= blend(start, end, step * i);
+ gradient[i]= blend(start, end, step * i);
return gradient;
}
@@ -217,7 +217,7 @@
* {@link DWT#COLOR_YELLOW yellow}, {@link DWT#COLOR_CYAN cyan},
* {@link DWT#COLOR_MAGENTA magenta}.
*
steps
colors evenly distributed on the color wheel
*/
@@ -241,7 +241,7 @@
* {@link DWT#COLOR_YELLOW yellow}, {@link DWT#COLOR_CYAN cyan},
* {@link DWT#COLOR_MAGENTA magenta}.
*
- *
+ *
* @param index the index of the color, must be >= 0
* @return a color hue in [0°, 360°)
* @see RGB#RGB(float, float, float)
@@ -252,7 +252,7 @@
* Base 3 gives a nice partitioning for RGB colors with red, green, blue being the colors
* 0,1,2, and yellow, cyan, magenta colors 3,4,5.
*/
- final int base= 3;
+ final int base= 3;
final float range= 360f;
// partition the baseRange by using the least significant bit to select one half of the
diff -r b411f1c62131 -r 5cf141e43417 dwtx/jface/internal/text/revisions/RevisionPainter.d
--- a/dwtx/jface/internal/text/revisions/RevisionPainter.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/jface/internal/text/revisions/RevisionPainter.d Sun Aug 24 23:05:26 2008 +0200
@@ -98,7 +98,7 @@
/**
* A strategy for painting the live annotate colors onto the vertical ruler column. It also manages
* the revision hover.
- *
+ *
* @since 3.2
*/
public final class RevisionPainter {
@@ -109,7 +109,7 @@
private static const RGB BY_DATE_START_COLOR= new RGB(199, 134, 57);
private static const RGB BY_DATE_END_COLOR= new RGB(241, 225, 206);
-
+
/**
* The annotations created to show a revision in the overview ruler.
*/
@@ -160,14 +160,14 @@
/**
* Sets the revision information, which is needed to compute the relative age of a revision.
- *
+ *
* @param info the new revision info, null
for none.
*/
public void setInfo(RevisionInformation info) {
fRevisions= null;
fColors.clear();
fFocusColors.clear();
-
+
if (info is null)
return;
List revisions= new ArrayList();
@@ -220,7 +220,7 @@
int index= fRevisions.indexOf(new Long(age));
return index;
}
-
+
private RGB getShadedColor(RGB color, float scale, bool focus) {
Assert.isLegal(scale >= 0.0);
Assert.isLegal(scale <= 1.0);
@@ -252,7 +252,7 @@
/**
* Returns the color for a revision based on relative age and author.
- *
+ *
* @param revision the revision
* @param focus true
to return the focus color
* @return the color for a revision
@@ -262,7 +262,7 @@
RGB color= cast(RGB) map.get(revision);
if (color !is null)
return color;
-
+
color= adaptColor(revision, focus);
map.put(revision, color);
return color;
@@ -275,7 +275,7 @@
private class MouseHandler : MouseMoveListener, MouseTrackListener, Listener {
private RevisionRange fMouseDownRegion;
-
+
private void handleMouseUp(Event e) {
if (e.button is 1) {
RevisionRange upRegion= fFocusRange;
@@ -366,7 +366,7 @@
*/
private static final class HoverInformationControlCreator : AbstractReusableInformationControlCreator {
private bool fIsFocusable;
-
+
public this(bool isFocusable) {
fIsFocusable= isFocusable;
}
@@ -385,11 +385,11 @@
content= addCSSToHTMLFragment(content);
super.setInformation(content);
}
-
+
/**
* Adds a HTML header and CSS info if html
is only an HTML fragment (has no
* <html> section).
- *
+ *
* @param html the html / text produced by a revision
* @return modified html
*/
@@ -398,14 +398,14 @@
if (html.substring(0, max).indexOf("") !is -1) //$NON-NLS-1$
// there is already a header
return html;
-
+
StringBuffer info= new StringBuffer(512 + html.length());
HTMLPrinter.insertPageProlog(info, 0, fgStyleSheet);
info.append(html);
HTMLPrinter.addPageEpilog(info);
return info.toString();
}
-
+
};
}
return new DefaultInformationControl(parent, fIsFocusable);
@@ -451,12 +451,12 @@
"var { font-style: italic }\n" + //$NON-NLS-1$
"th { font-weight: bold }\n" + //$NON-NLS-1$
""; //$NON-NLS-1$
-
+
/**
* The revision hover displays information about the currently selected revision.
*/
private final class RevisionHover : IAnnotationHover, IAnnotationHoverExtension, IAnnotationHoverExtension2, IInformationProviderExtension2 {
-
+
/*
* @see dwtx.jface.text.source.IAnnotationHover#getHoverInfo(dwtx.jface.text.source.ISourceViewer,
* int)
@@ -633,7 +633,7 @@
/**
* Creates a new revision painter for a vertical ruler column.
- *
+ *
* @param column the column that will delegate{@link #paint(GC, ILineRange) painting} to the
* newly created painter.
* @param sharedColors a shared colors object to store shaded colors in
@@ -647,7 +647,7 @@
/**
* Sets the revision information to be drawn and triggers a redraw.
- *
+ *
* @param info the revision information to show, null
to draw none
*/
public void setRevisionInformation(RevisionInformation info) {
@@ -666,7 +666,7 @@
/**
* Changes the rendering mode and triggers redrawing if needed.
- *
+ *
* @param renderingMode the rendering mode
* @since 3.3
*/
@@ -681,7 +681,7 @@
/**
* Sets the background color.
- *
+ *
* @param background the background color, null
for the platform's list
* background
*/
@@ -692,7 +692,7 @@
/**
* Sets the parent ruler - the delegating column must call this method as soon as it creates its
* control.
- *
+ *
* @param parentRuler the parent ruler
*/
public void setParentRuler(CompositeRuler parentRuler) {
@@ -703,7 +703,7 @@
* Delegates the painting of the quick diff colors to this painter. The painter will draw the
* color boxes onto the passed {@link GC} for all model (document) lines in
* visibleModelLines
.
- *
+ *
* @param gc the {@link GC} to draw onto
* @param visibleLines the lines (in document offsets) that are currently (perhaps only
* partially) visible
@@ -724,14 +724,14 @@
}
fAuthorInset= gc.stringExtent(new String(string)).x;
}
-
+
// recompute colors (show intense colors if ruler is narrow)
int width= getWidth();
if (width !is fLastWidth) {
fColorTool.setInfo(fRevisionInfo);
fLastWidth= width;
}
-
+
// draw change regions
List/* true
if the column is fully connected.
- *
+ *
* @return true
if the column is fully connected, false otherwise
*/
private bool isConnected() {
@@ -787,7 +787,7 @@
/**
* Sets the annotation model.
- *
+ *
* @param model the annotation model, possibly null
* @see IVerticalRulerColumn#setModel(IAnnotationModel)
*/
@@ -804,7 +804,7 @@
/**
* Sets the annotation model.
- *
+ *
* @param model the annotation model.
*/
private void setAnnotationModel(IAnnotationModel model) {
@@ -814,7 +814,7 @@
/**
* Sets the line differ.
- *
+ *
* @param differ the line differ or null
if none
*/
private void setDiffer(IAnnotationModel differ) {
@@ -839,13 +839,13 @@
(cast(IAnnotationModel) fLineDiffer).removeAnnotationModelListener(fAnnotationListener);
fLineDiffer= null;
}
-
+
fRevisionSelectionProvider.uninstall();
}
/**
* Paints a single change region onto gc
.
- *
+ *
* @param range the range to paint
* @param gc the {@link GC} to paint on
*/
@@ -915,16 +915,16 @@
*/
int offset= fWidget.getOffsetAtLine(widgetLine);
int widgetBaseline= fWidget.getBaseline(offset);
-
+
FontMetrics fm = gc.getFontMetrics();
int fontBaseline = fm.getAscent() + fm.getLeading();
int baselineBias= widgetBaseline - fontBaseline;
return Math.max(0, baselineBias);
}
-
+
/**
* Looks up the color for a certain revision.
- *
+ *
* @param revision the revision to get the color for
* @param focus true
if it is the focus revision
* @return the color for the revision
@@ -936,7 +936,7 @@
/**
* Returns the revision range that contains the given line, or
* null
if there is none.
- *
+ *
* @param line the line of interest
* @return the corresponding RevisionRange
or null
*/
@@ -961,7 +961,7 @@
/**
* Returns the sublist of all RevisionRange
s that intersect with the given lines.
- *
+ *
* @param lines the model based lines of interest
* @return elementType: RevisionRange
*/
@@ -992,7 +992,7 @@
/**
* Gets all change ranges of the revisions in the revision model and adapts them to the current
* quick diff information. The list is cached.
- *
+ *
* @return the list of all change regions, with diff information applied
*/
private List getRangeCache() {
@@ -1019,11 +1019,11 @@
private void clearRangeCache() {
fRevisionRanges= null;
}
-
+
/**
* Returns true
if range
contains line
. A line is
* not contained in a range if it is the range's exclusive end line.
- *
+ *
* @param range the range to check whether it contains line
* @param line the line the line
* @return true
if range
contains line
,
@@ -1035,7 +1035,7 @@
/**
* Computes the end index of a line range.
- *
+ *
* @param range a line range
* @return the last line (exclusive) of range
*/
@@ -1045,7 +1045,7 @@
/**
* Returns the visible extent of a document line range in widget lines.
- *
+ *
* @param range the document line range
* @return the visible extent of range
in widget lines
*/
@@ -1083,7 +1083,7 @@
/**
* Returns the revision hover.
- *
+ *
* @return the revision hover
*/
public IAnnotationHover getHover() {
@@ -1094,7 +1094,7 @@
* Computes and returns the bounds of the rectangle corresponding to a widget line range. The
* rectangle is in pixel coordinates relative to the text widget's
* {@link StyledText#getClientArea() client area} and has the width of the ruler.
- *
+ *
* @param range the widget line range
* @return the box bounds corresponding to range
*/
@@ -1111,7 +1111,7 @@
private void updateOverviewAnnotations() {
if (fAnnotationModel is null)
return;
-
+
Revision revision= fFocusRevision !is null ? fFocusRevision : fSelectedRevision;
Map added= null;
@@ -1153,7 +1153,7 @@
/**
* Returns the character offset based region of a line range.
- *
+ *
* @param lines the line range to convert
* @return the character offset range corresponding to range
* @throws BadLocationException if the line range is not within the document bounds
@@ -1172,7 +1172,7 @@
/**
* Handles the selection of a revision and informs listeners.
- *
+ *
* @param revision the selected revision, null
for none
*/
void handleRevisionSelected(Revision revision) {
@@ -1184,7 +1184,7 @@
/**
* Handles the selection of a revision id and informs listeners
- *
+ *
* @param id the selected revision id
*/
void handleRevisionSelected(String id) {
@@ -1206,7 +1206,7 @@
/**
* Returns the selection provider.
- *
+ *
* @return the selection provider
*/
public RevisionSelectionProvider getRevisionSelectionProvider() {
@@ -1215,7 +1215,7 @@
/**
* Updates the focus line with a new line.
- *
+ *
* @param line the new focus line, -1 for no focus
*/
private void updateFocusLine(int line) {
@@ -1225,13 +1225,13 @@
/**
* Handles a changing focus line.
- *
+ *
* @param previousLine the old focus line (-1 for no focus)
* @param nextLine the new focus line (-1 for no focus)
*/
private void onFocusLineChanged(int previousLine, int nextLine) {
- if cast(DEBUG)
- System.out_.println("line: " + previousLine + " > " + nextLine); //$NON-NLS-1$ //$NON-NLS-2$
+ if (DEBUG)
+ System.out_.println("line: " ~ previousLine ~ " > " ~ nextLine); //$NON-NLS-1$ //$NON-NLS-2$
fFocusLine= nextLine;
RevisionRange region= getRange(nextLine);
updateFocusRange(region);
@@ -1239,7 +1239,7 @@
/**
* Updates the focus range.
- *
+ *
* @param range the new focus range, null
for no focus
*/
private void updateFocusRange(RevisionRange range) {
@@ -1249,12 +1249,12 @@
/**
* Handles a changing focus range.
- *
+ *
* @param previousRange the old focus range (null
for no focus)
* @param nextRange the new focus range (null
for no focus)
*/
private void onFocusRangeChanged(RevisionRange previousRange, RevisionRange nextRange) {
- if cast(DEBUG)
+ if (DEBUG)
System.out_.println("range: " + previousRange + " > " + nextRange); //$NON-NLS-1$ //$NON-NLS-2$
fFocusRange= nextRange;
Revision revision= nextRange is null ? null : nextRange.getRevision();
@@ -1268,12 +1268,12 @@
/**
* Handles a changing focus revision.
- *
+ *
* @param previousRevision the old focus revision (null
for no focus)
* @param nextRevision the new focus revision (null
for no focus)
*/
private void onFocusRevisionChanged(Revision previousRevision, Revision nextRevision) {
- if cast(DEBUG)
+ if (DEBUG)
System.out_.println("revision: " + previousRevision + " > " + nextRevision); //$NON-NLS-1$ //$NON-NLS-2$
fFocusRevision= nextRevision;
uninstallWheelHandler();
@@ -1305,7 +1305,7 @@
/**
* Handles a mouse wheel event.
- *
+ *
* @param event the mouse wheel event
*/
private void handleMouseWheel(Event event) {
@@ -1381,7 +1381,7 @@
/**
* Translates a y coordinate in the pixel coordinates of the column's control to a document line
* number.
- *
+ *
* @param y the y coordinate
* @return the corresponding document line, -1 for no line
* @see CompositeRuler#toDocumentLineNumber(int)
@@ -1406,7 +1406,7 @@
/**
* Returns the width of the column.
- *
+ *
* @return the width of the column
*/
private int getWidth() {
@@ -1415,7 +1415,7 @@
/**
* Returns the System background color for list widgets.
- *
+ *
* @return the System background color for list widgets
*/
private Color getBackground() {
@@ -1426,7 +1426,7 @@
/**
* Sets the hover later returned by {@link #getHover()}.
- *
+ *
* @param hover the hover
*/
public void setHover(IAnnotationHover hover) {
@@ -1435,7 +1435,7 @@
/**
* Returns true
if the receiver can provide a hover for a certain document line.
- *
+ *
* @param activeLine the document line of interest
* @return true
if the receiver can provide a hover
*/
@@ -1445,7 +1445,7 @@
/**
* Returns the revision at a certain document offset, or null
for none.
- *
+ *
* @param offset the document offset
* @return the revision at offset, or null
for none
*/
@@ -1467,7 +1467,7 @@
/**
* Returns true
if a revision model has been set, false
otherwise.
- *
+ *
* @return true
if a revision model has been set, false
otherwise
*/
public bool hasInformation() {
@@ -1476,7 +1476,7 @@
/**
* Returns the width in chars required to display information.
- *
+ *
* @return the width in chars required to display information
* @since 3.3
*/
@@ -1506,7 +1506,7 @@
/**
* Enables showing the revision id.
- *
+ *
* @param show true
to show the revision, false
to hide it
*/
public void showRevisionId(bool show) {
@@ -1517,10 +1517,10 @@
postRedraw();
}
}
-
+
/**
* Enables showing the revision author.
- *
+ *
* @param show true
to show the author, false
to hide it
*/
public void showRevisionAuthor(bool show) {
@@ -1534,7 +1534,7 @@
/**
* Adds a revision listener.
- *
+ *
* @param listener the listener
* @since 3.3
*/
@@ -1544,7 +1544,7 @@
/**
* Removes a revision listener.
- *
+ *
* @param listener the listener
* @since 3.3
*/
@@ -1554,7 +1554,7 @@
/**
* Informs the revision listeners about a change.
- *
+ *
* @since 3.3
*/
private void informListeners() {
diff -r b411f1c62131 -r 5cf141e43417 dwtx/jface/text/AbstractHoverInformationControlManager.d
--- a/dwtx/jface/text/AbstractHoverInformationControlManager.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/jface/text/AbstractHoverInformationControlManager.d Sun Aug 24 23:05:26 2008 +0200
@@ -1003,20 +1003,21 @@
return;
}
- fReplacingDelayJob= new Job("AbstractHoverInformationControlManager Replace Delayer") { //$NON-NLS-1$
- public IStatus run(final IProgressMonitor monitor) {
+ fReplacingDelayJob= new class("AbstractHoverInformationControlManager Replace Delayer") Job { //$NON-NLS-1$
+ this( String str ){
+ super(str);
+ }
+ public IStatus run(IProgressMonitor monitor) {
if (monitor.isCanceled() || display.isDisposed()) {
return Status.CANCEL_STATUS;
}
- display.syncExec(new class() Runnable {
- public void run() {
- fReplacingDelayJob= null;
- if (monitor.isCanceled())
- return;
- if (! fWaitForMouseUp)
- replaceInformationControl(false);
- }
- });
+ display.syncExec(dgRunnable( (IProgressMonitor monitor_) {
+ fReplacingDelayJob= null;
+ if (monitor_.isCanceled())
+ return;
+ if (! fWaitForMouseUp)
+ replaceInformationControl(false);
+ }, monitor ));
return Status.OK_STATUS;
}
};
@@ -1057,10 +1058,10 @@
bool was= isEnabled();
super.setEnabled(enabled);
- bool is= isEnabled();
+ bool is_= isEnabled();
- if (was !is is && fMouseTracker !is null) {
- if (is)
+ if (was !is is_ && fMouseTracker !is null) {
+ if (is_)
fMouseTracker.start(getSubjectControl());
else
fMouseTracker.stop();
diff -r b411f1c62131 -r 5cf141e43417 dwtx/jface/text/DocumentEvent.d
--- a/dwtx/jface/text/DocumentEvent.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/jface/text/DocumentEvent.d Sun Aug 24 23:05:26 2008 +0200
@@ -169,12 +169,12 @@
* @see dwtx.jface.text.IDocument
*/
public class DocumentEvent {
-
+
/**
* Debug option for asserting that text is not null.
* If the dwtx.text/debug/DocumentEvent/assertTextNotNull
* system property is true
- *
+ *
* @since 3.3
*/
private static const bool ASSERT_TEXT_NOT_NULL= Boolean.getBoolean("dwtx.text/debug/DocumentEvent/assertTextNotNull"); //$NON-NLS-1$
@@ -207,7 +207,7 @@
Assert.isTrue(offset >= 0);
Assert.isTrue(length >= 0);
- if cast(ASSERT_TEXT_NOT_NULL)
+ if (ASSERT_TEXT_NOT_NULL)
Assert.isNotNull(text);
fDocument= doc;
@@ -274,7 +274,7 @@
public long getModificationStamp() {
return fModificationStamp;
}
-
+
/*
* @see java.lang.Object#toString()
* @since 3.4
diff -r b411f1c62131 -r 5cf141e43417 dwtx/jface/text/SequentialRewriteTextStore.d
--- a/dwtx/jface/text/SequentialRewriteTextStore.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/jface/text/SequentialRewriteTextStore.d Sun Aug 24 23:05:26 2008 +0200
@@ -248,7 +248,7 @@
int delta= getDelta(lastReplace);
fReplaceList.add(new Replace(offset - delta, offset, length, text));
- } else if cast(ASSERT_SEQUENTIALITY) {
+ } else if (ASSERT_SEQUENTIALITY) {
throw new IllegalArgumentException();
} else {
@@ -287,7 +287,7 @@
int delta= getDelta(lastReplace);
return fSource.get(offset - delta, length);
- } else if cast(ASSERT_SEQUENTIALITY) {
+ } else if (ASSERT_SEQUENTIALITY) {
throw new IllegalArgumentException();
} else {
@@ -347,7 +347,7 @@
int delta= getDelta(lastReplace);
return fSource.get(offset - delta);
- } else if cast(ASSERT_SEQUENTIALITY) {
+ } else if (ASSERT_SEQUENTIALITY) {
throw new IllegalArgumentException();
} else {
diff -r b411f1c62131 -r 5cf141e43417 dwtx/jface/text/link/LinkedModeModel.d
--- a/dwtx/jface/text/link/LinkedModeModel.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/jface/text/link/LinkedModeModel.d Sun Aug 24 23:05:26 2008 +0200
@@ -131,8 +131,8 @@
public static LinkedModeModel getModel(IDocument document, int offset) {
if (!hasInstalledModel(document))
return null;
-
- LinkedModeManager mgr= LinkedModeManager.getLinkedManager(new IDocument[] {document}, false);
+
+ LinkedModeManager mgr= LinkedModeManager.getLinkedManager([document], false);
if (mgr !is null)
return mgr.getTopEnvironment();
return null;
diff -r b411f1c62131 -r 5cf141e43417 dwtx/jface/text/link/LinkedModeUI.d
--- a/dwtx/jface/text/link/LinkedModeUI.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/jface/text/link/LinkedModeUI.d Sun Aug 24 23:05:26 2008 +0200
@@ -636,8 +636,8 @@
}
};
-
-
+
+
/** Whether this UI is in simple highlighting mode or not. */
private bool fSimple;
@@ -666,7 +666,7 @@
* @param viewer the viewer upon which the linked mode UI should act
*/
public this(LinkedModeModel model, ITextViewer viewer) {
- constructor(model, new LinkedModeUITarget[]{new EmptyTarget(viewer)});
+ constructor(model, [new EmptyTarget(viewer)]);
}
/**
@@ -691,7 +691,7 @@
* @param target the target upon which the linked mode UI should act
*/
public this(LinkedModeModel model, LinkedModeUITarget target) {
- constructor(model, new LinkedModeUITarget[]{target});
+ constructor(model, [target]);
}
/**
@@ -997,7 +997,7 @@
final StyledText widget= fCurrentTarget.fWidget;
if (widget is null || widget.isDisposed())
return;
-
+
// See https://bugs.eclipse.org/bugs/show_bug.cgi?id=132263
widget.getDisplay().asyncExec(new class() Runnable {
public void run() {
@@ -1060,7 +1060,7 @@
/**
* Returns all possible content types of document
.
- *
+ *
* @param document the document
* @return all possible content types of document
* @throws BadPartitioningException
@@ -1079,7 +1079,7 @@
}
return document.getLegalContentTypes();
}
-
+
private void createAnnotationModel() {
if (fCurrentTarget.fAnnotationModel is null) {
LinkedPositionAnnotations lpa= new LinkedPositionAnnotations();
@@ -1298,7 +1298,7 @@
* Enables the support for colored labels in the proposal popup.
* Completion proposals can implement {@link ICompletionProposalExtension6} * to provide colored proposal labels.
- * + * * @param isEnabled iftrue
the support for colored labels is enabled in the proposal popup
* @since 3.4
*/
diff -r b411f1c62131 -r 5cf141e43417 dwtx/jface/text/rules/DefaultPartitioner.d
--- a/dwtx/jface/text/rules/DefaultPartitioner.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/jface/text/rules/DefaultPartitioner.d Sun Aug 24 23:05:26 2008 +0200
@@ -137,7 +137,7 @@
* @since 3.0
*/
public String[] getManagingPositionCategories() {
- return new String[] { fPositionCategory };
+ return [ fPositionCategory ];
}
/*
diff -r b411f1c62131 -r 5cf141e43417 dwtx/jface/text/rules/FastPartitioner.d
--- a/dwtx/jface/text/rules/FastPartitioner.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/jface/text/rules/FastPartitioner.d Sun Aug 24 23:05:26 2008 +0200
@@ -144,7 +144,7 @@
* @see dwtx.jface.text.IDocumentPartitionerExtension2#getManagingPositionCategories()
*/
public String[] getManagingPositionCategories() {
- return new String[] { fPositionCategory };
+ return [ fPositionCategory ];
}
/*
@@ -824,7 +824,7 @@
protected final Position[] getPositions() {
if (fCachedPositions is null) {
fCachedPositions= fDocument.getPositions(fPositionCategory);
- } else if cast(CHECK_CACHE_CONSISTENCY) {
+ } else if (CHECK_CACHE_CONSISTENCY) {
Position[] positions= fDocument.getPositions(fPositionCategory);
int len= Math.min(positions.length, fCachedPositions.length);
for (int i= 0; i < len; i++) {
diff -r b411f1c62131 -r 5cf141e43417 dwtx/jface/text/rules/RuleBasedPartitioner.d
--- a/dwtx/jface/text/rules/RuleBasedPartitioner.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/jface/text/rules/RuleBasedPartitioner.d Sun Aug 24 23:05:26 2008 +0200
@@ -128,7 +128,7 @@
* @since 3.0
*/
public String[] getManagingPositionCategories() {
- return new String[] { fPositionCategory };
+ return [ fPositionCategory ];
}
/*
diff -r b411f1c62131 -r 5cf141e43417 dwtx/text/edits/MoveSourceEdit.d
--- a/dwtx/text/edits/MoveSourceEdit.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/text/edits/MoveSourceEdit.d Sun Aug 24 23:05:26 2008 +0200
@@ -113,7 +113,7 @@
*
* @return the target edit or null
*/
- public this getTargetEdit() {
+ public MoveTargetEdit getTargetEdit() {
return fTarget;
}
diff -r b411f1c62131 -r 5cf141e43417 dwtx/text/edits/MoveTargetEdit.d
--- a/dwtx/text/edits/MoveTargetEdit.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/text/edits/MoveTargetEdit.d Sun Aug 24 23:05:26 2008 +0200
@@ -97,7 +97,7 @@
*
* @return the source edit or null
*/
- public this getSourceEdit() {
+ public MoveSourceEdit getSourceEdit() {
return fSource;
}
@@ -201,11 +201,11 @@
/*
* @see dwtx.text.edits.TextEdit#traversePassThree
*/
- int traverseRegionUpdating(TextEditProcessor processor, IDocument document, int accumulatedDelta, bool delete) {
+ int traverseRegionUpdating(TextEditProcessor processor, IDocument document, int accumulatedDelta, bool delete_) {
// the children got already updated / normalized while they got removed
// from the source edit. So we only have to adjust the offset computed to
// far.
- if (delete) {
+ if (delete_) {
deleteTree();
} else {
internalMoveTree(accumulatedDelta);
diff -r b411f1c62131 -r 5cf141e43417 dwtx/text/edits/MultiTextEdit.d
--- a/dwtx/text/edits/MultiTextEdit.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/text/edits/MultiTextEdit.d Sun Aug 24 23:05:26 2008 +0200
@@ -172,7 +172,7 @@
* @see TextEdit#copy
*/
protected TextEdit doCopy() {
- Assert.isTrue(MultiTextEdit.class is getClass(), "Subclasses must reimplement copy0"); //$NON-NLS-1$
+ Assert.isTrue(MultiTextEdit.classinfo is getClass(), "Subclasses must reimplement copy0"); //$NON-NLS-1$
return new MultiTextEdit(this);
}
diff -r b411f1c62131 -r 5cf141e43417 dwtx/text/edits/TextEdit.d
--- a/dwtx/text/edits/TextEdit.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/text/edits/TextEdit.d Sun Aug 24 23:05:26 2008 +0200
@@ -944,10 +944,10 @@
abstract int performDocumentUpdating(IDocument document) ;
- int traverseRegionUpdating(TextEditProcessor processor, IDocument document, int accumulatedDelta, bool delete) {
- performRegionUpdating(accumulatedDelta, delete);
+ int traverseRegionUpdating(TextEditProcessor processor, IDocument document, int accumulatedDelta, bool delete_) {
+ performRegionUpdating(accumulatedDelta, delete_);
if (fChildren !is null) {
- bool childDelete= delete || deleteChildren();
+ bool childDelete= delete_ || deleteChildren();
for (Iterator iter= fChildren.iterator(); iter.hasNext();) {
TextEdit child= cast(TextEdit)iter.next();
accumulatedDelta= child.traverseRegionUpdating(processor, document, accumulatedDelta, childDelete);
@@ -972,8 +972,8 @@
protected void childRegionUpdated() {
}
- void performRegionUpdating(int accumulatedDelta, bool delete) {
- if (delete)
+ void performRegionUpdating(int accumulatedDelta, bool delete_) {
+ if (delete_)
markAsDeleted();
else
adjustOffset(accumulatedDelta);
diff -r b411f1c62131 -r 5cf141e43417 dwtx/text/edits/TextEditMessages.d
--- a/dwtx/text/edits/TextEditMessages.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/text/edits/TextEditMessages.d Sun Aug 24 23:05:26 2008 +0200
@@ -44,9 +44,14 @@
class TextEditMessages {
- private static const String BUNDLE_NAME= "dwtx.text.edits.Messages"; //$NON-NLS-1$
+// private static const String BUNDLE_NAME= "dwtx.text.edits.Messages"; //$NON-NLS-1$
+
+ private static const ResourceBundle RESOURCE_BUNDLE;//= ResourceBundle.getBundle(BUNDLE_NAME);
- private static const ResourceBundle RESOURCE_BUNDLE= ResourceBundle.getBundle(BUNDLE_NAME);
+ static this() {
+ RESOURCE_BUNDLE = ResourceBundle.getBundle(
+ getImportData!("dwtx.text.edits.TextEditMessages.properties"));
+ }
private this() {
}
@@ -55,15 +60,11 @@
try {
return RESOURCE_BUNDLE.getString(key);
} catch (MissingResourceException e) {
- return '!' + key + '!';
+ return '!' ~ key ~ '!';
}
}
- public static String getFormattedString(String key, Object arg) {
- return getFormattedString(key, new Object[] { arg });
- }
-
- public static String getFormattedString(String key, Object[] args) {
+ public static String getFormattedString(String key, Object[] args...) {
return MessageFormat.format(getString(key), args);
}
}
diff -r b411f1c62131 -r 5cf141e43417 dwtx/text/undo/UndoMessages.d
--- a/dwtx/text/undo/UndoMessages.d Sun Aug 24 22:41:48 2008 +0200
+++ b/dwtx/text/undo/UndoMessages.d Sun Aug 24 23:05:26 2008 +0200
@@ -33,9 +33,14 @@
*/
final class UndoMessages {
- private static const String BUNDLE_NAME= "dwtx.text.undo.UndoMessages"; //$NON-NLS-1$
+// private static const String BUNDLE_NAME= "dwtx.text.undo.UndoMessages"; //$NON-NLS-1$
+
+ private static const ResourceBundle RESOURCE_BUNDLE;//= ResourceBundle.getBundle(BUNDLE_NAME);
- private static const ResourceBundle RESOURCE_BUNDLE= ResourceBundle.getBundle(BUNDLE_NAME);
+ static this() {
+ RESOURCE_BUNDLE = ResourceBundle.getBundle(
+ getImportData!("dwtx.text.undo.UndoMessages.properties"));
+ }
private this() {
}
@@ -44,15 +49,11 @@
try {
return RESOURCE_BUNDLE.getString(key);
} catch (MissingResourceException e) {
- return '!' + key + '!';
+ return '!' ~ key ~ '!';
}
}
- public static String getFormattedString(String key, Object arg) {
- return getFormattedString(key, new Object[] { arg });
- }
-
- public static String getFormattedString(String key, Object[] args) {
+ public static String getFormattedString(String key, Object[] args...) {
return MessageFormat.format(getString(key), args);
}
}