Revision: 74b59cbec856 Branch: default Author: Sahel "sahel.mastoureshgh@xxxxxxxxx" Date: Mon Jul 21 15:35:17 2014 UTC Log: Applied Read only element to boxline http://code.google.com/p/brailleblaster/source/detail?r=74b59cbec856 Modified: /src/main/org/brailleblaster/perspectives/braille/views/wp/BrailleView.java /src/main/org/brailleblaster/perspectives/braille/views/wp/TextView.java =======================================--- /src/main/org/brailleblaster/perspectives/braille/views/wp/BrailleView.java Thu Jul 17 19:46:53 2014 UTC +++ /src/main/org/brailleblaster/perspectives/braille/views/wp/BrailleView.java Mon Jul 21 15:35:17 2014 UTC
@@ -146,7 +146,7 @@if(view.getCaretOffset() > currentEnd || view.getCaretOffset() < currentStart){
setCurrent(); - if(currentElement instanceof PageMapElement){+ if(currentElement instanceof PageMapElement || currentElement instanceof BrlOnlyMapElement){ if((previousEnd != -1 && view.getCaretOffset() < start) || nextStart == -1)
previousValidPosition();else if((nextStart != -1 && view.getCaretOffset() > end) || previousEnd == -1)
@@ -164,7 +164,7 @@if(currentChar == SWT.ARROW_DOWN || currentChar == SWT.ARROW_LEFT || currentChar == SWT.ARROW_RIGHT || currentChar == SWT.ARROW_UP || currentChar == SWT.PAGE_DOWN || currentChar == SWT.PAGE_UP){
if(e.caretOffset >= currentEnd || e.caretOffset < currentStart){ setCurrent(); - if(currentElement instanceof PageMapElement){+ if(currentElement instanceof PageMapElement || currentElement instanceof BrlOnlyMapElement){ if(nextStart != -1 && currentChar == SWT.ARROW_DOWN || currentChar == SWT.ARROW_RIGHT)
nextValidPosition();else if(previousEnd != -1 && currentChar == SWT.ARROW_LEFT || currentChar == SWT.ARROW_UP)
@@ -219,13 +219,13 @@ private void previousValidPosition(){TextMapElement t = manager.getElementInBrailleRange(view.getCaretOffset());
int index= manager.indexOf(t);- while((t.brailleList.getFirst().start != 0 && manager.indexOf(t) != 0) && t instanceof PageMapElement){ + while(((t.brailleList.getFirst().start != 0 && manager.indexOf(t) != 0) && t instanceof PageMapElement) || ((t.brailleList.getFirst().start != 0 && manager.indexOf(t) != 0) && t instanceof BrlOnlyMapElement)){
index--; t = manager.getTextMapElement(index); } currentChar = SWT.ARROW_UP; - if(t instanceof PageMapElement){ + if(t instanceof PageMapElement || t instanceof BrlOnlyMapElement){ view.setCaretOffset(t.brailleList.getLast().end); nextValidPosition(); } @@ -236,13 +236,13 @@ private void nextValidPosition(){TextMapElement t = manager.getElementInBrailleRange(view.getCaretOffset());
int index = manager.indexOf(t);- while((t.brailleList.getLast().end != view.getCharCount() && manager.indexOf(t) != manager.getListSize() - 1) && t instanceof PageMapElement){ + while(((t.brailleList.getLast().end != view.getCharCount() && manager.indexOf(t) != manager.getListSize() - 1) && t instanceof PageMapElement) || ((t.brailleList.getLast().end != view.getCharCount() && manager.indexOf(t) != manager.getListSize() - 1) && t instanceof BrlOnlyMapElement)){
index++; t = manager.getTextMapElement(index); } currentChar = SWT.ARROW_DOWN; - if(t instanceof PageMapElement){ + if(t instanceof PageMapElement || t instanceof BrlOnlyMapElement){ view.setCaretOffset(t.brailleList.getFirst().start); previousValidPosition(); } =======================================--- /src/main/org/brailleblaster/perspectives/braille/views/wp/TextView.java Thu Jul 17 20:03:48 2014 UTC +++ /src/main/org/brailleblaster/perspectives/braille/views/wp/TextView.java Mon Jul 21 15:35:17 2014 UTC
@@ -292,7 +292,7 @@ } setCurrent(view.getCaretOffset()); - if(currentElement instanceof PageMapElement){+ if(currentElement instanceof PageMapElement|| currentElement instanceof BrlOnlyMapElement){ if(nextStart != -1 && currentChar == SWT.ARROW_DOWN || currentChar == SWT.ARROW_RIGHT)
nextValidPosition();else if(previousEnd != -1 && currentChar == SWT.ARROW_LEFT || currentChar == SWT.ARROW_UP)
@@ -321,7 +321,7 @@ sendUpdate(); setCurrent(view.getCaretOffset()); - if(currentElement instanceof PageMapElement){+ if(currentElement instanceof PageMapElement || currentElement instanceof BrlOnlyMapElement){ if((previousEnd != -1 && view.getCaretOffset() < start) || nextStart == -1)
previousValidPosition();else if((nextStart != -1 && view.getCaretOffset() > end) || previousEnd == -1)
@@ -434,13 +434,13 @@ private void nextValidPosition(){ TextMapElement t = manager.getElementInRange(view.getCaretOffset()); int index = manager.indexOf(t);- while((t.end != view.getCharCount() && manager.indexOf(t) != manager.getListSize() - 1) && t instanceof PageMapElement){ + while(((t.end != view.getCharCount() && manager.indexOf(t) != manager.getListSize() - 1) && t instanceof PageMapElement) || ((t.end != view.getCharCount() && manager.indexOf(t) != manager.getListSize() - 1) &&t instanceof BrlOnlyMapElement)){
index++; t = manager.getTextMapElement(index); } currentChar = SWT.ARROW_DOWN; - if(t instanceof PageMapElement){ + if(t instanceof PageMapElement || t instanceof BrlOnlyMapElement){ view.setCaretOffset(t.start); previousValidPosition(); } @@ -451,13 +451,13 @@ private void previousValidPosition(){ TextMapElement t = manager.getElementInRange(view.getCaretOffset()); int index = manager.indexOf(t);- while((t.start != 0 && manager.indexOf(t) != 0) && t instanceof PageMapElement){ + while(((t.start != 0 && manager.indexOf(t) != 0) && t instanceof PageMapElement )|| ((t.start != 0 && manager.indexOf(t) != 0) && t instanceof BrlOnlyMapElement)){
index--; t = manager.getTextMapElement(index); } currentChar = SWT.ARROW_UP; - if(t instanceof PageMapElement){ + if(t instanceof PageMapElement || t instanceof BrlOnlyMapElement){ view.setCaretOffset(t.end); nextValidPosition(); }