LPEX
4.4.0

com.ibm.lpex.samples
Class MouseReselect

java.lang.Object
  extended by com.ibm.lpex.core.LpexViewAdapter
      extended by com.ibm.lpex.samples.MouseReselect
All Implemented Interfaces:
LpexViewListener

public class MouseReselect
extends LpexViewAdapter

Sample class to make new drags of mouse button 1 start new selections.

LPEX non-stream selections are by default extended on mouse drags in the same view. They must be explicitly cleared (with, for example, Alt+U) before marking a new block. Installing this class changes the default behavior of a view such that a new mouse drag action (mouse button 1 with no key modifiers) will always start a new selection.

Here is the MouseReselect source code.

A user profile (such as TestUserProfile) can install this feature in a document view by calling:

  MouseReselect.install(lpexView);

See also BlockNewMarkToMouseAction as an example of an editor action that installs this feature when it is run for the first time.

See Also:
All the samples

Method Summary
 void disposed(LpexView lpexView)
          View listener - the view is being disposed.
static void install(LpexView lpexView)
          Installs mouse reselection in the given document view.
 void mouseDoubleClick(MouseEvent e)
          Mouse listener - button double click.
 void mouseDown(MouseEvent e)
          Mouse listener - button pressed.
 void mouseMove(MouseEvent e)
          Mouse move listener.
 void mouseUp(MouseEvent e)
          Mouse listener - button released.
 void shown(LpexView lpexView)
          View listener - the view has been refreshed.
 void widgetDisposed(DisposeEvent e)
          Text window dispose listener - the window is being disposed.
 
Methods inherited from class com.ibm.lpex.core.LpexViewAdapter
readonly, renamed, renaming, saved, saving, showing, updateProfile
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

install

public static void install(LpexView lpexView)
Installs mouse reselection in the given document view. Does nothing if already installed.


shown

public void shown(LpexView lpexView)
View listener - the view has been refreshed. Installs our mouse listeners as soon as an LPEX window has been associated with the view. Assumes that the specified document view will only ever be shown in this window.

Specified by:
shown in interface LpexViewListener
Overrides:
shown in class LpexViewAdapter
See Also:
LpexViewListener.showing(com.ibm.lpex.core.LpexView)

disposed

public void disposed(LpexView lpexView)
View listener - the view is being disposed. Uninstalls the mouse reselection from this view.

Specified by:
disposed in interface LpexViewListener
Overrides:
disposed in class LpexViewAdapter

widgetDisposed

public void widgetDisposed(DisposeEvent e)
Text window dispose listener - the window is being disposed. Uninstalls the mouse reselection.


mouseDoubleClick

public void mouseDoubleClick(MouseEvent e)
Mouse listener - button double click.


mouseUp

public void mouseUp(MouseEvent e)
Mouse listener - button released.


mouseDown

public void mouseDown(MouseEvent e)
Mouse listener - button pressed. Records whether it is a sole button 1.


mouseMove

public void mouseMove(MouseEvent e)
Mouse move listener. Clears any existing selection if a sole mouse button 1 (i.e., with no key modifiers) was just pressed and is now dragged in our view's window.


LPEX
4.4.0

Copyright � 2016 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.