use of org.eclipse.swt.custom.CaretEvent in project otertool by wuntee.
the class CTabItemWithHexViewer method addListeners.
private void addListeners(final StyledText txt) {
txt.addMouseWheelListener(new MouseWheelListener() {
public void mouseScrolled(MouseEvent arg0) {
binContent.setTopIndex(txt.getTopIndex());
hexContent.setTopIndex(txt.getTopIndex());
counter.setTopIndex(txt.getTopIndex());
}
});
txt.addSelectionListener(new SelectionListener() {
public void widgetDefaultSelected(SelectionEvent arg0) {
binContent.setTopIndex(txt.getTopIndex());
hexContent.setTopIndex(txt.getTopIndex());
counter.setTopIndex(txt.getTopIndex());
}
public void widgetSelected(SelectionEvent arg0) {
binContent.setTopIndex(txt.getTopIndex());
hexContent.setTopIndex(txt.getTopIndex());
counter.setTopIndex(txt.getTopIndex());
}
});
txt.addKeyListener(new KeyAdapter() {
@Override
public void keyPressed(KeyEvent arg0) {
binContent.setTopIndex(txt.getTopIndex());
hexContent.setTopIndex(txt.getTopIndex());
counter.setTopIndex(txt.getTopIndex());
}
});
txt.addMouseListener(new MouseAdapter() {
@Override
public void mouseDown(MouseEvent arg0) {
binContent.setTopIndex(txt.getTopIndex());
hexContent.setTopIndex(txt.getTopIndex());
counter.setTopIndex(txt.getTopIndex());
}
});
txt.addCaretListener(new CaretListener() {
public void caretMoved(CaretEvent arg0) {
binContent.setTopIndex(txt.getTopIndex());
hexContent.setTopIndex(txt.getTopIndex());
counter.setTopIndex(txt.getTopIndex());
}
});
txt.addDragDetectListener(new DragDetectListener() {
public void dragDetected(DragDetectEvent arg0) {
binContent.setTopIndex(txt.getTopIndex());
hexContent.setTopIndex(txt.getTopIndex());
counter.setTopIndex(txt.getTopIndex());
}
});
ScrollBar vbar = txt.getVerticalBar();
if (vbar != null) {
vbar.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event arg0) {
binContent.setTopIndex(txt.getTopIndex());
hexContent.setTopIndex(txt.getTopIndex());
counter.setTopIndex(txt.getTopIndex());
}
});
}
}
Aggregations