當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。