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


Java TraverseEvent类代码示例

本文整理汇总了Java中org.eclipse.swt.events.TraverseEvent的典型用法代码示例。如果您正苦于以下问题:Java TraverseEvent类的具体用法?Java TraverseEvent怎么用?Java TraverseEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TraverseEvent类属于org.eclipse.swt.events包,在下文中一共展示了TraverseEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createControl

import org.eclipse.swt.events.TraverseEvent; //导入依赖的package包/类
protected Control createControl() {
  m_Text = new Text(m_Table, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);
  m_Text.addKeyListener(new KeyAdapter() {
    public void keyPressed(KeyEvent e) {
      try {
        onKeyPressed(e);
      } catch (Exception ex) {
      }
    }
  });
  m_Text.addTraverseListener(new TraverseListener() {
    public void keyTraversed(TraverseEvent arg0) {
      onTraverse(arg0);
    }
  });
  return m_Text;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:18,代码来源:KTableCellEditorMultilineWrapText.java

示例2: createControl

import org.eclipse.swt.events.TraverseEvent; //导入依赖的package包/类
protected Control createControl() {
  // System.out.println("Created a new one.");
  m_Text = new Text(m_Table, SWT.NONE);
  m_Text.addKeyListener(new KeyAdapter() {
    public void keyPressed(KeyEvent e) {
      try {
        onKeyPressed(e);
      } catch (Exception ex) {
      }
    }
  });
  m_Text.addTraverseListener(new TraverseListener() {
    public void keyTraversed(TraverseEvent arg0) {
      onTraverse(arg0);
    }
  });
  return m_Text;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:19,代码来源:KTableCellEditorText.java

示例3: createControl

import org.eclipse.swt.events.TraverseEvent; //导入依赖的package包/类
protected Control createControl() {
  m_Text = new Text(m_Table, SWT.MULTI | SWT.V_SCROLL);
  m_Text.addKeyListener(new KeyAdapter() {
    public void keyPressed(KeyEvent e) {
      try {
        onKeyPressed(e);
      } catch (Exception ex) {
      }
    }
  });
  m_Text.addTraverseListener(new TraverseListener() {
    public void keyTraversed(TraverseEvent arg0) {
      onTraverse(arg0);
    }
  });
  return m_Text;
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:18,代码来源:KTableCellEditorMultilineText.java

示例4: ParameterGridDialog

import org.eclipse.swt.events.TraverseEvent; //导入依赖的package包/类
/**
 * Create the dialog.
 * @param parentShell
 */
public ParameterGridDialog(Shell parentShell) {
	super(parentShell);
	setShellStyle(SWT.CLOSE | SWT.RESIZE | SWT.TITLE | SWT.WRAP | SWT.APPLICATION_MODAL);
	runGraph=false;
	
	
	lastRowLastColumnTraverseListener=new TraverseListener() {
		
		@Override
		public void keyTraversed(TraverseEvent e) {
			if(e.detail == SWT.TRAVERSE_TAB_NEXT)
				addRowToTextGrid();
		}
	};
	
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:21,代码来源:ParameterGridDialog.java

示例5: ToolStripTabs

import org.eclipse.swt.events.TraverseEvent; //导入依赖的package包/类
public ToolStripTabs(final Composite parent, final ToolStripTabPage[] tabs, final int style) {
    super(parent, style);
    this.tabs = tabs;
    imageHelper = new ImageHelper(TFSTeamBuildPlugin.PLUGIN_ID);
    createControls(this);
    setSelectedPage(0);
    addTraverseListener(new TraverseListener() {
        @Override
        public void keyTraversed(final TraverseEvent e) {
            if (e.detail == SWT.TRAVERSE_PAGE_NEXT) {
                traverseToNextPage(true);
                return;
            }
            if (e.detail == SWT.TRAVERSE_PAGE_PREVIOUS) {
                traverseToNextPage(false);
                return;
            }
        }
    });
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:21,代码来源:ToolStripTabs.java

示例6: addTraverseListener

import org.eclipse.swt.events.TraverseEvent; //导入依赖的package包/类
private void addTraverseListener() {
	addTraverseListener(new TraverseListener() {

		@Override
		public void keyTraversed(final TraverseEvent event) {

			/*
			 * traverse with the tab key to the next/previous control
			 */
			switch (event.detail) {
			case SWT.TRAVERSE_TAB_NEXT:
			case SWT.TRAVERSE_TAB_PREVIOUS:
				event.doit = true;
				break;
			}
		}
	});
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:19,代码来源:GalleryMT20.java

示例7: createHeader

import org.eclipse.swt.events.TraverseEvent; //导入依赖的package包/类
private Control createHeader(Composite parent, Font font, String message) {
	Composite header= new Composite(parent, SWT.NONE);
	GridLayout layout= new GridLayout();
	layout.numColumns= 2;
	layout.marginWidth= 0; layout.marginHeight= 0;
	header.setLayout(layout);
	header.setFont(font);
	Label label= new Label(header, SWT.NONE);
	label.setText(message);
	label.setFont(font);
	label.addTraverseListener(new TraverseListener() {
		public void keyTraversed(TraverseEvent e) {
			if (e.detail == SWT.TRAVERSE_MNEMONIC && e.doit) {
				e.detail= SWT.TRAVERSE_NONE;
				fFilter.setFocus();
			}
		}
	});
	GridData gd= new GridData(GridData.FILL_HORIZONTAL);
	label.setLayoutData(gd);
	
	createViewMenu(header);
	return header;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:25,代码来源:TypeSelectionComponent.java

示例8: createTextControl

import org.eclipse.swt.events.TraverseEvent; //导入依赖的package包/类
@Override
protected Text createTextControl(Composite parent) {
	Text text= new Text(parent, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
	text.addTraverseListener(new TraverseListener() {
		public void keyTraversed(TraverseEvent event) {
			switch (event.detail) {
				case SWT.TRAVERSE_ESCAPE:
				case SWT.TRAVERSE_PAGE_NEXT:
				case SWT.TRAVERSE_PAGE_PREVIOUS:
					event.doit= true;
					break;
				case SWT.TRAVERSE_RETURN:
				case SWT.TRAVERSE_TAB_NEXT:
				case SWT.TRAVERSE_TAB_PREVIOUS:
					if ((event.stateMask & SWT.MODIFIER_MASK) != 0) {
						event.doit= true;
					}
					break;
			}

		}
	});
	return text;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:25,代码来源:TextBoxDialogField.java

示例9: dispatchKeyTraversed

import org.eclipse.swt.events.TraverseEvent; //导入依赖的package包/类
/**
 * @see EventDispatcher#dispatchKeyTraversed(TraverseEvent)
 */
public void dispatchKeyTraversed(TraverseEvent e) {
	if (!figureTraverse)
		return;
	IFigure nextFigure = null;

	if (e.detail == SWT.TRAVERSE_TAB_NEXT)
		nextFigure = getFocusTraverseManager().getNextFocusableFigure(root,
				focusOwner);
	else if (e.detail == SWT.TRAVERSE_TAB_PREVIOUS)
		nextFigure = getFocusTraverseManager().getPreviousFocusableFigure(
				root, focusOwner);

	if (nextFigure != null) {
		e.doit = false;
		setFocus(nextFigure);
	}
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:21,代码来源:SWTEventDispatcher.java

示例10: onMnemonic

import org.eclipse.swt.events.TraverseEvent; //导入依赖的package包/类
void onMnemonic(TraverseEvent event) {
	char mnemonic = _findMnemonic(text);
	if (mnemonic == '\0')
		return;
	if (Character.toLowerCase(event.character) != mnemonic)
		return;
	Composite control = this.getParent();
	while (control != null) {
		Control[] children = control.getChildren();
		int index = 0;
		while (index < children.length) {
			if (children[index] == this)
				break;
			index++;
		}
		index++;
		if (index < children.length) {
			if (children[index].setFocus()) {
				event.doit = true;
				event.detail = SWT.TRAVERSE_NONE;
			}
		}
		control = control.getParent();
	}
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:26,代码来源:CLabel.java

示例11: keyTraversed

import org.eclipse.swt.events.TraverseEvent; //导入依赖的package包/类
@Override
public void keyTraversed(final TraverseEvent event) {
    if (event.detail == SWT.TRAVERSE_TAB_NEXT) {
        if (nextText != null) {
            event.detail = SWT.TRAVERSE_NONE;
            event.doit = false;
            nextText.setFocus();
        }
    } else if (event.detail == SWT.TRAVERSE_TAB_PREVIOUS) {
        if (prevText != null) {
            event.detail = SWT.TRAVERSE_NONE;
            event.doit = false;
            prevText.setFocus();
        }
    }
}
 
开发者ID:fabric8io,项目名称:data-mapper,代码行数:17,代码来源:MappingsViewer.java

示例12: getTraverseListener

import org.eclipse.swt.events.TraverseEvent; //导入依赖的package包/类
private TraverseListener getTraverseListener( )
{
	return new TraverseListener( ) {

		/**
		 * @see org.eclipse.swt.events.TraverseListener#keyTraversed(TraverseEvent)
		 */
		public void keyTraversed( TraverseEvent e )
		{
			if ( e.widget instanceof StyledText )
			{
				if ( ( e.detail == SWT.TRAVERSE_TAB_NEXT )
						|| ( e.detail == SWT.TRAVERSE_TAB_PREVIOUS ) )
					e.doit = true;
			}
		}
	};
}
 
开发者ID:eclipse,项目名称:birt,代码行数:19,代码来源:ExpressionSyntaxColoringPage.java

示例13: keyTraversed

import org.eclipse.swt.events.TraverseEvent; //导入依赖的package包/类
public void keyTraversed(TraverseEvent e) {
	switch (e.detail) {
		case SWT.TRAVERSE_MNEMONIC:
			if ((e.stateMask & SWT.MOD3) != 0) {
				switch (e.character) {
					case PREV:
					case NEXT:
						// if no key binding (which would take precedence) 
						// then pass to our handlers it directly
						if (!hasBinding(e)){
							handleTraverseEvent(e);
						}
				}
			}
			break;
		default:
	}
}
 
开发者ID:MulgaSoft,项目名称:e4macs,代码行数:19,代码来源:HistoryMinibuffer.java

示例14: handleTraverseEvent

import org.eclipse.swt.events.TraverseEvent; //导入依赖的package包/类
/**
 * Disable eclipse traversal event, and dispatch into our Alt/Ctrl
 * handlers in place of it
 * 
 * @param e the trapped TraverseEvent
 */
protected void handleTraverseEvent(TraverseEvent e) {
	// setting detail to NONE but doit=true disables further processing
	e.detail = SWT.TRAVERSE_NONE;
	e.doit = true;

	Event ee = new Event();
	ee.character = e.character;
	ee.doit = true;
	ee.stateMask = (e.stateMask & SWT.MODIFIER_MASK);
	ee.keyCode = e.keyCode;

	ee.display = e.display;
	ee.widget = e.widget;	// will throw an exception if not valid
	ee.time = e.time;
	ee.data = e.data;

	switch (ee.stateMask) {
		case SWT.CONTROL:	// Emacs+ key binding forces CTRL 
			dispatchCtrl(new VerifyEvent(ee));
			break;
		case SWT.ALT:	// AFAIK MOD3 is always ALT
			dispatchAlt(new VerifyEvent(ee));
			break;
	}
}
 
开发者ID:MulgaSoft,项目名称:e4macs,代码行数:32,代码来源:HistoryMinibuffer.java

示例15: createListeners

import org.eclipse.swt.events.TraverseEvent; //导入依赖的package包/类
@Override
public void createListeners() {
	write.addTraverseListener(new TraverseListener() {

		@Override
		public void keyTraversed(TraverseEvent e) {
			if (e.detail == SWT.TRAVERSE_RETURN) {
				if (write.getText().replaceAll(" ", "").isEmpty())
					return;

				Messaging.getInstance().sendChatMessage(staff, write.getText());

				write.setText("");
			}
		}
	});
}
 
开发者ID:coddo,项目名称:TeamSubb,代码行数:18,代码来源:TextFields.java


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