Package org.eclipse.jface.text

Examples of org.eclipse.jface.text.Region


        IRegion r = getLink(line, offsetInLine);
        if (r != null) {
            final String text = line.substring(r.getOffset(),
                    r.getOffset() + r.getLength());
            r = new Region(lineInfo.getOffset() + r.getOffset(), r.getLength());

            return new IHyperlink[] { new TraceHyperlink(r, text) };
        }
        return null;
    }
View Full Code Here


            if (line.indexOf('(') < 0) {
                return null;
            }
            pos = line.length();
        }
        return new Region(offset, pos - offset);
    }
View Full Code Here

            selection.y = -selection.y;
        }

        selection.x = widgetOffset2ModelOffset(sourceViewer, selection.x);

        return new Region(selection.x, selection.y);
    }
View Full Code Here

            editor.reconcileNow();
            final ErlToken token = editor.getScanner().getTokenAt(offset);
            if (token == null) {
                return null;
            }
            return new Region(token.getOffset(), token.getLength());
        }
        return null;
    }
View Full Code Here

        if (dirtyRegion != null) {
            fStrategy.reconcile(dirtyRegion);
        } else {
            final IDocument document = getDocument();
            if (document != null) {
                fStrategy.reconcile(new Region(0, document.getLength()));
            }
        }
    }
View Full Code Here

                final IDocument document = textViewer.getDocument();
                final IRegion lineInfo = document.getLineInformationOfOffset(offset);
                final String line = document.get(lineInfo.getOffset(), lineInfo.getLength());
                final int lineRelativeOffset = offset - lineInfo.getOffset();
                final int index = line.indexOf(javaElement.getElementName());
                return new Region(offset - lineRelativeOffset + index, javaElement.getElementName().length());
              } catch (final Exception ex) {
                return null;
              }
            }
          }
View Full Code Here

      int start = line.lastIndexOf("(", lineRelativeOffset) + 1;
      start = line.indexOf('"', start) + 1;
      if (start == 0)
        return null;
      final int end = line.indexOf('"', start);
      return new Region(offset - (lineRelativeOffset - start), end - start);
    } catch (final BadLocationException e) {
      return null;
    }
  }
View Full Code Here

        start = line.lastIndexOf('(', lineRelativeOffset);
      }
      if (start == -1) {
        return null;
      }
      return new Region(offset - lineRelativeOffset + start, 1);
    } catch (final BadLocationException e) {
      return null;
    }
  }
View Full Code Here

      start = line.lastIndexOf('"', lineRelativeOffset) + 1;
      if (start == 0) {
        return null;
      }
      final int end = line.indexOf('"', lineRelativeOffset);
      return new Region(offset - (lineRelativeOffset - start), end - start);
    } catch (final BadLocationException e) {
      return null;
    }
  }
View Full Code Here

                } else {
                    end = endOfLineOf(end);
                }

                end = Math.min(partition.getOffset() + partition.getLength(), end);
                return new Region(start, end - start);

            } catch (BadLocationException x) {
                // FIXME hu ? needs some comment
                IvyPlugin.logWarn("Something bad happened", x);
            }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.text.Region

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.