List<IAutoEditStrategy> strategies= (List<IAutoEditStrategy>) selectContentTypePlugin(command.offset, fAutoIndentStrategies); if (strategies == null) return;
List<IAutoEditStrategy> strategies= (List<IAutoEditStrategy>) selectContentTypePlugin(command.offset, fAutoIndentStrategies); if (strategies == null) return;
/** * Selects from the given map the one which is registered under the content type of the * partition in which the given offset is located. * * @param offset the offset for which to find the plug-in * @param plugins the map from which to choose * @return the plug-in registered under the offset's content type or <code>null</code> if none */ protected Object selectContentTypePlugin(int offset, Map<String, ?> plugins) { final IDocument document= getDocument(); if (document == null) return null; try { return selectContentTypePlugin(TextUtilities.getContentType(document, getDocumentPartitioning(), offset, true), plugins); } catch (BadLocationException x) { if (TRACE_ERRORS) System.out.println(JFaceTextMessages.getString("TextViewer.error.bad_location.selectContentTypePlugin")); //$NON-NLS-1$ } return null; }
/** * Selects from the given map the one which is registered under the content type of the * partition in which the given offset is located. * * @param offset the offset for which to find the plug-in * @param plugins the map from which to choose * @return the plug-in registered under the offset's content type or <code>null</code> if none */ protected Object selectContentTypePlugin(int offset, Map<String, ?> plugins) { final IDocument document= getDocument(); if (document == null) return null; try { return selectContentTypePlugin(TextUtilities.getContentType(document, getDocumentPartitioning(), offset, true), plugins); } catch (BadLocationException x) { if (TRACE_ERRORS) System.out.println(JFaceTextMessages.getString("TextViewer.error.bad_location.selectContentTypePlugin")); //$NON-NLS-1$ } return null; }
@Override public void getPreviousOffset(MovementEvent event) { if (event.movement != SWT.MOVEMENT_WORD_START) return; if (TRACE_DOUBLE_CLICK) { System.out.println("\n---"); //$NON-NLS-1$ print(event); } if (fDoubleClickSelection == null) { ITextDoubleClickStrategy s= (ITextDoubleClickStrategy) selectContentTypePlugin(getSelectedRange().x, fDoubleClickStrategies); if (s != null) { StyledText textWidget= getTextWidget(); s.doubleClicked(TextViewer.this); fDoubleClickSelection= textWidget.getSelection(); event.newOffset= fDoubleClickSelection.x; if (TRACE_DOUBLE_CLICK) System.out.println("- setting selection: x= " + fDoubleClickSelection.x + ", y= " + fDoubleClickSelection.y); //$NON-NLS-1$ //$NON-NLS-2$ } } else { if (fDoubleClickSelection.x <= event.offset && event.offset <= fDoubleClickSelection.y) event.newOffset= fDoubleClickSelection.x; } } }
@Override public void getPreviousOffset(MovementEvent event) { if (event.movement != SWT.MOVEMENT_WORD_START) return; if (TRACE_DOUBLE_CLICK) { System.out.println("\n---"); //$NON-NLS-1$ print(event); } if (fDoubleClickSelection == null) { ITextDoubleClickStrategy s= (ITextDoubleClickStrategy) selectContentTypePlugin(getSelectedRange().x, fDoubleClickStrategies); if (s != null) { StyledText textWidget= getTextWidget(); s.doubleClicked(TextViewer.this); fDoubleClickSelection= textWidget.getSelection(); event.newOffset= fDoubleClickSelection.x; if (TRACE_DOUBLE_CLICK) System.out.println("- setting selection: x= " + fDoubleClickSelection.x + ", y= " + fDoubleClickSelection.y); //$NON-NLS-1$ //$NON-NLS-2$ } } else { if (fDoubleClickSelection.x <= event.offset && event.offset <= fDoubleClickSelection.y) event.newOffset= fDoubleClickSelection.x; } } }
String[] prefixes= (String[]) selectContentTypePlugin(regions[i].getType(), map); if (prefixes != null && prefixes.length > 0 && lines[j] >= 0 && lines[j + 1] >= 0) { if (right)
String[] prefixes= (String[]) selectContentTypePlugin(regions[i].getType(), map); if (prefixes != null && prefixes.length > 0 && lines[j] >= 0 && lines[j + 1] >= 0) { if (right)