import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferenceConverter;
+//import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.DocumentCommand;
import org.eclipse.jface.text.IAutoEditStrategy;
}
}
- private static class BracketLevel {
- int fOffset;
-
- int fLength;
-
- LinkedPositionManager fManager;
-
- LinkedPositionUI fEditor;
- };
+// private static class BracketLevel {
+// int fOffset;
+//
+// int fLength;
+//
+// LinkedPositionManager fManager;
+//
+// LinkedPositionUI fEditor;
+// };
private class BracketInserter implements VerifyKeyListener,
LinkedPositionUI.ExitListener {
}
}
- private boolean hasIdentifierToTheLeft(IDocument document, int offset) {
- try {
- int start = offset;
- IRegion startLine = document.getLineInformationOfOffset(start);
- int minStart = startLine.getOffset();
- while (start != minStart
- && Character.isWhitespace(document.getChar(start - 1)))
- --start;
- return start != minStart
- && Scanner.isPHPIdentifierPart(document
- .getChar(start - 1));
- } catch (BadLocationException e) {
- return true;
- }
- }
+// private boolean hasIdentifierToTheLeft(IDocument document, int offset) {
+// try {
+// int start = offset;
+// IRegion startLine = document.getLineInformationOfOffset(start);
+// int minStart = startLine.getOffset();
+// while (start != minStart
+// && Character.isWhitespace(document.getChar(start - 1)))
+// --start;
+// return start != minStart
+// && Scanner.isPHPIdentifierPart(document
+// .getChar(start - 1));
+// } catch (BadLocationException e) {
+// return true;
+// }
+// }
private boolean hasCharacterToTheLeft(IDocument document, int offset,
char character) {
return store.getBoolean(SPACES_FOR_TABS);
}
- private Color getColor(String key) {
- RGB rgb = PreferenceConverter.getColor(getPreferenceStore(), key);
- return getColor(rgb);
- }
+// private Color getColor(String key) {
+// RGB rgb = PreferenceConverter.getColor(getPreferenceStore(), key);
+// return getColor(rgb);
+// }
private Color getColor(RGB rgb) {
JavaTextTools textTools = WebUI.getDefault()
// IVerticalRuler ruler, int styles) {
// return new AdaptedSourceViewer(parent, ruler, styles);
// }
- private boolean isValidSelection(int offset, int length) {
- IDocumentProvider provider = getDocumentProvider();
- if (provider != null) {
- IDocument document = provider.getDocument(getEditorInput());
- if (document != null) {
- int end = offset + length;
- int documentLength = document.getLength();
- return 0 <= offset && offset <= documentLength && 0 <= end
- && end <= documentLength;
- }
- }
- return false;
- }
+// private boolean isValidSelection(int offset, int length) {
+// IDocumentProvider provider = getDocumentProvider();
+// if (provider != null) {
+// IDocument document = provider.getDocument(getEditorInput());
+// if (document != null) {
+// int end = offset + length;
+// int documentLength = document.getLength();
+// return 0 <= offset && offset <= documentLength && 0 <= end
+// && end <= documentLength;
+// }
+// }
+// return false;
+// }
/*
* @see net.sourceforge.phpdt.internal.ui.javaeditor.JavaEditor#getInputElement()
/**
* Returns the updated java element for the old java element.
*/
- private IJavaElement findElement(IJavaElement element) {
- if (element == null)
- return null;
- IWorkingCopyManager manager = WebUI.getDefault()
- .getWorkingCopyManager();
- ICompilationUnit unit = manager.getWorkingCopy(getEditorInput());
- if (unit != null) {
- try {
- synchronized (unit) {
- unit.reconcile();
- }
- IJavaElement[] findings = unit.findElements(element);
- if (findings != null && findings.length > 0)
- return findings[0];
- } catch (JavaModelException x) {
- PHPeclipsePlugin.log(x.getStatus());
- // nothing found, be tolerant and go on
- }
- }
- return null;
- }
+// private IJavaElement findElement(IJavaElement element) {
+// if (element == null)
+// return null;
+// IWorkingCopyManager manager = WebUI.getDefault()
+// .getWorkingCopyManager();
+// ICompilationUnit unit = manager.getWorkingCopy(getEditorInput());
+// if (unit != null) {
+// try {
+// synchronized (unit) {
+// unit.reconcile();
+// }
+// IJavaElement[] findings = unit.findElements(element);
+// if (findings != null && findings.length > 0)
+// return findings[0];
+// } catch (JavaModelException x) {
+// PHPeclipsePlugin.log(x.getStatus());
+// // nothing found, be tolerant and go on
+// }
+// }
+// return null;
+// }
/**
* Returns the offset of the given Java element.
*/
- private int getOffset(IJavaElement element) {
- if (element instanceof ISourceReference) {
- ISourceReference sr = (ISourceReference) element;
- try {
- ISourceRange srcRange = sr.getSourceRange();
- if (srcRange != null)
- return srcRange.getOffset();
- } catch (JavaModelException e) {
- }
- }
- return -1;
- }
+// private int getOffset(IJavaElement element) {
+// if (element instanceof ISourceReference) {
+// ISourceReference sr = (ISourceReference) element;
+// try {
+// ISourceRange srcRange = sr.getSourceRange();
+// if (srcRange != null)
+// return srcRange.getOffset();
+// } catch (JavaModelException e) {
+// }
+// }
+// return -1;
+// }
/*
* @see AbstractTextEditor#restoreSelection()