本文整理汇总了Java中org.eclipse.swt.widgets.ScrollBar.removeListener方法的典型用法代码示例。如果您正苦于以下问题:Java ScrollBar.removeListener方法的具体用法?Java ScrollBar.removeListener怎么用?Java ScrollBar.removeListener使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.widgets.ScrollBar
的用法示例。
在下文中一共展示了ScrollBar.removeListener方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: removeListeners
import org.eclipse.swt.widgets.ScrollBar; //导入方法依赖的package包/类
void removeListeners() {
if (isValid()) {
proposalTable.removeListener(SWT.FocusOut, this);
ScrollBar scrollbar = proposalTable.getVerticalBar();
if (scrollbar != null) {
scrollbar.removeListener(SWT.Selection, this);
}
getShell().removeListener(SWT.Deactivate, this);
getShell().removeListener(SWT.Close, this);
}
if (control != null && !control.isDisposed()) {
control.removeListener(SWT.MouseDoubleClick, this);
control.removeListener(SWT.MouseDown, this);
control.removeListener(SWT.Dispose, this);
control.removeListener(SWT.FocusOut, this);
Shell controlShell = control.getShell();
controlShell.removeListener(SWT.Move, this);
controlShell.removeListener(SWT.Resize, this);
}
}
示例2: dispose
import org.eclipse.swt.widgets.ScrollBar; //导入方法依赖的package包/类
public void dispose()
{
if (textWidget != null && !textWidget.isDisposed())
{
textWidget.removeListener(SWT.MouseDown, listener);
textWidget.removeListener(SWT.MouseMove, listener);
textWidget.removeListener(SWT.MouseUp, listener);
textWidget.removeListener(SWT.KeyDown, listener);
textWidget.removeListener(SWT.KeyUp, listener);
textWidget.removeListener(SWT.Resize, listener);
ScrollBar vBar = textWidget.getVerticalBar();
if (vBar != null && !vBar.isDisposed())
{
vBar.removeListener(SWT.Selection, listener);
}
}
textWidget = null;
listener = null;
}
示例3: dispose
import org.eclipse.swt.widgets.ScrollBar; //导入方法依赖的package包/类
/**
* Removes all associations between the Editor and the underlying composite.
* The composite and the editor Control are <b>not</b> disposed.
*/
public void dispose() {
if (parent != null && !parent.isDisposed()) {
for (int i = 0; i < EVENTS.length; i++) {
parent.removeListener(EVENTS[i], controlListener);
}
ScrollBar hBar = parent.getHorizontalBar();
if (hBar != null)
hBar.removeListener(SWT.Selection, scrollbarListener);
ScrollBar vBar = parent.getVerticalBar();
if (vBar != null)
vBar.removeListener(SWT.Selection, scrollbarListener);
}
parent = null;
editor = null;
hadFocus = false;
controlListener = null;
scrollbarListener = null;
}
示例4: doCommand
import org.eclipse.swt.widgets.ScrollBar; //导入方法依赖的package包/类
@Override
public boolean doCommand(ILayerCommand command) {
boolean b = super.doCommand(command);
if (command instanceof ClientAreaResizeCommand && command.convertToTargetLayer(this)) {
ClientAreaResizeCommand clientAreaResizeCommand = (ClientAreaResizeCommand) command;
final ScrollBar vBar = clientAreaResizeCommand.getScrollable().getVerticalBar(); // 垂直滚动条
Listener[] listeners = vBar.getListeners(SWT.Selection);
for (Listener listener : listeners) { // 清除默认的 Selection 监听(在类 ScrollBarHandlerTemplate 中添加的)
vBar.removeListener(SWT.Selection, listener);
}
vBar.addListener(SWT.Selection, new Listener() {
private ViewportLayer viewportLayer = HorizontalViewportLayer.this;
private IUniqueIndexLayer scrollableLayer = viewportLayer.getScrollableLayer();
public void handleEvent(Event event) {
// 滚动滚动条前提交当前处于编辑状态的文本段
HsMultiActiveCellEditor.commit(true);
ScrollBar scrollBar = (ScrollBar) event.widget;
int position = scrollableLayer.getRowPositionByY(scrollBar.getSelection());
viewportLayer.invalidateVerticalStructure();
viewportLayer.setOriginRowPosition(position);
vBar.setIncrement(viewportLayer.getRowHeightByPosition(0));
// HsMultiCellEditorControl.activeSourceAndTargetCell(XLIFFEditorImplWithNatTable.getCurrent());
}
});
}
return b;
}
示例5: doCommand
import org.eclipse.swt.widgets.ScrollBar; //导入方法依赖的package包/类
@Override
public boolean doCommand(ILayerCommand command) {
boolean b = super.doCommand(command);
if (command instanceof ClientAreaResizeCommand && command.convertToTargetLayer(this)) {
ClientAreaResizeCommand clientAreaResizeCommand = (ClientAreaResizeCommand) command;
final ScrollBar vBar = clientAreaResizeCommand.getScrollable().getVerticalBar(); // 垂直滚动条
Listener[] listeners = vBar.getListeners(SWT.Selection);
for (Listener listener : listeners) { // 清除默认的 Selection 监听(在类 ScrollBarHandlerTemplate 中添加的)
vBar.removeListener(SWT.Selection, listener);
}
vBar.addListener(SWT.Selection, new Listener() {
private ViewportLayer viewportLayer = HorizontalViewportLayer.this;
private IUniqueIndexLayer scrollableLayer = viewportLayer.getScrollableLayer();
public void handleEvent(Event event) {
// 滚动滚动条前提交当前处于编辑状态的文本段
if (TeActiveCellEditor.isValid())
TeActiveCellEditor.commit();
ScrollBar scrollBar = (ScrollBar) event.widget;
int position = scrollableLayer.getRowPositionByY(scrollBar.getSelection());
viewportLayer.invalidateVerticalStructure();
viewportLayer.setOriginRowPosition(position);
vBar.setIncrement(viewportLayer.getRowHeightByPosition(0));
}
});
}
return b;
}
示例6: doCommand
import org.eclipse.swt.widgets.ScrollBar; //导入方法依赖的package包/类
@Override
public boolean doCommand(ILayerCommand command) {
boolean b = super.doCommand(command);
if (command instanceof ClientAreaResizeCommand && command.convertToTargetLayer(this)) {
ClientAreaResizeCommand clientAreaResizeCommand = (ClientAreaResizeCommand) command;
final ScrollBar vBar = clientAreaResizeCommand.getScrollable().getVerticalBar(); // 垂直滚动条
Listener[] listeners = vBar.getListeners(SWT.Selection);
for (Listener listener : listeners) { // 清除默认的 Selection 监听(在类 ScrollBarHandlerTemplate 中添加的)
vBar.removeListener(SWT.Selection, listener);
}
vBar.addListener(SWT.Selection, new Listener() {
private ViewportLayer viewportLayer = HorizontalViewportLayer.this;
private IUniqueIndexLayer scrollableLayer = viewportLayer.getScrollableLayer();
public void handleEvent(Event event) {
// 滚动滚动条前提交当前处于编辑状态的文本段
HsMultiActiveCellEditor.commit(true);
ScrollBar scrollBar = (ScrollBar) event.widget;
int position = scrollableLayer.getRowPositionByY(scrollBar.getSelection());
viewportLayer.invalidateVerticalStructure();
viewportLayer.setOriginRowPosition(position);
vBar.setIncrement(viewportLayer.getRowHeightByPosition(0));
HsMultiCellEditorControl.activeSourceAndTargetCell(XLIFFEditorImplWithNatTable.getCurrent());
}
});
}
return b;
}