Package org.eclipse.swt.custom

Examples of org.eclipse.swt.custom.StyledText.addMouseListener()


    StyledText text= fTextViewer.getTextWidget();
    if (text == null)
      return;

    text.addMouseListener(this);
    text.addFocusListener(this);
    fTextViewer.addTextListener(this);

    ISelectionProvider selectionProvider= fTextViewer.getSelectionProvider();
    if (selectionProvider != null)
View Full Code Here


    fTextViewer.addTextListener(this);

    StyledText text= fTextViewer.getTextWidget();
    text.addKeyListener(this);
    text.addMouseListener(this);
  }

  /**
   * Disposes this paint manager. The paint manager uninstalls itself
   * and clears all registered painters. This method is also called when the
View Full Code Here

        }
      };
    });
    */

    styledText.addMouseListener(getCursorListener());
    styledText.addKeyListener(getCursorListener());

    // Disable orientation switching until we fully support it.
    styledText.addListener(SWT.OrientationChange, new Listener() {
      public void handleEvent(Event event) {
View Full Code Here

    protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
        PySourceViewer viewer = (PySourceViewer) super.createSourceViewer(parent, ruler, styles);
        //add a cursor listener
        StyledText textWidget = viewer.getTextWidget();
        PyEditCursorListener cursorListener = new PyEditCursorListener();
        textWidget.addMouseListener(cursorListener);
        textWidget.addKeyListener(cursorListener);

        viewer.appendVerifyKeyListener(PyPeerLinker.createVerifyKeyListener(viewer));
        viewer.appendVerifyKeyListener(PyBackspace.createVerifyKeyListener(viewer, this));
        VerifyKeyListener createVerifyKeyListener = FirstCharAction.createVerifyKeyListener(viewer, this.getSite(),
View Full Code Here

     */
    public String updatePresentation(Drawable drawable, String hoverInfo, TextPresentation presentation, int maxWidth,
            int maxHeight) {
        if (drawable instanceof StyledText) {
            final StyledText styledText = (StyledText) drawable;
            styledText.addMouseListener(new MouseAdapter() {

                public void mouseDown(MouseEvent e) {
                    int offset;
                    try {
                        offset = styledText.getOffsetAtLocation(new Point(e.x, e.y));
View Full Code Here

        StyledText text = fTextViewer.getTextWidget();
        if (text == null)
            return;

        text.addMouseListener(this);
        text.addFocusListener(this);
        fTextViewer.addTextListener(this);

        ISelectionProvider selectionProvider = fTextViewer.getSelectionProvider();
        if (selectionProvider != null)
View Full Code Here

    public String updatePresentation(Drawable drawable, String hoverInfo, TextPresentation presentation, int maxWidth,
            int maxHeight) {
        if (drawable instanceof StyledText) {
            final StyledText styledText = (StyledText) drawable;
            styledText.addMouseListener(new MouseAdapter() {

                public void mouseDown(MouseEvent e) {
                    try {
                        int offset = styledText.getOffsetAtLocation(new Point(e.x, e.y));
                        StyleRange r = styledText.getStyleRangeAtOffset(offset);
View Full Code Here

        else
          t.setCursor(sys_normalCursor);
      }
    });
    // react on link click
    t.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseDown(final MouseEvent e) {
        // only process the hyper link if it was a primary mouse click
        if (e.button != 1)
          return;
View Full Code Here

    if (text == null || text.isDisposed())
      return;

    text.getDisplay().addFilter(SWT.KeyUp, this);
    text.addKeyListener(this);
    text.addMouseListener(this);
    text.addMouseMoveListener(this);
    text.addFocusListener(this);
    text.addMouseTrackListener(this);

    fTextViewer.addTextListener(this);
View Full Code Here

   */
  private void addListeners() {
    StyledText text= fTextViewer.getTextWidget();
    if (text != null) {
      fKeyAndMouseListener= new KeyAndMouseListener();
      text.addMouseListener(fKeyAndMouseListener);
      text.addKeyListener(fKeyAndMouseListener);
      fTextInputListener= new TextInputListener();
      fTextViewer.addTextInputListener(fTextInputListener);
    }
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.