Examples of TextEditor


Examples of org.eclipse.ui.editors.text.TextEditor

  }

  private void createTextPage()
  {
    try {
      editor = new TextEditor();
      int index = addPage(editor, getEditorInput());
      setPageText(index, editor.getTitle());
    } catch (PartInitException e) {
      ErrorDialog.openError(
        getSite().getShell(),
View Full Code Here

Examples of org.eclipse.ui.editors.text.TextEditor

    }
  }

  static void gotoError(IEditorPart editorPart, int line, int column) {
    if (editorPart != null) {
      TextEditor textEditor = (TextEditor) editorPart.getAdapter(TextEditor.class);
      if (textEditor != null) {
        try {
          IDocumentProvider dp = textEditor.getDocumentProvider();
          IDocument document = (dp != null) ? dp.getDocument(textEditor.getEditorInput()) : null;
          textEditor.selectAndReveal(document.getLineOffset(line - 1) + column - 1, 0);
        }
        catch (BadLocationException x) {
          // marker refers to invalid text position -> do nothing
        }
      }
View Full Code Here

Examples of org.eclipse.ui.editors.text.TextEditor

        if (!MaudesimpleGUIPlugin.getDefault().getMaude().isRunning()) {
          MessageDialog.openError(null, Messages.getString("MaudeGUI.E_TITLE"),Messages.getString("MaudeGUI.E_NORUNNING")); //$NON-NLS-1$ //$NON-NLS-2$
        } else {

          TextEditor editor;
         
          editor = (TextEditor) activeEditorPart;
         
          String editorText =
            editor.getDocumentProvider().getDocument(editor.getEditorInput()).get();
         
          MaudesimpleGUIPlugin.getDefault().getMaude().sendToMaude(editorText);
         
//          envio el texto a maude modules. Alfredo Mu�oz Andrades
          MaudeModules.getInstance().addModules(editorText);
           
        }
      }
    };
    actSendMaude.setText(Messages.getString("MaudeGUI.MM_SENDTOMAUDE")); //$NON-NLS-1$
    actSendMaude.setToolTipText(Messages.getString("MaudeGUI.MT_SENDTOMAUDE")); //$NON-NLS-1$
    actSendMaude.setAccelerator(SWT.F9);
    actSendMaude.setImageDescriptor(ImageDescriptor.createFromURL(
        MaudesimpleGUIPlugin.getDefault().find(new Path(Messages.getString("MaudeGUI.MI_SENDTOMAUDE"))))); //$NON-NLS-1$
    actSendMaude.setDisabledImageDescriptor(ImageDescriptor.createFromURL(
        MaudesimpleGUIPlugin.getDefault().find(new Path(Messages.getString("MaudeGUI.MC_SENDTOMAUDE"))))); //$NON-NLS-1$
   
    // Send selection to Maude
    actSendSelMaude = new Action() {
      public void run() {
       
        if (!MaudesimpleGUIPlugin.getDefault().getMaude().isRunning()) {
          MessageDialog.openError(Workbench.getInstance().getDisplay().getActiveShell(), Messages.getString("MaudeGUI.E_TITLE"),Messages.getString("MaudeGUI.E_NORUNNING")); //$NON-NLS-1$ //$NON-NLS-2$
        } else {
 
          TextEditor editor;
         
          editor = (TextEditor) activeEditorPart;
         
          ISelection sel = editor.getSelectionProvider().getSelection();
          Object selection = null;
          if(sel instanceof TextSelection) {
            selection = ((TextSelection)sel).getText();
          }
          if(selection!= null && selection.toString().length() > 0)
View Full Code Here

Examples of org.eclipse.ui.editors.text.TextEditor

        if (!MaudesimpleGUIPlugin.getDefault().getMaude().isRunning()) {
          MessageDialog.openError(null, Messages.getString("MaudeGUI.E_TITLE"),Messages.getString("MaudeGUI.E_NORUNNING")); //$NON-NLS-1$ //$NON-NLS-2$
        } else {

          TextEditor editor;
         
          editor = (TextEditor) activeEditorPart;
         
          String editorText =
            editor.getDocumentProvider().getDocument(editor.getEditorInput()).get();
         
          MaudesimpleGUIPlugin.getDefault().getMaude().sendToMaude(editorText);
           
        }
      }
    };
    actSendMaude.setText(Messages.getString("MaudeGUI.MM_SENDTOMAUDE")); //$NON-NLS-1$
    actSendMaude.setToolTipText(Messages.getString("MaudeGUI.MT_SENDTOMAUDE")); //$NON-NLS-1$
    actSendMaude.setAccelerator(SWT.F9);
    actSendMaude.setImageDescriptor(ImageDescriptor.createFromURL(
        MaudesimpleGUIPlugin.getDefault().find(new Path(Messages.getString("MaudeGUI.MI_SENDTOMAUDE"))))); //$NON-NLS-1$
    actSendMaude.setDisabledImageDescriptor(ImageDescriptor.createFromURL(
        MaudesimpleGUIPlugin.getDefault().find(new Path(Messages.getString("MaudeGUI.MC_SENDTOMAUDE"))))); //$NON-NLS-1$
   
    // Send selection to Maude
    actSendSelMaude = new Action() {
      public void run() {
       
        if (!MaudesimpleGUIPlugin.getDefault().getMaude().isRunning()) {
          MessageDialog.openError(null, Messages.getString("MaudeGUI.E_TITLE"),Messages.getString("MaudeGUI.E_NORUNNING")); //$NON-NLS-1$ //$NON-NLS-2$
        } else {
 
          TextEditor editor;
         
          editor = (TextEditor) activeEditorPart;
         
          ISelection sel = editor.getSelectionProvider().getSelection();
          Object selection = null;
          if(sel instanceof TextSelection) {
            selection = ((TextSelection)sel).getText();
          }
          if(selection!= null && selection.toString().length() > 0)
View Full Code Here

Examples of org.eclipse.ui.editors.text.TextEditor

   * Creates page of the multi-page editor as <code>TextEditor</code>
   * for representing csv content as normal text.
   */
  private void createTextPage() {
    try {
      csvTextEditor = new TextEditor();
      int index = addPage(csvTextEditor, getEditorInput());
      setPageText(index, "Source view");
    } catch (PartInitException e) {
      ErrorDialog.openError(getSite().getShell(), "Error creating nested text editor", null,e.getStatus());
    }
View Full Code Here

Examples of org.eclipse.ui.editors.text.TextEditor

  protected void addPages() {
    try {
      myDisplayGroupPage = new DisplayGroupPage(this, "Display Groups");
      addPage(myDisplayGroupPage);

      myTextEditor = new TextEditor();
      IEditorInput input = this.getEditorInput();
      IFile file = ((FileEditorInput) input).getFile();
      if (!file.exists()) {
        try {
          FileEditorInput fileInput = (FileEditorInput)input;
View Full Code Here

Examples of org.eclipse.ui.editors.text.TextEditor

   * Creates page 0 of the multi-page editor,
   * which contains a text editor.
   */
  void createPage0() {
    try {
      editor = new TextEditor();
      int index = addPage(editor, getEditorInput());
      setPageText(index, editor.getTitle());
    } catch (PartInitException e) {
      ErrorDialog.openError(
        getSite().getShell(),
View Full Code Here

Examples of org.eclipse.ui.editors.text.TextEditor

              Object editorPage = ((MultiPageEditorPart) editor)
                  .getSelectedPage();
              if (!(editorPage instanceof ITextEditor)) {

                IEditorPart[] editorPages = ((MultiPageEditorPart) editor)
                    .findEditors(new TextEditor()
                        .getEditorInput());
                System.out.println(editorPages.length);
                ((MultiPageEditorPart) editor)
                    .setActiveEditor(new TextEditor());
              }

              if (editorPage instanceof ITextEditor) {
                ITextEditor editorTextual = (ITextEditor) editorPage;
                IDocument document = editorTextual
View Full Code Here

Examples of org.eclipse.ui.editors.text.TextEditor

              Object editorPage = ((MultiPageEditorPart) editor)
                  .getSelectedPage();
              if (!(editorPage instanceof ITextEditor)) {

                IEditorPart[] editorPages = ((MultiPageEditorPart) editor)
                    .findEditors(new TextEditor()
                        .getEditorInput());
                System.out.println(editorPages.length);
                ((MultiPageEditorPart) editor)
                    .setActiveEditor(new TextEditor());
              }

              if (editorPage instanceof ITextEditor) {
                ITextEditor editorTextual = (ITextEditor) editorPage;
                IDocument document = editorTextual
View Full Code Here

Examples of org.eclipse.ui.editors.text.TextEditor

            file.create(stringToStream(contents, ResourcesPlugin.getEncoding()), true, null);
            IWorkbenchWindow dw = getWorkbench().getActiveWorkbenchWindow();
            if (dw != null) {
                IWorkbenchPage page = dw.getActivePage();
                if (page != null) {
                    TextEditor editor = (TextEditor) IDE.openEditor(page, file, true);
                    editor.selectAndReveal(contents.length(), 0);
                }
            }
        }
        catch (CoreException e) {
            CCWPlugin.logError(e);
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.