Package jetbrains.communicator.core.vfs

Examples of jetbrains.communicator.core.vfs.CodePointer


    });
    testCase.markLastListenerForCleanup();

    log[0] = "";

    CodePointer pointer = new CodePointer(0, 1);
    VFile file = VFile.create("path");

    self.sendCodeIntervalPointer(file, pointer, "comment���< && 53", testCase.getBroadcaster());

    new WaitFor(2000) {
View Full Code Here


  static UserModel getUserModel() {
    return ((UserModel) Pico.getInstance().getComponentInstanceOfType(UserModel.class));
  }

  static CodePointer getCodePointer(Editor editor) {
    CodePointer codePointer;
    int selectionStart = editor.getSelectionModel().getSelectionStart();
    int selectionEnd = editor.getSelectionModel().getSelectionEnd();
    if (selectionStart != selectionEnd) {
      LogicalPosition start = editor.offsetToLogicalPosition(selectionStart);
      LogicalPosition end = editor.offsetToLogicalPosition(selectionEnd);
      codePointer = new CodePointer(start.line, start.column, end.line, end.column);
    }
    else {
      LogicalPosition pos = editor.getCaretModel().getLogicalPosition();
      codePointer = new CodePointer(pos.line, pos.column);
    }
    return codePointer;
  }
View Full Code Here

    if (vFile == null) {
      LOG.info("Unable to send code pointer for " + file);
      return;
    }

    CodePointer codePointer = ActionUtil.getCodePointer(editor);

    SendCodePointerCommand command =
        Pico.getCommandManager().getCommand(SendCodePointerCommand.class, BaseAction.getContainer(editor.getProject()));
    command.setCodePointer(codePointer);
    command.setVFile(vFile);
View Full Code Here

  public SendCodePointerAction() {
    super(SendCodePointerCommand.class);
  }

  protected void prepareCommand(FileCommand command, Editor editor, MutablePicoContainer container) {
    CodePointer codePointer = ActionUtil.getCodePointer(editor);
    ((SendCodePointerCommand) command).setCodePointer(codePointer);
  }
View Full Code Here

    assertEquals("Bad projectName", file1.getProjectName(), file2.getProjectName());
    assertEquals("Bad sourcePath", file1.getSourcePath(), file2.getSourcePath());
  }

  public void testSimplest() throws Throwable {
    _test("", VFile.create("some/path"), new CodePointer(1,2,3,4));
  }
View Full Code Here

    expected.setContents("#$@#@#$\u0447\u0442\u043e-\u0442\u043e \u0442\u0430\u043a\u043e\u0435");
    expected.setProjectName("project");
    expected.setFQName("some FQName");
    expected.setSourcePath("some source path");

    _test("", expected, new CodePointer(1,2,3,4));
  }
View Full Code Here

  }

  public void testEnabled() throws Exception {
    assertFalse(myCommand.isEnabled());

    myCommand.setCodePointer(new CodePointer(0,0));
    assertFalse(myCommand.isEnabled());

    myCommand.setVFile(VFile.create("a path"));
    assertFalse(myCommand.isEnabled());
View Full Code Here

    myCommand.setUser(new MockUser());
    assertTrue("Now codePointer, file, user are selected - ready to send", myCommand.isEnabled());
  }

  public void testExecute_WithMessage() throws Exception {
    final CodePointer codePointerToSend = new CodePointer(0, 0);
    final VFile fileToSend = VFile.create("a path");

    final boolean [] sent = new boolean[1];
    MockUser user = new MockUser() {
      @Override
View Full Code Here

  }

  public void testExecute_LocalMessage() throws Exception {
    addEventListener();

    final CodePointer codePointerToSend = new CodePointer(0, 0);
    final VFile fileToSend = VFile.create("a path");
    User user = UserImpl.create("user", MockTransport.NAME);

    myCommand.setCodePointer(codePointerToSend);
    myCommand.setVFile(fileToSend);
View Full Code Here

      public void sendCodeIntervalPointer(VFile file, CodePointer pointer, String comment, EventBroadcaster eventBroadcaster) {
        sent[0] = true;
      }
    };

    myCommand.setCodePointer(new CodePointer(0, 0));
    myCommand.setVFile(VFile.create("a path"));
    myCommand.setUser(user);

    myFacadeMock.expects(once()).method("getMessage").will(returnValue(null));
View Full Code Here

TOP

Related Classes of jetbrains.communicator.core.vfs.CodePointer

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.