Class PiccoloViewerUI.LabelTextWidgetListener

java.lang.Object
de.cau.cs.kieler.klighd.ui.viewers.PiccoloViewerUI.LabelTextWidgetListener
All Implemented Interfaces:
org.eclipse.swt.widgets.Listener
Enclosing class:
PiccoloViewerUI

public static class PiccoloViewerUI.LabelTextWidgetListener extends Object implements org.eclipse.swt.widgets.Listener
SWT event Listener implementation that is dedicated to the creation and propagation of KlighdTextSelections after corresponding mouse and key events notified to the employed label text widget.

Note: This class may be subclassed. However, make sure to call super.handleEvent(event) for the event types distinguished in this implementation. Make also sure to register your subclass for additional event types if necessary, see LabelTextWidgetListener(PiccoloViewerUI, StyledText).
Author:
chsch
  • Constructor Details

    • LabelTextWidgetListener

      public LabelTextWidgetListener(PiccoloViewerUI viewer, org.eclipse.swt.custom.StyledText textLabelWidget)
      Constructor.
      Parameters:
      viewer - employed instance of PiccoloViewerUI
      textLabelWidget - the employed instance of StyledText
  • Method Details

    • getFigureNode

      protected KlighdNode.KlighdFigureNode<KText> getFigureNode()
      Provides the KlighdNode.KlighdFigureNode the label text widget is currently attached to. Make sure to let this method be executed by the UI thread as it relies on Widget#getData().
      Returns:
      the desired KlighdNode.KlighdFigureNode
    • getPrevSelection

      protected String getPrevSelection()
      Returns:
      the prevSelection
    • setPrevSelection

      protected void setPrevSelection(String prevSelection)
      Parameters:
      prevSelection - the prevSelection to set
    • handleEvent

      public void handleEvent(org.eclipse.swt.widgets.Event event)
      Specified by:
      handleEvent in interface org.eclipse.swt.widgets.Listener