コード例 #1
0
 public boolean removeTextLocation(String category, MateTextLocation location) {
   try {
     mateText.getDocument().removePosition(category, (SwtMateTextLocation) location);
     return true;
   } catch (BadPositionCategoryException e) {
     e.printStackTrace();
   }
   return false;
 }
コード例 #2
0
  public boolean addTextLocation(String category, MateTextLocation location) {
    try {
      mateText.getDocument().addPosition(category, (SwtMateTextLocation) location);
      return true;
    } catch (BadLocationException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    } catch (BadPositionCategoryException e) {
      e.printStackTrace();
    }

    return false;
  }
コード例 #3
0
 public SwtMateDocument(MateText mateText) {
   this.mateText = mateText;
   this.document = (Document) mateText.getDocument();
   for (IPositionUpdater u : document.getPositionUpdaters()) {
     document.removePositionUpdater(u);
   }
   document.addPositionCategory("scopes");
   document.addPositionUpdater(
       new SwtScopePositionUpdater("scopes", SwtScopePositionUpdater.RIGHT_GRAVITY));
   document.addPositionCategory("lefts");
   document.addPositionUpdater(
       new SwtScopePositionUpdater("lefts", SwtScopePositionUpdater.LEFT_GRAVITY));
   document.addPositionCategory("rights");
   document.addPositionUpdater(
       new SwtScopePositionUpdater("rights", SwtScopePositionUpdater.RIGHT_GRAVITY));
 }