当前位置: 首页>>代码示例>>Java>>正文


Java ScrollBar.removeListener方法代码示例

本文整理汇总了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);
	}
}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:25,代码来源:MyContentProposalAdapter.java

示例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;
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:20,代码来源:ConsoleAutoScrollPageParticipant.java

示例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;
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:24,代码来源:ControlEditor.java

示例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;
	}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:34,代码来源:HorizontalViewportLayer.java

示例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;
}
 
开发者ID:heartsome,项目名称:tmxeditor8,代码行数:34,代码来源:HorizontalViewportLayer.java

示例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;
}
 
开发者ID:heartsome,项目名称:tmxeditor8,代码行数:34,代码来源:HorizontalViewportLayer.java


注:本文中的org.eclipse.swt.widgets.ScrollBar.removeListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。