Examples of IAutoEditStrategy


Examples of org.eclipse.jface.text.IAutoEditStrategy

  /*
   * @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String)
   */
  public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
    IAutoEditStrategy strategy= (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType) ? new JavaAutoIndentStrategy() : new DefaultIndentLineAutoEditStrategy());
    return new IAutoEditStrategy[] { strategy };
  }
View Full Code Here

Examples of org.eclipse.jface.text.IAutoEditStrategy

    super(colorManager);
  }
  @Override
  public IAutoEditStrategy[] getAutoEditStrategies(
      ISourceViewer sourceViewer, String contentType) {
    IAutoEditStrategy strategy = (IDocument.DEFAULT_CONTENT_TYPE
                .equals(contentType) ? new MethodAutoEditStrategy()
                : new DefaultIndentLineAutoEditStrategy());
        return new IAutoEditStrategy[] { strategy };
  }
View Full Code Here

Examples of org.eclipse.jface.text.IAutoEditStrategy

    return contentAssistant;
  }
  @Override
  public IAutoEditStrategy[] getAutoEditStrategies(
      ISourceViewer sourceViewer, String contentType) {
    IAutoEditStrategy strategy = (IDocument.DEFAULT_CONTENT_TYPE
                .equals(contentType) ? new ToolAutoEditStrategy()
                : new DefaultIndentLineAutoEditStrategy());
        return new IAutoEditStrategy[] { strategy };
  }
View Full Code Here

Examples of org.eclipse.jface.text.IAutoEditStrategy

        };
    }

    @Override
    public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
        IAutoEditStrategy strategy =
                (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType) ? new ApexAutoIndentStrategy()
                        : new DefaultIndentLineAutoEditStrategy());

        return new IAutoEditStrategy[] { strategy };
    }
View Full Code Here

Examples of org.eclipse.jface.text.IAutoEditStrategy

                  data = data.substring(0, offset)
                      + data.substring(offset + 1);

                  document.set(data);

                  IAutoEditStrategy indentLineAutoEditStrategy = new MainAutoEditStrategy();

                  DocumentCommand cmd = new DocumentCommand() {

                  };

                  cmd.offset = offset;
                  cmd.length = 0;
                  if (pdttFile.getOther() != null) {
                    cmd.text = pdttFile.getOther();
                  } else {
                    cmd.text = "\n";
                  }

                  cmd.doit = true;
                  cmd.shiftsCaret = true;
                  cmd.caretOffset = -1;

                  indentLineAutoEditStrategy
                      .customizeDocumentCommand(document,
                          cmd);
                  document.replace(cmd.offset, cmd.length,
                      cmd.text);
View Full Code Here

Examples of org.eclipse.jface.text.IAutoEditStrategy

    if (config == null || getViewer() == null) {
      return; //editor has been disposed.
    }
    IAutoEditStrategy[] strategies= config.getAutoEditStrategies(getViewer(), null);
    for (int i = 0; i < strategies.length; i++) {
      IAutoEditStrategy strategy = strategies[i];
      if (strategy instanceof CFEIndentStrategy) {
        ((CFEIndentStrategy)strategy).reconciled();
      }
    }
    if(getPreferenceStore().getBoolean(ParserPreferenceConstants.P_AUTO_RECONCILE)){     
View Full Code Here

Examples of org.eclipse.jface.text.IAutoEditStrategy

  public List<IAutoEditStrategy> getStrategies(final ISourceViewer sourceViewer, final String contentType) {
    final List<IAutoEditStrategy> strategies = Lists.newArrayList();
    configure(new IEditStrategyAcceptor() {
      public void accept(IAutoEditStrategy strategy, String type) {
        if(type == null || contentType.equals(type)) {
          IAutoEditStrategy original = strategy;
          if(strategy instanceof PreferenceCheckingStrategy)
            strategy = ((PreferenceCheckingStrategy) strategy).wrapped;
          if(strategy instanceof ISourceViewerAware) {
            ((ISourceViewerAware) strategy).setSourceViewer(sourceViewer);
          }
View Full Code Here

Examples of org.eclipse.jface.text.IAutoEditStrategy

  /* Method declared on SourceViewerConfiguration */
  public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) { return new ProcessingAnnotationHover(); }
   
  /* @see org.eclipse.jface.text.source.SourceViewerConfiguration#getAutoEditStrategies(org.eclipse.jface.text.source.ISourceViewer, java.lang.String) */
  public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType) {
    IAutoEditStrategy strategy= (IDocument.DEFAULT_CONTENT_TYPE.equals(contentType) ? new ProcessingAutoIndentStrategy() : new DefaultIndentLineAutoEditStrategy());
    return new IAutoEditStrategy[] { strategy };
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.