# HG changeset patch
# User Frank Benoit start
< 0
*/
- public void moveTo(int start) throws LineIndexOutOfBoundsException {
+ public void moveTo(int start) {
if (!(start >= 0))
throw new LineIndexOutOfBoundsException("Cannot set a negative start: " + start); //$NON-NLS-1$
fStart= start;
@@ -159,7 +159,7 @@
* @param end the new end
* @throws LineIndexOutOfBoundsException if end
<= {@link #start()}
*/
- public void moveEndTo(int end) throws LineIndexOutOfBoundsException {
+ public void moveEndTo(int end) {
moveTo(end - length());
}
@@ -170,7 +170,7 @@
* @param delta the number of lines to shift the range
* @throws LineIndexOutOfBoundsException if -delta
> {@link #start()}
*/
- public void moveBy(int delta) throws LineIndexOutOfBoundsException {
+ public void moveBy(int delta) {
moveTo(start() + delta);
}
@@ -180,7 +180,7 @@
* @param start the new start, must be >= 0 and < {@link #end()}
* @throws LineIndexOutOfBoundsException if start
< 0 or >= {@link #end()}
*/
- public void setStart(int start) throws LineIndexOutOfBoundsException {
+ public void setStart(int start) {
int end= end();
if (!(start >= 0 && start < end))
throw new LineIndexOutOfBoundsException("Cannot set a negative start: " + start); //$NON-NLS-1$
@@ -194,7 +194,7 @@
* @param end the new end, must be > {@link #start()}
* @throws LineIndexOutOfBoundsException if end
<= {@link #start()}
*/
- public void setEnd(int end) throws LineIndexOutOfBoundsException {
+ public void setEnd(int end) {
setLength(end - start());
}
@@ -204,7 +204,7 @@
* @param length the new length, must be > 0
* @throws LineIndexOutOfBoundsException if length
<= 0
*/
- public void setLength(int length) throws LineIndexOutOfBoundsException {
+ public void setLength(int length) {
if (!(length > 0))
throw new LineIndexOutOfBoundsException("Cannot set length <= 0: " + length); //$NON-NLS-1$
fLength= length;
@@ -216,7 +216,7 @@
* @param length the new length, must be > 0 and <= {@link #end()}
* @throws LineIndexOutOfBoundsException if length
<= 0
*/
- public void setLengthAndMove(int length) throws LineIndexOutOfBoundsException {
+ public void setLengthAndMove(int length) {
setStart(end() - length);
}
@@ -226,7 +226,7 @@
* @param delta the number of lines to resize the range
* @throws LineIndexOutOfBoundsException if -delta
>= {@link #length()}
*/
- public void resizeBy(int delta) throws LineIndexOutOfBoundsException {
+ public void resizeBy(int delta) {
setLength(length() + delta);
}
@@ -236,7 +236,7 @@
* @param delta the number of lines to resize the range
* @throws LineIndexOutOfBoundsException if -delta
>= {@link #length()}
*/
- public void resizeAndMoveBy(int delta) throws LineIndexOutOfBoundsException {
+ public void resizeAndMoveBy(int delta) {
setStart(start() + delta);
}
@@ -248,7 +248,7 @@
* @return the split off range
* @throws LineIndexOutOfBoundsException if remaining
>= {@link #length()} or remaining
<t;= 0
*/
- public Range split(int remaining) throws LineIndexOutOfBoundsException {
+ public Range split(int remaining) {
if (!(remaining < length())) // assert before modification
throw new LineIndexOutOfBoundsException("Remaining must be less than length: " + length()); //$NON-NLS-1$
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/internal/text/revisions/RevisionPainter.d
--- a/dwtx/jface/internal/text/revisions/RevisionPainter.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/internal/text/revisions/RevisionPainter.d Sun Aug 24 02:20:40 2008 +0200
@@ -1158,7 +1158,7 @@
* @return the character offset range corresponding to range
* @throws BadLocationException if the line range is not within the document bounds
*/
- private IRegion toCharRegion(ILineRange lines) throws BadLocationException {
+ private IRegion toCharRegion(ILineRange lines) {
IDocument document= fViewer.getDocument();
int offset= document.getLineOffset(lines.getStartLine());
int nextLine= end(lines);
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/AbstractDocument.d
--- a/dwtx/jface/text/AbstractDocument.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/AbstractDocument.d Sun Aug 24 02:20:40 2008 +0200
@@ -515,7 +515,7 @@
/*
* @see dwtx.jface.text.IDocument#addPosition(dwtx.jface.text.Position)
*/
- public void addPosition(Position position) throws BadLocationException {
+ public void addPosition(Position position) {
try {
addPosition(DEFAULT_CATEGORY, position);
} catch (BadPositionCategoryException e) {
@@ -913,7 +913,7 @@
/*
* @see dwtx.jface.text.IDocument#getChar(int)
*/
- public char getChar(int pos) throws BadLocationException {
+ public char getChar(int pos) {
if ((0 > pos) || (pos >= getLength()))
throw new BadLocationException();
return getStore().get(pos);
@@ -922,7 +922,7 @@
/*
* @see dwtx.jface.text.IDocument#getContentType(int)
*/
- public String getContentType(int offset) throws BadLocationException {
+ public String getContentType(int offset) {
String contentType= null;
try {
contentType= getContentType(DEFAULT_PARTITIONING, offset, false);
@@ -957,7 +957,7 @@
/*
* @see dwtx.jface.text.IDocument#getLineDelimiter(int)
*/
- public String getLineDelimiter(int line) throws BadLocationException {
+ public String getLineDelimiter(int line) {
return getTracker().getLineDelimiter(line);
}
@@ -1016,35 +1016,35 @@
/*
* @see dwtx.jface.text.IDocument#getLineLength(int)
*/
- public int getLineLength(int line) throws BadLocationException {
+ public int getLineLength(int line) {
return getTracker().getLineLength(line);
}
/*
* @see dwtx.jface.text.IDocument#getLineOfOffset(int)
*/
- public int getLineOfOffset(int pos) throws BadLocationException {
+ public int getLineOfOffset(int pos) {
return getTracker().getLineNumberOfOffset(pos);
}
/*
* @see dwtx.jface.text.IDocument#getLineOffset(int)
*/
- public int getLineOffset(int line) throws BadLocationException {
+ public int getLineOffset(int line) {
return getTracker().getLineOffset(line);
}
/*
* @see dwtx.jface.text.IDocument#getLineInformation(int)
*/
- public IRegion getLineInformation(int line) throws BadLocationException {
+ public IRegion getLineInformation(int line) {
return getTracker().getLineInformation(line);
}
/*
* @see dwtx.jface.text.IDocument#getLineInformationOfOffset(int)
*/
- public IRegion getLineInformationOfOffset(int offset) throws BadLocationException {
+ public IRegion getLineInformationOfOffset(int offset) {
return getTracker().getLineInformationOfOffset(offset);
}
@@ -1058,7 +1058,7 @@
/*
* @see dwtx.jface.text.IDocument#getNumberOfLines(int, int)
*/
- public int getNumberOfLines(int offset, int length) throws BadLocationException {
+ public int getNumberOfLines(int offset, int length) {
return getTracker().getNumberOfLines(offset, length);
}
@@ -1072,7 +1072,7 @@
/*
* @see dwtx.jface.text.IDocument#getPartition(int)
*/
- public ITypedRegion getPartition(int offset) throws BadLocationException {
+ public ITypedRegion getPartition(int offset) {
ITypedRegion partition= null;
try {
partition= getPartition(DEFAULT_PARTITIONING, offset, false);
@@ -1086,7 +1086,7 @@
/*
* @see dwtx.jface.text.IDocument#computePartitioning(int, int)
*/
- public ITypedRegion[] computePartitioning(int offset, int length) throws BadLocationException {
+ public ITypedRegion[] computePartitioning(int offset, int length) {
ITypedRegion[] partitioning= null;
try {
partitioning= computePartitioning(DEFAULT_PARTITIONING, offset, length, false);
@@ -1100,7 +1100,7 @@
/*
* @see dwtx.jface.text.IDocument#getPositions(java.lang.String)
*/
- public Position[] getPositions(String category) throws BadPositionCategoryException {
+ public Position[] getPositions(String category) {
if (category is null)
throw new BadPositionCategoryException();
@@ -1144,7 +1144,7 @@
/*
* @see dwtx.jface.text.IDocument#get(int, int)
*/
- public String get(int pos, int length) throws BadLocationException {
+ public String get(int pos, int length) {
int myLength= getLength();
if ((0 > pos) || (0 > length) || (pos + length > myLength))
throw new BadLocationException();
@@ -1170,7 +1170,7 @@
/*
* @see dwtx.jface.text.IDocument#removePosition(java.lang.String, dwtx.jface.text.Position)
*/
- public void removePosition(String category, Position position) throws BadPositionCategoryException {
+ public void removePosition(String category, Position position) {
if (position is null)
return;
@@ -1241,7 +1241,7 @@
/*
* @see dwtx.jface.text.IDocument#removePositionCategory(java.lang.String)
*/
- public void removePositionCategory(String category) throws BadPositionCategoryException {
+ public void removePositionCategory(String category) {
if (category is null)
return;
@@ -1286,7 +1286,7 @@
* @see dwtx.jface.text.IDocument#replace(int, int, java.lang.String)
* @since 3.1
*/
- public void replace(int pos, int length, String text, long modificationStamp) throws BadLocationException {
+ public void replace(int pos, int length, String text, long modificationStamp) {
if ((0 > pos) || (0 > length) || (pos + length > getLength()))
throw new BadLocationException();
@@ -1308,14 +1308,14 @@
*
* @since 3.4
*/
- public bool isLineInformationRepairNeeded(int offset, int length, String text) throws BadLocationException {
+ public bool isLineInformationRepairNeeded(int offset, int length, String text) {
return false;
}
/*
* @see dwtx.jface.text.IDocument#replace(int, int, java.lang.String)
*/
- public void replace(int pos, int length, String text) throws BadLocationException {
+ public void replace(int pos, int length, String text) {
if (length is 0 && (text is null || text.length() is 0))
replace(pos, length, text, getModificationStamp());
else
@@ -1369,7 +1369,7 @@
/*
* @see dwtx.jface.text.IDocument#search(int, java.lang.String, bool, bool, bool)
*/
- public int search(int startPosition, String findString, bool forwardSearch, bool caseSensitive, bool wholeWord) throws BadLocationException {
+ public int search(int startPosition, String findString, bool forwardSearch, bool caseSensitive, bool wholeWord) {
try {
IRegion region= getFindReplaceDocumentAdapter().find(startPosition, findString, forwardSearch, caseSensitive, wholeWord, false);
return region is null ? -1 : region.getOffset();
@@ -1575,7 +1575,7 @@
* @see dwtx.jface.text.IDocumentExtension3#getLegalContentTypes(java.lang.String)
* @since 3.0
*/
- public String[] getLegalContentTypes(String partitioning) throws BadPartitioningException {
+ public String[] getLegalContentTypes(String partitioning) {
IDocumentPartitioner partitioner= getDocumentPartitioner(partitioning);
if (partitioner !is null)
return partitioner.getLegalContentTypes();
@@ -1832,7 +1832,7 @@
* @throws BadPositionCategoryException if category is undefined in this document
* @since 3.4
*/
- public Position[] getPositions(String category, int offset, int length, bool canStartBefore, bool canEndAfter) throws BadPositionCategoryException {
+ public Position[] getPositions(String category, int offset, int length, bool canStartBefore, bool canEndAfter) {
if (canStartBefore && canEndAfter || (!canStartBefore && !canEndAfter)) {
List documentPositions;
if (canStartBefore && canEndAfter) {
@@ -1901,7 +1901,7 @@
* @throws BadPositionCategoryException if category is undefined in this document
* @since 3.4
*/
- private List getStartingPositions(String category, int offset, int length) throws BadPositionCategoryException {
+ private List getStartingPositions(String category, int offset, int length) {
List positions= cast(List) fPositions.get(category);
if (positions is null)
throw new BadPositionCategoryException();
@@ -1923,7 +1923,7 @@
* @throws BadPositionCategoryException if category is undefined in this document
* @since 3.4
*/
- private List getEndingPositions(String category, int offset, int length) throws BadPositionCategoryException {
+ private List getEndingPositions(String category, int offset, int length) {
List positions= cast(List) fEndPositions.get(category);
if (positions is null)
throw new BadPositionCategoryException();
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/AbstractInformationControl.d
--- a/dwtx/jface/text/AbstractInformationControl.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/AbstractInformationControl.d Sun Aug 24 02:20:40 2008 +0200
@@ -210,7 +210,7 @@
* They should also extend {@link #computeTrim()} if they create a content area
* with additional trim (e.g. scrollbars) and override {@link #getInformationPresenterControlCreator()}.
*
null
if none. */
private Composite fStatusComposite;
/** Separator between content and status line or null
if none. */
@@ -232,17 +232,17 @@
private final ToolBarManager fToolBarManager;
/** Status line toolbar or null
if none. */
private ToolBar fToolBar;
-
+
/** Listener for shell activation and deactivation. */
private Listener fShellListener;
/** All focus listeners registered to this information control. */
private ListenerList fFocusListeners= new ListenerList(ListenerList.IDENTITY);
-
+
/** Size constraints, x is the maxWidth and y is the maxHeight, or null
if not set. */
private Point fSizeConstraints;
/** The size of the resize handle if already set, -1 otherwise */
private int fResizeHandleSize;
-
+
/**
* Creates an abstract information control with the given shell as parent.
* The control will not be resizable and optionally show a status line with
@@ -250,7 +250,7 @@
* * Important: Subclasses are required to call {@link #create()} at the end of their constructor. *
- * + * * @param parentShell the parent of this control's shell * @param statusFieldText the text to be used in the status field ornull
to hide the status field
*/
@@ -265,7 +265,7 @@
* * Important: Subclasses are required to call {@link #create()} at the end of their constructor. *
- * + * * @param parentShell the parent of this control's shell * @param toolBarManager the manager ornull
if toolbar is not desired
*/
@@ -278,7 +278,7 @@
* * Important: Subclasses are required to call {@link #create()} at the end of their constructor. *
- * + * * @param parentShell the parent of this control's shell * @param isResizabletrue
if the control should be resizable
*/
@@ -296,47 +296,47 @@
* * Important:: Subclasses are required to call {@link #create()} at the end of their constructor. *
- * + * * @param parentShell the parent of this control's shell * @param shellStyle style of this control's shell * @param statusFieldText the text to be used in the status field ornull
to hide the status field
* @param toolBarManager the manager or null
if toolbar is not desired
- *
+ *
* @deprecated clients should use one of the public constructors
*/
this(Shell parentShell, int shellStyle, final String statusFieldText, final ToolBarManager toolBarManager) {
Assert.isTrue(statusFieldText is null || toolBarManager is null);
fResizeHandleSize= -1;
fToolBarManager= toolBarManager;
-
+
if ((shellStyle & DWT.NO_TRIM) !is 0)
shellStyle&= ~(DWT.NO_TRIM | DWT.SHELL_TRIM); // make sure we get the OS border but no other trims
-
+
fResizable= (shellStyle & DWT.RESIZE) !is 0; // on GTK, Shell removes DWT.RESIZE if DWT.ON_TOP is set
fShell= new Shell(parentShell, shellStyle);
Display display= fShell.getDisplay();
Color foreground= display.getSystemColor(DWT.COLOR_INFO_FOREGROUND);
Color background= display.getSystemColor(DWT.COLOR_INFO_BACKGROUND);
setColor(fShell, foreground, background);
-
+
GridLayout layout= new GridLayout(1, false);
layout.marginHeight= 0;
layout.marginWidth= 0;
layout.verticalSpacing= 0;
fShell.setLayout(layout);
-
+
fContentComposite= new Composite(fShell, DWT.NONE);
fContentComposite.setLayoutData(new GridData(DWT.FILL, DWT.FILL, true, true));
fContentComposite.setLayout(new FillLayout());
setColor(fContentComposite, foreground, background);
-
+
createStatusComposite(statusFieldText, toolBarManager, foreground, background);
}
private void createStatusComposite(final String statusFieldText, final ToolBarManager toolBarManager, Color foreground, Color background) {
if (toolBarManager is null && statusFieldText is null)
return;
-
+
fStatusComposite= new Composite(fShell, DWT.NONE);
GridData gridData= new GridData(DWT.FILL, DWT.BOTTOM, true, false);
fStatusComposite.setLayoutData(gridData);
@@ -345,10 +345,10 @@
statusLayout.marginWidth= 0;
statusLayout.verticalSpacing= 1;
fStatusComposite.setLayout(statusLayout);
-
+
fSeparator= new Label(fStatusComposite, DWT.SEPARATOR | DWT.HORIZONTAL);
fSeparator.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
+
if (statusFieldText !is null) {
createStatusLabel(statusFieldText, foreground, background);
} else {
@@ -360,39 +360,39 @@
fStatusLabel= new Label(fStatusComposite, DWT.RIGHT);
fStatusLabel.setLayoutData(new GridData(DWT.FILL, DWT.CENTER, true, false));
fStatusLabel.setText(statusFieldText);
-
+
FontData[] fontDatas= JFaceResources.getDialogFont().getFontData();
for (int i= 0; i < fontDatas.length; i++) {
fontDatas[i].setHeight(fontDatas[i].getHeight() * 9 / 10);
}
fStatusLabel.setFont(new Font(fStatusLabel.getDisplay(), fontDatas));
-
+
fStatusLabel.setForeground(fStatusLabel.getDisplay().getSystemColor(DWT.COLOR_WIDGET_DARK_SHADOW));
fStatusLabel.setBackground(background);
setColor(fStatusComposite, foreground, background);
}
-
+
private void createToolBar(ToolBarManager toolBarManager) {
final Composite bars= new Composite(fStatusComposite, DWT.NONE);
bars.setLayoutData(new GridData(DWT.FILL, DWT.FILL, false, false));
-
+
GridLayout layout= new GridLayout(3, false);
layout.marginHeight= 0;
layout.marginWidth= 0;
layout.horizontalSpacing= 0;
layout.verticalSpacing= 0;
bars.setLayout(layout);
-
+
fToolBar= toolBarManager.createControl(bars);
GridData gd= new GridData(DWT.BEGINNING, DWT.BEGINNING, false, false);
fToolBar.setLayoutData(gd);
-
+
Composite spacer= new Composite(bars, DWT.NONE);
gd= new GridData(DWT.FILL, DWT.FILL, true, true);
gd.widthHint= 0;
gd.heightHint= 0;
spacer.setLayoutData(gd);
-
+
addMoveSupport(spacer);
addResizeSupportIfNecessary(bars);
}
@@ -405,11 +405,11 @@
final bool isWin= platform.equals("win32"); //$NON-NLS-1$
if (!isWin && !platform.equals("gtk")) //$NON-NLS-1$
return;
-
+
final Canvas resizer= new Canvas(bars, DWT.NONE);
-
+
int size= getResizeHandleSize(bars);
-
+
GridData data= new GridData(DWT.END, DWT.END, false, true);
data.widthHint= size;
data.heightHint= size;
@@ -432,7 +432,7 @@
for (int i= 0; i <= 2; i++)
for (int j= 0; j <= 2 - i; j++)
e.gc.fillRectangle(end - 4 * i, end - 4 * j, 2, 2);
-
+
} else {
// draw diagonal lines
e.gc.setForeground(resizer.getDisplay().getSystemColor(DWT.COLOR_WIDGET_NORMAL_SHADOW));
@@ -446,11 +446,11 @@
}
}
});
-
+
resizer.setCursor(new Cursor(resizer.getDisplay(), DWT.CURSOR_SIZESE));
MouseAdapter resizeSupport= new class() MouseAdapter {
private MouseMoveListener fResizeListener;
-
+
public void mouseDown(MouseEvent e) {
Point shellSize= fShell.getSize();
final int shellX= shellSize.x;
@@ -468,7 +468,7 @@
};
resizer.addMouseMoveListener(fResizeListener);
}
-
+
public void mouseUp(MouseEvent e) {
resizer.removeMouseMoveListener(fResizeListener);
fResizeListener= null;
@@ -487,13 +487,13 @@
sliderH.dispose();
fResizeHandleSize= Math.min(width, height);
}
-
+
return fResizeHandleSize;
}
/**
* Adds support to move the shell by dragging the given control.
- *
+ *
* @param control the control that can be used to move the shell
*/
private void addMoveSupport(final Control control) {
@@ -529,7 +529,7 @@
/**
* Utility to set the foreground and the background color of the given
* control
- *
+ *
* @param control the control to modify
* @param foreground the color to use for the foreground
* @param background the color to use for the background
@@ -541,17 +541,17 @@
/**
* The shell of the popup window.
- *
+ *
* @return the shell used for the popup window
*/
protected final Shell getShell() {
return fShell;
}
-
+
/**
* The toolbar manager used to manage the toolbar, or null
if
* no toolbar is shown.
- *
+ *
* @return the tool bar manager or null
*/
protected final ToolBarManager getToolBarManager() {
@@ -582,11 +582,11 @@
* The given parent
comes with a {@link FillLayout}.
* Subclasses may set a different layout.
*
- *
+ *
* @param parent the container of the content
*/
protected abstract void createContent(Composite parent);
-
+
/**
* Sets the information to be presented by this information control.
*
@@ -594,16 +594,16 @@
* or implement {@link IInformationControlExtension2}.
*
* @param information the information to be presented
- *
+ *
* @see dwtx.jface.text.IInformationControl#setInformation(java.lang.String)
*/
public void setInformation(String information) {
-
+
}
-
+
/**
* Returns whether the information control is resizable.
- *
+ *
* @return true
if the information control is resizable,
* false
if it is not resizable.
*/
@@ -617,7 +617,7 @@
public void setVisible(bool visible) {
if (fShell.isVisible() is visible)
return;
-
+
fShell.setVisible(visible);
}
@@ -649,10 +649,10 @@
public void setSizeConstraints(int maxWidth, int maxHeight) {
fSizeConstraints= new Point(maxWidth, maxHeight);
}
-
+
/**
* Returns the size constraints.
- *
+ *
* @return the size constraints or null
if not set
* @see #setSizeConstraints(int, int)
*/
@@ -668,7 +668,7 @@
Point constrains= getSizeConstraints();
if (constrains is null)
return fShell.computeSize(DWT.DEFAULT, DWT.DEFAULT, true);
-
+
return fShell.computeSize(constrains.x, constrains.y, true);
}
@@ -676,7 +676,7 @@
* Computes the trim (status text and tool bar are considered as trim).
* Subclasses can extend this method to add additional trim (e.g. scroll
* bars for resizable information controls).
- *
+ *
* @see dwtx.jface.text.IInformationControlExtension3#computeTrim()
*/
public Rectangle computeTrim() {
@@ -756,7 +756,7 @@
/**
* This default implementation sets the focus on the popup shell.
* Subclasses can override or extend.
- *
+ *
* @see IInformationControl#setFocus()
*/
public void setFocus() {
@@ -812,10 +812,10 @@
* shown if the information control has been created with a non-null status
* field text.
*
null
if the status field should be hidden
- *
+ *
* @see dwtx.jface.text.IInformationControlExtension4#setStatusText(java.lang.String)
*/
public void setStatusText(String statusFieldText) {
@@ -828,7 +828,7 @@
}
}
}
-
+
/*
* @see dwtx.jface.text.IInformationControlExtension5#containsControl(dwt.widgets.Control)
*/
@@ -836,7 +836,7 @@
do {
if (control is fShell)
return true;
- if (control instanceof Shell)
+ if (cast(Shell)control )
return false;
control= control.getParent();
} while (control !is null);
@@ -862,7 +862,7 @@
* Computes the size constraints based on the
* {@link JFaceResources#getDialogFont() dialog font}. Subclasses can
* override or extend.
- *
+ *
* @see dwtx.jface.text.IInformationControlExtension5#computeSizeConstraints(int, int)
*/
public Point computeSizeConstraints(int widthInChars, int heightInChars) {
@@ -874,5 +874,5 @@
return new Point(widthInChars * width, heightInChars * height);
}
-
+
}
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/AbstractLineTracker.d
--- a/dwtx/jface/text/AbstractLineTracker.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/AbstractLineTracker.d Sun Aug 24 02:20:40 2008 +0200
@@ -270,7 +270,7 @@
/*
* @see dwtx.jface.text.ILineTracker#getLineDelimiter(int)
*/
- public String getLineDelimiter(int line) throws BadLocationException {
+ public String getLineDelimiter(int line) {
checkRewriteSession();
return fDelegate.getLineDelimiter(line);
}
@@ -278,7 +278,7 @@
/*
* @see dwtx.jface.text.ILineTracker#getLineInformation(int)
*/
- public IRegion getLineInformation(int line) throws BadLocationException {
+ public IRegion getLineInformation(int line) {
checkRewriteSession();
return fDelegate.getLineInformation(line);
}
@@ -286,7 +286,7 @@
/*
* @see dwtx.jface.text.ILineTracker#getLineInformationOfOffset(int)
*/
- public IRegion getLineInformationOfOffset(int offset) throws BadLocationException {
+ public IRegion getLineInformationOfOffset(int offset) {
checkRewriteSession();
return fDelegate.getLineInformationOfOffset(offset);
}
@@ -294,7 +294,7 @@
/*
* @see dwtx.jface.text.ILineTracker#getLineLength(int)
*/
- public int getLineLength(int line) throws BadLocationException {
+ public int getLineLength(int line) {
checkRewriteSession();
return fDelegate.getLineLength(line);
}
@@ -302,7 +302,7 @@
/*
* @see dwtx.jface.text.ILineTracker#getLineNumberOfOffset(int)
*/
- public int getLineNumberOfOffset(int offset) throws BadLocationException {
+ public int getLineNumberOfOffset(int offset) {
checkRewriteSession();
return fDelegate.getLineNumberOfOffset(offset);
}
@@ -310,7 +310,7 @@
/*
* @see dwtx.jface.text.ILineTracker#getLineOffset(int)
*/
- public int getLineOffset(int line) throws BadLocationException {
+ public int getLineOffset(int line) {
checkRewriteSession();
return fDelegate.getLineOffset(line);
}
@@ -330,7 +330,7 @@
/*
* @see dwtx.jface.text.ILineTracker#getNumberOfLines(int, int)
*/
- public int getNumberOfLines(int offset, int length) throws BadLocationException {
+ public int getNumberOfLines(int offset, int length) {
checkRewriteSession();
return fDelegate.getNumberOfLines(offset, length);
}
@@ -351,7 +351,7 @@
/*
* @see dwtx.jface.text.ILineTracker#replace(int, int, java.lang.String)
*/
- public void replace(int offset, int length, String text) throws BadLocationException {
+ public void replace(int offset, int length, String text) {
if (hasActiveRewriteSession()) {
fPendingRequests.add(new Request(offset, length, text));
return;
@@ -432,7 +432,7 @@
* @throws BadLocationException in case the recorded requests cannot be processed correctly
* @since 3.1
*/
- protected final void flushRewriteSession() throws BadLocationException {
+ protected final void flushRewriteSession() {
if cast(DEBUG)
System.out.println("AbstractLineTracker: Flushing rewrite session: " + fActiveRewriteSession); //$NON-NLS-1$
@@ -456,7 +456,7 @@
* @throws BadLocationException in case flushing does not succeed
* @since 3.1
*/
- protected final void checkRewriteSession() throws BadLocationException {
+ protected final void checkRewriteSession() {
if (hasActiveRewriteSession())
flushRewriteSession();
}
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/DefaultDocumentAdapter.d
--- a/dwtx/jface/text/DefaultDocumentAdapter.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/DefaultDocumentAdapter.d Sun Aug 24 02:20:40 2008 +0200
@@ -290,7 +290,7 @@
* @throws BadLocationException if the line number is invalid for the adapted document
* @since 3.0
*/
- private String doGetLine(IDocument document, int line) throws BadLocationException {
+ private String doGetLine(IDocument document, int line) {
IRegion r= document.getLineInformation(line);
return document.get(r.getOffset(), r.getLength());
}
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/DefaultIndentLineAutoEditStrategy.d
--- a/dwtx/jface/text/DefaultIndentLineAutoEditStrategy.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/DefaultIndentLineAutoEditStrategy.d Sun Aug 24 02:20:40 2008 +0200
@@ -184,7 +184,7 @@
* @return the offset in the specified range whose character is not a space or tab
* @exception BadLocationException if position is an invalid range in the given document
*/
- protected int findEndOfWhiteSpace(IDocument document, int offset, int end) throws BadLocationException {
+ protected int findEndOfWhiteSpace(IDocument document, int offset, int end) {
while (offset < end) {
char c= document.getChar(offset);
if (c !is ' ' && c !is '\t') {
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/DefaultTextHover.d
--- a/dwtx/jface/text/DefaultTextHover.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/DefaultTextHover.d Sun Aug 24 02:20:40 2008 +0200
@@ -166,7 +166,7 @@
/**
* Standard implementation of {@link dwtx.jface.text.ITextHover}.
- *
+ *
* @since 3.2
*/
public class DefaultTextHover : ITextHover {
@@ -176,14 +176,14 @@
/**
* Creates a new annotation hover.
- *
+ *
* @param sourceViewer this hover's annotation model
*/
public this(ISourceViewer sourceViewer) {
Assert.isNotNull(sourceViewer);
fSourceViewer= sourceViewer;
}
-
+
/*
* @see dwtx.jface.text.ITextHover#getHoverInfo(dwtx.jface.text.ITextViewer, dwtx.jface.text.IRegion)
*/
@@ -191,7 +191,7 @@
IAnnotationModel model= getAnnotationModel(fSourceViewer);
if (model is null)
return null;
-
+
Iterator e= model.getAnnotationIterator();
while (e.hasNext()) {
Annotation a= cast(Annotation) e.next();
@@ -204,7 +204,7 @@
}
}
}
-
+
return null;
}
@@ -214,26 +214,26 @@
public IRegion getHoverRegion(ITextViewer textViewer, int offset) {
return findWord(textViewer.getDocument(), offset);
}
-
+
/**
* Tells whether the annotation should be included in
* the computation.
- *
+ *
* @param annotation the annotation to test
* @return true
if the annotation is included in the computation
*/
protected bool isIncluded(Annotation annotation) {
return true;
}
-
+
private IAnnotationModel getAnnotationModel(ISourceViewer viewer) {
- if (viewer instanceof ISourceViewerExtension2) {
+ if (cast(ISourceViewerExtension2)viewer ) {
ISourceViewerExtension2 extension= cast(ISourceViewerExtension2) viewer;
return extension.getVisualAnnotationModel();
}
return viewer.getAnnotationModel();
}
-
+
private IRegion findWord(IDocument document, int offset) {
int start= -2;
int end= -1;
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/Document.d
--- a/dwtx/jface/text/Document.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/Document.d Sun Aug 24 02:20:40 2008 +0200
@@ -211,7 +211,7 @@
* @see dwtx.jface.text.IRepairableDocumentExtension#isLineInformationRepairNeeded(int, int, java.lang.String)
* @since 3.4
*/
- public bool isLineInformationRepairNeeded(int offset, int length, String text) throws BadLocationException {
+ public bool isLineInformationRepairNeeded(int offset, int length, String text) {
if ((0 > offset) || (0 > length) || (offset + length > getLength()))
throw new BadLocationException();
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/DocumentCommand.d
--- a/dwtx/jface/text/DocumentCommand.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/DocumentCommand.d Sun Aug 24 02:20:40 2008 +0200
@@ -227,7 +227,7 @@
* @param document the document on which to execute the command.
* @throws BadLocationException in case this commands cannot be executed
*/
- public void execute(IDocument document) throws BadLocationException {
+ public void execute(IDocument document) {
if (fLength is 0 && fText is null)
return;
@@ -470,7 +470,7 @@
* @throws BadLocationException if the added command intersects with an existing one
* @since 2.1
*/
- public void addCommand(int commandOffset, int commandLength, String commandText, IDocumentListener commandOwner) throws BadLocationException {
+ public void addCommand(int commandOffset, int commandLength, String commandText, IDocumentListener commandOwner) {
final Command command= new Command(commandOffset, commandLength, commandText, commandOwner);
if (intersects(command))
@@ -554,7 +554,7 @@
* @throws BadLocationException in case access to the given document fails
* @since 2.1
*/
- void execute(IDocument document) throws BadLocationException {
+ void execute(IDocument document) {
if (length is 0 && text is null && fCommands.size() is 0)
return;
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/FindReplaceDocumentAdapter.d
--- a/dwtx/jface/text/FindReplaceDocumentAdapter.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/FindReplaceDocumentAdapter.d Sun Aug 24 02:20:40 2008 +0200
@@ -248,7 +248,7 @@
* @throws BadLocationException if startOffset is an invalid document offset
* @throws PatternSyntaxException if a regular expression has invalid syntax
*/
- public IRegion find(int startOffset, String findString, bool forwardSearch, bool caseSensitive, bool wholeWord, bool regExSearch) throws BadLocationException {
+ public IRegion find(int startOffset, String findString, bool forwardSearch, bool caseSensitive, bool wholeWord, bool regExSearch) {
Assert.isTrue(!(regExSearch && wholeWord));
// Adjust offset to special meaning of -1
@@ -283,7 +283,7 @@
* @throws IllegalStateException if a REPLACE or REPLACE_FIND operation is not preceded by a successful FIND operation
* @throws PatternSyntaxException if a regular expression has invalid syntax
*/
- private IRegion findReplace(final FindReplaceOperationCode operationCode, int startOffset, String findString, String replaceText, bool forwardSearch, bool caseSensitive, bool wholeWord, bool regExSearch) throws BadLocationException {
+ private IRegion findReplace(final FindReplaceOperationCode operationCode, int startOffset, String findString, String replaceText, bool forwardSearch, bool caseSensitive, bool wholeWord, bool regExSearch) {
// Validate option combinations
Assert.isTrue(!(regExSearch && wholeWord));
@@ -409,7 +409,7 @@
* @throws PatternSyntaxException if \R is added at an illegal position (e.g. in a character set)
* @since 3.4
*/
- private String substituteLinebreak(String findString) throws PatternSyntaxException {
+ private String substituteLinebreak(String findString) {
int length= findString.length();
StringBuffer buf= new StringBuffer(length);
@@ -742,7 +742,7 @@
* @see DocumentEvent
* @see IDocumentListener
*/
- public IRegion replace(String text, bool regExReplace) throws BadLocationException {
+ public IRegion replace(String text, bool regExReplace) {
return findReplace(REPLACE, -1, null, text, false, false, false, regExReplace);
}
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/ListLineTracker.d
--- a/dwtx/jface/text/ListLineTracker.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/ListLineTracker.d Sun Aug 24 02:20:40 2008 +0200
@@ -241,7 +241,7 @@
* @return the number of lines covered by this text range
* @exception BadLocationException if range is undefined in this tracker
*/
- private int getNumberOfLines(int startLine, int offset, int length) throws BadLocationException {
+ private int getNumberOfLines(int startLine, int offset, int length) {
if (length is 0)
return 1;
@@ -265,7 +265,7 @@
/*
* @see dwtx.jface.text.ILineTracker#getLineLength(int)
*/
- public final int getLineLength(int line) throws BadLocationException {
+ public final int getLineLength(int line) {
int lines= fLines.size();
if (line < 0 || line > lines)
@@ -281,7 +281,7 @@
/*
* @see dwtx.jface.text.ILineTracker#getLineNumberOfOffset(int)
*/
- public final int getLineNumberOfOffset(int position) throws BadLocationException {
+ public final int getLineNumberOfOffset(int position) {
if (position < 0 || position > fTextLength)
throw new BadLocationException();
@@ -301,7 +301,7 @@
/*
* @see dwtx.jface.text.ILineTracker#getLineInformationOfOffset(int)
*/
- public final IRegion getLineInformationOfOffset(int position) throws BadLocationException {
+ public final IRegion getLineInformationOfOffset(int position) {
if (position > fTextLength)
throw new BadLocationException();
@@ -319,7 +319,7 @@
/*
* @see dwtx.jface.text.ILineTracker#getLineInformation(int)
*/
- public final IRegion getLineInformation(int line) throws BadLocationException {
+ public final IRegion getLineInformation(int line) {
int lines= fLines.size();
if (line < 0 || line > lines)
@@ -340,7 +340,7 @@
/*
* @see dwtx.jface.text.ILineTracker#getLineOffset(int)
*/
- public final int getLineOffset(int line) throws BadLocationException {
+ public final int getLineOffset(int line) {
int lines= fLines.size();
if (line < 0 || line > lines)
@@ -376,7 +376,7 @@
/*
* @see dwtx.jface.text.ILineTracker#getNumberOfLines(int, int)
*/
- public final int getNumberOfLines(int position, int length) throws BadLocationException {
+ public final int getNumberOfLines(int position, int length) {
if (position < 0 || position + length > fTextLength)
throw new BadLocationException();
@@ -405,7 +405,7 @@
/*
* @see dwtx.jface.text.ILineTracker#getLineDelimiter(int)
*/
- public final String getLineDelimiter(int line) throws BadLocationException {
+ public final String getLineDelimiter(int line) {
int lines= fLines.size();
if (line < 0 || line > lines)
@@ -480,7 +480,7 @@
/*
* @see dwtx.jface.text.ILineTracker#replace(int, int, java.lang.String)
*/
- public final void replace(int position, int length, String text) throws BadLocationException {
+ public final void replace(int position, int length, String text) {
throw new UnsupportedOperationException();
}
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/TextUtilities.d
--- a/dwtx/jface/text/TextUtilities.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/TextUtilities.d Sun Aug 24 02:20:40 2008 +0200
@@ -180,7 +180,7 @@
/**
* Default line delimiters used by the text functions of this class.
*/
- public final static String[] DELIMITERS= new String[] { "\n", "\r", "\r\n" }; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
+ public final static String[] DELIMITERS= [ "\n", "\r", "\r\n" ]; //$NON-NLS-3$ //$NON-NLS-2$ //$NON-NLS-1$
/**
* Default line delimiters used by these text functions.
@@ -327,7 +327,7 @@
* @return returns the merged document event
* @throws BadLocationException might be thrown if document is not in the correct state with respect to document events
*/
- public static DocumentEvent mergeUnprocessedDocumentEvents(IDocument unprocessedDocument, List documentEvents) throws BadLocationException {
+ public static DocumentEvent mergeUnprocessedDocumentEvents(IDocument unprocessedDocument, List documentEvents) {
if (documentEvents.size() is 0)
return null;
@@ -392,7 +392,7 @@
* @return returns the merged document event
* @throws BadLocationException might be thrown if document is not in the correct state with respect to document events
*/
- public static DocumentEvent mergeProcessedDocumentEvents(List documentEvents) throws BadLocationException {
+ public static DocumentEvent mergeProcessedDocumentEvents(List documentEvents) {
if (documentEvents.size() is 0)
return null;
@@ -452,7 +452,7 @@
*/
public static Map removeDocumentPartitioners(IDocument document) {
Map partitioners= new HashMap();
- if (document instanceof IDocumentExtension3) {
+ if (cast(IDocumentExtension3)document ) {
IDocumentExtension3 extension3= cast(IDocumentExtension3) document;
String[] partitionings= extension3.getPartitionings();
for (int i= 0; i < partitionings.length; i++) {
@@ -483,7 +483,7 @@
* @since 3.0
*/
public static void addDocumentPartitioners(IDocument document, Map partitioners) {
- if (document instanceof IDocumentExtension3) {
+ if (cast(IDocumentExtension3)document ) {
IDocumentExtension3 extension3= cast(IDocumentExtension3) document;
Iterator e= partitioners.keySet().iterator();
while (e.hasNext()) {
@@ -513,8 +513,8 @@
* @throws BadLocationException if offset is invalid in the document
* @since 3.0
*/
- public static String getContentType(IDocument document, String partitioning, int offset, bool preferOpenPartitions) throws BadLocationException {
- if (document instanceof IDocumentExtension3) {
+ public static String getContentType(IDocument document, String partitioning, int offset, bool preferOpenPartitions) {
+ if (cast(IDocumentExtension3)document ) {
IDocumentExtension3 extension3= cast(IDocumentExtension3) document;
try {
return extension3.getContentType(partitioning, offset, preferOpenPartitions);
@@ -540,8 +540,8 @@
* @throws BadLocationException if offset is invalid in the given document
* @since 3.0
*/
- public static ITypedRegion getPartition(IDocument document, String partitioning, int offset, bool preferOpenPartitions) throws BadLocationException {
- if (document instanceof IDocumentExtension3) {
+ public static ITypedRegion getPartition(IDocument document, String partitioning, int offset, bool preferOpenPartitions) {
+ if (cast(IDocumentExtension3)document ) {
IDocumentExtension3 extension3= cast(IDocumentExtension3) document;
try {
return extension3.getPartition(partitioning, offset, preferOpenPartitions);
@@ -568,8 +568,8 @@
* document
* @since 3.0
*/
- public static ITypedRegion[] computePartitioning(IDocument document, String partitioning, int offset, int length, bool includeZeroLengthPartitions) throws BadLocationException {
- if (document instanceof IDocumentExtension3) {
+ public static ITypedRegion[] computePartitioning(IDocument document, String partitioning, int offset, int length, bool includeZeroLengthPartitions) {
+ if (cast(IDocumentExtension3)document ) {
IDocumentExtension3 extension3= cast(IDocumentExtension3) document;
try {
return extension3.computePartitioning(partitioning, offset, length, includeZeroLengthPartitions);
@@ -590,14 +590,14 @@
* @since 3.0
*/
public static String[] computePartitionManagingCategories(IDocument document) {
- if (document instanceof IDocumentExtension3) {
+ if (cast(IDocumentExtension3)document ) {
IDocumentExtension3 extension3= cast(IDocumentExtension3) document;
String[] partitionings= extension3.getPartitionings();
if (partitionings !is null) {
Set categories= new HashSet();
for (int i= 0; i < partitionings.length; i++) {
IDocumentPartitioner p= extension3.getDocumentPartitioner(partitionings[i]);
- if (p instanceof IDocumentPartitionerExtension2) {
+ if (cast(IDocumentPartitionerExtension2)p ) {
IDocumentPartitionerExtension2 extension2= cast(IDocumentPartitionerExtension2) p;
String[] c= extension2.getManagingPositionCategories();
if (c !is null) {
@@ -625,11 +625,11 @@
*/
public static String getDefaultLineDelimiter(IDocument document) {
- if (document instanceof IDocumentExtension4)
+ if (cast(IDocumentExtension4)document )
return (cast(IDocumentExtension4)document).getDefaultLineDelimiter();
-
+
String lineDelimiter= null;
-
+
try {
lineDelimiter= document.getLineDelimiter(0);
} catch (BadLocationException x) {
@@ -637,7 +637,7 @@
if (lineDelimiter !is null)
return lineDelimiter;
-
+
String sysLineDelimiter= System.getProperty("line.separator"); //$NON-NLS-1$
String[] delimiters= document.getLegalLineDelimiters();
Assert.isTrue(delimiters.length > 0);
@@ -647,7 +647,7 @@
break;
}
}
-
+
if (lineDelimiter is null)
lineDelimiter= delimiters[0];
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/TextViewer.d
--- a/dwtx/jface/text/TextViewer.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/TextViewer.d Sun Aug 24 02:20:40 2008 +0200
@@ -2966,7 +2966,7 @@
* @since 2.1
* @deprecated use updateSlaveDocument
instead
*/
- protected bool updateVisibleDocument(IDocument visibleDocument, int visibleRegionOffset, int visibleRegionLength) throws BadLocationException {
+ protected bool updateVisibleDocument(IDocument visibleDocument, int visibleRegionOffset, int visibleRegionLength) {
if (visibleDocument instanceof ChildDocument) {
ChildDocument childDocument= cast(ChildDocument) visibleDocument;
@@ -2994,7 +2994,7 @@
* @throws BadLocationException in case the specified range is not valid in the master document
* @since 3.0
*/
- protected bool updateSlaveDocument(IDocument slaveDocument, int modelRangeOffset, int modelRangeLength) throws BadLocationException {
+ protected bool updateSlaveDocument(IDocument slaveDocument, int modelRangeOffset, int modelRangeLength) {
return updateVisibleDocument(slaveDocument, modelRangeOffset, modelRangeLength);
}
@@ -5483,7 +5483,7 @@
* @throws IllegalStateException if the hyperlink manager has already been created
* @since 3.1
*/
- public void setHyperlinkPresenter(IHyperlinkPresenter hyperlinkPresenter) throws IllegalStateException {
+ public void setHyperlinkPresenter(IHyperlinkPresenter hyperlinkPresenter) {
if (fHyperlinkManager !is null)
throw new IllegalStateException();
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/TreeLineTracker.d
--- a/dwtx/jface/text/TreeLineTracker.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/TreeLineTracker.d Sun Aug 24 02:20:40 2008 +0200
@@ -365,7 +365,7 @@
* @return the line starting at or containing offset
* @throws BadLocationException if the offset is invalid
*/
- private Node nodeByOffset(final int offset) throws BadLocationException {
+ private Node nodeByOffset(final int offset) {
/*
* Works for any binary search tree.
*/
@@ -403,7 +403,7 @@
* @return the line number starting at or containing offset
* @throws BadLocationException if the offset is invalid
*/
- private int lineByOffset(final int offset) throws BadLocationException {
+ private int lineByOffset(final int offset) {
/*
* Works for any binary search tree.
*/
@@ -438,7 +438,7 @@
* @return the line with the given line number
* @throws BadLocationException if the line is invalid
*/
- private Node nodeByLine(final int line) throws BadLocationException {
+ private Node nodeByLine(final int line) {
/*
* Works for any binary search tree.
*/
@@ -472,7 +472,7 @@
* @return the line offset with the given line number
* @throws BadLocationException if the line is invalid
*/
- private int offsetByLine(final int line) throws BadLocationException {
+ private int offsetByLine(final int line) {
/*
* Works for any binary search tree.
*/
@@ -747,7 +747,7 @@
/*
* @see dwtx.jface.text.ILineTracker#replace(int, int, java.lang.String)
*/
- public final void replace(int offset, int length, String text) throws BadLocationException {
+ public final void replace(int offset, int length, String text) {
if cast(ASSERT) checkTree();
// Inlined nodeByOffset as we need both node and offset
@@ -1203,7 +1203,7 @@
* @param offset the illegal character or line offset that caused the exception
* @throws BadLocationException always
*/
- private void fail(int offset) throws BadLocationException {
+ private void fail(int offset) {
throw new BadLocationException();
}
@@ -1220,7 +1220,7 @@
/*
* @see dwtx.jface.text.ILineTracker#getLineDelimiter(int)
*/
- public final String getLineDelimiter(int line) throws BadLocationException {
+ public final String getLineDelimiter(int line) {
Node node= nodeByLine(line);
return node.delimiter is NO_DELIM ? null : node.delimiter;
}
@@ -1257,7 +1257,7 @@
/*
* @see dwtx.jface.text.ILineTracker#getNumberOfLines(int, int)
*/
- public final int getNumberOfLines(int offset, int length) throws BadLocationException {
+ public final int getNumberOfLines(int offset, int length) {
if (length is 0)
return 1;
@@ -1270,14 +1270,14 @@
/*
* @see dwtx.jface.text.ILineTracker#getLineOffset(int)
*/
- public final int getLineOffset(int line) throws BadLocationException {
+ public final int getLineOffset(int line) {
return offsetByLine(line);
}
/*
* @see dwtx.jface.text.ILineTracker#getLineLength(int)
*/
- public final int getLineLength(int line) throws BadLocationException {
+ public final int getLineLength(int line) {
Node node= nodeByLine(line);
return node.length;
}
@@ -1285,14 +1285,14 @@
/*
* @see dwtx.jface.text.ILineTracker#getLineNumberOfOffset(int)
*/
- public final int getLineNumberOfOffset(int offset) throws BadLocationException {
+ public final int getLineNumberOfOffset(int offset) {
return lineByOffset(offset);
}
/*
* @see dwtx.jface.text.ILineTracker#getLineInformationOfOffset(int)
*/
- public final IRegion getLineInformationOfOffset(final int offset) throws BadLocationException {
+ public final IRegion getLineInformationOfOffset(final int offset) {
// Inline nodeByOffset start as we need both node and offset
int remaining= offset;
Node node= fRoot;
@@ -1322,7 +1322,7 @@
/*
* @see dwtx.jface.text.ILineTracker#getLineInformation(int)
*/
- public final IRegion getLineInformation(int line) throws BadLocationException {
+ public final IRegion getLineInformation(int line) {
try {
// Inline nodeByLine start
int remaining= line;
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/contentassist/AdditionalInfoController.d
--- a/dwtx/jface/text/contentassist/AdditionalInfoController.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/contentassist/AdditionalInfoController.d Sun Aug 24 02:20:40 2008 +0200
@@ -316,7 +316,7 @@
return LEGACY_WAIT;
}
- private synchronized void loop() throws InterruptedException {
+ private synchronized void loop() {
long current= System.currentTimeMillis();
Task task= currentTask();
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/contentassist/CompletionProposalPopup.d
--- a/dwtx/jface/text/contentassist/CompletionProposalPopup.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/contentassist/CompletionProposalPopup.d Sun Aug 24 02:20:40 2008 +0200
@@ -166,7 +166,7 @@
* @see dwtx.core.commands.AbstractHandler#execute(dwtx.core.commands.ExecutionEvent)
* @since 3.4
*/
- public Object execute(ExecutionEvent event) throws ExecutionException {
+ public Object execute(ExecutionEvent event) {
int itemCount= fProposalTable.getItemCount();
int selectionIndex= fProposalTable.getSelectionIndex();
switch (fOperationCode) {
@@ -1743,7 +1743,7 @@
/*
* @since 3.1
*/
- private bool isPrefixCompatible(CharSequence oneSequence, int oneOffset, CharSequence twoSequence, int twoOffset, IDocument document) throws BadLocationException {
+ private bool isPrefixCompatible(CharSequence oneSequence, int oneOffset, CharSequence twoSequence, int twoOffset, IDocument document) {
if (oneSequence is null || twoSequence is null)
return true;
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/formatter/ContentFormatter.d
--- a/dwtx/jface/text/formatter/ContentFormatter.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/formatter/ContentFormatter.d Sun Aug 24 02:20:40 2008 +0200
@@ -459,7 +459,7 @@
* @exception BadLocationException of region is invalid in the document
* @since 3.0
*/
- private TypedPosition[] getPartitioning(IRegion region) throws BadLocationException {
+ private TypedPosition[] getPartitioning(IRegion region) {
ITypedRegion[] regions= TextUtilities.computePartitioning(fDocument, fPartitioning, region.getOffset(), region.getLength(), false);
TypedPosition[] positions= new TypedPosition[regions.length];
@@ -804,7 +804,7 @@
* @exception BadLocationException if offset is invalid in document
* @since 3.0
*/
- private bool isLineStart(int offset) throws BadLocationException {
+ private bool isLineStart(int offset) {
int start= fDocument.getLineOfOffset(offset);
start= fDocument.getLineOffset(start);
return (start is offset);
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/link/LinkedModeModel.d
--- a/dwtx/jface/text/link/LinkedModeModel.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/link/LinkedModeModel.d Sun Aug 24 02:20:40 2008 +0200
@@ -313,7 +313,7 @@
* @throws BadLocationException if group
conflicts with this
* model's groups
*/
- private void enforceDisjoint(LinkedPositionGroup group) throws BadLocationException {
+ private void enforceDisjoint(LinkedPositionGroup group) {
for (Iterator it= fGroups.iterator(); it.hasNext(); ) {
LinkedPositionGroup g= cast(LinkedPositionGroup) it.next();
g.enforceDisjoint(group);
@@ -419,7 +419,7 @@
* @throws IllegalStateException if the method is called when the
* model is already sealed
*/
- public void addGroup(LinkedPositionGroup group) throws BadLocationException {
+ public void addGroup(LinkedPositionGroup group) {
if (group is null)
throw new IllegalArgumentException("group may not be null"); //$NON-NLS-1$
if (fIsSealed)
@@ -453,7 +453,7 @@
* @throws BadLocationException if some of the positions of this model
* were not valid positions on their respective documents
*/
- public void forceInstall() throws BadLocationException {
+ public void forceInstall() {
if (!install(true))
Assert.isTrue(false);
}
@@ -474,7 +474,7 @@
* @throws BadLocationException if some of the positions of this model
* were not valid positions on their respective documents
*/
- public bool tryInstall() throws BadLocationException {
+ public bool tryInstall() {
return install(false);
}
@@ -494,7 +494,7 @@
* @throws BadLocationException if some of the positions of this model
* were not valid positions on their respective documents
*/
- private bool install(bool force) throws BadLocationException {
+ private bool install(bool force) {
if (fIsSealed)
throw new IllegalStateException("model is already installed"); //$NON-NLS-1$
enforceNotEmpty();
@@ -700,7 +700,7 @@
* @throws BadLocationException if the position cannot be added to its
* document
*/
- void register(LinkedPosition position) throws BadLocationException {
+ void register(LinkedPosition position) {
Assert.isNotNull(position);
IDocument document= position.getDocument();
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/link/LinkedModeUI.d
--- a/dwtx/jface/text/link/LinkedModeUI.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/link/LinkedModeUI.d Sun Aug 24 02:20:40 2008 +0200
@@ -755,7 +755,7 @@
* @throws BadLocationException if the position is not valid in the viewer's
* document
*/
- public void setExitPosition(LinkedModeUITarget target, int offset, int length, int sequence) throws BadLocationException {
+ public void setExitPosition(LinkedModeUITarget target, int offset, int length, int sequence) {
// remove any existing exit position
if (fExitPosition !is null) {
fExitPosition.getDocument().removePosition(fExitPosition);
@@ -786,7 +786,7 @@
* @throws BadLocationException if the position is not valid in the
* viewer's document
*/
- public void setExitPosition(ITextViewer viewer, int offset, int length, int sequence) throws BadLocationException {
+ public void setExitPosition(ITextViewer viewer, int offset, int length, int sequence) {
setExitPosition(new EmptyTarget(viewer), offset, length, sequence);
}
@@ -1066,7 +1066,7 @@
* @throws BadPartitioningException
* @since 3.1
*/
- private String[] getContentTypes(IDocument document) throws BadPartitioningException {
+ private String[] getContentTypes(IDocument document) {
if (document instanceof IDocumentExtension3) {
IDocumentExtension3 ext= cast(IDocumentExtension3) document;
String[] partitionings= ext.getPartitionings();
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/link/LinkedPosition.d
--- a/dwtx/jface/text/link/LinkedPosition.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/link/LinkedPosition.d Sun Aug 24 02:20:40 2008 +0200
@@ -162,7 +162,7 @@
* @return the content of the document at this position
* @throws BadLocationException if the position is not valid
*/
- public String getContent() throws BadLocationException {
+ public String getContent() {
return fDocument.get(offset, length);
}
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/link/LinkedPositionAnnotations.d
--- a/dwtx/jface/text/link/LinkedPositionAnnotations.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/link/LinkedPositionAnnotations.d Sun Aug 24 02:20:40 2008 +0200
@@ -73,7 +73,7 @@
* @param position the new focus position, or null
if no focus is set.
* @throws BadLocationException if position
is invalid
*/
- private void setFocusPosition(Position position) throws BadLocationException {
+ private void setFocusPosition(Position position) {
if (fMarkFocus && getPosition(fFocusAnnotation) !is position) {
removeAnnotation(fFocusAnnotation, false);
if (position !is null) {
@@ -92,7 +92,7 @@
* @param position the new exit position, or null
if no focus is set.
* @throws BadLocationException in case position
is invalid
*/
- private void setExitPosition(Position position) throws BadLocationException {
+ private void setExitPosition(Position position) {
if (fMarkExitTarget && getPosition(fExitAnnotation) !is position) {
removeAnnotation(fExitAnnotation, false);
if (position !is null) {
@@ -110,7 +110,7 @@
* @param positions the new slave positions, or null
if no slave positions are to be set
* @throws BadLocationException in case any of the given positions is invalid
*/
- private void setGroupPositions(List positions) throws BadLocationException {
+ private void setGroupPositions(List positions) {
if (!fMarkSlaves)
return;
@@ -144,7 +144,7 @@
* @param positions the new target positions, or null
if no target positions are to be set
* @throws BadLocationException in case any of the given positions is invalid
*/
- private void setTargetPositions(List positions) throws BadLocationException {
+ private void setTargetPositions(List positions) {
if (!fMarkTargets)
return;
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/link/LinkedPositionGroup.d
--- a/dwtx/jface/text/link/LinkedPositionGroup.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/link/LinkedPositionGroup.d Sun Aug 24 02:20:40 2008 +0200
@@ -112,7 +112,7 @@
* @throws IllegalStateException if the group has already been added to a
* model
*/
- public void addPosition(LinkedPosition position) throws BadLocationException {
+ public void addPosition(LinkedPosition position) {
/*
* Enforces constraints and sets the custom iteration flag. If the
* position is already in this group, nothing happens.
@@ -136,7 +136,7 @@
* @param position the position to check
* @throws BadLocationException if the equal content check fails
*/
- private void enforceEqualContent(LinkedPosition position) throws BadLocationException {
+ private void enforceEqualContent(LinkedPosition position) {
if (fPositions.size() > 0) {
LinkedPosition groupPosition= cast(LinkedPosition) fPositions.get(0);
String groupContent= groupPosition.getContent();
@@ -154,7 +154,7 @@
* @param position the position to check
* @throws BadLocationException if the disjointness check fails
*/
- private void enforceDisjoint(LinkedPosition position) throws BadLocationException {
+ private void enforceDisjoint(LinkedPosition position) {
for (Iterator it= fPositions.iterator(); it.hasNext(); ) {
LinkedPosition p= cast(LinkedPosition) it.next();
if (p.overlapsWith(position))
@@ -168,7 +168,7 @@
* @param group the group to check
* @throws BadLocationException if the disjointness check fails
*/
- void enforceDisjoint(LinkedPositionGroup group) throws BadLocationException {
+ void enforceDisjoint(LinkedPositionGroup group) {
Assert.isNotNull(group);
for (Iterator it= group.fPositions.iterator(); it.hasNext(); ) {
LinkedPosition p= cast(LinkedPosition) it.next();
@@ -312,7 +312,7 @@
return docs;
}
- void register(LinkedModeModel model) throws BadLocationException {
+ void register(LinkedModeModel model) {
for (Iterator it= fPositions.iterator(); it.hasNext(); ) {
LinkedPosition pos= cast(LinkedPosition) it.next();
model.register(pos);
@@ -329,7 +329,7 @@
* @throws BadLocationException if more than one position are affected by
* group
*/
- LinkedPosition adopt(LinkedPositionGroup group) throws BadLocationException {
+ LinkedPosition adopt(LinkedPositionGroup group) {
LinkedPosition found= null;
for (Iterator it= group.fPositions.iterator(); it.hasNext(); ) {
LinkedPosition pos= cast(LinkedPosition) it.next();
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/presentation/PresentationReconciler.d
--- a/dwtx/jface/text/presentation/PresentationReconciler.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/presentation/PresentationReconciler.d Sun Aug 24 02:20:40 2008 +0200
@@ -535,7 +535,7 @@
* @return the damage end offset (excluding)
* @exception BadLocationException if method accesses invalid offset
*/
- private int getDamageEndOffset(DocumentEvent e) throws BadLocationException {
+ private int getDamageEndOffset(DocumentEvent e) {
IDocument d= e.getDocument();
@@ -596,7 +596,7 @@
* @throws BadLocationException if offset is invalid in the given document
* @since 3.0
*/
- private ITypedRegion getPartition(IDocument document, int offset) throws BadLocationException {
+ private ITypedRegion getPartition(IDocument document, int offset) {
return TextUtilities.getPartition(document, getDocumentPartitioning(), offset, false);
}
}
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/projection/ChildDocument.d
--- a/dwtx/jface/text/projection/ChildDocument.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/projection/ChildDocument.d Sun Aug 24 02:20:40 2008 +0200
@@ -100,7 +100,7 @@
* @param length the length of the range
* @throws BadLocationException if the given range is not valid
*/
- public void setParentDocumentRange(int offset, int length) throws BadLocationException {
+ public void setParentDocumentRange(int offset, int length) {
replaceMasterDocumentRanges(offset, length);
}
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/projection/ProjectionDocument.d
--- a/dwtx/jface/text/projection/ProjectionDocument.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/projection/ProjectionDocument.d Sun Aug 24 02:20:40 2008 +0200
@@ -298,7 +298,7 @@
* @throws BadLocationException if the given range is invalid in the master
* document
*/
- private void internalAddMasterDocumentRange(int offsetInMaster, int lengthInMaster, DocumentEvent masterDocumentEvent) throws BadLocationException {
+ private void internalAddMasterDocumentRange(int offsetInMaster, int lengthInMaster, DocumentEvent masterDocumentEvent) {
if (lengthInMaster is 0)
return;
@@ -405,7 +405,7 @@
* this projection document or is not completely comprised by
* an existing fragment
*/
- private void internalRemoveMasterDocumentRange(int offsetInMaster, int lengthInMaster) throws BadLocationException {
+ private void internalRemoveMasterDocumentRange(int offsetInMaster, int lengthInMaster) {
try {
IRegion imageRegion= fMapping.toExactImageRegion(new Region(offsetInMaster, lengthInMaster));
@@ -470,7 +470,7 @@
* @throws BadLocationException in case the given range is invalid in the
* master document
*/
- public final IRegion[] computeUnprojectedMasterRegions(int offsetInMaster, int lengthInMaster) throws BadLocationException {
+ public final IRegion[] computeUnprojectedMasterRegions(int offsetInMaster, int lengthInMaster) {
IRegion[] fragments= null;
IRegion imageRegion= fMapping.toImageRegion(new Region(offsetInMaster, lengthInMaster));
@@ -517,7 +517,7 @@
* master document
* @since 3.1
*/
- private IRegion computeFirstUnprojectedMasterRegion(int offsetInMaster, int lengthInMaster) throws BadLocationException {
+ private IRegion computeFirstUnprojectedMasterRegion(int offsetInMaster, int lengthInMaster) {
IRegion[] fragments= null;
IRegion imageRegion= fMapping.toImageRegion(new Region(offsetInMaster, lengthInMaster));
@@ -556,7 +556,7 @@
* @param lengthInMaster the length of the master document range
* @throws BadLocationException in case the master event is not valid
*/
- public void addMasterDocumentRange(int offsetInMaster, int lengthInMaster) throws BadLocationException {
+ public void addMasterDocumentRange(int offsetInMaster, int lengthInMaster) {
addMasterDocumentRange(offsetInMaster, lengthInMaster, null);
}
@@ -570,7 +570,7 @@
* projection change, or null
if none
* @throws BadLocationException in case the master event is not valid
*/
- private void addMasterDocumentRange(int offsetInMaster, int lengthInMaster, DocumentEvent masterDocumentEvent) throws BadLocationException {
+ private void addMasterDocumentRange(int offsetInMaster, int lengthInMaster, DocumentEvent masterDocumentEvent) {
/*
* Calling internalAddMasterDocumentRange may cause other master ranges
* to become unfolded, resulting in re-entrant calls to this method. In
@@ -601,7 +601,7 @@
* @param lengthInMaster the length of the master document range
* @throws BadLocationException in case the master event is not valid
*/
- public void removeMasterDocumentRange(int offsetInMaster, int lengthInMaster) throws BadLocationException {
+ public void removeMasterDocumentRange(int offsetInMaster, int lengthInMaster) {
IRegion[] fragments= computeProjectedMasterRegions(offsetInMaster, lengthInMaster);
if (fragments is null || fragments.length is 0)
return;
@@ -622,7 +622,7 @@
* @return the sequence of regions which are part of the projection document or null
* @throws BadLocationException in case the given range is invalid in the master document
*/
- public final IRegion[] computeProjectedMasterRegions(int offsetInMaster, int lengthInMaster) throws BadLocationException {
+ public final IRegion[] computeProjectedMasterRegions(int offsetInMaster, int lengthInMaster) {
IRegion imageRegion= fMapping.toImageRegion(new Region(offsetInMaster, lengthInMaster));
return imageRegion !is null ? fMapping.toExactOriginRegions(imageRegion) : null;
}
@@ -639,7 +639,7 @@
/*
* @see dwtx.jface.text.IDocument#replace(int, int, java.lang.String)
*/
- public void replace(int offset, int length, String text) throws BadLocationException {
+ public void replace(int offset, int length, String text) {
try {
fIsUpdating= true;
if (fMasterDocumentExtension !is null)
@@ -680,7 +680,7 @@
* @return the slave document event
* @throws BadLocationException in case the master event is not valid
*/
- private ProjectionDocumentEvent normalize(DocumentEvent masterEvent) throws BadLocationException {
+ private ProjectionDocumentEvent normalize(DocumentEvent masterEvent) {
if (!isUpdating()) {
IRegion imageRegion= fMapping.toExactImageRegion(new Region(masterEvent.getOffset(), masterEvent.getLength()));
if (imageRegion !is null)
@@ -701,7 +701,7 @@
* @return true
if masterEvent affects this projection document
* @throws BadLocationException in case the master event is not valid
*/
- protected final bool adaptProjectionToMasterChange(DocumentEvent masterEvent) throws BadLocationException {
+ protected final bool adaptProjectionToMasterChange(DocumentEvent masterEvent) {
if (!isUpdating() && fFragmentsUpdater.affectsPositions(masterEvent) || fIsAutoExpanding && masterEvent.getLength() > 0) {
addMasterDocumentRange(masterEvent.getOffset(), masterEvent.getLength(), masterEvent);
@@ -891,7 +891,7 @@
* @param lengthInMaster the length in the master document
* @throws BadLocationException if the given range of the master document is not valid
*/
- public void replaceMasterDocumentRanges(int offsetInMaster, int lengthInMaster) throws BadLocationException {
+ public void replaceMasterDocumentRanges(int offsetInMaster, int lengthInMaster) {
try {
ProjectionDocumentEvent event= new ProjectionDocumentEvent(this, 0, fMapping.getImageLength(), fMasterDocument.get(offsetInMaster, lengthInMaster), offsetInMaster, lengthInMaster);
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/projection/ProjectionMapping.d
--- a/dwtx/jface/text/projection/ProjectionMapping.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/projection/ProjectionMapping.d Sun Aug 24 02:20:40 2008 +0200
@@ -114,7 +114,7 @@
return fCachedFragments;
}
- private int findSegmentIndex(int offset) throws BadLocationException {
+ private int findSegmentIndex(int offset) {
Position[] segments= getSegments();
if (segments.length is 0) {
if (offset > 0)
@@ -140,7 +140,7 @@
}
}
- private Segment findSegment(int offset) throws BadLocationException {
+ private Segment findSegment(int offset) {
checkImageOffset(offset);
@@ -181,7 +181,7 @@
* @throws BadLocationException if the index is not valid on the master
* document
*/
- private int findFragmentIndex(int offset, int extensionDirection) throws BadLocationException {
+ private int findFragmentIndex(int offset, int extensionDirection) {
try {
Position[] fragments= getFragments();
@@ -211,7 +211,7 @@
}
}
- private Fragment findFragment(int offset) throws BadLocationException {
+ private Fragment findFragment(int offset) {
checkOriginOffset(offset);
int index= findFragmentIndex(offset, NONE);
@@ -242,7 +242,7 @@
* @return the image region of originRegion
* @throws BadLocationException if the region is not a valid origin region
*/
- private IRegion toImageRegion(IRegion originRegion, bool exact, bool takeClosestImage) throws BadLocationException {
+ private IRegion toImageRegion(IRegion originRegion, bool exact, bool takeClosestImage) {
if (originRegion.getLength() is 0 && !takeClosestImage) {
int imageOffset= toImageOffset(originRegion.getOffset());
return imageOffset is -1 ? null : new Region(imageOffset, 0);
@@ -305,7 +305,7 @@
* not exist
* @throws BadLocationException if the region is not a valid origin region
*/
- private Fragment[] findFragments(IRegion originRegion, bool exact, bool takeClosestImage) throws BadLocationException {
+ private Fragment[] findFragments(IRegion originRegion, bool exact, bool takeClosestImage) {
Position[] fragments= getFragments();
if (fragments.length is 0)
return null;
@@ -388,7 +388,7 @@
/*
* @see dwtx.jface.text.IDocumentInformationMapping#toOriginOffset(int)
*/
- public int toOriginOffset(int imageOffset) throws BadLocationException {
+ public int toOriginOffset(int imageOffset) {
Segment segment= findSegment(imageOffset);
int relative= imageOffset - segment.offset;
return segment.fragment.offset + relative;
@@ -397,7 +397,7 @@
/*
* @see dwtx.jface.text.IDocumentInformationMapping#toOriginRegion(dwtx.jface.text.IRegion)
*/
- public IRegion toOriginRegion(IRegion imageRegion) throws BadLocationException {
+ public IRegion toOriginRegion(IRegion imageRegion) {
int imageOffset= imageRegion.getOffset();
int imageLength= imageRegion.getLength();
@@ -420,7 +420,7 @@
/*
* @see dwtx.jface.text.IDocumentInformationMapping#toOriginLines(int)
*/
- public IRegion toOriginLines(int imageLine) throws BadLocationException {
+ public IRegion toOriginLines(int imageLine) {
IRegion imageRegion= fSlaveDocument.getLineInformation(imageLine);
IRegion originRegion= toOriginRegion(imageRegion);
@@ -435,7 +435,7 @@
/*
* @see dwtx.jface.text.IDocumentInformationMapping#toOriginLine(int)
*/
- public int toOriginLine(int imageLine) throws BadLocationException {
+ public int toOriginLine(int imageLine) {
IRegion lines= toOriginLines(imageLine);
return (lines.getLength() > 1 ? -1 : lines.getOffset());
}
@@ -443,7 +443,7 @@
/*
* @see dwtx.jface.text.IDocumentInformationMapping#toImageOffset(int)
*/
- public int toImageOffset(int originOffset) throws BadLocationException {
+ public int toImageOffset(int originOffset) {
Fragment fragment= findFragment(originOffset);
if (fragment !is null) {
int relative= originOffset - fragment.offset;
@@ -455,14 +455,14 @@
/*
* @see dwtx.jface.text.IDocumentInformationMappingExtension#toExactImageRegion(dwtx.jface.text.IRegion)
*/
- public IRegion toExactImageRegion(IRegion originRegion) throws BadLocationException {
+ public IRegion toExactImageRegion(IRegion originRegion) {
return toImageRegion(originRegion, true, false);
}
/*
* @see dwtx.jface.text.IDocumentInformationMapping#toImageRegion(dwtx.jface.text.IRegion)
*/
- public IRegion toImageRegion(IRegion originRegion) throws BadLocationException {
+ public IRegion toImageRegion(IRegion originRegion) {
return toImageRegion(originRegion, false, false);
}
@@ -470,14 +470,14 @@
* @see dwtx.jface.text.IDocumentInformationMappingExtension2#toClosestImageRegion(dwtx.jface.text.IRegion)
* @since 3.1
*/
- public IRegion toClosestImageRegion(IRegion originRegion) throws BadLocationException {
+ public IRegion toClosestImageRegion(IRegion originRegion) {
return toImageRegion(originRegion, false, true);
}
/*
* @see dwtx.jface.text.IDocumentInformationMapping#toImageLine(int)
*/
- public int toImageLine(int originLine) throws BadLocationException {
+ public int toImageLine(int originLine) {
IRegion originRegion= fMasterDocument.getLineInformation(originLine);
IRegion imageRegion= toImageRegion(originRegion);
if (imageRegion is null) {
@@ -502,7 +502,7 @@
/*
* @see dwtx.jface.text.IDocumentInformationMapping#toClosestImageLine(int)
*/
- public int toClosestImageLine(int originLine) throws BadLocationException {
+ public int toClosestImageLine(int originLine) {
try {
int imageLine= toImageLine(originLine);
@@ -546,7 +546,7 @@
/*
* @see dwtx.jface.text.IDocumentInformationMappingExtension#toExactOriginRegions(dwtx.jface.text.IRegion)
*/
- public IRegion[] toExactOriginRegions(IRegion imageRegion) throws BadLocationException {
+ public IRegion[] toExactOriginRegions(IRegion imageRegion) {
if (imageRegion.getLength() is 0)
return new IRegion[] { new Region(toOriginOffset(imageRegion.getOffset()), 0) };
@@ -597,7 +597,7 @@
/*
* @see dwtx.jface.text.IDocumentInformationMappingExtension#toExactImageRegions(dwtx.jface.text.IRegion)
*/
- public IRegion[] toExactImageRegions(IRegion originRegion) throws BadLocationException {
+ public IRegion[] toExactImageRegions(IRegion originRegion) {
int offset= originRegion.getOffset();
if (originRegion.getLength() is 0) {
@@ -642,7 +642,7 @@
/*
* @see dwtx.jface.text.IDocumentInformationMappingExtension#getExactCoverage(dwtx.jface.text.IRegion)
*/
- public IRegion[] getExactCoverage(IRegion originRegion) throws BadLocationException {
+ public IRegion[] getExactCoverage(IRegion originRegion) {
int originOffset= originRegion.getOffset();
int originLength= originRegion.getLength();
@@ -686,7 +686,7 @@
return result;
}
- private final void checkOriginRegion(IRegion originRegion) throws BadLocationException {
+ private final void checkOriginRegion(IRegion originRegion) {
int offset= originRegion.getOffset();
int endOffset= inclusiveEnd(originRegion);
int max= fMasterDocument.getLength();
@@ -694,12 +694,12 @@
throw new BadLocationException();
}
- private final void checkOriginOffset(int originOffset) throws BadLocationException {
+ private final void checkOriginOffset(int originOffset) {
if (originOffset < 0 || originOffset > fMasterDocument.getLength())
throw new BadLocationException();
}
- private final void checkImageOffset(int imageOffset) throws BadLocationException {
+ private final void checkImageOffset(int imageOffset) {
if (imageOffset < 0 || imageOffset > getImageLength())
throw new BadLocationException();
}
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/revisions/Revision.d
--- a/dwtx/jface/text/revisions/Revision.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/revisions/Revision.d Sun Aug 24 02:20:40 2008 +0200
@@ -66,7 +66,7 @@
* @param range a line range that was changed with this revision
* @throws IndexOutOfBoundsException if the line range is empty or has a negative start line
*/
- public final void addRange(ILineRange range) throws IndexOutOfBoundsException {
+ public final void addRange(ILineRange range) {
fChangeRegions.add(new ChangeRegion(this, range));
}
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/rules/DefaultDamagerRepairer.d
--- a/dwtx/jface/text/rules/DefaultDamagerRepairer.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/rules/DefaultDamagerRepairer.d Sun Aug 24 02:20:40 2008 +0200
@@ -131,7 +131,7 @@
* @return the line end offset for the given offset
* @exception BadLocationException if offset is invalid in the current document
*/
- protected int endOfLineOf(int offset) throws BadLocationException {
+ protected int endOfLineOf(int offset) {
IRegion info= fDocument.getLineInformationOfOffset(offset);
if (offset <= info.getOffset() + info.getLength())
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/rules/DefaultPartitioner.d
--- a/dwtx/jface/text/rules/DefaultPartitioner.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/rules/DefaultPartitioner.d Sun Aug 24 02:20:40 2008 +0200
@@ -719,7 +719,7 @@
* @see dwtx.jface.text.IDocumentPartitionerExtension3#startRewriteSession(dwtx.jface.text.DocumentRewriteSession)
* @since 3.1
*/
- public void startRewriteSession(DocumentRewriteSession session) throws IllegalStateException {
+ public void startRewriteSession(DocumentRewriteSession session) {
if (fActiveRewriteSession !is null)
throw new IllegalStateException();
fActiveRewriteSession= session;
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/rules/FastPartitioner.d
--- a/dwtx/jface/text/rules/FastPartitioner.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/rules/FastPartitioner.d Sun Aug 24 02:20:40 2008 +0200
@@ -761,7 +761,7 @@
/*
* @see dwtx.jface.text.IDocumentPartitionerExtension3#startRewriteSession(dwtx.jface.text.DocumentRewriteSession)
*/
- public void startRewriteSession(DocumentRewriteSession session) throws IllegalStateException {
+ public void startRewriteSession(DocumentRewriteSession session) {
if (fActiveRewriteSession !is null)
throw new IllegalStateException();
fActiveRewriteSession= session;
@@ -821,7 +821,7 @@
* @throws BadPositionCategoryException if getting the positions from the
* document fails
*/
- protected final Position[] getPositions() throws BadPositionCategoryException {
+ protected final Position[] getPositions() {
if (fCachedPositions is null) {
fCachedPositions= fDocument.getPositions(fPositionCategory);
} else if cast(CHECK_CACHE_CONSISTENCY) {
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/source/AnnotationBarHoverManager.d
--- a/dwtx/jface/text/source/AnnotationBarHoverManager.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/source/AnnotationBarHoverManager.d Sun Aug 24 02:20:40 2008 +0200
@@ -556,7 +556,7 @@
* @return the corresponding character range
* @throws BadLocationException in case the given line range is invalid
*/
- private IRegion convertToRegion(ILineRange lineRange) throws BadLocationException {
+ private IRegion convertToRegion(ILineRange lineRange) {
IDocument document= fSourceViewer.getDocument();
int startOffset= document.getLineOffset(lineRange.getStartLine());
int endLine= lineRange.getStartLine() + Math.max(0, lineRange.getNumberOfLines() - 1);
@@ -574,7 +574,7 @@
* @return the region of the set that contains the line
* @throws BadLocationException in case line is invalid
*/
- private IRegion findRegionContainingLine(IRegion[] regions, int line) throws BadLocationException {
+ private IRegion findRegionContainingLine(IRegion[] regions, int line) {
IDocument document= fSourceViewer.getDocument();
IRegion lineInfo= document.getLineInformation(line);
for (int i= 0; i < regions.length; i++) {
@@ -591,7 +591,7 @@
* @return the corresponding line range
* @throws BadLocationException in case the given region in invalid
*/
- private ILineRange convertToLineRange(IRegion region) throws BadLocationException {
+ private ILineRange convertToLineRange(IRegion region) {
IDocument document= fSourceViewer.getDocument();
int startLine= document.getLineOfOffset(region.getOffset());
int endLine= document.getLineOfOffset(region.getOffset() + region.getLength());
@@ -676,7 +676,7 @@
* @return the line number relative to the viewer's visible region
* @throws BadLocationException if line
is not valid in the viewer's document
*/
- private int getWidgetLineNumber(int line) throws BadLocationException {
+ private int getWidgetLineNumber(int line) {
if (fSourceViewer instanceof ITextViewerExtension5) {
ITextViewerExtension5 extension= cast(ITextViewerExtension5) fSourceViewer;
return extension.modelLine2WidgetLine(line);
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/source/AnnotationModel.d
--- a/dwtx/jface/text/source/AnnotationModel.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/source/AnnotationModel.d Sun Aug 24 02:20:40 2008 +0200
@@ -467,7 +467,7 @@
* invalid position
* @since 3.0
*/
- protected void replaceAnnotations(Annotation[] annotationsToRemove, Map annotationsToAdd, bool fireModelChanged) throws BadLocationException {
+ protected void replaceAnnotations(Annotation[] annotationsToRemove, Map annotationsToAdd, bool fireModelChanged) {
if (annotationsToRemove !is null) {
for (int i= 0, length= annotationsToRemove.length; i < length; i++)
@@ -499,7 +499,7 @@
* @param fireModelChanged indicates whether to notify all model listeners
* @throws BadLocationException if the position is not a valid document position
*/
- protected void addAnnotation(Annotation annotation, Position position, bool fireModelChanged) throws BadLocationException {
+ protected void addAnnotation(Annotation annotation, Position position, bool fireModelChanged) {
if (!fAnnotations.containsKey(annotation)) {
addPosition(fDocument, position);
@@ -538,7 +538,7 @@
* @param position the position to add
* @throws BadLocationException if the position is not a valid document position
*/
- protected void addPosition(IDocument document, Position position) throws BadLocationException {
+ protected void addPosition(IDocument document, Position position) {
if (document !is null)
document.addPosition(position);
}
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/source/DefaultCharacterPairMatcher.d
--- a/dwtx/jface/text/source/DefaultCharacterPairMatcher.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/source/DefaultCharacterPairMatcher.d Sun Aug 24 02:20:40 2008 +0200
@@ -152,7 +152,7 @@
/*
* Performs the actual work of matching for #match(IDocument, int).
*/
- private IRegion performMatch(IDocument doc, int caretOffset) throws BadLocationException {
+ private IRegion performMatch(IDocument doc, int caretOffset) {
final int charOffset= caretOffset - 1;
final char prevChar= doc.getChar(Math.max(charOffset, 0));
if (!fPairs.contains(prevChar)) return null;
@@ -184,7 +184,7 @@
* @return the index of the end character if it was found, otherwise -1
* @throws BadLocationException
*/
- private int findMatchingPeer(DocumentPartitionAccessor doc, char start, char end, bool searchForward, int boundary, int startPos) throws BadLocationException {
+ private int findMatchingPeer(DocumentPartitionAccessor doc, char start, char end, bool searchForward, int boundary, int startPos) {
int pos= startPos;
while (pos !is boundary) {
final char c= doc.getChar(pos);
@@ -246,7 +246,7 @@
* @return the character at the offset
* @throws BadLocationException
*/
- public char getChar(int pos) throws BadLocationException {
+ public char getChar(int pos) {
return fDocument.getChar(pos);
}
@@ -261,7 +261,7 @@
* @return true exactly if the position represents a valid match
* @throws BadLocationException
*/
- public bool isMatch(int pos, char end) throws BadLocationException {
+ public bool isMatch(int pos, char end) {
return getChar(pos) is end && inPartition(pos);
}
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/source/projection/ProjectionAnnotationHover.d
--- a/dwtx/jface/text/source/projection/ProjectionAnnotationHover.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/source/projection/ProjectionAnnotationHover.d Sun Aug 24 02:20:40 2008 +0200
@@ -139,7 +139,7 @@
return null;
}
- private String getText(IDocument document, int offset, int length, int numberOfLines) throws BadLocationException {
+ private String getText(IDocument document, int offset, int length, int numberOfLines) {
int endOffset= offset + length;
try {
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/source/projection/ProjectionViewer.d
--- a/dwtx/jface/text/source/projection/ProjectionViewer.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/source/projection/ProjectionViewer.d Sun Aug 24 02:20:40 2008 +0200
@@ -419,7 +419,7 @@
/*
* @see dwtx.jface.text.TextViewer#updateSlaveDocument(dwtx.jface.text.IDocument, int, int)
*/
- protected bool updateSlaveDocument(IDocument slaveDocument, int modelRangeOffset, int modelRangeLength) throws BadLocationException {
+ protected bool updateSlaveDocument(IDocument slaveDocument, int modelRangeOffset, int modelRangeLength) {
if (slaveDocument instanceof ProjectionDocument) {
ProjectionDocument projection= cast(ProjectionDocument) slaveDocument;
@@ -630,7 +630,7 @@
*
* @see ProjectionDocument#addMasterDocumentRange(int, int)
*/
- private void addMasterDocumentRange(ProjectionDocument projection, int offset, int length) throws BadLocationException {
+ private void addMasterDocumentRange(ProjectionDocument projection, int offset, int length) {
if (fCommandQueue !is null) {
fCommandQueue.add(new ProjectionCommand(projection, ProjectionCommand.ADD, offset, length));
@@ -661,7 +661,7 @@
*
* @see ProjectionDocument#removeMasterDocumentRange(int, int)
*/
- private void removeMasterDocumentRange(ProjectionDocument projection, int offset, int length) throws BadLocationException {
+ private void removeMasterDocumentRange(ProjectionDocument projection, int offset, int length) {
if (fCommandQueue !is null) {
fCommandQueue.add(new ProjectionCommand(projection, ProjectionCommand.REMOVE, offset, length));
} else {
@@ -690,7 +690,7 @@
* @throws BadLocationException if the offset is invalid
* @since 3.2
*/
- private int toLineStart(IDocument document, int offset, bool testLastLine) throws BadLocationException {
+ private int toLineStart(IDocument document, int offset, bool testLastLine) {
if (document is null)
return offset;
@@ -801,7 +801,7 @@
* @param fireRedraw true
if a redraw request should be issued, false
otherwise
* @throws BadLocationException in case the range is invalid
*/
- private void collapse(int offset, int length, bool fireRedraw) throws BadLocationException {
+ private void collapse(int offset, int length, bool fireRedraw) {
ProjectionDocument projection= null;
IDocument visibleDocument= getVisibleDocument();
@@ -841,7 +841,7 @@
* false
otherwise
* @throws BadLocationException in case the range is invalid
*/
- private void expand(int offset, int length, bool fireRedraw) throws BadLocationException {
+ private void expand(int offset, int length, bool fireRedraw) {
IDocument slave= getVisibleDocument();
if (slave instanceof ProjectionDocument) {
ProjectionDocument projection= cast(ProjectionDocument) slave;
@@ -958,7 +958,7 @@
* @param event the annotation model event or null
* @exception BadLocationException in case the annotation model event is no longer in synchronization with the document
*/
- private void catchupWithProjectionAnnotationModel(AnnotationModelEvent event) throws BadLocationException {
+ private void catchupWithProjectionAnnotationModel(AnnotationModelEvent event) {
if (event is null || !isVisibleMasterDocumentSameAsDocument()) {
@@ -1019,7 +1019,7 @@
}
}
- private void executeProjectionCommands(ProjectionCommandQueue commandQueue, bool fireRedraw) throws BadLocationException {
+ private void executeProjectionCommands(ProjectionCommandQueue commandQueue, bool fireRedraw) {
ProjectionCommand command;
Iterator e= commandQueue.iterator();
@@ -1084,7 +1084,7 @@
/*
* We pass the removed annotation into this method for performance reasons only. Otherwise, they could be fetch from the event.
*/
- private void processDeletions(AnnotationModelEvent event, Annotation[] removedAnnotations, bool fireRedraw) throws BadLocationException {
+ private void processDeletions(AnnotationModelEvent event, Annotation[] removedAnnotations, bool fireRedraw) {
for (int i= 0; i < removedAnnotations.length; i++) {
ProjectionAnnotation annotation= cast(ProjectionAnnotation) removedAnnotations[i];
if (annotation.isCollapsed()) {
@@ -1178,7 +1178,7 @@
return null;
}
- private void processChanges(Annotation[] annotations, bool fireRedraw, List coverage) throws BadLocationException {
+ private void processChanges(Annotation[] annotations, bool fireRedraw, List coverage) {
for (int i= 0; i < annotations.length; i++) {
ProjectionAnnotation annotation= cast(ProjectionAnnotation) annotations[i];
Position position= fProjectionAnnotationModel.getPosition(annotation);
@@ -1216,7 +1216,7 @@
*
* @throws BadLocationException in case something goes wrong during initialization
*/
- public final void reinitializeProjection() throws BadLocationException {
+ public final void reinitializeProjection() {
ProjectionDocument projection= null;
@@ -1622,7 +1622,7 @@
}
}
- private void deleteTextRange(int offset, int length, StyledText textWidget) throws BadLocationException {
+ private void deleteTextRange(int offset, int length, StyledText textWidget) {
getDocument().replace(offset, length, ""); //$NON-NLS-1$
int widgetCaret= modelOffset2WidgetOffset(offset);
if (widgetCaret > -1)
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/templates/TemplateContextType.d
--- a/dwtx/jface/text/templates/TemplateContextType.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/templates/TemplateContextType.d Sun Aug 24 02:20:40 2008 +0200
@@ -141,7 +141,7 @@
* @throws RuntimeException an unspecified exception if the id has already
* been set on this context type
*/
- public final void setId(String id) throws RuntimeException {
+ public final void setId(String id) {
Assert.isNotNull(id);
Assert.isTrue(fId is null); // may only be called once when the context is instantiated
fId= id;
@@ -217,7 +217,7 @@
* @param pattern the template pattern to validate
* @throws TemplateException if the pattern is invalid
*/
- public void validate(String pattern) throws TemplateException {
+ public void validate(String pattern) {
TemplateTranslator translator= new TemplateTranslator();
TemplateBuffer buffer= translator.translate(pattern);
validateVariables(buffer.getVariables());
@@ -235,7 +235,7 @@
* @throws TemplateException if one of the variables is not valid in this
* context type
*/
- protected void validateVariables(TemplateVariable[] variables) throws TemplateException {
+ protected void validateVariables(TemplateVariable[] variables) {
}
/**
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/templates/TemplateTranslator.d
--- a/dwtx/jface/text/templates/TemplateTranslator.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/templates/TemplateTranslator.d Sun Aug 24 02:20:40 2008 +0200
@@ -116,7 +116,7 @@
fType= type;
}
- void mergeType(TemplateVariableType type) throws TemplateException {
+ void mergeType(TemplateVariableType type) {
if (type is null)
return;
if (fType is null)
@@ -155,7 +155,7 @@
* @see #getErrorMessage()
* @throws TemplateException if translation failed
*/
- public TemplateBuffer translate(Template template) throws TemplateException {
+ public TemplateBuffer translate(Template template) {
return parse(template.getPattern());
}
@@ -169,7 +169,7 @@
* @see #getErrorMessage()
* @throws TemplateException if translation failed
*/
- public TemplateBuffer translate(String string) throws TemplateException {
+ public TemplateBuffer translate(String string) {
return parse(string);
}
@@ -180,7 +180,7 @@
* @return the parsed TemplateBuffer
* @throws TemplateException if the string does not conform to the template format
*/
- private TemplateBuffer parse(String string) throws TemplateException {
+ private TemplateBuffer parse(String string) {
fErrorMessage= null;
final StringBuffer buffer= new StringBuffer(string.length());
@@ -240,7 +240,7 @@
return new TemplateVariableType(typeName, (String[]) params.toArray(new String[params.size()]));
}
- private void fail(String message) throws TemplateException {
+ private void fail(String message) {
fErrorMessage= message;
throw new TemplateException(message);
}
@@ -257,7 +257,7 @@
* @throws TemplateException if merging the type fails
* @since 3.3
*/
- private void updateOrCreateVariable(Map variables, String name, TemplateVariableType type, int offset) throws TemplateException {
+ private void updateOrCreateVariable(Map variables, String name, TemplateVariableType type, int offset) {
VariableDescription varDesc= cast(VariableDescription) variables.get(name);
if (varDesc is null) {
varDesc= new VariableDescription(name, type);
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/templates/persistence/TemplateReaderWriter.d
--- a/dwtx/jface/text/templates/persistence/TemplateReaderWriter.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/templates/persistence/TemplateReaderWriter.d Sun Aug 24 02:20:40 2008 +0200
@@ -92,7 +92,7 @@
* @return the read templates, encapsulated in instances of TemplatePersistenceData
* @throws IOException if reading from the stream fails
*/
- public TemplatePersistenceData[] read(Reader reader) throws IOException {
+ public TemplatePersistenceData[] read(Reader reader) {
return read(reader, null);
}
@@ -108,7 +108,7 @@
* @throws IOException if reading from the stream fails
* @since 3.1
*/
- public TemplatePersistenceData readSingle(Reader reader, String id) throws IOException {
+ public TemplatePersistenceData readSingle(Reader reader, String id) {
TemplatePersistenceData[] datas= read(new InputSource(reader), null, id);
if (datas.length > 0)
return datas[0];
@@ -123,7 +123,7 @@
* @return the read templates, encapsulated in instances of TemplatePersistenceData
* @throws IOException if reading from the stream fails
*/
- public TemplatePersistenceData[] read(Reader reader, ResourceBundle bundle) throws IOException {
+ public TemplatePersistenceData[] read(Reader reader, ResourceBundle bundle) {
return read(new InputSource(reader), bundle, null);
}
@@ -135,7 +135,7 @@
* @return the read templates, encapsulated in instances of TemplatePersistenceData
* @throws IOException if reading from the stream fails
*/
- public TemplatePersistenceData[] read(InputStream stream, ResourceBundle bundle) throws IOException {
+ public TemplatePersistenceData[] read(InputStream stream, ResourceBundle bundle) {
return read(new InputSource(stream), bundle, null);
}
@@ -148,7 +148,7 @@
* @return the read templates, encapsulated in instances of TemplatePersistenceData
* @throws IOException if reading from the stream fails
*/
- private TemplatePersistenceData[] read(InputSource source, ResourceBundle bundle, String singleId) throws IOException {
+ private TemplatePersistenceData[] read(InputSource source, ResourceBundle bundle, String singleId) {
try {
Collection templates= new ArrayList();
Set ids= new HashSet();
@@ -234,7 +234,7 @@
* @param stream the byte output to write the templates to in XML
* @throws IOException if writing the templates fails
*/
- public void save(TemplatePersistenceData[] templates, OutputStream stream) throws IOException {
+ public void save(TemplatePersistenceData[] templates, OutputStream stream) {
save(templates, new StreamResult(stream));
}
@@ -245,7 +245,7 @@
* @param writer the writer to write the templates to in XML
* @throws IOException if writing the templates fails
*/
- public void save(TemplatePersistenceData[] templates, Writer writer) throws IOException {
+ public void save(TemplatePersistenceData[] templates, Writer writer) {
save(templates, new StreamResult(writer));
}
@@ -256,7 +256,7 @@
* @param result the stream result to write to
* @throws IOException if writing the templates fails
*/
- private void save(TemplatePersistenceData[] templates, StreamResult result) throws IOException {
+ private void save(TemplatePersistenceData[] templates, StreamResult result) {
try {
DocumentBuilderFactory factory= DocumentBuilderFactory.newInstance();
DocumentBuilder builder= factory.newDocumentBuilder();
@@ -336,7 +336,7 @@
}
}
- private bool getBooleanValue(NamedNodeMap attributes, String attribute, bool defaultValue) throws SAXException {
+ private bool getBooleanValue(NamedNodeMap attributes, String attribute, bool defaultValue) {
Node enabledNode= attributes.getNamedItem(attribute);
if (enabledNode is null)
return defaultValue;
@@ -348,7 +348,7 @@
throw new SAXException(TemplatePersistenceMessages.getString("TemplateReaderWriter.error.illegal_boolean_attribute")); //$NON-NLS-1$
}
- private String getStringValue(NamedNodeMap attributes, String name) throws SAXException {
+ private String getStringValue(NamedNodeMap attributes, String name) {
String val= getStringValue(attributes, name, null);
if (val is null)
throw new SAXException(TemplatePersistenceMessages.getString("TemplateReaderWriter.error.missing_attribute")); //$NON-NLS-1$
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/jface/text/templates/persistence/TemplateStore.d
--- a/dwtx/jface/text/templates/persistence/TemplateStore.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/jface/text/templates/persistence/TemplateStore.d Sun Aug 24 02:20:40 2008 +0200
@@ -110,7 +110,7 @@
*
* @throws IOException if loading fails.
*/
- public void load() throws IOException {
+ public void load() {
fTemplates.clear();
loadContributedTemplates();
loadCustomTemplates();
@@ -178,7 +178,7 @@
*
* @throws IOException if loading fails
*/
- protected void loadContributedTemplates() throws IOException {
+ protected void loadContributedTemplates() {
}
/**
@@ -205,7 +205,7 @@
*
* @throws IOException if the templates cannot be written
*/
- public void save() throws IOException {
+ public void save() {
ArrayList custom= new ArrayList();
for (Iterator it= fTemplates.iterator(); it.hasNext();) {
TemplatePersistenceData data= cast(TemplatePersistenceData) it.next();
@@ -408,7 +408,7 @@
return null;
}
- private void loadCustomTemplates() throws IOException {
+ private void loadCustomTemplates() {
String pref= fPreferenceStore.getString(fKey);
if (pref !is null && pref.trim().length() > 0) {
Reader input= new StringReader(pref);
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/text/edits/CopySourceEdit.d
--- a/dwtx/text/edits/CopySourceEdit.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/text/edits/CopySourceEdit.d Sun Aug 24 02:20:40 2008 +0200
@@ -162,7 +162,7 @@
* @exception MalformedTreeException is thrown if the target edit
* is a direct or indirect child of the source edit
*/
- public void setTargetEdit(CopyTargetEdit edit) throws MalformedTreeException {
+ public void setTargetEdit(CopyTargetEdit edit) {
Assert.isNotNull(edit);
if (fTarget !is edit) {
fTarget= edit;
@@ -260,7 +260,7 @@
return result;
}
- void performConsistencyCheck(TextEditProcessor processor, IDocument document) throws MalformedTreeException {
+ void performConsistencyCheck(TextEditProcessor processor, IDocument document) {
if (fTarget is null)
throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("CopySourceEdit.no_target")); //$NON-NLS-1$
if (fTarget.getSourceEdit() !is this)
@@ -311,7 +311,7 @@
return fModifier !is null;
}
- private void applyTransformation(IDocument document) throws MalformedTreeException {
+ private void applyTransformation(IDocument document) {
TextEdit newEdit= new MultiTextEdit(0, document.getLength());
ReplaceEdit[] replaces= fModifier.getModifications(document.get());
for (int i= 0; i < replaces.length; i++) {
@@ -326,7 +326,7 @@
//---- document updating ----------------------------------------------------------------
- int performDocumentUpdating(IDocument document) throws BadLocationException {
+ int performDocumentUpdating(IDocument document) {
fDelta= 0;
return fDelta;
}
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/text/edits/CopyTargetEdit.d
--- a/dwtx/text/edits/CopyTargetEdit.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/text/edits/CopyTargetEdit.d Sun Aug 24 02:20:40 2008 +0200
@@ -108,7 +108,7 @@
* @exception MalformedTreeException is thrown if the target edit
* is a direct or indirect child of the source edit
*/
- public void setSourceEdit(CopySourceEdit edit) throws MalformedTreeException {
+ public void setSourceEdit(CopySourceEdit edit) {
Assert.isNotNull(edit);
if (fSource !is edit) {
fSource= edit;
@@ -161,7 +161,7 @@
/*
* @see TextEdit#performConsistencyCheck
*/
- void performConsistencyCheck(TextEditProcessor processor, IDocument document) throws MalformedTreeException {
+ void performConsistencyCheck(TextEditProcessor processor, IDocument document) {
if (fSource is null)
throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("CopyTargetEdit.no_source")); //$NON-NLS-1$
if (fSource.getTargetEdit() !is this)
@@ -171,7 +171,7 @@
/*
* @see TextEdit#performDocumentUpdating
*/
- int performDocumentUpdating(IDocument document) throws BadLocationException {
+ int performDocumentUpdating(IDocument document) {
String source= fSource.getContent();
document.replace(getOffset(), getLength(), source);
fDelta= source.length() - getLength();
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/text/edits/CopyingRangeMarker.d
--- a/dwtx/text/edits/CopyingRangeMarker.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/text/edits/CopyingRangeMarker.d Sun Aug 24 02:20:40 2008 +0200
@@ -90,7 +90,7 @@
/*
* @see TextEdit#performDocumentUpdating
*/
- int performDocumentUpdating(IDocument document) throws BadLocationException {
+ int performDocumentUpdating(IDocument document) {
fText= document.get(getOffset(), getLength());
fDelta= 0;
return fDelta;
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/text/edits/DeleteEdit.d
--- a/dwtx/text/edits/DeleteEdit.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/text/edits/DeleteEdit.d Sun Aug 24 02:20:40 2008 +0200
@@ -87,7 +87,7 @@
/*
* @see TextEdit#performDocumentUpdating
*/
- int performDocumentUpdating(IDocument document) throws BadLocationException {
+ int performDocumentUpdating(IDocument document) {
document.replace(getOffset(), getLength(), ""); //$NON-NLS-1$
fDelta= -getLength();
return fDelta;
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/text/edits/EditDocument.d
--- a/dwtx/text/edits/EditDocument.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/text/edits/EditDocument.d Sun Aug 24 02:20:40 2008 +0200
@@ -64,7 +64,7 @@
throw new UnsupportedOperationException();
}
- public void addPosition(Position position) throws BadLocationException {
+ public void addPosition(Position position) {
throw new UnsupportedOperationException();
}
@@ -92,7 +92,7 @@
throw new UnsupportedOperationException();
}
- public ITypedRegion[] computePartitioning(int offset, int length) throws BadLocationException {
+ public ITypedRegion[] computePartitioning(int offset, int length) {
throw new UnsupportedOperationException();
}
@@ -108,15 +108,15 @@
return fBuffer.toString();
}
- public String get(int offset, int length) throws BadLocationException {
+ public String get(int offset, int length) {
return fBuffer.substring(offset, offset + length);
}
- public char getChar(int offset) throws BadLocationException {
+ public char getChar(int offset) {
throw new UnsupportedOperationException();
}
- public String getContentType(int offset) throws BadLocationException {
+ public String getContentType(int offset) {
throw new UnsupportedOperationException();
}
@@ -136,27 +136,27 @@
return fBuffer.length();
}
- public String getLineDelimiter(int line) throws BadLocationException {
+ public String getLineDelimiter(int line) {
throw new UnsupportedOperationException();
}
- public IRegion getLineInformation(int line) throws BadLocationException {
+ public IRegion getLineInformation(int line) {
throw new UnsupportedOperationException();
}
- public IRegion getLineInformationOfOffset(int offset) throws BadLocationException {
+ public IRegion getLineInformationOfOffset(int offset) {
throw new UnsupportedOperationException();
}
- public int getLineLength(int line) throws BadLocationException {
+ public int getLineLength(int line) {
throw new UnsupportedOperationException();
}
- public int getLineOffset(int line) throws BadLocationException {
+ public int getLineOffset(int line) {
throw new UnsupportedOperationException();
}
- public int getLineOfOffset(int offset) throws BadLocationException {
+ public int getLineOfOffset(int offset) {
throw new UnsupportedOperationException();
}
@@ -164,11 +164,11 @@
throw new UnsupportedOperationException();
}
- public int getNumberOfLines(int offset, int length) throws BadLocationException {
+ public int getNumberOfLines(int offset, int length) {
throw new UnsupportedOperationException();
}
- public ITypedRegion getPartition(int offset) throws BadLocationException {
+ public ITypedRegion getPartition(int offset) {
throw new UnsupportedOperationException();
}
@@ -176,7 +176,7 @@
throw new UnsupportedOperationException();
}
- public Position[] getPositions(String category) throws BadPositionCategoryException {
+ public Position[] getPositions(String category) {
throw new UnsupportedOperationException();
}
@@ -200,11 +200,11 @@
throw new UnsupportedOperationException();
}
- public void removePosition(String category, Position position) throws BadPositionCategoryException {
+ public void removePosition(String category, Position position) {
throw new UnsupportedOperationException();
}
- public void removePositionCategory(String category) throws BadPositionCategoryException {
+ public void removePositionCategory(String category) {
throw new UnsupportedOperationException();
}
@@ -216,11 +216,11 @@
throw new UnsupportedOperationException();
}
- public void replace(int offset, int length, String text) throws BadLocationException {
+ public void replace(int offset, int length, String text) {
fBuffer.replace(offset, offset + length, text);
}
- public int search(int startOffset, String findString, bool forwardSearch, bool caseSensitive, bool wholeWord) throws BadLocationException {
+ public int search(int startOffset, String findString, bool forwardSearch, bool caseSensitive, bool wholeWord) {
throw new UnsupportedOperationException();
}
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/text/edits/InsertEdit.d
--- a/dwtx/text/edits/InsertEdit.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/text/edits/InsertEdit.d Sun Aug 24 02:20:40 2008 +0200
@@ -104,7 +104,7 @@
/*
* @see TextEdit#performDocumentUpdating
*/
- int performDocumentUpdating(IDocument document) throws BadLocationException {
+ int performDocumentUpdating(IDocument document) {
document.replace(getOffset(), getLength(), fText);
fDelta= fText.length() - getLength();
return fDelta;
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/text/edits/MoveSourceEdit.d
--- a/dwtx/text/edits/MoveSourceEdit.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/text/edits/MoveSourceEdit.d Sun Aug 24 02:20:40 2008 +0200
@@ -229,7 +229,7 @@
return result;
}
- void performConsistencyCheck(TextEditProcessor processor, IDocument document) throws MalformedTreeException {
+ void performConsistencyCheck(TextEditProcessor processor, IDocument document) {
if (fTarget is null)
throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("MoveSourceEdit.no_target")); //$NON-NLS-1$
if (fTarget.getSourceEdit() !is this)
@@ -286,7 +286,7 @@
//---- document updating ----------------------------------------------------------------
- int performDocumentUpdating(IDocument document) throws BadLocationException {
+ int performDocumentUpdating(IDocument document) {
document.replace(getOffset(), getLength(), ""); //$NON-NLS-1$
fDelta= -getLength();
return fDelta;
@@ -307,7 +307,7 @@
return fModifier !is null;
}
- private void applyTransformation(IDocument document, int style) throws MalformedTreeException {
+ private void applyTransformation(IDocument document, int style) {
if ((style & TextEdit.UPDATE_REGIONS) !is 0 && fSourceRoot !is null) {
Map editMap= new HashMap();
TextEdit newEdit= createEdit(editMap);
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/text/edits/MoveTargetEdit.d
--- a/dwtx/text/edits/MoveTargetEdit.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/text/edits/MoveTargetEdit.d Sun Aug 24 02:20:40 2008 +0200
@@ -163,7 +163,7 @@
/*
* @see TextEdit#performConsistencyCheck
*/
- void performConsistencyCheck(TextEditProcessor processor, IDocument document) throws MalformedTreeException {
+ void performConsistencyCheck(TextEditProcessor processor, IDocument document) {
if (fSource is null)
throw new MalformedTreeException(getParent(), this, TextEditMessages.getString("MoveTargetEdit.no_source")); //$NON-NLS-1$
if (fSource.getTargetEdit() !is this)
@@ -175,7 +175,7 @@
/*
* @see TextEdit#performDocumentUpdating
*/
- int performDocumentUpdating(IDocument document) throws BadLocationException {
+ int performDocumentUpdating(IDocument document) {
String source= fSource.getContent();
document.replace(getOffset(), getLength(), source);
fDelta= source.length() - getLength();
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/text/edits/MultiTextEdit.d
--- a/dwtx/text/edits/MultiTextEdit.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/text/edits/MultiTextEdit.d Sun Aug 24 02:20:40 2008 +0200
@@ -108,7 +108,7 @@
* @exception MalformedTreeException if the edit isn't in a valid state
* and can therefore not be executed
*/
- protected void checkIntegrity() throws MalformedTreeException {
+ protected void checkIntegrity() {
// does nothing
}
@@ -207,14 +207,14 @@
/*
* @see TextEdit#performConsistencyCheck
*/
- void performConsistencyCheck(TextEditProcessor processor, IDocument document) throws MalformedTreeException {
+ void performConsistencyCheck(TextEditProcessor processor, IDocument document) {
checkIntegrity();
}
/*
* @see TextEdit#performDocumentUpdating
*/
- int performDocumentUpdating(IDocument document) throws BadLocationException {
+ int performDocumentUpdating(IDocument document) {
fDelta= 0;
return fDelta;
}
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/text/edits/RangeMarker.d
--- a/dwtx/text/edits/RangeMarker.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/text/edits/RangeMarker.d Sun Aug 24 02:20:40 2008 +0200
@@ -85,7 +85,7 @@
/*
* @see TextEdit#performDocumentUpdating
*/
- int performDocumentUpdating(IDocument document) throws BadLocationException {
+ int performDocumentUpdating(IDocument document) {
fDelta= 0;
return fDelta;
}
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/text/edits/ReplaceEdit.d
--- a/dwtx/text/edits/ReplaceEdit.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/text/edits/ReplaceEdit.d Sun Aug 24 02:20:40 2008 +0200
@@ -105,7 +105,7 @@
/*
* @see TextEdit#performDocumentUpdating
*/
- int performDocumentUpdating(IDocument document) throws BadLocationException {
+ int performDocumentUpdating(IDocument document) {
document.replace(getOffset(), getLength(), fText);
fDelta= fText.length() - getLength();
return fDelta;
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/text/edits/TextEdit.d
--- a/dwtx/text/edits/TextEdit.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/text/edits/TextEdit.d Sun Aug 24 02:20:40 2008 +0200
@@ -125,7 +125,7 @@
public static final int UPDATE_REGIONS= 1 << 1;
private static class InsertionComparator : Comparator {
- public int compare(Object o1, Object o2) throws MalformedTreeException {
+ public int compare(Object o1, Object o2) {
TextEdit edit1= cast(TextEdit)o1;
TextEdit edit2= cast(TextEdit)o2;
@@ -357,7 +357,7 @@
* overlaps with one of its siblings or if the child edit's region
* isn't fully covered by this edit.
*/
- public final void addChild(TextEdit child) throws MalformedTreeException {
+ public final void addChild(TextEdit child) {
internalAdd(child);
}
@@ -370,7 +370,7 @@
*
* @see #addChild(TextEdit)
*/
- public final void addChildren(TextEdit[] edits) throws MalformedTreeException {
+ public final void addChildren(TextEdit[] edits) {
for (int i= 0; i < edits.length; i++) {
internalAdd(edits[i]);
}
@@ -760,11 +760,11 @@
return apply(document, CREATE_UNDO | UPDATE_REGIONS);
}
- UndoEdit dispatchPerformEdits(TextEditProcessor processor) throws BadLocationException {
+ UndoEdit dispatchPerformEdits(TextEditProcessor processor) {
return processor.executeDo();
}
- void dispatchCheckIntegrity(TextEditProcessor processor) throws MalformedTreeException {
+ void dispatchCheckIntegrity(TextEditProcessor processor) {
processor.checkIntegrityDo();
}
@@ -794,7 +794,7 @@
fChildren= children;
}
- void internalAdd(TextEdit child) throws MalformedTreeException {
+ void internalAdd(TextEdit child) {
child.aboutToBeAdded(this);
if (child.isDeleted())
throw new MalformedTreeException(this, child, TextEditMessages.getString("TextEdit.deleted_edit")); //$NON-NLS-1$
@@ -808,7 +808,7 @@
child.internalSetParent(this);
}
- private int computeInsertionIndex(TextEdit edit) throws MalformedTreeException {
+ private int computeInsertionIndex(TextEdit edit) {
int size= fChildren.size();
if (size is 0)
return 0;
@@ -909,7 +909,7 @@
void performSourceComputation(TextEditProcessor processor, IDocument document) {
}
- int traverseDocumentUpdating(TextEditProcessor processor, IDocument document) throws BadLocationException {
+ int traverseDocumentUpdating(TextEditProcessor processor, IDocument document) {
int delta= 0;
if (fChildren !is null) {
for (int i= fChildren.size() - 1; i >= 0; i--) {
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/text/edits/TextEditProcessor.d
--- a/dwtx/text/edits/TextEditProcessor.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/text/edits/TextEditProcessor.d Sun Aug 24 02:20:40 2008 +0200
@@ -90,8 +90,8 @@
Assert.isNotNull(root);
fDocument= document;
fRoot= root;
- if (fRoot instanceof MultiTextEdit)
- (cast(MultiTextEdit)fRoot).defineRegion(0);
+ if ( auto mte = cast(MultiTextEdit)fRoot )
+ mte.defineRegion(0);
fStyle= style;
if (secondary) {
fChecked= true;
@@ -191,7 +191,7 @@
//---- checking --------------------------------------------------------------------
- void checkIntegrityDo() throws MalformedTreeException {
+ void checkIntegrityDo() {
fSourceEdits= new ArrayList();
fRoot.traverseConsistencyCheck(this, fDocument, fSourceEdits);
if (fRoot.getExclusiveEnd() > fDocument.getLength())
@@ -205,7 +205,7 @@
//---- execution --------------------------------------------------------------------
- UndoEdit executeDo() throws BadLocationException {
+ UndoEdit executeDo() {
UndoCollector collector= new UndoCollector(fRoot);
try {
if (createUndo())
@@ -233,7 +233,7 @@
}
}
- UndoEdit executeUndo() throws BadLocationException {
+ UndoEdit executeUndo() {
UndoCollector collector= new UndoCollector(fRoot);
try {
if (createUndo())
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/text/edits/UndoEdit.d
--- a/dwtx/text/edits/UndoEdit.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/text/edits/UndoEdit.d Sun Aug 24 02:20:40 2008 +0200
@@ -69,7 +69,7 @@
/*
* @see dwtx.text.edits.TextEdit#internalAdd(dwtx.text.edits.TextEdit)
*/
- void internalAdd(TextEdit child) throws MalformedTreeException {
+ void internalAdd(TextEdit child) {
throw new MalformedTreeException(null, this, TextEditMessages.getString("UndoEdit.no_children")); //$NON-NLS-1$
}
@@ -80,11 +80,11 @@
throw new MalformedTreeException(parent, this, TextEditMessages.getString("UndoEdit.can_not_be_added")); //$NON-NLS-1$
}
- UndoEdit dispatchPerformEdits(TextEditProcessor processor) throws BadLocationException {
+ UndoEdit dispatchPerformEdits(TextEditProcessor processor) {
return processor.executeUndo();
}
- void dispatchCheckIntegrity(TextEditProcessor processor) throws MalformedTreeException {
+ void dispatchCheckIntegrity(TextEditProcessor processor) {
processor.checkIntegrityUndo();
}
@@ -108,7 +108,7 @@
/*
* @see TextEdit#performDocumentUpdating
*/
- int performDocumentUpdating(IDocument document) throws BadLocationException {
+ int performDocumentUpdating(IDocument document) {
fDelta= 0;
return fDelta;
}
diff -r 65801ad2b265 -r 6dcb0baaa031 dwtx/text/undo/DocumentUndoManager.d
--- a/dwtx/text/undo/DocumentUndoManager.d Sun Aug 24 01:52:31 2008 +0200
+++ b/dwtx/text/undo/DocumentUndoManager.d Sun Aug 24 02:20:40 2008 +0200
@@ -149,8 +149,8 @@
*/
protected void undoTextChange() {
try {
- if (fDocumentUndoManager.fDocument instanceof IDocumentExtension4)
- (cast(IDocumentExtension4) fDocumentUndoManager.fDocument).replace(fStart, fText
+ if (auto de4 = cast(IDocumentExtension4)fDocumentUndoManager.fDocument )
+ de4.replace(fStart, fText
.length(), fPreservedText, fUndoModificationStamp);
else
fDocumentUndoManager.fDocument.replace(fStart, fText.length(),
@@ -164,7 +164,7 @@
*/
public bool canUndo() {
if (isValid()) {
- if (fDocumentUndoManager.fDocument instanceof IDocumentExtension4) {
+ if (cast(IDocumentExtension4)fDocumentUndoManager.fDocument) {
long docStamp= (cast(IDocumentExtension4) fDocumentUndoManager.fDocument)
.getModificationStamp();
@@ -210,7 +210,7 @@
&& this is fDocumentUndoManager.fHistory
.getUndoOperation(fDocumentUndoManager.fUndoContext)
&& // this is the latest operation
- this instanceof UndoableCompoundTextChange
+ null !is cast(UndoableCompoundTextChange)this
&& this is fDocumentUndoManager.fCurrent
&& // this is the current operation
this.fStart is -1
@@ -234,7 +234,7 @@
*/
public bool canRedo() {
if (isValid()) {
- if (fDocumentUndoManager.fDocument instanceof IDocumentExtension4) {
+ if (cast(IDocumentExtension4)fDocumentUndoManager.fDocument ) {
long docStamp= (cast(IDocumentExtension4) fDocumentUndoManager.fDocument)
.getModificationStamp();
return docStamp is IDocumentExtension4.UNKNOWN_MODIFICATION_STAMP
@@ -283,7 +283,7 @@
*/
protected void redoTextChange() {
try {
- if (fDocumentUndoManager.fDocument instanceof IDocumentExtension4)
+ if (cast(IDocumentExtension4)fDocumentUndoManager.fDocument)
(cast(IDocumentExtension4) fDocumentUndoManager.fDocument).replace(fStart, fEnd - fStart, fText, fRedoModificationStamp);
else
fDocumentUndoManager.fDocument.replace(fStart, fEnd - fStart, fText);
@@ -666,7 +666,7 @@
// if we are undoing/redoing an operation we generated, then
// ignore
// the document changes associated with this undo or redo.
- if (event.getOperation() instanceof UndoableTextChange) {
+ if (cast(UndoableTextChange)event.getOperation() ) {
listenToTextChanges(false);
// in the undo case only, make sure compounds are closed
@@ -858,7 +858,7 @@
/*
* @see dwtx.text.undo.IDocumentUndoManager#undo()
*/
- public void redo() throws ExecutionException {
+ public void redo() {
if (isConnected() && redoable())
OperationHistoryFactory.getOperationHistory().redo(getUndoContext(), null, null);
}
@@ -866,7 +866,7 @@
/*
* @see dwtx.text.undo.IDocumentUndoManager#undo()
*/
- public void undo() throws ExecutionException {
+ public void undo() {
if (undoable())
OperationHistoryFactory.getOperationHistory().undo(fUndoContext, null, null);
}
@@ -968,7 +968,7 @@
*/
private void addToOperationHistory(UndoableTextChange edit) {
if (!fFoldingIntoCompoundChange
- || edit instanceof UndoableCompoundTextChange) {
+ || cast(UndoableCompoundTextChange)edit ) {
fHistory.add(edit);
fLastAddedTextEdit= edit;
}
@@ -1259,20 +1259,20 @@
for (int i= 0; i < operations.length; i++) {
// First replace the undo context
IUndoableOperation op= operations[i];
- if (op instanceof IContextReplacingOperation) {
+ if (cast(IContextReplacingOperation)op ) {
(cast(IContextReplacingOperation)op).replaceContext(oldUndoContext, getUndoContext());
} else {
op.addContext(getUndoContext());
op.removeContext(oldUndoContext);
}
// Now update the manager that owns the text edit.
- if (op instanceof UndoableTextChange) {
+ if (cast(UndoableTextChange)op ) {
(cast(UndoableTextChange)op).fDocumentUndoManager= this;
}
}
IUndoableOperation op= OperationHistoryFactory.getOperationHistory().getUndoOperation(getUndoContext());
- if (op !is null && !(op instanceof UndoableTextChange))
+ if (op !is null && !(cast(UndoableTextChange)op ))
return;
// Record the transfer itself as an undoable change.
@@ -1283,7 +1283,7 @@
UndoableTextChange cmd= new UndoableTextChange(this);
cmd.fStart= cmd.fEnd= 0;
cmd.fText= cmd.fPreservedText= ""; //$NON-NLS-1$
- if (fDocument instanceof IDocumentExtension4) {
+ if (cast(IDocumentExtension4)fDocument ) {
cmd.fRedoModificationStamp= (cast(IDocumentExtension4)fDocument).getModificationStamp();
if (op !is null)
cmd.fUndoModificationStamp= (cast(UndoableTextChange)op).fRedoModificationStamp;