Package com.google.collide.shared.document.anchor.Anchor

Examples of com.google.collide.shared.document.anchor.Anchor.ShiftListener


      // Add anchors at the conflict regions' boundaries, so their position/size
      // gets adjusted automatically as the user enters text in and around them.
      startLineAnchor = doc.addAnchor(
          CONFLICT_CHUNK_START_LINE, chunk.getStartLine(), AnchorManager.IGNORE_COLUMN);
      startLineAnchor.setRemovalStrategy(Anchor.RemovalStrategy.SHIFT);
      startLineAnchor.getShiftListenerRegistrar().add(new ShiftListener() {
          @Override
        public void onAnchorShifted(Anchor anchor) {
          setStartLine(anchor.getLineNumber());
        }
      });
      endLineAnchor =
          doc.addAnchor(CONFLICT_CHUNK_END_LINE, chunk.getEndLine(), AnchorManager.IGNORE_COLUMN);
      endLineAnchor.setInsertionPlacementStrategy(InsertionPlacementStrategy.LATER);
      endLineAnchor.setRemovalStrategy(Anchor.RemovalStrategy.SHIFT);
      endLineAnchor.getShiftListenerRegistrar().add(new ShiftListener() {
          @Override
        public void onAnchorShifted(Anchor anchor) {
          setEndLine(anchor.getLineNumber());
        }
      });
View Full Code Here


   
    Anchor shiftAnchor =
        doc.getAnchorManager().createAnchor(DOCUMENT_TEST_ANCHOR_TYPE,
            doc.getLineFinder().findLine(doc.getLineCount() / 2).line(), doc.getLineCount() / 2, 0);
    shiftAnchor.setRemovalStrategy(RemovalStrategy.SHIFT);
    shiftAnchor.getShiftListenerRegistrar().add(new ShiftListener() {
      @Override
      public void onAnchorShifted(Anchor anchor) {
        callbackOrdering.add(ShiftListener.class);
      }
    });
View Full Code Here

TOP

Related Classes of com.google.collide.shared.document.anchor.Anchor.ShiftListener

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.