本文整理匯總了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;
}