Package tool.editors.method

Source Code of tool.editors.method.MethodSourceViewerConfiguration

package tool.editors.method;

import org.eclipse.jface.text.DefaultIndentLineAutoEditStrategy;
import org.eclipse.jface.text.IAutoEditStrategy;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.source.ISourceViewer;

import tool.editors.ColorManager;
import tool.editors.ToolAutoEditStrategy;
import tool.editors.ToolSourceViewerConfiguration;

public class MethodSourceViewerConfiguration extends
    ToolSourceViewerConfiguration {

  public MethodSourceViewerConfiguration(ColorManager colorManager) {
    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 };
  }
}
TOP

Related Classes of tool.editors.method.MethodSourceViewerConfiguration

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.