Package org.eclipse.dltk.internal.ui.editor

Examples of org.eclipse.dltk.internal.ui.editor.ScriptEditor


  }

  @Override
  protected QuerySpecification createQuery(INamedElement defunit) throws ModelException {
    DLTKSearchScopeFactory factory= DLTKSearchScopeFactory.getInstance();
    ScriptEditor editor= deeEditor;
   
    IScriptProject scriptProject = deeEditor.getInputModelElement().getScriptProject();
   
    IDLTKSearchScope scope;
    String description;
    boolean isInsideInterpreterEnvironment = isInsideInterpreterEnv(defunit, factory);
    if (editor != null) {
      scope= factory.createProjectSearchScope(editor.getEditorInput(), isInsideInterpreterEnvironment);
      description= factory.getProjectScopeDescription(editor.getEditorInput(), isInsideInterpreterEnvironment);
    } else {
      scope= factory.createProjectSearchScope(scriptProject, isInsideInterpreterEnvironment);
      description=  factory.getProjectScopeDescription(scriptProject, isInsideInterpreterEnvironment);
    }
   
View Full Code Here


        breakpoint.delete();
        return;
      }

      if (textEditor instanceof ScriptEditor) {
        ScriptEditor scriptEditor = (ScriptEditor) textEditor;
        try {
          IDocument doc = scriptEditor.getScriptSourceViewer().getDocument();

          IRegion region = doc.getLineInformation(lineNumber - 1);
          String string = doc.get(region.getOffset(), region.getLength());
          int index = string.indexOf("function");
          if (index != -1) {
View Full Code Here

  public boolean canToggleWatchpoints(IWorkbenchPart part, ISelection selection) {
    if (selection instanceof ITextSelection) {
      final ITextSelection textSelection = (ITextSelection) selection;
      final String text = textSelection.getText();
      if (part instanceof ScriptEditor) {
        ScriptEditor scriptEditor = (ScriptEditor) part;
        try {
          IDocument doc = scriptEditor.getScriptSourceViewer().getDocument();
          IRegion region = doc.getLineInformation(textSelection.getStartLine());
          String string = doc.get(region.getOffset(), region.getLength());

          return string.indexOf('=') != -1 || string.trim().startsWith("var ");
        } catch (BadLocationException e) {
View Full Code Here

      }

      if (editor instanceof ScriptEditor) {

        try {
          ScriptEditor scriptEditor = (ScriptEditor) editor;
          IDocument doc = scriptEditor.getScriptSourceViewer().getDocument();
          IRegion region = doc.getLineInformation(lineNumber - 1);
          String string = doc.get(region.getOffset(), region.getLength());

          int index = string.indexOf('=');
          if (index != -1) {
View Full Code Here

  }

  public ICompletionProposal[] computeQuickAssistProposals(
          IQuickAssistInvocationContext invocationContext) {
    final Annotation[] annotations = fAssistant.getAnnotationsAtOffset();
    final ScriptEditor editor = (ScriptEditor) this.fAssistant.getEditor();
    final IAnnotationModel model = DLTKUIPlugin.getDocumentProvider().getAnnotationModel(
            editor.getEditorInput());
    final IModelElement element = editor.getInputModelElement();
    final IScriptProject scriptProject = element.getScriptProject();
    List proposals = null;
    for (int i = 0; i < annotations.length; i++) {
      final Annotation annotation = annotations[i];
      ICompletionProposal proposal = null;
View Full Code Here

public class CommonDeeUITest extends CommonUITest {
 
  public static ScriptEditor openDeeEditorForFile(IFile file) {
    IWorkbenchPage page = WorkbenchUtils.getActivePage();
    try {
      ScriptEditor editor = (ScriptEditor) IDE.openEditor(page, file, EditorSettings_Actual.EDITOR_ID);
      assertTrue(editor.getScriptSourceViewer() != null);
      return editor;
    } catch(PartInitException e) {
      throw melnorme.utilbox.core.ExceptionAdapter.unchecked(e);
    }
  }
View Full Code Here

  }

  public ICompletionProposal[] computeQuickAssistProposals(
          IQuickAssistInvocationContext invocationContext) {
    final Annotation[] annotations = fAssistant.getAnnotationsAtOffset();
    final ScriptEditor editor = (ScriptEditor) this.fAssistant.getEditor();
    final IAnnotationModel model = DLTKUIPlugin.getDocumentProvider().getAnnotationModel(
            editor.getEditorInput());
    final IModelElement element = editor.getInputModelElement();
    final IScriptProject scriptProject = element.getScriptProject();
    List proposals = null;
    for (int i = 0; i < annotations.length; i++) {
      final Annotation annotation = annotations[i];
      ICompletionProposal proposal = null;
View Full Code Here

        breakpoint.delete();
        return;
      }

      if (textEditor instanceof ScriptEditor) {
        ScriptEditor scriptEditor = (ScriptEditor) textEditor;
        try {
          IDocument doc = scriptEditor.getScriptSourceViewer().getDocument();

          IRegion region = doc.getLineInformation(lineNumber - 1);
          String string = doc.get(region.getOffset(), region.getLength());
          int index = string.indexOf("function");
          if (index != -1) {
View Full Code Here

  public boolean canToggleWatchpoints(IWorkbenchPart part, ISelection selection) {
    if (selection instanceof ITextSelection) {
      final ITextSelection textSelection = (ITextSelection) selection;
      final String text = textSelection.getText();
      if (part instanceof ScriptEditor) {
        ScriptEditor scriptEditor = (ScriptEditor) part;
        try {
          IDocument doc = scriptEditor.getScriptSourceViewer().getDocument();
          IRegion region = doc.getLineInformation(textSelection.getStartLine());
          String string = doc.get(region.getOffset(), region.getLength());

          return string.indexOf('=') != -1 || string.trim().startsWith("var ");
        } catch (BadLocationException e) {
View Full Code Here

      }

      if (editor instanceof ScriptEditor) {

        try {
          ScriptEditor scriptEditor = (ScriptEditor) editor;
          IDocument doc = scriptEditor.getScriptSourceViewer().getDocument();
          IRegion region = doc.getLineInformation(lineNumber - 1);
          String string = doc.get(region.getOffset(), region.getLength());

          int index = string.indexOf('=');
          if (index != -1) {
View Full Code Here

TOP

Related Classes of org.eclipse.dltk.internal.ui.editor.ScriptEditor

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.