use of org.eclipse.draw2d.FocusEvent in project tdi-studio-se by Talend.
the class TalendDrawerEditPart method createFigure.
@Override
@SuppressWarnings("restriction")
public IFigure createFigure() {
EditPart module = getParent();
if (module instanceof TalendDrawerEditPart) {
TalendDrawerEditPart parent = (TalendDrawerEditPart) getParent();
childLevel = parent.childLevel + 1;
} else {
childLevel = 0;
}
//$NON-NLS-1$
getViewer().getControl().setData("ANIMATE", Boolean.FALSE);
TalendDrawerFigure fig = new TalendDrawerFigure(getViewer().getControl(), childLevel, cssStyleSetting) {
@Override
IFigure buildTooltip() {
return createToolTip();
}
};
//$NON-NLS-1$
getViewer().getControl().setData("ANIMATE", Boolean.TRUE);
fig.setExpanded(getDrawer().isInitiallyOpen());
fig.setPinned(getDrawer().isInitiallyPinned());
fig.getCollapseToggle().addFocusListener(new FocusListener.Stub() {
@Override
public void focusGained(FocusEvent fe) {
getViewer().select(TalendDrawerEditPart.this);
}
});
return fig;
}
use of org.eclipse.draw2d.FocusEvent in project yamcs-studio by yamcs.
the class ScrollbarFigure method initializeListeners.
/**
*/
private void initializeListeners() {
addKeyListener(new KeyListener() {
@Override
public void keyPressed(KeyEvent ke) {
if ((ke.keycode == SWT.ARROW_UP && !isHorizontal()) || (ke.keycode == SWT.ARROW_LEFT && isHorizontal()))
stepUp();
else if ((ke.keycode == SWT.ARROW_DOWN && !isHorizontal()) || (ke.keycode == SWT.ARROW_RIGHT && isHorizontal()))
stepDown();
else if ((ke.keycode == SWT.PAGE_DOWN && !isHorizontal()) || (ke.keycode == SWT.PAGE_UP && isHorizontal()))
pageDown();
else if ((ke.keycode == SWT.PAGE_UP && !isHorizontal()) || (ke.keycode == SWT.PAGE_DOWN && isHorizontal()))
pageUp();
}
@Override
public void keyReleased(KeyEvent ke) {
}
});
addFocusListener(new FocusListener() {
@Override
public void focusGained(FocusEvent fe) {
repaint();
}
@Override
public void focusLost(FocusEvent fe) {
repaint();
}
});
}
Aggregations