@Override public int getLineOfLastMouseButtonActivity() { if (fDelegate instanceof IVerticalRulerInfo) return ((IVerticalRulerInfo)fDelegate).getLineOfLastMouseButtonActivity(); return -1; }
@Override public int getLineOfLastMouseButtonActivity() { if (fDelegate instanceof IVerticalRulerInfo) return ((IVerticalRulerInfo)fDelegate).getLineOfLastMouseButtonActivity(); return -1; }
public int getLineOfLastMouseButtonActivity() { if (fDelegate instanceof IVerticalRulerInfo) ((IVerticalRulerInfo) fDelegate).getLineOfLastMouseButtonActivity(); return -1; }
public int getLineOfLastMouseButtonActivity() { if (fDelegate instanceof IVerticalRulerInfo) ((IVerticalRulerInfo) fDelegate).getLineOfLastMouseButtonActivity(); return -1; }
/** * Checks whether a position includes the ruler's line of activity. * * @param position the position to be checked * @param document the document the position refers to * @return <code>true</code> if the line is included by the given position */ protected boolean includesRulerLine(Position position, IDocument document) { if (position != null) { try { int markerLine= document.getLineOfOffset(position.getOffset()); int line= fRuler.getLineOfLastMouseButtonActivity(); if (line == markerLine) return true; // commented because of "1GEUOZ9: ITPJUI:ALL - Confusing UI for multi-line Bookmarks and Tasks" // return (markerLine <= line && line <= document.getLineOfOffset(position.getOffset() + position.getLength())); } catch (BadLocationException x) { } } return false; }
/** * Checks whether a position includes the ruler's line of activity. * * @param position the position to be checked * @param document the document the position refers to * @return <code>true</code> if the line is included by the given position */ protected boolean includesRulerLine(Position position, IDocument document) { if (position != null) { try { int markerLine= document.getLineOfOffset(position.getOffset()); int line= fRuler.getLineOfLastMouseButtonActivity(); if (line == markerLine) return true; // commented because of "1GEUOZ9: ITPJUI:ALL - Confusing UI for multi-line Bookmarks and Tasks" // return (markerLine <= line && line <= document.getLineOfOffset(position.getOffset() + position.getLength())); } catch (BadLocationException x) { } } return false; }
/** * Checks whether a position includes the ruler's line of activity. * * @param position the position to be checked * @param document the document the position refers to * @return <code>true</code> if the line is included by the given position */ protected boolean includesRulerLine(Position position, IDocument document) { if (position != null) { try { int markerLine= document.getLineOfOffset(position.getOffset()); int line= fRuler.getLineOfLastMouseButtonActivity(); if (line == markerLine) return true; // commented because of "1GEUOZ9: ITPJUI:ALL - Confusing UI for multi-line Bookmarks and Tasks" // return (markerLine <= line && line <= document.getLineOfOffset(position.getOffset() + position.getLength())); } catch (BadLocationException x) { } } return false; }
/** * Checks whether a position includes the ruler's line of activity. * * @param position the position to be checked * @param document the document the position refers to * @return <code>true</code> if the line is included by the given position */ protected final boolean includesRulerLine(Position position, IDocument document) { if (position != null) { try { int markerLine= document.getLineOfOffset(position.getOffset()); int line= fRuler.getLineOfLastMouseButtonActivity(); if (line == markerLine) return true; // commented because of "1GEUOZ9: ITPJUI:ALL - Confusing UI for multi-line Bookmarks and Tasks" // return (markerLine <= line && line <= document.getLineOfOffset(position.getOffset() + position.getLength())); } catch (BadLocationException x) { } } return false; }
/** * Checks whether a position includes the ruler's line of activity. * * @param position * the position to be checked * @param document * the document the position refers to * @return <code>true</code> if the line is included by the given position */ protected boolean includesRulerLine(Position position, IDocument document) { if (position != null) { try { int markerLine = document.getLineOfOffset(position.getOffset()); int line = fRuler.getLineOfLastMouseButtonActivity(); if (line == markerLine) { return true; } } catch (BadLocationException x) { } } return false; }
/** * Tries to make an annotation hover focusable (or "sticky"). * * @param annotationHover the hover to make focusable * @return <code>true</code> if successful, <code>false</code> otherwise */ private boolean makeAnnotationHoverFocusable(IAnnotationHover annotationHover) { IVerticalRulerInfo info= getVerticalRuler(); int line= info.getLineOfLastMouseButtonActivity(); if (line == -1) return false; return getInformationPresenter().openFocusedAnnotationHover(annotationHover, line); }
/** * Tries to make an annotation hover focusable (or "sticky"). * * @param annotationHover the hover to make focusable * @return <code>true</code> if successful, <code>false</code> otherwise */ private boolean makeAnnotationHoverFocusable(IAnnotationHover annotationHover) { IVerticalRulerInfo info= getVerticalRuler(); int line= info.getLineOfLastMouseButtonActivity(); if (line == -1) return false; return getInformationPresenter().openFocusedAnnotationHover(annotationHover, line); }
/** * Returns the active line. * * @param useRulerInfo <code>true</code> if ruler info should be used * @return the line of interest. * @since 3.1 */ private int computeLine(boolean useRulerInfo) { int lastLine; if (useRulerInfo) { IVerticalRulerInfo ruler= getRuler(); if (ruler == null) lastLine= -1; else lastLine= ruler.getLineOfLastMouseButtonActivity(); } else { ITextSelection selection= getSelection(); if (selection == null) lastLine= -1; else lastLine= selection.getEndLine(); } return lastLine; }
/** * Returns the active line * * @param useRulerInfo * @return the line of interest. * @since 3.1 */ private int computeLine(boolean useRulerInfo) { int lastLine; if (useRulerInfo) { IVerticalRulerInfo ruler= getRuler(); if (ruler == null) lastLine= -1; else lastLine= ruler.getLineOfLastMouseButtonActivity(); } else { ITextSelection selection= getSelection(); if (selection == null) lastLine= -1; else lastLine= selection.getEndLine(); } return lastLine; }
/** * Returns the active line * * @param useRulerInfo * @return the line of interest. * @since 3.1 */ private int computeLine(boolean useRulerInfo) { int lastLine; if (useRulerInfo) { IVerticalRulerInfo ruler= getRuler(); if (ruler == null) lastLine= -1; else lastLine= ruler.getLineOfLastMouseButtonActivity(); } else { ITextSelection selection= getSelection(); if (selection == null) lastLine= -1; else lastLine= selection.getEndLine(); } return lastLine; }
/** * Returns the active line. * * @param useRulerInfo <code>true</code> if ruler info should be used * @return the line of interest. * @since 3.1 */ private int computeLine(boolean useRulerInfo) { int lastLine; if (useRulerInfo) { IVerticalRulerInfo ruler= getRuler(); if (ruler == null) lastLine= -1; else lastLine= ruler.getLineOfLastMouseButtonActivity(); } else { ITextSelection selection= getSelection(); if (selection == null) lastLine= -1; else lastLine= selection.getEndLine(); } return lastLine; }
/** * Returns the active line * * @param useRulerInfo <code>true</code> if the ruler info should be used * @return the line of interest. * @since 3.1 */ private int computeLine(boolean useRulerInfo) { int lastLine; if (useRulerInfo) { IVerticalRulerInfo ruler= getRuler(); if (ruler == null) lastLine= -1; else lastLine= ruler.getLineOfLastMouseButtonActivity(); } else { ITextSelection selection= getSelection(); if (selection == null) lastLine= -1; else lastLine= selection.getEndLine(); } return lastLine; }
void doIt() { if (fPartTarget != null && fTargetElement != null) { try { IDocument document= getDocument(); if (document != null) { int line = fRulerInfo.getLineOfLastMouseButtonActivity(); if (line > -1) { ITextSelection selection = getTextSelection(document, line); fPartTarget.runToLine(fActivePart, selection, fTargetElement); } } } catch (CoreException e) { DebugUIPlugin.errorDialog(fActivePart.getSite().getWorkbenchWindow().getShell(), ActionMessages.RunToLineAction_0, ActionMessages.RunToLineAction_1, e.getStatus()); // } catch (BadLocationException e) { // ignore } } }
@Override public void menuAboutToShow(IMenuManager manager) { fSelection = StructuredSelection.EMPTY; if (fEditor != null && fRulerInfo != null) { IDocumentProvider provider = fEditor.getDocumentProvider(); if (provider != null) { IDocument document = provider.getDocument(fEditor.getEditorInput()); int line = fRulerInfo.getLineOfLastMouseButtonActivity(); if (line > -1) { try { IRegion region = document.getLineInformation(line); fSelection = new TextSelection(document, region.getOffset(), 0); } catch (BadLocationException e) {} } } ToggleBreakpointsTargetManager toggleTargetManager = ToggleBreakpointsTargetManager.getDefault(); Set<String> enabledIDs = toggleTargetManager.getEnabledToggleBreakpointsTargetIDs(fEditor, fSelection); fCallerAction.setEnabled(enabledIDs.size() > 0); } else { fCallerAction.setEnabled(false); } }
/** * Returns the attributes with which a newly created marker will be * initialized. * * @return the initial marker attributes */ protected Map getInitialAttributes() { Map attributes= new HashMap(11); IDocumentProvider provider= fTextEditor.getDocumentProvider(); IDocument document= provider.getDocument(fTextEditor.getEditorInput()); int line= fRuler.getLineOfLastMouseButtonActivity(); int start= -1; int end= -1; int length= 0; try { IRegion lineInformation= document.getLineInformation(line); start= lineInformation.getOffset(); length= lineInformation.getLength(); end= start + length; } catch (BadLocationException x) { } // marker line numbers are 1-based MarkerUtilities.setMessage(attributes, getLabelProposal(document, start, length)); MarkerUtilities.setLineNumber(attributes, line + 1); MarkerUtilities.setCharStart(attributes, start); MarkerUtilities.setCharEnd(attributes, end); return attributes; }
@Override public void run() { try { // Move offset to the line of the annotation, if necessary IDocument document = getDocument(); int annotationLine = ruler.getLineOfLastMouseButtonActivity(); int annotationLineOffet = document.getLineOffset(annotationLine); Point currentSelection = textEditor.getInternalSourceViewer().getSelectedRange(); int currentLine = document.getLineOfOffset(currentSelection.x); if (currentLine != annotationLine) textEditor.getInternalSourceViewer().setSelectedRange(annotationLineOffet, 0); // show QuickFix dialog ITextOperationTarget operation = (ITextOperationTarget) textEditor.getAdapter(ITextOperationTarget.class); final int opCode = ISourceViewer.QUICK_ASSIST; if (operation != null && operation.canDoOperation(opCode)) operation.doOperation(opCode); } catch (BadLocationException e) { // Ignore -> do nothing } }