Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.IFindReplaceTarget


    /*
     * @see IPartListener#partActivated(IWorkbenchPart)
     */
    public void partActivated(IWorkbenchPart part) {

      IFindReplaceTarget target= part == null ? null : (IFindReplaceTarget) part.getAdapter(IFindReplaceTarget.class);
      fPreviousPart= fPart;
      fPart= target == null ? null : part;

      if (fPreviousTarget != target) {
        fPreviousTarget= target;
        if (fDialog != null) {
          boolean isEditable= false;
          if (fPart instanceof ITextEditorExtension2) {
            ITextEditorExtension2 extension= (ITextEditorExtension2) fPart;
            isEditable= extension.isEditorInputModifiable();
          } else if (target != null)
            isEditable= target.isEditable();
          fDialog.updateTarget(target, isEditable, false);
        }
      }
    }
View Full Code Here


      StyledText styledText= viewer.getTextWidget();

      Color color= createColor(store, PREFERENCE_COLOR_FIND_SCOPE, styledText.getDisplay());

      IFindReplaceTarget target= viewer.getFindReplaceTarget();
      if (target != null && target instanceof IFindReplaceTargetExtension)
        ((IFindReplaceTargetExtension) target).setScopeHighlightColor(color);

      if (fFindScopeHighlightColor != null)
        fFindScopeHighlightColor.dispose();
View Full Code Here

      return fIncrementalFindTarget;
    }

    if (IFindReplaceTarget.class.equals(required)) {
      if (fFindReplaceTarget == null) {
        IFindReplaceTarget target= (fSourceViewer == null ? null : fSourceViewer.getFindReplaceTarget());
        if (target != null) {
          fFindReplaceTarget= new FindReplaceTarget(this, target);
          if (fFindScopeHighlightColor != null)
            fFindReplaceTarget.setScopeHighlightColor(fFindScopeHighlightColor);
        }
View Full Code Here

  public void testFreemarkerContentAssistIsShowed() {
    IEditorPart part = WorkbenchUtils.openEditor(TEST_EDITOR_PROJECT + IPath.SEPARATOR + EDITPROPERTY_XHTML_FTL);
    assertTrue(part instanceof FreemarkerMultiPageEditor);
    FreemarkerMultiPageEditor editor = (FreemarkerMultiPageEditor)part;
    CompletionProcessor proc = new CompletionProcessor(editor.getEditor());
    IFindReplaceTarget find = (IFindReplaceTarget)editor.getAdapter(IFindReplaceTarget.class);
    int pos = find.findAndSelect(0, "<#", true, false, false); //$NON-NLS-1$
    ICompletionProposal[] proposals = proc.computeCompletionProposals(editor.getEditor().getTextViewer(),pos+2);
    assertTrue(proposals.length>0);

    pos = find.findAndSelect(0, "label(componentProperty.name)", true, false, false); //$NON-NLS-1$
    proposals = proc.computeCompletionProposals(editor.getEditor().getTextViewer(),pos);
    assertTrue(proposals.length>0);
  }
View Full Code Here

    public FindReplaceDialog getDialog() {
      return fDialog;
    }

    private void partActivated(IWorkbenchPart part) {
      IFindReplaceTarget target= part == null ? null : (IFindReplaceTarget) part.getAdapter(IFindReplaceTarget.class);
      fPreviousPart= fPart;
      fPart= target == null ? null : part;

      if (fPreviousTarget != target) {
        fPreviousTarget= target;
        if (fDialog != null) {
          boolean isEditable= false;
          if (fPart instanceof ITextEditorExtension2) {
            ITextEditorExtension2 extension= (ITextEditorExtension2) fPart;
            isEditable= extension.isEditorInputModifiable();
          } else if (target != null)
            isEditable= target.isEditable();
          fDialog.updateTarget(target, isEditable, false);
        }
      }
    }
View Full Code Here

      StyledText styledText= viewer.getTextWidget();

      Color color= createColor(store, PREFERENCE_COLOR_FIND_SCOPE, styledText.getDisplay());

      IFindReplaceTarget target= viewer.getFindReplaceTarget();
      if (target != null && target instanceof IFindReplaceTargetExtension)
        ((IFindReplaceTargetExtension) target).setScopeHighlightColor(color);

      if (fFindScopeHighlightColor != null)
        fFindScopeHighlightColor.dispose();
View Full Code Here

      return fIncrementalFindTarget;
    }

    if (IFindReplaceTarget.class.equals(required)) {
      if (fFindReplaceTarget == null) {
        IFindReplaceTarget target= (fSourceViewer == null ? null : fSourceViewer.getFindReplaceTarget());
        if (target != null) {
          fFindReplaceTarget= new FindReplaceTarget(this, target);
          if (fFindScopeHighlightColor != null)
            fFindReplaceTarget.setScopeHighlightColor(fFindScopeHighlightColor);
        }
View Full Code Here

  {
    IEditorPart editor = InstaSearchUI.getActiveEditor();
   
    if( editor != null )
    {
      IFindReplaceTarget target = (IFindReplaceTarget) editor.getAdapter(IFindReplaceTarget.class);
     
      if( target != null )
        lastIncrementalSearchPos = target.findAndSelect(lastIncrementalSearchPos, searchText.getText(), true, false, false) + searchText.getText().length();
    }
  }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.IFindReplaceTarget

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.