本文整理了Java中org.eclipse.swt.widgets.ScrollBar.addListener()
方法的一些代码示例,展示了ScrollBar.addListener()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ScrollBar.addListener()
方法的具体详情如下:
包路径:org.eclipse.swt.widgets.ScrollBar
类名称:ScrollBar
方法名:addListener
暂无
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
/**
* Creates a ControlEditor for the specified Composite.
*
* @param parent the Composite above which this editor will be displayed
*/
public ControlEditor( Composite parent ) {
this.parent = parent;
controlListener = new Listener() {
public void handleEvent( Event e ) {
layout();
}
};
for( int i = 0; i < EVENTS.length; i++ ) {
parent.addListener( EVENTS[ i ], controlListener );
}
scrollbarListener = new Listener() {
public void handleEvent( Event e ) {
scroll( e );
}
};
ScrollBar hBar = parent.getHorizontalBar();
ScrollBar vBar = parent.getVerticalBar();
if( hBar != null ) {
hBar.addListener( SWT.Selection, scrollbarListener );
}
if( vBar != null ) {
vBar.addListener( SWT.Selection, scrollbarListener );
}
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
if (hBar != null) hBar.addListener (SWT.Selection, scrollbarListener);
ScrollBar vBar = parent.getVerticalBar ();
if (vBar != null) vBar.addListener (SWT.Selection, scrollbarListener);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
if (hBar != null) hBar.addListener (SWT.Selection, scrollbarListener);
ScrollBar vBar = parent.getVerticalBar ();
if (vBar != null) vBar.addListener (SWT.Selection, scrollbarListener);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
if (hBar != null) hBar.addListener (SWT.Selection, scrollbarListener);
ScrollBar vBar = parent.getVerticalBar ();
if (vBar != null) vBar.addListener (SWT.Selection, scrollbarListener);
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
/**
* Creates a ControlEditor for the specified Composite.
*
* @param parent the Composite above which this editor will be displayed
*
*/
public ControlEditor (Composite parent) {
this.parent = parent;
controlListener = new Listener() {
public void handleEvent(Event e) {
layout ();
}
};
for (int i=0; i<EVENTS.length; i++) {
parent.addListener (EVENTS [i], controlListener);
}
scrollbarListener = new Listener() {
public void handleEvent(Event e) {
scroll (e);
}
};
ScrollBar hBar = parent.getHorizontalBar ();
if (hBar != null) hBar.addListener (SWT.Selection, scrollbarListener);
ScrollBar vBar = parent.getVerticalBar ();
if (vBar != null) vBar.addListener (SWT.Selection, scrollbarListener);
}
Rectangle computeBounds () {
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
if (hBar != null) hBar.addListener (SWT.Selection, scrollbarListener);
ScrollBar vBar = parent.getVerticalBar ();
if (vBar != null) vBar.addListener (SWT.Selection, scrollbarListener);
代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener(listener);
addListener(SWT.Selection,typedListener);
addListener(SWT.DefaultSelection,typedListener);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener (listener);
addListener (SWT.Selection,typedListener);
addListener (SWT.DefaultSelection,typedListener);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener (listener);
addListener (SWT.Selection,typedListener);
addListener (SWT.DefaultSelection,typedListener);
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener(listener);
addListener (SWT.Selection,typedListener);
addListener (SWT.DefaultSelection,typedListener);
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
if (listener == null) error (SWT.ERROR_NULL_ARGUMENT);
TypedListener typedListener = new TypedListener (listener);
addListener (SWT.Selection,typedListener);
addListener (SWT.DefaultSelection,typedListener);
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt
addListener( SWT.Selection, typedListener );
addListener( SWT.DefaultSelection, typedListener );
代码示例来源:origin: org.eclipse/org.eclipse.compare
public ImageCanvas(Composite parent, int style) {
super(parent, style | SWT.H_SCROLL | SWT.V_SCROLL);
ScrollBar sb= getHorizontalBar();
sb.setIncrement(20);
sb.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
repaint();
}
});
sb= getVerticalBar();
sb.setIncrement(20);
sb.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event e) {
repaint();
}
});
addListener(SWT.Resize, new Listener() {
public void handleEvent(Event e) {
updateScrollbars();
}
});
addListener(SWT.Paint, new Listener() {
public void handleEvent(Event event) {
paint(event.gc);
}
});
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.compare
public ImageCanvas(Composite parent, int style) {
super(parent, style | SWT.H_SCROLL | SWT.V_SCROLL);
ScrollBar sb= getHorizontalBar();
sb.setIncrement(20);
sb.addListener(SWT.Selection, e -> repaint());
sb= getVerticalBar();
sb.setIncrement(20);
sb.addListener(SWT.Selection, e -> repaint());
addListener(SWT.Resize, e -> updateScrollbars());
addListener(SWT.Paint, event -> paint(event.gc));
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc
verticalBar.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
horizontalBar.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x
verticalBar.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
horizontalBar.addListener(SWT.Selection, new Listener() {
@Override
public void handleEvent(Event event) {
代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.jface
void installListeners() {
// Listeners on this popup's table and scroll bar
proposalTable.addListener(SWT.FocusOut, this);
ScrollBar scrollbar = proposalTable.getVerticalBar();
if (scrollbar != null) {
scrollbar.addListener(SWT.Selection, this);
}
// Listeners on this popup's shell
getShell().addListener(SWT.Deactivate, this);
getShell().addListener(SWT.Close, this);
// Listeners on the target control
control.addListener(SWT.MouseDoubleClick, this);
control.addListener(SWT.MouseDown, this);
control.addListener(SWT.Dispose, this);
control.addListener(SWT.FocusOut, this);
// Listeners on the target control's shell
Shell controlShell = control.getShell();
controlShell.addListener(SWT.Move, this);
// RAP [if] Don't add a resize listener because of
// TextSizeDetermnation
// controlShell.addListener(SWT.Resize, this);
// RAPEND [if]
}
代码示例来源:origin: org.eclipse.platform/org.eclipse.jface
void installListeners() {
// Listeners on this popup's table and scroll bar
proposalTable.addListener(SWT.FocusOut, this);
ScrollBar scrollbar = proposalTable.getVerticalBar();
if (scrollbar != null) {
scrollbar.addListener(SWT.Selection, this);
}
// Listeners on this popup's shell
getShell().addListener(SWT.Deactivate, this);
getShell().addListener(SWT.Close, this);
// Listeners on the target control
control.addListener(SWT.MouseDoubleClick, this);
control.addListener(SWT.MouseDown, this);
control.addListener(SWT.Dispose, this);
control.addListener(SWT.FocusOut, this);
// Listeners on the target control's shell
Shell controlShell = control.getShell();
controlShell.addListener(SWT.Move, this);
controlShell.addListener(SWT.Resize, this);
}
代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jface
void installListeners() {
// Listeners on this popup's table and scroll bar
proposalTable.addListener(SWT.FocusOut, this);
ScrollBar scrollbar = proposalTable.getVerticalBar();
if (scrollbar != null) {
scrollbar.addListener(SWT.Selection, this);
}
// Listeners on this popup's shell
getShell().addListener(SWT.Deactivate, this);
getShell().addListener(SWT.Close, this);
// Listeners on the target control
control.addListener(SWT.MouseDoubleClick, this);
control.addListener(SWT.MouseDown, this);
control.addListener(SWT.Dispose, this);
control.addListener(SWT.FocusOut, this);
// Listeners on the target control's shell
Shell controlShell = control.getShell();
controlShell.addListener(SWT.Move, this);
controlShell.addListener(SWT.Resize, this);
}
代码示例来源:origin: com.diffplug.durian/durian-swt
e.doit = false;
});
getVerticalBar().addListener(SWT.Selection, e -> {
setTopPixelSaturated(getVerticalBar().getSelection() + minTopPixel);
});
内容来源于网络,如有侵权,请联系作者删除!