Package com.github.marook.eclipse_remote_control.command.command

Examples of com.github.marook.eclipse_remote_control.command.command.OpenFileCommand


  /**
   * @deprecated Instantiate OpenFileCommand and run fireCmd instead.
   */
  public static void openFile(final String fileName, final int lineNumber) throws IOException {
    final OpenFileCommand cmd = new OpenFileCommand();
    cmd.setFileName(fileName);
    cmd.setLineNumber(lineNumber);
   
    fireCommand(cmd);
  }
View Full Code Here


    }

    final int lineNumber = args.length < 3 ? 1 : parseLineNumber(args[2]);
    final String fileName = args[1];

    final OpenFileCommand cmd = new OpenFileCommand();
    cmd.setFileName(fileName);
    cmd.setLineNumber(lineNumber);

    return cmd;
  }
View Full Code Here

    }
  }

  @Override
  protected void internalExecute(final Command cmd) throws Exception {
    final OpenFileCommand c = (OpenFileCommand) cmd;
   
    final IFile file = javaFileToPluginFile(c.getFileName());
    if (file != null){
      // it seems that file is in the workspace
     
      final IWorkbench workbench = PlatformUI.getWorkbench();
        workbench.getDisplay().syncExec(new Runnable() {
        @Override
        public void run() {
          final IWorkbenchWindow activeWorkbenchWindow =
            workbench.getActiveWorkbenchWindow();
          final IWorkbenchPage page =
              activeWorkbenchWindow.getActivePage();
        
            openInEditor(page, file, c.getLineNumber());
        }
      });
       
        return;
    }
   
    // here comes the alternative approach: open file through EFS local fs
    final File f = new File(c.getFileName());
    final IFileStore fileStore =
      EFS.getLocalFileSystem().getStore(f.toURI());
      final IWorkbench workbench = PlatformUI.getWorkbench();
      workbench.getDisplay().syncExec(new Runnable() {
      @Override
View Full Code Here

TOP

Related Classes of com.github.marook.eclipse_remote_control.command.command.OpenFileCommand

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.